12/7/12

Install Tomcat 7 on Ubuntu 12.04

Install Tomcat 7 on Ubuntu 12.04


Apache has officially launched version 7.0 of the servlet container for Java applications, Tomcat. Major changes in this version, you can highlight support for Servlet 3.0 and JavaServer Pages 2.2.


Install JDK
See this post: Install JDK 6 update 23 in Ubuntu 10.10

Installation

The first thing to do is download the package "apache-tomcat-7.0.6.tar.gz" from the NEXT link
http://tomcat.apache.org/download-70.cgi [tar.gz]
Now unpack it with the following command:
tar xvzf apache-tomcat-7.0.8.tar.gz

Then we let in a more appropriate directory, in our case in / usr/share/tomcat7, but can be in any directory. We do this with the command:
sudo mv apache-tomcat-7.0.8/ /usr/share/tomcat7

Now we define the environment variables JAVA_HOME and JRE_HOME. This file is in the "environment" in / etc. Command to edit the file:
sudo gedit /etc/environment

Here we record the routes where we have installed Java in my case this is as follows:

JAVA_HOME="/usr/local/jdk1.6.0_23"
JRE_HOME="/usr/local/jdk1.6.0_23/jre"
PATH="...(other path):$JAVA_HOME:$JRE_HOME"
( or we can configure it directly in /etc/environment )
IMPORTANT: Verify the routes where they have installed Java.

I have had some problems in defining these environment variables, as sometimes tomcat does not recognize, but a surefire way of recognizing that tomcat is to define the file paths inside "catalina.sh"located in tomcat7/bin. To modify this file use the command:
sudo gedit /usr/share/tomcat7/bin/catalina.sh

Now just insert the JAVA_HOME and JRE_HOME after the first line, so the file is as follows:
#!/bin/sh
JAVA_HOME="/usr/local/jdk1.6.0_23"
JRE_HOME="/usr/local/jdk1.6.0_23/jre"
# Licensed to the Apache Software Foundation (ASF)...
#...
#...
....

Now let's configure Tomcat users, this is done in the file "tomcat-users.xml"directory tomcat7/conf. Command to edit the file:
sudo gedit /usr/share/tomcat7/conf/tomcat-users.xml

Unlike previous versions where the administrator should own role "manager" now it should be "manager-gui"to operate on the web administration tomcat7. The file would be as follows:

















Now you should be all ready to try tomcat7.

First we must lift the server with the following command:
sudo /usr/share/tomcat7/bin/startup.sh

With this we get the following output on console:
Using CATALINA_BASE: /usr/share/tomcat7
Using CATALINA_HOME: /usr/share/tomcat7
Using JRE_HOME: /usr/local/jdk1.6.0_20/jre
Using CLASSPATH: /usr/share/tomcat7/bin/bootstrap.jar:/usr/share/tomcat7/bin/tomcat-juli.jar

Verify that the JRE_HOME is where we define.

Now open your web browser and type the following url:
http://127.0.0.1:8080/

So we get the following page:

If we enter the administration Tomcat Manager we click on the menu or directly at URL:
http://127.0.0.1:8080/manager/html

Here we ask the user data from previous record in mind tomcat-users.xml.

I recommend testing the sample to make sure everything works ok, they are in the section "Miscellaneous" from the side menu or at the URL:
http://127.0.0.1:8080/examples/

Commands

Start server:
sudo /usr/share/tomcat7/bin/startup.sh

Stop server:
sudo /usr/share/tomcat7/bin/shutdown.sh

Automatic Starting

To make tomcat automatically start when we boot up the computer, you can add a script to make it auto-start and shutdown.


sudo gedit /etc/init.d/tomcat7

Now paste in the following:


# Tomcat auto-start
#
# description: Auto-starts tomcat
# processname: tomcat
# pidfile: /var/run/tomcat.pid

case $1 in
start)
sh /usr/share/tomcat7/bin/startup.sh
;;
stop)
sh /usr/share/tomcat7/bin/shutdown.sh
;;
restart)
sh /usr/share/tomcat7/bin/shutdown.sh
sh /usr/share/tomcat7/bin/startup.sh
;;
esac
exit 0

You’ll need to make the script executable by running the chmod command:


sudo chmod 755 /etc/init.d/tomcat7

The last step is actually linking this script to the startup folders with a symbolic link. Execute these two commands and we should be on our way.


sudo ln -s /etc/init.d/tomcat7 /etc/rc1.d/K99tomcat
sudo ln -s /etc/init.d/tomcat7 /etc/rc2.d/S99tomcat

Tomcat should now be fully installed and operational. Enjoy!

sudo /etc/init.d/tomcat7 restart

9/6/12

EMAIL SIGN-OFF CONSIDERATIONS


EMAIL SIGN-OFF CONSIDERATIONS

The topic of how to sign-off an email is one that has perplexed and concerned many a Netizen. Those who are concerned about being perceived favorably wonder how to sign-off with the appropriate tone, close with the intended meaning getting across as well as how not to look redundant by always including the same closing.
First things first. All sign-offs need to include your name. Whether you include your first name alone or first and last name is dependent on the level of formality in your email. For first time contacts you can include your last name, but in subsequent communications that isn’t necessary. If you have your email program setup properly, your last name is in the From: field.
Not only does how you sign your name set the tone of an email, so does how you choose to sign-off. Some have their own way of signing off that reflects individuality or their personality. For example I am known for signing off my emails with “At your service,” or “Virtually,”. If you see anyone else using these closings, you now know where they got it from!
Then there are the most popular:
Best,

Cheers,

Yours,

Cordially,

Regards,

Best regards,

Best wishes,

Sincerely,

Kindest regards,

Warmest regards,

I remain yours truly,

Warmly,

Thanks again,

My sincere thanks for your time and consideration,

Take care,

Continued success,
As with anything to do with email, use your discretion as to what is best for that particular message. For example, you wouldn’t use “I remain yours truly” in business communications, but you would use that closing with someone you admire, like or would like to have a friendly email relationship with. Whereas “Regards,” is the other end of the scale. Very professional, unemotional and depending on the content of the email could be perceived as a terse closing.
One must take the time to choose a sign-off that is indicative of the overall tone of your email. A sign-off that does not match the essence of the email’s text can be perceived as being sarcastic or down right rude. For example, I doubt if you were sending a professionally stern email that you would sign off with “Warmly!”
And that is the dilemma we all face when writing and closing our emails. Using our discretion to determine the best words to use to relay the exact tone and intent with clarity to avoid misunderstandings. From how you open your email with a salutation to the content and then the sign-off, all parts of your email are a component that contributes to the overall interpretation of your message.
Most onliners are not clear communicators. If you think about it we haven’t had to rely on communicating with the written word in decades. Just a mere century ago people wrote letters daily. This meant choosing their words carefully and thoughtfully to communicate the emotion and intent of their writings. Now, fast forward to this century and many emails appear to be written by someone who didn’t make it out of grade school!
The above examples are not the end-all-be-all either. Your sign-off isn’t exclusively the words above your name separated by a comma. You can also use phrases that reflect the purpose of your email as well. Some examples could be:
Good Job!

All the best of success!

Have a great day!

Happy Holidays!

Keep up the good work!

Thank you!

Thank you for your quick response.

Thank you for taking your time.

Looking forward to your reply.

Enjoy your weekend!

HTH! (Hope This Helps!)

Have a good one!
Your closing, while very important, is only the icing on the cake. It needs to be inline with the overall tone and demeanor of your email to ensure that your message is received as intended and leaves no room for misunderstandings or incorrect perceptions.
By taking your time and choosing your words carefully your sign-offs will just be one more indicator of what a pleasure it will be to communicate with you.
Help get the word out by sharing! ;-)

6/6/12

IPv6

What if the Internet ran out of room?
In fact, it's already happening.


Vint Cerf, Chief Internet Evangelist at Google, and a founding father of the Internet, discusses the next version of the Internet, IPv6, and why we need it.

Why is the internet running out of room?

Just as phones use a system of phone numbers in order to place calls, every Internet-connected device gets a unique number known as an "IP address" that connects it to the global online network.
The problem is that the current Internet addressing system, IPv4, only has room for about 4 billion addresses -- not nearly enough for the world's people, let alone the devices that are online today and those that will be in the future: computers, phones, TVs, watches, fridges, cars, and so on. More than 4 billion devices already share addresses. As IPv4 runs out of free addresses, everyone will need to share.
IPv6 Graph

How are we making space to grow?

Clearly the internet needs more IP addresses. How many more, exactly? Well, how about 340 trillion trillion trillion (or, 340,000,000,000,000,000,000,000,000,000,000,000,000)? That's how many addresses the internet's new "piping," IPv6, can handle. That's a number big enough to give everyone on Earth their own list of billions of IP addresses. Big enough, in other words, to offer the Internet virtually infinite room to grow, from now into the foreseeable future.

When is the transition happening?

At Google we believe IPv6 is essential to the continued health and growth of the Internet and that by allowing all devices to talk to each other directly, IPv6 enables new innovative services. Replacing the Internet's plumbing will take some time, but the transition has begun. World IPv6 Launch on June 6, 2012, marks the start of a coordinated rollout by major websites and Internet service and equipment providers.
You do not need to do anything to prepare, but if you're interested in learning more and supporting IPv6, check out a few frequently asked questions.

5/26/12

Awesome Duplicate Photo Finder

Awesome Duplicate Photo Finder

Awesome Duplicate Photo Finder is a free powerful tool, that helps you to find and remove duplicate photos on your PC. With this program you can easily clean up your photo collection from duplicates or even similar images.
Awesome Duplicate Photo Finder is a completely FREE Software. It contains absolutely NO ADWARE, NO SPYWARE, NO REGISTRATION, NO POPUPS, NO MALWARE or other unwanted software.

This program is very easy to use. You can do all you need with duplicate photos in just a couple of mouse clicks. Awesome Duplicate Photo Finder is able to compare pictures that was resized or pictures with corrected colors (black and white photos etc.). It supports all major image types: JPG, BMP, GIF, PNG.

To start playing just drag some folders from the Windows Explorer into the program's window and click "Start" button. And have fun!
Download Awesome Duplicate Photo Finder

5/23/12

Android Sync Manager WiFi

Software Download
For using Android Sync Manager, you must download the two software below:
1. Install Android Sync Manager WiFi on PC Android Sync Manager WiFi
(Latest Android Sync Manager WiFi Version: 2.2.1110.2763)
Please click "Help > About Android Manager" on your PC software to check the version of Android Sync Manager WiFi software"
2. Install Android Sync Manager WiFi Agent on your Android phone, you can download from any one of the download links below.
a. [Download from Android Market] Recommended
Please go to Apps > Tools to search and install the Android Sync Manager WiFi software.

(Latest Android Sync Manager WiFi agent Version: 2.2.1110.2763)
Please open Android Sync Manager WiFi agent on your Android phone, and then click "About" button to check the version of Android Sync Manager WiFi agent"

b. [Download from Mobile Action]
Please input the link below on your Android phone to download it
http://ds.mobileaction.com/android/amagentwifi.apk
(Latest Android Sync Manager WiFi agent Version: 2.2.1110.2763)
zoon-in when you click the this

Quick Installation Guide
 
Android Sync Manager can be easily set up within 5 simple steps:
Step1. Install Android Sync Manager on PC


Step2. Install Android Sync Manager Agent on handset
a. [Download from Android Market] Recommended
Please go to Apps > Tools to search and install the Android Sync Manager WiFi software.
b. [Download from Moible Action]

  • On your handset, please go to: Settings > Applications, and enable Unknown sources.



  • On your Android phone, open your browser and directly input the download link (http://ds.mobileaction.com/android/amagentwifi.apk) to download Android Sync Manager Agent.
  • Locate the downloaded file in "Download history", and click to start installation.




Step3. Launch Android Sync Manager Agent on handset

  • Open Android Sync Manager Agent after installation is completed.
  • On the Welcome page, click Next button to get into Android Sync Manager Settings page, and complete configurations required for WiFi connection:
PIN Code: Set up a PIN code for connection to PC. This code must be entered on both PC and handset to establish connection.
Idle timeout: Set up a time period to be waited before WiFi connection is turned off for power saving.




  • Return back to the main connection page, and make sure your handset is connected to a wireless access point.


Step4. Start connection with handset
On Android Sync Manager, go to: Settings > Connection, and enter the PIN code previously set up in your handset and the connected WiFi IP address.





Step5. Verify connection on handset
On your handset screen, verify whether connection between PC and handset is successfully established.

If WiFi Sync happens to be off, click it again to start establishing connection.
Accordingly, PC and handset should be connected immediately within a few seconds.




Note:Android Sync Manager Agent will turn off WiFi connection automatically after program has been idle for a while, for the sake of power saving. To resume WiFi connection, please return to your handset screen and press WiFi ON.

5/12/12

Webster Voice Package English

Webster Voice Package English 

http://www.mediafire.com/?ky1jynwviiz
http://www.mediafire.com/?tz1ql22zmdx
http://www.mediafire.com/?ytzemjzey5g

(http://www.lingoes.net/en/translator/speech.htm)

Install Natural Voice package
The way is very easy, open the folder named speech in "installation folder of Lingoes", and create a new folder in it with name of the natural voice, then unzip the downloaded natural voice package into the new folder.
If you want to uninstall some one package, just del the folder of the package.
Now we demonstrate the installation method to take Lingoes Basic English Voice Package for example:
1. First, create a new folder named "Lingoes English" in speech folder of installation folder of Lingoes, the path is:

    Installation folder of Lingoes\speech\Lingoes English\ 2. Download the zip file of Lingoes Basic English Voice Package, then unzip all files and folders in the zip file into the new folder.
3. Then choose "Lingoes English" in the list of "Configuration"→"Speech"→"Natural Voice Engine"→"Voice"
4. After install/change the package, remember to click the button "Rebuild Index file", so lingoes will rebuild a index file for every voice package correctly, it will improve and speed up rate of search and play the natural voice.

 

ETL tools comparison criteria

ETL Tools - general information

ETL tools are designed to save time and money by eliminating the need of 'hand-coding' when a new data warehouse is developed. They are also used to facilitate the work of the database administrators who connect different branches of databases as well as integrate or change the existing databases.
    The main purpose of the ETL tool is:
  • extraction of the data from legacy sources (usually heterogenous)
  • data transformation (data optimized for transaction --> data optimized for analysis)
  • synchronization and cleansing of the data
  • loading the data into data warehouse.
There are several requirements that must be had by ETL tools in order to deliver an optimal value to users, supporting a full range of possible scenarios.

Those are:
- data delivery and transformation capabilities
- data and metadata modelling capabilities
- data source and target support
- data governance capability
- runtime platform capabilities
- operations and administration capabilities
- service-enablements capability.

ETL tools comparison criteria

The research presented in this article is based on Gartner’s data integration magic quadrant, forrester researches and our professional experience. The etltools.org portal is not affiliated with any of the companies listed below in the comparison.

The research inclusion and exclusion criteria are as follows:
- range and mode of connectivity/adapter support
- data transformation and delivery modes support
- metadata and data modelling support
- design, development and data governance support
- runtime platform support
- enablement of service and three additional requirements for vendors:
- $20 milion or more of software revenue from data integration tools every year or not less than 300 production customers
- support of customers in not less than two major geographic regions
- have customer implementations at crossdepartamental and multiproject level.

ETL Tools Comparison

The information provided below lists major strengths and weaknesses of the most popular ETL vendors.

IBM (Information Server Infosphere platform)

    Advantages:
  • strongest vision on the market, flexibility
  • progress towards common metadata platform
  • high level of satisfaction from clients and a variety of initiatives
    Disadvantages:
  • difficult learning curve
  • long implementation cycles
  • became very heavy (lots of GBs) with version 8.x and requires a lot of processing power

Informatica PowerCenter

    Advantages:
  • most substantial size and resources on the market of data integration tools vendors
  • consistent track record, solid technology, straightforward learning curve, ability to address real-time data integration schemes
  • Informatica is highly specialized in ETL and Data Integration and focuses on those topics, not on BI as a whole
  • focus on B2B data exchange
    Disadvantages:
  • several partnerships diminishing the value of technologies
  • limited experience in the field.

Microsoft (SQL Server Integration Services)

    Advantages:
  • broad documentation and support, best practices to data warehouses
  • ease and speed of implementation
  • standardized data integration
  • real-time, message-based capabilities
  • relatively low cost - excellent support and distribution model
    Disadvantages:
  • problems in non-Windows environments. Takes over all Microsoft Windows limitations.
  • unclear vision and strategy

Oracle (OWB and ODI)

    Advantages:
  • based on Oracle Warehouse Builder and Oracle Data Integrator – two very powerful tools;
  • tight connection to all Oracle datawarehousing applications;
  • tendency to integrate all tools into one application and one environment.
    Disadvantages:
  • focus on ETL solutions, rather than in an open context of data management;
  • tools are used mostly for batch-oriented work, transformation rather than real-time processes or federation data delivery;
  • long-awaited bond between OWB and ODI brought only promises - customers confused in the functionality area and the future is uncertain

SAP BusinessObjects (Data Integrator / Data Services)

    Advantages:
  • integration with SAP
  • SAP Business Objects created a firm company determined to stir the market;
  • Good data modeling and data-management support;
  • SAP Business Objects provides tools for data mining and quality; profiling due to many acquisitions of other companies.
  • Quick learning curve and ease of use
    Disadvantages:
  • SAP Business Objects is seen as two different companies
  • Uncertain future. Controversy over deciding which method of delivering data integration to use (SAP BW or BODI).
  • BusinessObjects Data Integrator (Data Services) may not be seen as a stand-alone capable application to some organizations.

SAS

    Advantages:
  • experienced company, great support and most of all very powerful data integration tool with lots of multi-management features
  • can work on many operating systems and gather data through number of sources – very flexible
  • great support for the business-class companies as well for those medium and minor ones
    Disadvantages:
  • misplaced sales force, company is not well recognized
  • SAS has to extend influences to reach non-BI community
  • Costly

Sun Microsystems

    Advantages:
  • Data integration tools are a part of huge Java Composite Application Platform Suite - very flexible with ongoing development of the products
  • 'Single-view' services draw together data from variety of sources; small set of vendors with a strong vision
    Disadvantages:
  • relative weakness in bulk data movement
  • limited mindshare in the market
  • support and services rated below adequate

Sybase

    Advantages:
  • assembled a range of capabilities to be able to address a mulitude of data delivery styles
  • size and global presence of Sybase create opportunities in the market
  • pragmatic near-term strategy - better of current market demand
  • broad partnerships with other data quality and data integration tools vendors
    Disadvantages:
  • falls behind market leaders and large vendors
  • gaps in many aspects of data management

Syncsort

    Advantages:
  • functionality; well-known brand on the market (40 years experience); loyal customer and experience base;
  • easy implementation, strong performance, targeted functionality and lower costs
    Disadvantages:
  • struggle with gaining mind share in the market
  • lack of support for other than ETL delivery styles
  • unsatisfactory with lack of capability of professional services

Tibco Software

    Advantages:
  • message-oriented application integration; capabilities based on common SOA structures;
  • support for federated views; easy implementation, support andperformance
    Disadvantages:
  • scarce references from customers; not widely enough recognised for data integration competencies
  • lacking in data quality capabilities.

ETI

    Advantages:
  • proven and mature code-generating architecture
  • one of the earliest vendors on the data integration market; support for SOA service-oriented deployments;
  • successfully deals with large data volumes and a high degree of complexity, extension of the range of data platforms and data sources;
  • customers' positive responses to ETI technology
    Disadvantages:
  • relatively slow growth of customer base
  • rather not attractive and inventive technology.

iWay Software

    Advantages:
  • offers physical data movement and delivery; support of wide range of adapters and access to numerous sources;
  • well integrated, standard tools;
  • reasonable ease of implementation effort
    Disadvantages:
  • gaps in specific capabilities
  • relatively costly - not competitive versus market leaders

Pervasive Software

    Advantages:
  • many customers, years of experience, solid applications and support;
  • good use of metadata
  • upgrade from older versions into newer is straightforward.
    Disadvantages:
  • inconsistency in defining the target for their applications;
  • no federation capability;
  • limitated presence due to poor marketing.

Open Text

    Advantages
  • Simplicity of use in less-structured sources
  • Easy licensing for business solutions
  • cooperates with a wide range of sources and targets
  • increasingly high functionality
    Disadvantages:
  • limited federation, replication and data quality support; rare upgrades due to its simplicity;
  • weak real-time support due to use third party solutions and other database utilities.

Pitney Bowes Software

    Advantages:
  • Data Flow concentrates on data integrity and quality;
  • supports mainly ETL patterns; can be used for other purposes too;
  • ease of use, fast implementation, specific ETL functionality.
    Disadvantages:
  • rare competition with other major companies, repeated rebranding trigger suspicions among customers.
  • narrow vision of possibilities even though Data Flow comes with variety of applications.
  • weak support, unexperienced service.

5/6/12

66 Điều phật dạy


1. Sở dĩ người ta đau khổ chính vì mãi đeo đuổi những thứ sai lầm.

2. Nếu anh không muốn rước phiền não vào mình, thì người khác cũng không cách nào gây phiền não cho bạn. Vì chính tâm bạn không buông xuống nổi.

3. Bạn hãy luôn cảm ơn những ai đem đến nghịch cảnh cho mình.

4. Bạn phải luôn mở lòng khoan dung lượng thứ cho chúng sanh, cho dù họ xấu bao nhiêu, thậm chí họ đã làm tổn thương bạn, bạn phải buông bỏ, mới có được niềm vui đích thực.

5. Khi bạn vui, phải nghĩ rằng niềm vui này không phải là vĩnh hằng. Khi bạn đau khổ, bạn hãy nghĩ rằng nỗi đau này cũng không trường tồn.

6. Sự chấp trước của ngày hôm nay sẽ là niềm hối hận cho ngày mai.

7. Bạn có thể có tình yêu nhưng đừng nên dính mắc, vì chia ly là lẽ tất nhiên.

8. Đừng lãng phí sinh mạng của mình trong những chốn mà nhất định bạn sẽ ân hận.

9. Khi nào bạn thật sự buông xuống thì lúc ấy bạn sẽ hết phiền não.

10. Mỗi một vết thương đều là một sự trưởng thành.

11. Người cuồng vọng còn cứu được, người tự ti thì vô phương, chỉ khi nhận thức được mình, hàng phục chính mình, sửa đổi mình, mới có thể thay đổi người khác.

12. Bạn đừng có thái độ bất mãn người ta hoài, bạn phải quay về kiểm điểm chính mình mới đúng. Bất mãn người khác là chuốc khổ cho chính bạn.

13. Một người nếu tự đáy lòng không thể tha thứ cho kẻ khác, thì lòng họ sẽ không bao giờ được thanh thản.

14. Người mà trong tâm chứa đầy cách nghĩ và cách nhìn của mình thì sẽ không bao giờ nghe được tiếng lòng người khác.

15. Hủy diệt người chỉ cần một câu, xây dựng người lại mất ngàn lời, xin bạn “Đa khẩu hạ lưu tình”.

16. Vốn dĩ không cần quay đầu lại xem người nguyền rủa bạn là ai? Giả sử bạn bị chó điên cắn bạn một phát, chẳng lẽ bạn cũng phải chạy đến cắn lại một phát?

17. Đừng bao giờ lãng phí một giây phút nào để nghĩ nhớ đến người bạn không hề yêu thích.

18. Mong bạn đem lòng từ bi và thái độ ôn hòa để bày tỏ những nỗi oan ức và bất mãn của mình, có như vậy người khác mới khả dĩ tiếp nhận.

19. Cùng là một chiếc bình như vậy, tại sao bạn lại chứa độc dược? Cùng một mảnh tâm tại sao bạn phải chứa đầy những não phiền như vậy?

20. Những thứ không đạt được, chúng ta sẽ luôn cho rằng nó đẹp đẽ, chính vì bạn hiểu nó quá ít, bạn không có thời gian ở chung với nó. Nhưng rồi một ngày nào đó khi bạn hiểu sâu sắc, bạn sẽ phát hiện nó vốn không đẹp như trong tưởng tượng của bạn.

21. Sống một ngày là có diễm phúc của một ngày, nên phải trân quý. Khi tôi khóc, tôi không có dép để mang thì tôi lại phát hiện có người không có chân.

22. Tốn thêm một chút tâm lực để chú ý người khác chi bằng bớt một chút tâm lực phản tỉnh chính mình, bạn hiểu chứ?

23. Hận thù người khác là một mất mát lớn nhất đối với mình.

24. Mỗi người ai cũng có mạng sống, nhưng không phải ai cũng hiểu được điều đó, thậm chí trân quý mạng sống của mình hơn. Người không hiểu được mạng sống thì mạng sống đối với họ mà nói chính là một sự trừng phạt.

25. Tình chấp là nguyên nhân của khổ não, buông tình chấp bạn mới được tự tại.

26. Đừng khẳng định về cách nghĩ của mình quá, như vậy sẽ đỡ phải hối hận hơn.

27. Khi bạn thành thật với chính mình, thế giới sẽ không ai lừa dối bạn.

28. Người che đậy khuyết điểm của mình bằng thủ đoạn tổn thương người khác là kẻ đê tiện.

29. Người âm thầm quan tâm chúc phúc người khác, đó là một sự bố thí vô hình.

30. Đừng gắng sức suy đoán cách nghĩ của người khác, nếu bạn không phán đoán chính xác bằng trí huệ và kinh nghiệm thì mắc phải nhầm lẫn là lẽ thường tình.

31. Muốn hiểu một người, chỉ cần xem mục đích đến và xuất phát điểm của họ có giống nhau không, thì có thể biết được họ có thật lòng không.

32. Chân lý của nhân sinh chỉ là giấu trong cái bình thường đơn điệu.

33. Người không tắm rửa thì càng xức nước hoa càng thấy thối. Danh tiếng và tôn quý đến từ sự chân tài thực học. Có đức tự nhiên thơm.

34. Thời gian sẽ trôi qua, để thời gian xóa sạch phiền não của bạn đi.

35. Bạn cứ xem những chuyện đơn thuần thành nghiêm trọng, như thế bạn sẽ rất đau khổ.

36. Người luôn e dè với thiện ý của người khác thì hết thuốc cứu chữa.

37. Nói một lời dối gian thì phải bịa thêm mười câu không thật nữa để đắp vào, cần gì khổ như vậy?

38. Sống một ngày vô ích, không làm được chuyện gì, thì chẳng khác gì kẻ phạm tội ăn trộm.

39. Quảng kết chúng duyên, chính là không làm tổn thương bất cứ người nào.

40. Im lặng là một câu trả lời hay nhất cho sự phỉ báng.

41. Cung kính đối với người là sự trang nghiêm cho chính mình.

42. Có lòng thương yêu vô tư thì sẽ có tất cả.

43. Đến là ngẫu nhiên, đi là tất nhiên. Cho nên bạn cần phải “Tùy duyên mà hằng bất biến, bất biến mà hằng tùy duyên”.

44. Từ bi là vũ khí tốt nhất của chính bạn.

45. Chỉ cần đối diện với hiện thực, bạn mới vượt qua hiện thực.

46. Lương tâm là tòa án công bằng nhất của mỗi người, bạn dối người khác được nhưng không bao giờ dối nổi lương tâm mình.

47. Người không biết yêu mình thì không thể yêu được người khác.

48. Có lúc chúng ta muốn thầm hỏi mình, chúng ta đang đeo đuổi cái gì? Chúng ta sống vì cái gì?

49. Đừng vì một chút tranh chấp mà xa lìa tình bạn chí thân của bạn, cũng đừng vì một chút oán giận mà quên đi thâm ân của người khác.

50. Cảm ơn đời với những gì tôi đã có, cảm ơn đời những gì tôi không có.

51. Nếu có thể đứng ở góc độ của người khác để nghĩ cho họ thì đó mới là từ bi.

52. Nói năng đừng có tánh châm chọc, đừng gây thương tổn, đừng khoe tài cán của mình, đừng phô điều xấu của người, tự nhiên sẽ hóa địch thành bạn.

53. Thành thật đối diện với mâu thuẫn và khuyết điểm trong tâm mình, đừng lừa dối chính mình.

54. Nhân quả không nợ chúng ta thứ gì, cho nên xin đừng oán trách nó.

55. Đa số người cả đời chỉ làm được ba việc: Dối mình, dối người, và bị người dối.

56. Tâm là tên lừa đảo lớn nhất, người khác có thể dối bạn nhất thời, nhưng nó lại gạt bạn suốt đời.

57. Chỉ cần tự giác tâm an, thì đông tây nam bắc đều tốt. Nếu còn một người chưa độ thì đừng nên thoát một mình.

58. Khi trong tay bạn nắm chặt một vật gì mà không buông xuống, thì bạn chỉ có mỗi thứ này, nếu bạn chịu buông xuống, thì bạn mới có cơ hội chọn lựa những thứ khác. Nếu một người luôn khư khư với quan niệm của mình, không chịu buông xuống thì trí huệ chỉ có thể đạt đến ở một mức độ nào đó mà thôi.

59. Nếu bạn có thể sống qua những ngày bình an, thì đó chính là một phúc phần rồi. Biết bao nhiêu người hôm nay đã không thấy được vầng thái dương của ngày mai, biết bao nhiêu người hôm nay đã trở thành tàn phế, biết bao nhiêu người hôm nay đã đánh mất tự do, biết bao nhiêu người hôm nay đã trở thành nước mất nhà tan.

60. Bạn có nhân sinh quan của bạn, tôi có nhân sinh quan của tôi, tôi không dính dáng gì tới bạn. Chỉ cần tôi có thể, tôi sẽ cảm hóa được bạn. Nếu không thể thì tôi đành cam chịu.

61. Bạn hy vọng nắm được sự vĩnh hằng thì bạn cần phải khống chế hiện tại.

62. Ác khẩu, mãi mãi đừng để nó thốt ra từ miệng chúng ta, cho dù người ta có xấu bao nhiêu, có ác bao nhiêu. Bạn càng nguyền rủa họ, tâm bạn càng bị nhiễm ô, bạn hãy nghĩ, họ chính là thiện tri thức của bạn.

63. Người khác có thể làm trái nhân quả, người khác có thể tổn hại chúng ta, đánh chúng ta, hủy báng chúng ta. Nhưng chúng ta đừng vì thế mà oán hận họ, vì sao? Vì chúng ta nhất định phải giữ một bản tánh hoàn chỉnh và một tâm hồn thanh tịnh.

64. Nếu một người chưa từng cảm nhận sự đau khổ khó khăn thì rất khó cảm thông cho người khác. Bạn muốn học tinh thần cứu khổ cứu nạn, thì trước hết phải chịu đựng được khổ nạn.

65. Thế giới vốn không thuộc về bạn, vì thế bạn không cần vứt bỏ, cái cần vứt bỏ chính là những tánh cố chấp. Vạn vật đều cung ứng cho ta, nhưng không thuộc về ta.

66. Bởi chúng ta không thể thay đổi được thế giới xung quanh, nên chúng ta đành phải sửa đổi chính mình, đối diện với tất cả bằng lòng từ bi và tâm trí huệ

4/12/12

Adding more fields to the Joomla

1.5 Registration page

Warning: Joomla Hack! The following code involves modifying the core Joomla code. This has intrinisc drawbacks, i.e. any time you upgrade you'll have to redo the code, or lose this functionality
Make sure you take backups before you do this change!
The Joomla Registration page usually contains enough information for most website. Users who want enhanced user information, typically go for Community Builder which allows extensive user registration fields. However, it is entirely possible to create additional registration fields without installing any components, by modifying a few lines in the Joomla core code. Here's how to do it. In this example, we will be adding Business and Phone to the user registration field, however you can modify the example to add any fields you want to.

Step 1 - Add fields to the Users table

The first thing you need to do is to add the new fields into the Users table into the database. Using phpmyadmin or otherwise add the fields to the users tabl. The following SQL command adds the fields, however you can add these in any way you want:

ALTER TABLE jos_users ADD business VARCHAR (100) NO NULL AFTER name;
and
ALTER TABLE jos_users ADD phone VARCHAR (100) NO NULL AFTER business;

Once you have created the columns, verify that they have been created correctly and move on to the next step.

Step 2 - Modify the code

You'll need to modify a total of 4 files:
1. Modify the user class to include the new files in libraries/joomla/database/table/user.php
    var $name = null;
    /**
    * The login name
    *
    * @var string
    */
    var $username = null;
var $business = null;
var $phone = null;
2. Modify the code which displays the registration page components/com_user/views/register/tmpl/default.php 




    *





*





*
     

3. Modify the view of the users list: components/com_user/views/user/tmpl/form.php













:









:





 
4. Edit the page which displays the users in the backend: administrator\components\com_users\views\user\tmpl\form.php

                   
                       
                   
                   
                       
                   
               

                   
                       
                   
                   
                       
                   
               
               
                   
                       
                   
                   
                       
                   
               
 
That's it! You now have a couple of additional fields in the users table, and more information available to use. Thanks goes to jtullous from the Joomla Forums who supplied the code.
Make sure you take backups before you do this change!

4/9/12

JAVA DESIGN PATTERNS


Link

ABOUT THE AUTHOR:
Prashant Satarkar
He has a good experience into Java and J2EE designing and development. He has worked for many national and international clients as developer and designer on J2EE technologies.

Requirement Analysis and Designing has been his core competency. He has also studied Rational Unified Processes. The design patterns can come in handy designing phase of the project.
Here is a write-up by Mr. Prashant Satarkar on the subject of design patterns.

Who should read this?
I want to write this article on patterns because I have found in many books that reading about a pattern also, does not at times gives us complete feel of how and where to use it. I want that I should be able to write something which presents the patterns in as simple a way as possible. If the reader understands about the patterns after reading this, I will consider myself successful.

Abstract: “Pattern” as the name suggests, means series of events occurring in a definite order. The patterns can be found in Java and J2ee technologies also. Many a times, we find that there is a particular way of tackling a problem. This way is easy and has been used many times successfully by a number of people earlier also. This method becomes a pattern.

Learning the design patterns is a multiple step process:
1. Acceptance
2. Recognition
3. Internalization

Patterns Defined: The patterns can be defined in many ways. You can find the definitions of patterns in many good books.
“Design patterns are recurring solutions to design problems.”
Patterns: According to commonly known practices, there are 23 design patterns in Java. These patterns are grouped under three heads:
1. Creational Patterns
2. Structural Patterns
3. Behavioral Patterns

Design Pattern detection using Similarity Scoring

Related Papers

Installation

  • Install Java™ 2 Runtime Environment, Standard Edition 1.5.0
    You can download it from http://java.com/en/index.jsp
  • Download the Design Pattern detection Tool (version 4.5 - build 28/05/2010)
    In order to avoid Heap size OutOfMemoryError, execute in console java -Xms32m -Xmx512m -jar pattern4.jar

Usage

  • You must first select the root of the project package. Only class files (bytecode files) are necessary for the project analysis.
  • Then select the pattern(s) to be detected from the pattern list.
  • You can use some of the Huston design pattern Java demos for testing the tool.

Proxy Variation

The design pattern reported by the tool as Proxy2 is actually a variation of Proxy pattern.

However, this Proxy variation is structurally more similar to Decorator pattern than Proxy pattern, since Proxy role has an association to Subject role (named subject) and method Request() declared in Proxy invokes an abstract method having the same signature through subject association (as exactly happens between Decorator and Component roles in Decorator pattern).
The differences between Decorator pattern and this Proxy variation are: a) Decorator role is abstract while Proxy role is concrete, b) Proxy role initializes its association to Subject role with a reference to an object of RealSubject role which is instantiated inside the constructor of Proxy role.

This kind of Proxy variation has been reported by Günter Kniesel and Alex Binun from University of Bonn.

Proxy Variation

ChangeLog

  • Fixed a bug related with the handling of composite generic types (bug reported by Lin-Chieh Wen from the Dept. of Information Engineering & Computer Science, Feng Chia University, Tai-Chung, Taiwan, R.O.C.) (version 4.5)tick
  • Report of additional pattern roles corresponding to methods and fields (version 4.4)tick
  • The Subject role in Observer pattern should also contain a detach method used for unregistering Observers (version 4.3)tick
  • In Visitor pattern visitConcreteElement methods may also have Element type as parameter instead of ConcreteElement types (version 4.2)tick
  • Array types are included in the analysis for the identification of Composite and Observer pattern instances (version 4.1)tick
  • Fixed the problem concerning the distinction of Observer from Composite pattern (version 4)tick
  • Add support for Proxy design pattern (version 4)tick
  • Export detected design pattern instances to XML format (version 2)tick
  • Detection of all design patterns with a single click (version 2)tick
  • Console version (version 2)tick
    Execution: java -Xms32m -Xmx512m -jar pattern4.jar -target "C:\foo\myclasses" -output "C:\foo\output.xml"

Detected Design Patterns in JHotDraw 5.1

Design Pattern Name Roles and Corresponding Classes

* Last updated on April 1st 2009
Object Adapter-
Command
Adapter/ConcreteCommand Adaptee/Receiver
CH.ifa.draw.standard.AbstractFigure
adaptee: FigureChangeListener fListener
Request(): release, invalidate, changed
Target role is played by class CH.ifa.draw.framework.Figure
CH.ifa.draw.framework.FigureChangeListener
SpecificRequest(): figureRemoved, figureInvalidated, figureChanged
CH.ifa.draw.figures.RadiusHandle
adaptee: RoundRectangleFigure fOwner
Request(): locate
Target role is played by class CH.ifa.draw.standard.AbstractHandle
CH.ifa.draw.figures.RoundRectangleFigure
SpecificRequest(): getArc, displayBox
CH.ifa.draw.figures.GroupCommand
receiver: DrawingView fView
Execute(): execute
Command role is played by class CH.ifa.draw.util.Command
CH.ifa.draw.framework.DrawingView
Action(): selectionZOrdered, drawing, clearSelection, addToSelection(Figure), checkDamage
CH.ifa.draw.figures.InsertImageCommand
receiver: DrawingView fView
Execute(): execute
Command role is played by class CH.ifa.draw.util.Command
CH.ifa.draw.framework.DrawingView
Action(): lastClick, add(Figure), clearSelection, addToSelection(Figure), checkDamage
CH.ifa.draw.figures.UngroupCommand
receiver: DrawingView fView
Execute(): execute
Command role is played by class CH.ifa.draw.util.Command
CH.ifa.draw.framework.DrawingView
Action(): selectionElements, clearSelection, drawing, addToSelection(Figure), checkDamage
CH.ifa.draw.standard.AlignCommand
receiver: DrawingView fView
Execute(): execute
Command role is played by class CH.ifa.draw.util.Command
CH.ifa.draw.framework.DrawingView
Action(): selectionElements, checkDamage
CH.ifa.draw.standard.BringToFrontCommand
receiver: DrawingView fView
Execute(): execute
Command role is played by class CH.ifa.draw.util.Command
CH.ifa.draw.framework.DrawingView
Action(): selectionZOrdered, drawing, checkDamage
CH.ifa.draw.standard.ChangeAttributeCommand
receiver: DrawingView fView
Execute(): execute
Command role is played by class CH.ifa.draw.util.Command
CH.ifa.draw.framework.DrawingView
Action(): selectionElements, checkDamage
CH.ifa.draw.standard.SendToBackCommand
receiver: DrawingView fView
Execute(): execute
Command role is played by class CH.ifa.draw.util.Command
CH.ifa.draw.framework.DrawingView
Action(): selectionZOrdered, drawing, checkDamage
CH.ifa.draw.standard.ToggleGridCommand
receiver: DrawingView fView
Execute(): execute
Command role is played by class CH.ifa.draw.util.Command
CH.ifa.draw.framework.DrawingView
Action(): getConstrainer, setConstrainer(PointConstrainer)
CH.ifa.draw.figures.TextFigure
adaptee: OffsetLocator fLocator
Request(): moveBy
Target role is played by class CH.ifa.draw.standard.AbstractFigure
CH.ifa.draw.standard.OffsetLocator
SpecificRequest(): moveBy
CH.ifa.draw.standard.AbstractTool
adaptee: DrawingView fView
Request(): activate, deactivate
Target role is played by class CH.ifa.draw.framework.Tool
CH.ifa.draw.framework.DrawingView
SpecificRequest(): clearSelection, setCursor(Cursor)
CH.ifa.draw.figures.LineConnection
adaptee: Connector fStart, Connector fEnd
Request(): updateConnection
Target role is played by class CH.ifa.draw.framework.ConnectionFigure
CH.ifa.draw.framework.Connector
SpecificRequest(): findStart(ConnectionFigure), findEnd(ConnectionFigure)
CH.ifa.draw.standard.AbstractConnector
adaptee: Figure fOwner
Request(): displayBox, containsPoint
Target role is played by class CH.ifa.draw.framework.Connector
CH.ifa.draw.framework.Figure
SpecificRequest(): displayBox, containsPoint
CH.ifa.draw.applet.DrawApplet
adaptee: ToolButton fDefaultToolButton
Request(): toolDone
Target role is played by class CH.ifa.draw.framework.DrawingEditor
adaptee: ToolButton fSelectedToolButton
Request(): paletteUserOver
Target role is played by class CH.ifa.draw.util.PaletteListener
CH.ifa.draw.standard.ToolButton
SpecificRequest(): name, tool
CH.ifa.draw.application.DrawApplication
adaptee: ToolButton fDefaultToolButton
Request(): toolDone
Target role is played by class CH.ifa.draw.framework.DrawingEditor
adaptee: ToolButton fSelectedToolButton
Request(): paletteUserOver
Target role is played by class CH.ifa.draw.util.PaletteListener
CH.ifa.draw.standard.ToolButton
SpecificRequest(): name, tool
CH.ifa.draw.standard.StandardDrawingView
adaptee: Drawing fDrawing
Request(): drawDrawing, setDrawing
Target role is played by class CH.ifa.draw.framework.DrawingView
adaptee: Drawing drawing()
Request(): add(Figure), remove(Figure), freezeView, unfreezeView, selectionZOrdered
CH.ifa.draw.framework.Drawing
SpecificRequest(): draw, removeDrawingChangeListener, addDrawingChangeListener
SpecificRequest(): add(Figure), remove(Figure), lock, unlock, figures
CH.ifa.draw.standard.StandardDrawingView
adaptee: DrawingEditor fEditor
Request(): tool
Target role is played by class CH.ifa.draw.framework.DrawingView
CH.ifa.draw.framework.DrawingEditor
SpecificRequest(): tool
CH.ifa.draw.contrib.PolygonHandle
adaptee: Locator fLocator
Request(): locate
Target role is played by class CH.ifa.draw.standard.AbstractHandle
CH.ifa.draw.framework.Locator
SpecificRequest(): locate(Figure)
CH.ifa.draw.standard.LocatorHandle
adaptee: Locator fLocator
Request(): locate
Target role is played by class CH.ifa.draw.standard.AbstractHandle
CH.ifa.draw.framework.Locator
SpecificRequest(): locate(Figure)
CH.ifa.draw.standard.ToolButton
adaptee: PaletteIcon fIcon
Request(): paintNormal, paintPressed, paintSelected
Target role is played by class CH.ifa.draw.util.PaletteButton
CH.ifa.draw.util.PaletteIcon
SpecificRequest(): normal, pressed, selected
CH.ifa.draw.standard.StandardDrawingView
adaptee: Painter fUpdateStrategy
Request(): paint(Graphics)
Target role is played by class CH.ifa.draw.framework.DrawingView
CH.ifa.draw.framework.Painter
SpecificRequest(): draw(Graphics, DrawingView)
CH.ifa.draw.standard.ReverseFigureEnumerator
adaptee: ReverseVectorEnumerator fEnumeration
Request(): hasMoreElements, nextElement, nextFigure
Target role is played by class CH.ifa.draw.framework.FigureEnumeration
CH.ifa.draw.util.ReverseVectorEnumerator
SpecificRequest(): hasMoreElements, nextElement
Composite Component Composite
CH.ifa.draw.framework.Figure CH.ifa.draw.standard.CompositeFigure
children: Vector fFigures
Add(Component): add(Figure)
Remove(Component): remove(Figure)
Operation(): draw
Decorator Component Decorator
CH.ifa.draw.framework.Locator CH.ifa.draw.standard.OffsetLocator
component: Locator fBase
Operation(): locate(Figure)
CH.ifa.draw.framework.Figure CH.ifa.draw.standard.DecoratorFigure
component: Figure fComponent
Operation(): displayBox, basicDisplayBox, draw, handles
CH.ifa.draw.framework.Tool CH.ifa.draw.standard.SelectionTool
component: Tool fChild
Operation(): mouseDown, mouseDrag, mouseUp
Factory Method Creator
CH.ifa.draw.framework.DrawingView
FactoryMethod(): selectionElements, getFigureSelection
ConcreteCreator role is played by class CH.ifa.draw.standard.StandardDrawingView
CH.ifa.draw.framework.Figure
FactoryMethod(): figures, decompose, connectorAt
ConcreteCreator role is played by class CH.ifa.draw.standard.AbstractFigure
Observer Subject Observer
CH.ifa.draw.standard.StandardDrawing
observers: Vector fListeners
Attach(Observer): addDrawingChangeListener
Detach(Observer): removeDrawingChangeListener
Notify(): figureInvalidated, figureRequestUpdate
CH.ifa.draw.framework.DrawingChangeListener
Update(): drawingInvalidated, drawingRequestUpdate
CH.ifa.draw.standard.StandardDrawingView
observers: Vector fBackgrounds, Vector fForegrounds
Attach(Observer): addBackground, addForeground
Detach(Observer): removeBackground, removeForeground
Notify(): drawAll -> drawPainters
CH.ifa.draw.framework.Painter
Update(): draw
CH.ifa.draw.standard.StandardDrawingView
observers: Vector fSelection
Attach(Observer): addToSelection
Detach(Observer): removeFromSelection
Notify(): keyPressed -> handleCursorKey -> moveSelection
CH.ifa.draw.framework.Figure
Update(): moveBy
Prototype Client Prototype
CH.ifa.draw.standard.ConnectionHandle
prototype: ConnectionFigure fPrototype
Operation(): createConnection
CH.ifa.draw.framework.Figure
CH.ifa.draw.standard.ConnectionTool
prototype: ConnectionFigure fPrototype
Operation(): createConnection
CH.ifa.draw.framework.Figure
CH.ifa.draw.standard.CreationTool
prototype: Figure fPrototype
Operation(): createFigure
CH.ifa.draw.framework.Figure
Singleton Singleton
CH.ifa.draw.util.Clipboard
uniqueInstance: static Clipboard fgClipboard
CH.ifa.draw.util.Iconkit
uniqueInstance: static Iconkit fgIconkit
Instance(): instance
State-Strategy Context State/Strategy
CH.ifa.draw.standard.AbstractFigure CH.ifa.draw.framework.FigureChangeListener
CH.ifa.draw.standard.ChangeConnectionHandle
CH.ifa.draw.standard.ConnectionHandle
CH.ifa.draw.framework.Figure
CH.ifa.draw.figures.GroupCommand
CH.ifa.draw.figures.InsertImageCommand
CH.ifa.draw.figures.UngroupCommand
CH.ifa.draw.standard.AlignCommand
CH.ifa.draw.standard.BringToFrontCommand
CH.ifa.draw.standard.ChangeAttributeCommand
CH.ifa.draw.standard.FigureTransferCommand
CH.ifa.draw.standard.SendToBackCommand
CH.ifa.draw.standard.ToggleGridCommand
CH.ifa.draw.framework.DrawingView
CH.ifa.draw.applet.DrawApplet
CH.ifa.draw.application.DrawApplication
CH.ifa.draw.framework.Tool
CH.ifa.draw.standard.AbstractTool CH.ifa.draw.framework.DrawingView
CH.ifa.draw.standard.ChangeConnectionHandle
CH.ifa.draw.standard.ConnectionHandle
CH.ifa.draw.framework.ConnectionFigure
CH.ifa.draw.samples.javadraw.URLTool
CH.ifa.draw.standard.ConnectionTool
CH.ifa.draw.standard.CreationTool
CH.ifa.draw.standard.DragTracker
CH.ifa.draw.framework.Figure
CH.ifa.draw.standard.AbstractConnector CH.ifa.draw.framework.Figure
CH.ifa.draw.figures.LineConnection CH.ifa.draw.framework.Connector
CH.ifa.draw.util.CommandButton CH.ifa.draw.util.Command
CH.ifa.draw.standard.SelectionTool CH.ifa.draw.framework.Tool
CH.ifa.draw.util.PaletteButton CH.ifa.draw.util.PaletteListener
CH.ifa.draw.standard.StandardDrawingView CH.ifa.draw.framework.Drawing
CH.ifa.draw.figures.LineConnection CH.ifa.draw.framework.Connector
CH.ifa.draw.standard.StandardDrawingView CH.ifa.draw.framework.Drawing
CH.ifa.draw.standard.StandardDrawingView CH.ifa.draw.framework.DrawingEditor
CH.ifa.draw.contrib.PolygonHandle
CH.ifa.draw.standard.LocatorHandle
CH.ifa.draw.framework.Locator
CH.ifa.draw.standard.ConnectionTool CH.ifa.draw.framework.ConnectionFigure
CH.ifa.draw.samples.javadraw.Animator CH.ifa.draw.framework.DrawingView
CH.ifa.draw.applet.DrawApplet
CH.ifa.draw.application.DrawApplication
CH.ifa.draw.framework.Drawing
CH.ifa.draw.figures.TextTool CH.ifa.draw.standard.TextHolder
CH.ifa.draw.standard.StandardDrawingView CH.ifa.draw.framework.Painter
CH.ifa.draw.figures.PolyLineFigure CH.ifa.draw.figures.LineDecoration
CH.ifa.draw.standard.ChangeConnectionHandle CH.ifa.draw.framework.Connector
CH.ifa.draw.standard.StandardDrawingView CH.ifa.draw.framework.PointConstrainer
CH.ifa.draw.standard.HandleTracker CH.ifa.draw.framework.Handle
CH.ifa.draw.standard.ConnectionTool CH.ifa.draw.framework.Connector
CH.ifa.draw.standard.LocatorConnector CH.ifa.draw.framework.Locator
CH.ifa.draw.samples.javadraw.Animator CH.ifa.draw.util.Animatable
Template Method AbstractClass
CH.ifa.draw.standard.AbstractFigure
TemplateMethod(): moveBy, displayBox(Point, Point), size, containsPoint, invalidate, center
PrimitiveOperation(): basicMoveBy, basicDisplayBox, displayBox()
moveBy -> {basicMoveBy }
displayBox(Point origin, Point corner) -> {basicDisplayBox }
size, containsPoint, invalidate, center -> {displayBox() }
CH.ifa.draw.standard.AbstractHandle
TemplateMethod(): displayBox
PrimitiveOperation(): locate
CH.ifa.draw.standard.ActionTool
TemplateMethod(): mouseDown
PrimitiveOperation(): action
CH.ifa.draw.standard.ChangeConnectionHandle
TemplateMethod(): source, invokeStart, invokeStep, invokeEnd
PrimitiveOperation(): target, disconnect, connect, setPoint
source -> {target }
invokeStart -> {target, disconnect }
invokeStep -> {setPoint }
invokeEnd -> {setPoint, connect }
CH.ifa.draw.util.PaletteButton
TemplateMethod(): paint
PrimitiveOperation(): paintBackground, paintPressed, paintSelected, paintNormal


Detected Design Patterns in JRefactory 2.6.24

Design Pattern Name Roles and Corresponding Classes

* Last updated on April 1st 2009
Object Adapter-
Command
Adapter/ConcreteCommand Adaptee/Receiver
org.acm.seguin.refactor.type.ExtractInterfaceRefactoring org.acm.seguin.refactor.ComplexTransform
org.acm.seguin.refactor.EliminatePackageImportVisitor org.acm.seguin.summary.PackageSummary
org.acm.seguin.refactor.type.RemoveEmptyClassRefactoring org.acm.seguin.summary.TypeSummary
org.acm.seguin.refactor.method.RenameParameterRefactoring org.acm.seguin.summary.MethodSummary
org.acm.seguin.refactor.AddImportTransform org.acm.seguin.parser.ast.ASTName
org.acm.seguin.refactor.type.ChangePackageTransform org.acm.seguin.parser.ast.ASTName
org.acm.seguin.pretty.PrettyPrintVisitor org.acm.seguin.pretty.FieldSizeLookAhead
org.acm.seguin.pretty.PrettyPrintVisitor org.acm.seguin.pretty.LocalVariableLookAhead
org.acm.seguin.metrics.TextReport org.acm.seguin.util.TextFormatter
org.acm.seguin.uml.refactor.ExtractMethodDialog org.acm.seguin.refactor.method.ExtractMethodRefactoring
org.acm.seguin.uml.refactor.ExtractMethodDialog org.acm.seguin.awt.OrderableList
org.acm.seguin.uml.refactor.MoveMethodDialog org.acm.seguin.uml.refactor.ParameterPanel
org.acm.seguin.tools.stub.StubGenTraversal org.acm.seguin.tools.stub.StubFile
org.acm.seguin.print.text.TextPagePrinter org.acm.seguin.print.text.LineSet
org.acm.seguin.uml.refactor.RenameParameterDialog org.acm.seguin.summary.MethodSummary
org.acm.seguin.uml.refactor.RenameClassDialog org.acm.seguin.summary.TypeSummary
org.acm.seguin.uml.UMLPackage org.acm.seguin.uml.line.SegmentedLine
org.acm.seguin.uml.print.UMLPagePrinter org.acm.seguin.uml.UMLPackage
org.acm.seguin.summary.SummaryTraversal org.acm.seguin.summary.load.LoadStatus
org.acm.seguin.metrics.GatherData org.acm.seguin.metrics.MetricsReport
org.acm.seguin.print.text.TextPagePrinter org.acm.seguin.print.text.LinePrinter
org.acm.seguin.summary.load.SwingLoadStatus org.acm.seguin.tools.install.RefactoryStorage
org.acm.seguin.metrics.MethodMetricsFrame org.acm.seguin.summary.MethodSummary
org.acm.seguin.metrics.PackageMetricsFrame org.acm.seguin.summary.PackageSummary
org.acm.seguin.metrics.TypeMetricsFrame org.acm.seguin.summary.TypeSummary
org.acm.seguin.uml.UMLPackage org.acm.seguin.summary.PackageSummary
Factory Method Creator
org.acm.seguin.refactor.type.TypeChangeVisitor
FactoryMethod(): getFileSpecificTransform, getNewImports, getRemoveImportTransform
ConcreteCreator role is played by classes EliminatePackageImportVisitor, MoveClassVisitor, RenameClassVisitor
Observer Subject Observer
org.acm.seguin.refactor.ComplexTransform
observers: ArrayList transforms
Attach(Observer): add(TransformAST)
Detach(): clear
Notify(): apply
org.acm.seguin.refactor.TransformAST
Update(): update
Singleton Singleton
org.acm.seguin.ide.command.PackageSelectorPanel
uniqueInstance: static PackageSelectorPanel mainPanel
Instance(): getMainPanel
org.acm.seguin.ide.common.action.CurrentSummary
uniqueInstance: static CurrentSummary singleton
Instance(): get
org.acm.seguin.ide.common.EditorOperations
uniqueInstance: static EditorOperations singleton
Instance(): get
org.acm.seguin.ide.common.PackageListFilter
uniqueInstance: static PackageListFilter singleton
Instance(): get
org.acm.seguin.ide.common.SourceBrowser
uniqueInstance: static SourceBrowser singleton
Instance(): get
org.acm.seguin.ide.jbuilder.RefactoryNodeViewerFactory
uniqueInstance: static RefactoryNodeViewerFactory factory
Instance(): getFactory
org.acm.seguin.ide.jbuilder.UMLNodeViewerFactory
uniqueInstance: static UMLNodeViewerFactory factory
Instance(): getFactory
org.acm.seguin.pretty.ai.RequiredTags
uniqueInstance: static RequiredTags tags
Instance(): getTagger
org.acm.seguin.refactor.RefactoringFactory
uniqueInstance: static RefactoringFactory singleton
Instance(): get
org.acm.seguin.refactor.undo.UndoStack
uniqueInstance: static UndoStack singleton
Instance(): get
org.acm.seguin.uml.line.LabelSizeComputation
uniqueInstance: static LabelSizeComputation singleton
Instance(): get
org.acm.seguin.version.VersionControlCache
uniqueInstance: static VersionControlCache ssc
Instance(): getCache
State-
Strategy
Context State/Strategy
org.acm.seguin.parser.ast.SimpleNode
org.acm.seguin.pretty.PrettyPrintVisitor
org.acm.seguin.refactor.method.EMParameterFinder
org.acm.seguin.parser.Node
org.acm.seguin.parser.ast.SimpleNode org.acm.seguin.parser.JavaParserVisitor
org.acm.seguin.refactor.field.RenameFieldData org.acm.seguin.summary.Summary
org.acm.seguin.summary.ImportSummary
org.acm.seguin.summary.MethodSummary
org.acm.seguin.summary.TypeSummary
org.acm.seguin.summary.VariableSummary
org.acm.seguin.summary.SummaryVisitor
org.acm.seguin.refactor.method.MoveMethodRefactoring org.acm.seguin.summary.Summary
org.acm.seguin.refactor.AddImportTransform org.acm.seguin.parser.Node
org.acm.seguin.parser.ast.ASTClassDeclaration
org.acm.seguin.parser.ast.ASTConstructorDeclaration
org.acm.seguin.parser.ast.ASTFieldDeclaration
org.acm.seguin.parser.ast.ASTInterfaceDeclaration
org.acm.seguin.parser.ast.ASTMethodDeclaration
org.acm.seguin.parser.ast.ASTNestedClassDeclaration
org.acm.seguin.parser.ast.ASTNestedInterfaceDeclaration
org.acm.seguin.parser.ast.ASTPackageDeclaration
org.acm.seguin.parser.JavaParserVisitor
org.acm.seguin.refactor.method.MoveMethodVisitor org.acm.seguin.summary.Summary
org.acm.seguin.uml.line.DragPanelAdapter org.acm.seguin.uml.line.EndPointPanel
org.acm.seguin.uml.SaveMenuSelection org.acm.seguin.io.Saveable
org.acm.seguin.uml.line.DragPanelAdapter org.acm.seguin.uml.line.LinedPanel
org.acm.seguin.uml.line.LineMouseAdapter org.acm.seguin.uml.line.LinedPanel
org.acm.seguin.ide.common.SourceBrowserAdapter org.acm.seguin.uml.ISourceful
org.acm.seguin.uml.loader.ReloaderSingleton org.acm.seguin.uml.loader.Reloader
org.acm.seguin.refactor.method.ExtractMethodRefactoring org.acm.seguin.parser.Node
org.acm.seguin.refactor.ComplexTransform org.acm.seguin.refactor.TransformAST
org.acm.seguin.ide.common.action.RefactoringAction org.acm.seguin.ide.common.action.SelectedFileSet
org.acm.seguin.uml.UMLLine org.acm.seguin.uml.UMLIcon
org.acm.seguin.ide.elixir.version.ElixirContainsThread
org.acm.seguin.ide.elixir.version.ElixirVersionControlThread
org.acm.seguin.version.VersionControl
org.acm.seguin.uml.line.SegmentedLine org.acm.seguin.uml.line.EndPointPanel
org.acm.seguin.summary.SummaryTraversal
org.acm.seguin.summary.FrameworkFileSummaryLoader
org.acm.seguin.summary.load.LoadStatus
org.acm.seguin.summary.SummaryTraversal org.acm.seguin.summary.FrameworkLoader
org.acm.seguin.pretty.sort.MultipleOrdering org.acm.seguin.pretty.sort.Ordering
org.acm.seguin.pretty.sort.MultipleOrdering org.acm.seguin.util.Settings
Template Method AbstractClass
org.acm.seguin.ide.common.action.CurrentSummary
TemplateMethod(): updateMetaData, find
PrimitiveOperation(): getMetadataReloader, registerWithCurrentDocument
updateMetaData -> {getMetadataReloader }
find -> {registerWithCurrentDocument }
org.acm.seguin.ide.common.action.RefactoringAction
TemplateMethod(): actionPerformed
PrimitiveOperation(): activateListener
org.acm.seguin.io.DirectoryTreeTraversal
TemplateMethod(): traverse
PrimitiveOperation(): isTarget, visit
org.acm.seguin.metrics.MetricsFrame
TemplateMethod(): createFrame
PrimitiveOperation(): getTitle
org.acm.seguin.metrics.MetricsReport
TemplateMethod(): finalReport, typeReport, methodReport
PrimitiveOperation(): reportAverageStatements, reportAveragePublicMethods, reportAverageOtherMethods, reportAverageClassMethods, reportAverageInstanceVariables, reportAverageClassVariables, reportAbstractClasses, reportInterfaces, reportAverageParameters, reportPublicMethods, reportOtherMethods, reportClassMethods, reportInstanceVariables, reportClassVariables, reportStatement, reportParameters, reportLinesOfCode, reportBlockDepth
finalReport -> {reportAverageStatements, reportAveragePublicMethods, reportAverageOtherMethods, reportAverageClassMethods, reportAverageInstanceVariables, reportAverageClassVariables, reportAbstractClasses, reportInterfaces, reportAverageParameters }
typeReport -> {reportPublicMethods, reportOtherMethods, reportClassMethods, reportInstanceVariables, reportClassVariables }
methodReport -> {reportStatement, reportParameters, reportLinesOfCode, reportBlockDepth }
org.acm.seguin.parser.factory.ParserFactory
TemplateMethod(): getParser, getAbstractSyntaxTree
PrimitiveOperation(): getInputStream, getKey
getParser -> {getInputStream }
getAbstractSyntaxTree -> {getKey }
org.acm.seguin.pretty.PrettyPrintFromIDE
TemplateMethod(): prettyPrintCurrentWindow, getPrintData
PrimitiveOperation(): getStringFromIDE, setStringInIDE, setLineNumber, getLineNumber
prettyPrintCurrentWindow -> {getStringFromIDE, setStringInIDE, setLineNumber }
getPrintData -> {getLineNumber }
org.acm.seguin.pretty.sort.Ordering
TemplateMethod(): compare
PrimitiveOperation(): getIndex
org.acm.seguin.print.xml.State
TemplateMethod(): processLine(String), print(StringBuffer)
PrimitiveOperation(): processLine(String, int, StringBuffer), getFont
processLine(String) -> {processLine(String, int, StringBuffer) }
print(StringBuffer) -> {getFont }
org.acm.seguin.refactor.Refactoring
TemplateMethod(): run, recordUsage
PrimitiveOperation(): preconditions, transform, getID
run -> {preconditions, transform }
recordUsage -> {getID }
org.acm.seguin.refactor.type.AddClassRefactoring
TemplateMethod(): transform
PrimitiveOperation(): transformOriginal, createClass
org.acm.seguin.refactor.type.TypeChangeVisitor
TemplateMethod(): visit(FileSummary, Object), visit(ImportSummary, Object), isSamePackage, isMatchingPackage
PrimitiveOperation(): getAppropriateClasses, getFileSpecificTransform, getNewImports, getNewFile, addRenamingTransforms, getRemoveImportTransform, getCurrentPackage
visit(FileSummary, Object) -> {getAppropriateClasses, getFileSpecificTransform, getNewImports, getNewFile, addRenamingTransforms }
visit(ImportSummary, Object) -> {getRemoveImportTransform, getCurrentPackage }
isSamePackage, isMatchingPackage -> {getCurrentPackage }
org.acm.seguin.summary.query.TypeList
TemplateMethod(): query(PackageSummary), add(FileSummary, LinkedList)
PrimitiveOperation(): isIncluded(FileSummary), isIncluded(TypeSummary)
query(PackageSummary) -> {isIncluded(FileSummary) }
add(FileSummary, LinkedList) -> {isIncluded(TypeSummary) }
org.acm.seguin.uml.refactor.DialogViewListener
TemplateMethod(): actionPerformed
PrimitiveOperation(): createDialog
org.acm.seguin.uml.refactor.ExtractMethodDialog
TemplateMethod(): followup, init
PrimitiveOperation(): setStringInIDE, getStringFromIDE, getSelectionFromIDE
followup -> {setStringInIDE }
init -> {getStringFromIDE, getSelectionFromIDE }
org.acm.seguin.uml.refactor.NoInputRefactoringListener
TemplateMethod(): runRefactoring
PrimitiveOperation(): createRefactoring
org.acm.seguin.uml.refactor.RefactoringDialog
TemplateMethod(): runRefactoring
PrimitiveOperation(): createRefactoring
Visitor Visitor ConcreteElement
org.acm.seguin.parser.JavaParserVisitor 86 subclasses of org.acm.seguin.parser.ast.SimpleNode
org.acm.seguin.summary.SummaryVisitor 13 subclasses of org.acm.seguin.summary.Summary


Detected Design Patterns in JUnit 3.7

Design Pattern Name Roles and Corresponding Classes

* Last updated on April 1st 2009
Object Adapter-Command Adapter/ConcreteCommand Adaptee/Receiver
junit.swingui.TestSuitePanel
adaptee: TestTreeModel fModel
Request(): addError, addFailure, endTest
Target role is played by class junit.framework.TestListener
junit.swingui.TestTreeModel
SpecificRequest(): addError(Test), addFailure(Test), addRunTest(Test)
junit.awtui.TestRunner
adaptee: TestResult fTestResult
Request(): addError, addFailure, endTest
Target role is played by class junit.framework.TestListener
junit.framework.TestResult
SpecificRequest(): errorCount, failureCount, runCount, wasSuccessful
junit.awtui.TestRunner
adaptee: ProgressBar fProgressIndicator
Request(): endTest
Target role is played by class junit.framework.TestListener
junit.awtui.ProgressBar
SpecificRequest(): step
junit.swingui.TestHierarchyRunView
adaptee: TestSuitePanel fTreeBrowser
Request(): getSelectedTest, revealFailure, aboutToStart
Target role is played by class junit.swingui.TestRunView
junit.swingui.TestSuitePanel
SpecificRequest(): getSelectedTest, getTree, showTestTree
junit.extensions.TestSetup$1
Request(): protect
Target role is played by class junit.framework.Protectable
junit.extensions.TestSetup
SpecificRequest(): setUp, basicRun, tearDown
junit.framework.TestResult$1
Request(): protect
Target role is played by class junit.framework.Protectable
junit.framework.TestCase
SpecificRequest(): runBare
Composite Component Composite
junit.framework.Test junit.framework.TestSuite
children: Vector fTests
Add(Component): addTest(Test)
Operation(): countTestCases, run -> runTest
Decorator Component Decorator
junit.framework.Test junit.extensions.TestDecorator
component: Test fTest
Operation(): countTestCases, run -> basicRun
Observer Subject Observer
junit.framework.TestResult
observers: Vector fListeners
Attach(Observer): addListener
Detach(Observer): removeListener
Notify(): addError, addFailure, endTest, startTest
junit.framework.TestListener
Update(): addError, addFailure, endTest, startTest
State-Strategy Context State/Strategy
junit.extensions.ActiveTestSuite$1 junit.framework.Test
junit.swingui.FailureRunView
junit.swingui.TestHierarchyRunView
junit.swingui.TestRunContext
junit.swingui.TestRunner junit.runner.FailureDetailView
Template Method AbstractClass
junit.runner.BaseTestRunner
TemplateMethod(): getTest
PrimitiveOperation(): runFailed


Acknowledgments

  • I would like to thank Alex Binun from University of Bonn, Germany for reporting a missing instance of Decorator design pattern in java.io package and helping me to improve the tool. Version 4 resulted based on his valuable feedback!
  • I would like to thank Lei Hu from the Dept. of Computing & Software, McMaster University, Canada for reporting some missing design pattern instances in JHotDraw 5.1

External documentation sources