Friday, January 29, 2010

Linux Tips

1. vi hangs
Ctrl-s inside vi editor freezes the shell as it locks the terminal output
Ctrl-q to resume terminal output

2. vi command
<ESC> : end insert mode and return to command mode
ZZ : exit vi

dd : delete an entire line
3dd : delete 3 lines
u : undo last change

:set number : show line number
nG: go to line n
Shift+G : go to bottom

3. scp copy files between servers
scp [[user@]from-host:]source-file [[user@]to-host:][destination-file]

4. Find File
find / -name 'xxx.xx'

Tuesday, January 26, 2010

Use Case Modeling

Introduction to  UML 2 Use Case Diagrams

Use cases. A use case describes a sequence of actions that provide something of measurable value to an actor and is drawn as a horizontal ellipse. 

Actors. An actor is a person, organization, or external system that plays a role in one or more interactions with your system. Actors are drawn as stick figures. 

Associations.  Associations between actors and use cases are indicated in use case diagrams by solid lines. An association exists whenever an actor is involved with an interaction described by a use case.  Associations are modeled as lines connecting use cases and actors to one another, with an optional arrowhead on one end of the line. The arrowhead is often used to indicating the direction of the initial invocation of the relationship or to indicate the primary actor within the use case.  The arrowheads are typically confused with data flow and as a result I avoid their use. 

System boundary boxes (optional). You can draw a rectangle around the use cases, called the system boundary box, to indicates the scope of your system.  Anything within the box represents functionality that is in scope and anything outside the box is not.  System boundary boxes are rarely used, although on occasion I have used them to identify which use cases will be delivered in each major release of a system.

Packages (optional).  Packages are UML constructs that enable you to organize model elements (such as use cases) into groups. Packages are depicted as file folders and can be used on any of the UML diagrams, including both use case diagrams and class diagrams. I use packages only when my diagrams become unwieldy, which generally implies they cannot be printed on a single page, to organize a large diagram into smaller ones.

Writing effective Use Case Examples

UML Use Case Diagrams: Tips

Business Requirements Template

Business Requirements Template 1

1. Project Summary
2. Reference Documents
   2.1 Company Documents
   2.2 Industry Standards
3 Assumptions, Dependencies and Constraints
   3.1 Assumptions
   3.2 Dependencies
   3.3 Constraints
4 Top Level Functional Requirements
   4.1 Next Level Summary (repeat as necessary)
        4.1.1 Detailed Functional Requirements (repeat as necessary)
5 NonFunctional Requirements
   5.1 Security Requirements
   5.2 Data Conversion Requirements
   5.3 Performance and Response Time Requirements
   5.4 Platform Dependent and Installation Requirements
   5.5 Parallel Testing Requirements
   5.6 System Interface Requirements
   5.7 Data Archival, Backup and Recovery Requirements
   5.8 Forms and Reporting Requirements
   5.8.1 Localization Requirements
   5.8.2 Forms
   5.8.3 Reports
   5.9 Training and Procedures
6 Terms and Definitions
   6.1 Documentation Standard
   6.2 Diagrams and Models
   6.3 Glossary

Business Requirements Template 2
1. Business Process Flow / Overview
  • Dependencies 
  • Current Business Process Flow Diagram
  • Proposed Business Process Flow Diagram
2. Information Flow
  • Current System Context Diagram
  • Proposed System Context Diagram
3. Business Requirements
  • Security Requirements
  • Performance Requirements
  • Availability Requirements
  • User Requirements
4. System Requirements and Processing Rules
Techical Services Impact Statemnt
  • System Environment Needs
  • Questions
  • Network Needs
  • Bakcup and Recovery Needs
  • Storage Capacity Needs
  • Telecommunications Load
5. Solution Alternatives / Preliminary Architecture Diagram
  • Solution #1
  • Solution #2

6. Budget and Resource Estimates
7. Glossary
8. Approvals
9. Inspection Checklist for Software Requirements
  • Organization and Completeness
  • Correctness
  • Quality Attributes
  • Traceability
  • Special Issues

Business Requirements Template 3

1. Introduction
  • Scope
  • Business Overview
  • Business Opportunity
  • Customer Needs
  • Project Objectives
  • Success Criteria
  • Business Constrains
  • Project Constrains
2. Solution Proposal
  • Solution Overview
  • Solution Features
  • Assumptions
  • Dependencies
3. Feature Releases
  • Feature
4. Limitations
5. Exclusions
6. Busines Context Inventory
  • Stakeholder Catelog
7. Appendix
  • Appendix A: Terminology
  • Appendix B: Glossary

Thursday, January 21, 2010

How to write Business Requirement

How to Create Business Requirements
1. Review use case document or interview end-user
- Capture functionality
- System specifications

2. Transcribe each step of your use case into a specific business requirement
- How the functionality works
- what has to happen to make it work

3. List all the database, servers and software systems that are involved in the process

4. List other items that are not necessarily requirements, but have a direct impact on the particular process
- People involved in the process (name, description and title)
- What role or function they do in this process
- Rank each requirement with a priority

5. List the business rules within the requirements document
- Cataloged with the date identified, given an ID, title and description, who has authority over the rule and what part it plays in the current process.

Ten Top Tips for Creating Good Business Requirements
1. Develop a clear understanding of the problems 

2. Identify all project stakeholders and involve them in the business requirements gathering process

3. Clearly document all business data including workflow, current problems, anticipated risks, and required performance metrics

4. Use approved templates for all documentation

5. Identify potential privacy and security issues

6. Make a concerted effort to identify and document all risks, the impact of these risks on the project's costs and timetable

7. Conduct both group and one-on-one meetings to insure that all business requirements, risks and concerns are identified

8. Present a draft of the business requirements document to key stakeholders for preliminary review and tentative approval

9. Rewrite the draft business requirements document to address any issues discovered

10. Present the completed business requirements document to all stakeholders in a formal meeting.

Think "What", Not "How"
How to Specify What You Want

Wednesday, January 20, 2010

PHP Tips

PHP String Functions

1.  Contain String

int strpos ( string $haystack, mixed $needle [, int $offset = 0 ])  - Find position of first occurrence of a string

int strstr ( string $haystack, mixed $needle [, bool $before_needle = false ]) Find first occurrence of a string

2. Array
array_merge( array1, array2 ...)  - merge array
array_intersect(array1,array2,array3...) - compares array values, and returns the matches
array_diff(array1,array2,array3...)  - compares array values, and returns the difference

array_unique(array) - remove duplicate value
in_array(search,array,type) - searches an array for a specific value (true or false)

Remove an item from array base on the value

foreach($myArray as $key => $item) {
   if($item->getValue() == $remove_value) {

explode — Split a string by string
implode — Join array elements with a string

array explode ( string $delimiter , string $string [, int $limit ] )
string implode ( string $glue , array $pieces )

3. Input & Output
$user_input = $this->getRequestParameter('query');
$user_input = htmlentities($user_input, ENT_QUOTES, 'UTF-8'); 

$output = html_entity_decode($value, ENT_QUOTES, 'UTF-8');



$name = html_entity_decode($name, ENT_QUOTES, 'UTF-8');
$name = truncate_text($name, 40, '..');
$name= htmlentities($name, ENT_QUOTES, 'UTF-8');



such as /etc/php.ini

Macro Photography

40 Amazing Examples of Macro Photography

Friday, January 15, 2010

Web Development Special Characters

1. Suvivial Guide to i18n

2. PHP UTF-8 Cheatsheet
Encodes HTML safely for UTF-8 
htmlentities($var, ENT_QUOTES, 'UTF-8')

3. PHP: htmlentities - Manual
4. The Absolute Minimum Every Software Developer Absolutely, 
Positively Must Know About Unicode and Character Sets 
(No Excuses!) - Joel on Software

Tuesday, January 12, 2010

Set Your Default Browser

Windows XP
  • Firefox 2: "Tools -> Options -> Main / System Defaults -> (checkmark) Always check to see if Firefox is the default browser on startup -> Check Now"
  • Firefox 3: "Tools -> Options -> Advanced -> General / System Defaults -> (checkmark) Always check to see if Firefox is the default browser on startup -> Check Now"
  • IE: In Internet Explorer -> View menu -> Internet Options -> Programs
  • Google Chrome: "Customize and Control" -> Options ->Basics -> Default Browser

Monday, January 11, 2010

How to be a UX Expert

Most important is to have compassion for users.

Today's reading:

What does it take be a UX designer?

So you wanna be a user experience designer — Step 1: Resources

11 Blogs to Help You Become a User Experience Expert

Friday, January 8, 2010

First Post

This blog is built to collect technology and art knowledge which is interesting in my eyes.