Tuesday, April 2, 2013

Merging in SVN using Eclipse

  1. Do a fresh checkout of the project where you are going to merge into. This is done to ensure that your target branch is up to date.
  2. Right click the project and click Team -> Merge
  3. In URL, browse on the source project
  4. Click Ok
  5. Resolve any conflicts

Thursday, February 7, 2013

JBoss Drools

JBoss/JBoss AS (JavaBeans Open Source Software Application Server)

- now has a new name WildFly
- is a J2EE platform for developing and deploying enterprise Java applications, Web applications and services, and portals

Drools/JBoss Rules

- a rule language
- case sensitive
- single line comments starts with # or //, multi-line comments are enclosed in /* and */

Rule file - file ending with .drl

jBPM

- is a flexible java Business Process Management (BPM) Suite
BPM makes the bridge between business analysts, developers and end users, by offering process management features and tools in a way that both business users and developers like it

Components of jBPM

  • core process engine - the only required component
    • history log
    • human task service
  • graphical editors
    • eclipse plugin
    • web-based designer
  • Guvnor respository - can store all business processes
  • jBPM console - web-based console for managinf business processes

Core

knowledge base
   - used to look up the process definitions whenever necessary
   - uses a knowledge builder to load processes from various resources (for example from the classpath, from file system or process repository), i.e.
KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();
kbuilder.add(ResourceFactory.newClassPathResource("ruleflow.rf"), ResourceType.DRF);
   - can be dynamically changed (so you can add or remove processes at runtime)
session
   - instantiated from knowledge base and are used to execute processes and interact with the engine

Structure of a Rule File:

package package-name - must always be the first element
imports - optional, order does not matter
globals - optional, order does not matter, define global vars
functions - optional, order does not matter
function String hello(String name) {
    return "Hello "+name+"!";
}

queries - optional, order does not matter
rules - optional, order does not matter
rule "name"
    attributes
    when
        LHS
    then
        RHS
end


Common rule attributes: 

salience - priority, higher salience values are given higher priority, default is 0, can be positive or negative
agenda-group - a group name, only rules in the agenda group that has acquired the focus are allowed to fire
activation-group - same as if else, only one will fire

Ref:
http://docs.jboss.org/jbpm/v5.1/userguide/

Monday, January 28, 2013

Ant buildfile

Each buildfile contains one project and at least one (default) target. Targets contain task elements.

Basic components/tags:
1) project - attributes: name, default, and basedir

2) target - attributes: name, depends, if, unless, descriptiondefault, and basedir

3) tasks - can be built-in or user defined
Common tasks: init, sets properties, prepare, creates directories, build, builds the system, package, creates jar file, install, installs an application to Tomcat or other engine, deploy, deploy a WAR engine, reload, update previously installed application engine, redeploy

4) properties - to reference, enclose in "${" and "}"
Some Built-in Properties: basedir, ant.file, ant.version, ant.project.name, ant.java.version


Tags:
                     ...


Ref:
http://ant.apache.org/manual/using.html

Sunday, January 27, 2013

Windows and Unix common commands

WindowsUnixDescription
attrib

change(clear or set) the attribute of the file

cdpwdprint current working directory
cd <dir>cd <dir>change directory
clsclearclear screen
cmdStarts a new instance of the Windows command interpreter
copycpcopy
cp /mySrc .
date, timedateprint current date and/or time
delrmdelete
deltreerm - rrecursively delete entire directory tree
dirlslist files and directories
ls attributes:
-a Include hidden fiels (beginning with .)
-l long format
-s sort by time modified
-r reverse sort 
doskey /hhistoryprint history
editvi etc.create new file, show edit window

common vi commands:
/<text> - search forward
n - next occurrence
?<text> - search backward
n - previous occurrence
:set number - show line number
:q | :quit | :q! - quit
exitexit
Ctrl-D
exit
findfinds files/folders or string in files
Ex.
dir c:\ /s /b | find "CPU" - display the file names on drive C that contain the string "CPU"
find . -name "foo*"
findgrepsearch
grep -n 'UnknownServiceException' */*/*/server.log
grep -rni "string" * .*
grep -E "a|b"
  r = recursive i.e, search subdirectories within the current directory
  n = to print the line numbers to stdout
  i = case insensitive search
  .* = hidden files/directory
  -E = extended regex (i.e., may use | for or) 
helpmanhelp/manual
displays all available commands & how to use them
ipconfig /allipconfig -aprint network details
mkdirmkdircreate new folder/directory
movemvmove file or folder
rmdirrmdirremove folder/directory
setenvset environment variable
set Pathecho $PATHprint value of environment var PATH
startstarting/opening a command/program
List of commands for Windows XP, Vista and Windows 7: http://ss64.com/nt/run.html
Ex.
subst notepad
start /d "C:\Program Files (x86)\Notepad++" notepad++.exe -> start the executable and close the command prompt that called it
substsubstituting path
subst R: D:\temp\temp
typecatdisplay contents of a file, concatenate files or create a new file
Ex.
cat > 1.txt
This is the first line.
- creates a simple text file. ^D mrks the end of file.
cat 1.txt - display contents of 1.txt
cat 1.txt 2.txt > 3.txt - concatenate 1.txt and 2.txt ans save it in 3.txt
treefind .,
ls -R
print directory structure
lessdisplay the contents of a text file on console
lnmake link
Types:
1. Hard link (default) - Points to a file through inode number. If the original file's name is changed, hard link still points to same file.
2. Symbolic link (ln -s) - Points to a file through name. If the original file's name is changed, symbolic link still points to the original name and does not point anymore to the original file. If the original file's content is changed, symbolic link still points to the same file.
ln -s myFolder myShortcut - create
ln -sfn myFolder2 myShortcut - update
   -f = force
   -n = treat LINK_NAME as a normal file if it is a symbolic link to a directory, else LINK_NAME  will be treated as symbolic link and will not effectively remove link to previous target and point to new target
printenvprint environment variables
tararchive/extract
tar -xvf sample.tar.gz

PATH
WindowsUnixDescription
\/Directory separator, e.g. C:\user\docs\sample.txt
/-Switch, e.g. dir /w
[drive letter:]\ or
\\[server name]\[volume]\
/Root directory
..Current directory
....Parent directory
~Home directory - $HOME var in UNIX, which usually is /home/username
C:\user\docs\sample.txt
docs\sample.txt
A:pic.jpg \\server01\user\docs\sample.txt
//home/user/docs/Letter.txt .
/inthisdir
../../greatgrandparent ~/.rcinfotd>
Sample paths


Source:
https://en.wikipedia.org/wiki/Path_(computing)

Sunday, January 13, 2013

Software Testing

Testing Levels
  • Unit testing
    • done in local/DEV
    • testing fixes individually
  • Integration testing
    • done in SIT
    • testing integrated modules
    • deals with integration of a process in the system, not the integration of the whole system
  • System testing
    • done in SIT
    • testing the system as a whole
    • Types of system testing:
      • Usability testing – this is how well the user can access the different features in the system and how easy it is to use.
      • GUI software testing – this is to check if graphically that the program looks how was intended and the GUI works as intended.
      • Security testing – this would be to check if important information is secure and if there are certain access restriction that they work.
      • Accessibility – how easy is it for various users including users with disability to use the system.
      • Reliability testing – to check that the system works for long period of time and does not constantly crash.
  • User acceptance testing
    • done in UAT
    • obtain confirmation that a system meets mutually agreed-upon requirements

Wednesday, October 3, 2012

Outline: Warren Buffett's Management Secrets

by Mary Buffett and David Clark

Step 1. Pick the right business to work for (business that offers greatest career opportunities)

Chapter 1. how to find companies that offer greatest career opportunities (w/ durable competitive advantage)

have products that:
- never really change
- easy to sell
- own a piece of consumer's mind
come in 3 basic business models:
- sell unique product, e.g. Coca Cola, Hershey
- sell unique service, sell what people need
- low cost buyer and seller of product/service that the public is consistently in need of - offer low cost through high volum, e.g. Walmart, Costco, Burlington

Chapter 2. quick test for identifying the best company to work for 

- per share earnings test (10 year period) - consistent and has upward trend
- debt test - long term debt must be low, debt load should be < 5*net earnings
- gross margin test - must be higher
      gross profit = revenue - cost of good sold
      gross margin = gross profit/revenue

Step 2. Delegate

Chapter 3. rules for delegating authority 

- every business culture is unique
- leave managers alone - let them continue to think their business as their own
- managers must have a GREAT deal of INTEGRITY

Step 3. Find the right manager for the job

Chapter 4. where to start search for manager 

- change manager only when necessary
- promote from within if possible
- look for talent w/ proven talent record

Chapter 5. victor or victim

- must have an internal locus of control
- victor = with internal locus of control - in control of themselves, take responsibility for their failures
- victim = with external locus of control - don't believe that they have power to solve their problems

Chapter 6. work at a job you like

- do what you love/love what you do, must not be driven by money

Chapter 7. put a winning sales team together

- find people who believe in the product

Chapter 8. obsession

- sd




Monday, September 3, 2012

Useful Maven Commands

  • mvn --version - displays the Maven version in use
  • mvn dependency:tree - displays the dependency tree for this project
  • mvn eclipse:eclipse - creates/updates Java eclipse project settings (.project, .classpath, .setting/org.eclipse.jdt.core.prefs, & other config files)
  • mvn eclipse:clean - cleans/removes Java eclipse project settings (.project, .classpath, .setting/org.eclipse.jdt.core.prefs, & other config files)

Monday, June 18, 2012

Useful DB2 Queries

ALL TABLES:
select * from sysibm.systables

TABLE DESCRIPTION:
select * from sysibm.syscolumns where tbname = 'tableName'
- NOT VERY RELIABLE, SOME COLs MIGHT BE MISSING

or

select colname, typename, length, scale from syscat.columns
where tabschema = 'schemaName' and tabname = 'tableName'
- NOT VERY RELIABLE, SOME COLs MIGHT BE MISSING

or

describe table tableName - DOES NOT WORK :(

Note: Use SYSCAT views rather than the SYSIBM tables. Reason being is that from release to release the tables are being revised while DB2 development tries hard to keep the SYSCAT view signatures compatible. For this reason SYSCAT is being described in the SQL Reference while SYSIBM is not.

GET CURRENT DATE/TIME:
select current date from sysibm.sysdummy1
select current time from sysibm.sysdummy1
select current timestamp from sysibm.sysdummy1

Note: sysibm.sysdummy1 table is a special in-memory table that can be used to discover the value of DB2 registers

Sources:
http://www.databaseteam.org/9-db2/b4ac3f33bec9fb23.htm#.UfdJQ41OS6M
http://www.ibm.com/developerworks/data/library/techarticle/0211yip/0211yip3.html

Tuesday, May 22, 2012

Database Normalization

First Normal Form (1NF)
- no duplicate columns, e.g. teacher, student1, student2, student3
- no non-atomic columns, e.g. teacher, students
- rows must be have unique identifier (primary key), e.g. teacher, studentID, studentName

 Second Normal Form (2NF)
- satisfied 1NF
use foreign key (move subset of data/column that apply to multiple rows of a table to another table and connect them through the foreign key)
e.g.
studentID, studentName, courseID, courseName to
studentID, studentName, courseID and courseID, courseName

Third Normal Form (3NF)
- 2NF
- remove columns that are not dependent upon primary key
e.g.

Boyce-Codd Normal Form (BCNF or 3.5NF)

Fourth Normal Form

Sunday, May 20, 2012

Apache log4j

DEBUG < INFO < WARN < ERROR < FATAL

Tuesday, May 15, 2012

HTML

Complete list of HTML tags: http://www.w3schools.com/tags/default.asp

- HTML stands for Hyper Text Markup Language
- HTML is not a programming language, it is a markup language
- Practically speaking, there is no difference between the htm and html extensions
- In XHTML, all elements must be closed. Adding a slash inside the start tag, like
, is the proper way of closing empty elements in XHTML (and XML)
- HTML tags, attribute names and attribute values are not case sensitive but World Wide Web Consortium (W3C) recommends lowercase in HTML 4, and demands lowercase tags in XHTML. Newer versions of (X)HTML will demand lowercase attributes
- In XHTML, XML, elements with no end tag (closing tag) are not allowed
- attribute id vs name: id must be unique and is used as an identifier of an HTML element while name is used for form elements and form elements can share the same name
- HTML comment sample:
 <!-- This is a comment --> 
- The <center>, <font>, <basefont>, <s>, <strike> and <u> tags and align, bgcolor and color attributes are deprecated in HTML 4, and removed from HTML5. Style sheets (CSS) should be used to define the layout and display properties for many HTML element
- Always add a trailing slash to subfolder references. If you link like this: href="http://www.w3schools.com/html", you will generate two requests to the server, the server will first add a slash to the address, and then create a new request like this: href="http://www.w3schools.com/html/"
- HTML frames are obsolete in HTML5. Cons: http://webdesign.about.com/od/framesprosandcons/a/aaframesyuck_2.htm
- The doctype declaration refers to a Document Type Definition (DTD). The DTD specifies the rules for the markup language, so that the browsers render the content correctly. 
 <!-- This is a comment --> 

Reference: http://www.w3schools.com

Wednesday, May 9, 2012

How to create Sublabels / Hierarchical Labels in Blogspot

I always wanted my label section to look like the archive section where labels can have hierarchy and the number of posts is displayed beside each label. I learned how to create the hierarchical tree from this blog but the nodes have to be added one by one and the number of posts per label are not displayed so I tweaked it a little to suit my needs. Here are the steps:
  1. Add the Labels gadget if is not yet added
    From your dashboard, click Layout -> Add a Gadget and select Labels
  2. Add an HTML gadget. This is where you will create your hierarchical labels.
    From your dashboard, click Layout -> Add a Gadget and select HTML/Javascript
  3. Ensure that the Labels gadget comes first before the HTML gadget in your layout.
    From your dashboard, click Layout and arrange your gadgets by dragging them to the desired location so that the Labels gadget is on top or comes first before the HTML gadget
  4. Update the Template
    1. Add the dtree javascript.
      From your dashboard, click Template -> Edit HTML -> Proceed and check Expand Widget Templates. Copy and paste this code
      <link href='https://sites.google.com/site/efekefek/file-js/dtree.css' rel='StyleSheet' type='text/css'/>
      <script src='https://sites.google.com/site/efekefek/file-js/createdtree.js' type='text/javascript'/>
      after this tag
      <b:skin><![CDATA[/*
    2. Remove the Label widget content
      Find the Label widget code. It looks like this
      <b:widget id='Label1' locked='false' title='Labels' type='Label'>
      <b:includable id='main'>
          
       ...  
      
      </b:includable>
      </b:widget>
      Replace the code inside <b:includable id='main'> and </b:includable> with this code
      <script type='text/javascript'>
        var labelCountMap = {};
        <b:loop values='data:labels' var='label'>
           labelCountMap ["<data:label.name/>"] = "<data:label.count/>";
         </b:loop>
      </script>
    3. Save template
  5. Prepare the code of the Hierarchical Labels
    Copy the code below and replace the data with your own Labels. The data is in format
    parentLabel: { subLabels }
    The subLabels are comma separated. If the parentLabel doesn't have subLabels, replace it with {}.
    <div class="dtree">
    <p><a href="javascript: d.openAll();">open all</a> | <a href="javascript: d.closeAll();">close all</a></p>
    <script type="text/javascript">
    <!--
    function isEmpty(obj) {
        for(var prop in obj) {
            if(obj.hasOwnProperty(prop))
                return false;
        }
        return true;
    }
    
    function addMap(d, startingNode, parentNode, map) {
     for (var key in map) {
      if (isEmpty(map[key])) {
       d.add(startingNode++,parentNode,key+' ('+labelCountMap[key]+')','/search/label/'+key);
      } else {
       d.add(startingNode++,parentNode,key+' ('+labelCountMap[key]+')','/search/label/'+key);
       startingNode = addMap(d, startingNode, startingNode-1, map[key]);
      }
      
     }
     return startingNode; 
    }
    
    var data = {
     'Label 1' : {
      'Label 1.1' : {},
      'Label 1.2' : {
       'Label 1.2.1' : {}
      }, 
      'Label 1.3' : {}
     }, 
     'Label 2' : {
      'Label 2.1' : {}, 
      'Label 2.2' : {}
     }, 
     'Label 3' : {}, 
     'Label 4' : {}};
    
    d = new dTree('d');
    d.config.useLines = true;
    d.config.useIcons = false;
    d.config.inOrder = true;
    
    d.add(0,-1,'');   
    addMap(d, 1, 0, data);
    
    document.write(d);
    //-->
    </script>
    </div>
  6. Paste the code in the HTML widget
    From your dashboard, click Layout and Edit the HTML widget. Paste the code inside Content and Save

Wednesday, July 27, 2011

Maven POM


Source: http://maven.apache.org/guides/introduction/introduction-to-the-pom.html

Monday, July 25, 2011

Basic UNIX commands

  • man - manual/help
  • pwd - print working/current directory
  • ls - list files
  • ls -l - lists files in 'long format', which contains lots of useful information, e.g. the exact size of the file, who owns the file and who has the right to look at it, and when it was last modified
  • cd - change directory
  • mkdir [dir] - creates dir
  • rmdir [dir] - removes dir
  • more [options] file(s) - Display contents of files
  • less [options] file(s) - Display contents of files
    Useful commands while viewing a file with 'more' or 'less':
    • <spacebar> - scroll forward one page
    • ^b (control-b) - scroll backward one page
    • /<text> - search for string
    • n - find next occurence of string
    • N - find previous occurence of string (search for string in opposite direction)*
    • g - go to the beginning of the file*
    • G - go to the end of the file*
    • v - edit the current file with 'vi'*
    • :n - go to the next file*
    • :p - go to the previous file*
    • q - quit
    *works in 'less', not 'more'
  • grep [options] <pattern> [files] - search inside files for the given pattern
    Useful options:
    • -i - ignore case
    • -r or -R - search files in directories/subdirectories recursively
    • -v - nvert match: select non-matching lines
  • tail [options] [filenames] - show tail/end of file
  • tail -f temp.log - follow/monitor the file, display the last 10 lines of temp.log and append new lines to the display as new lines are added to temp.log
  • vi filename - edit the file
    Modes:
    • command mode - letters of the keyboard will be interpreted as commands
    • insert mode - letters of the keyboard will type or edit text
    Useful commands:
    • x - deletes the character the cursor is under
    • dd - deletes the line the cursor is on
    • a - append after the cursor
    • i - insert before the cursor
    • ESC - non edit mode
    • :wq - saves the current changes and exits vi
    • :w - saves the current changes but does not exit vi
    • :q - exits vi without saving any change

References:
http://claymore.rfmh.org/public/computer_resources/unix_commands.html
http://mally.stanford.edu/~sr/computing/basic-unix.html
http://cmgm.stanford.edu/classes/unix/vi.html
http://en.wikipedia.org
http://www.ccsf.edu/Pub/Fac/vi.html

Friday, July 22, 2011

Installing your own jar into Local Repository

  • Update your maven setting to point the localRepository to where you want to install the jar
    1. Go to <MAVEN_HOME>\conf directory
    2. Open settings.xml and change <localRepositorygt; tag to the path where you want to install the jar file
  • In command prompt, type:
    mvn install:install-file -Dfile=your-artifact-1.0.jar \
                             [-DpomFile=your-pom.xml] \
                             [-Dsources=src.jar] \
                             [-Djavadoc=apidocs.jar] \
                             [-DgroupId=org.some.group] \
                             [-DartifactId=your-artifact] \
                             [-Dversion=1.0] \
                             [-Dpackaging=jar] \
                             [-Dclassifier=sources] \
                             [-DgeneratePom=true] \
                             [-DcreateChecksum=true]
    
    Where: <path-to-file>  the path to the file to load
       <group-id>      the group that the file should be registered under
       <artifact-id>   the artifact name for the file
       <version>       the version of the file
       <packaging>     the packaging of the file e.g. jar

    Sample:
    mvn install:install-file -Dfile=C:\bel\docs\lib\jxl-2.6.3.jar -DgroupId=jexcelapi -DartifactId=jxl -Dversion=2.6.3 -Dpackaging=jar -DgeneratePom -DcreateChecksum=true

  • In your repository, you will find the new jar installed
  • To use the jar, add it in your pom.xml like:
    <dependency>
     <groupId>jexcelapi</groupId>
     <artifactId>jxl</artifactId>
     <version>2.6.3</version>
    </dependency>

Monday, April 25, 2011

Maven Setup

  1. Install Maven
  2. Update {MAVEN_HOME}\conf\settings.xml
    Update the following:
    • localRepository
    • proxies
    • profiles
    • activeProfiles

Sunday, March 6, 2011

Deployment

  1. Create the package for full release
    1. Check out the Project in Eclipse
      1. Open SVN Repositories. Click Window->Open Perspective->SVN Repository Browser
      2. Assuming that you already have Repository Location set up, find the project in the trunk or branches
      3. Right click project then click Show History to ensure that it has the latest change/fix needed
      4. Tag or make a branch out of the project. Right click project then click New->Tag or Branch
      5. Right click newly created tag/branch then click Show History to ensure that the it has the latest change/fix needed
      6. Check out the newly created tag or branch. Right click project the click Check Out

    2. Build the package
      1. In the console, go to emea-pom of the checked out project
      2. Type
        mvn clean package –DemeaVersion=${currentversion}
      3. After a successful build, go to the emea-release project and copy the whole target folder in a different directory.

  2. Generate the config files/folders of the package
    1. Create a config folder inside the target folder or where the jar is located
    2. Create folders dev, sit, uat and prod inside config folder
    3. Open you FTP Client (e.g. FileZilla) and copy the config files to the newly created folders
      • DEV
      • SIT
      • UAT
      • PROD
    4. Update the ini file with the changes from project and change the VERSION property

  3. Deploy DEV using the exploded jar
    1. In FileZilla, upload/add target/classes/versions to /ams/domains/ACCTSVCS102/versions
    2. In FileZilla, copy target/config/dev to/ams/domains/ACCTSVCS102/versions/config
    3. On DEV WEBLOGIC, stop and delete previously deployed ear
    4. Open Putty and login to DEV (ehdeapp10v.uk.jpmorgan.com)
    5. Point latest to latest deployed version

      1. Go to /ams/domains/ACCTSVCS102/versions/biz-rules
      2. Type rm latest
      3. Type ln -s {newversionFolder} latest
      4. Do step 1-3 to config & emea folders as well

    6. On DEV WEBLOGIC, deploy new ear and start
    7. Delete temporary files

      1. Go to /ams/domains/ACCTSVCS102/scripts and type stop_all.sh
      2. Go to /ams/domains/ACCTSVCS102/servers/admACCTSVCS
      3. Delete tmp folder. Type rm -rf {folderName}
      4. Go to /ams/domains/ACCTSVCS102/servers/mngACCTSVCS
      5. Delete tmp & stage folder
      6. Go to /ams/domains/ACCTSVCS102/scripts and type start_all.sh

    8. Check server: DEV

  4. Copy package(jar) and config files to SIT (ehdeapp10v.uk.jpmorgan.com), /home/eis_dev/a_pfdv01/AMSNA

  5. Create JIRA

  6. Finish!

Thursday, January 20, 2011

Common DB2 SQLCODE

SQLCODE Description
-301THE VALUE OF INPUT HOST VARIABLE OR PARAMETER NUMBER position-number CANNOT BE USED AS SPECIFIED BECAUSE OF ITS DATA TYPE
-302THE VALUE OF INPUT VARIABLE OR PARAMETER NUMBER position-number IS INVALID OR TOO LARGE FOR THE TARGET COLUMN OR THE TARGET VALUE
-440THE NUMBER OF PARAMETERS IN THE PARAMETER LIST DOES NOT MATCH THE NUMBER OF PARAMETERS EXPECTED FOR STORED PROCEDURE name, AUTHID authid, LUNAME luname. number PARAMETERS WERE EXPECTED.
-551 auth-id DOES NOT HAVE THE PRIVILEGE TO PERFORM OPERATION operation ON OBJECT object-name


Complete list: http://www.caliberdt.com/tips/sqlcode.htm

Sunday, January 16, 2011

Getting started with Ant

A(nother) N(eat) T(ool)

What is Apache Ant?
http://ant.apache.org/

Download bin:
http://ant.apache.org/bindownload.cgi

Getting started with Maven

Apache Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

Download and extract bin from http://maven.apache.org/download.html

Basics:
http://maven.apache.org/guides/getting-started/maven-in-five-minutes.html

To install a package into your local repository:
1) Open <MAVEN_HOME>/conf/settings.xml
2) Set the local repository
<localRepository>S:/bel/repo</localRepository>
3) Set profile
4) Set what profile to activate
5) Set proxy (optional?)
6) Run mvn install (if variables are needed, add -D{varname}={varValue}). To skip test add <skipTests>true</skipTests> on pom.xml (inside properties tag). To set a default/permanent variable, set it in MAVEN_OPTS environment variable

How to set MAVEN_OPTS
-> set MAVEN_OPTS=-Xmx512M -XX:MaxPermSize=128M
-> add in mvn.bat
1) edit <MAVEN_HOME>/bin/mvn.bat
2) add SET MAVEN_OPTS=-Dmaven.test.skip=true

Note:
- dependencies -> mvn install copies all libraries first from WEB-INF/lib to the snapshot lib before downloading all dependencies declared in pom into the snapshot lib. so make sure to always clean up WEB-INF/lib first before executing mvn install to remove any conflicting jars

Source: http://maven.apache.org/

Getting started with Weblogic

Download: http://www.oracle.com/technetwork/middleware/weblogic/overview/index.html

Wednesday, January 5, 2011

Object Oriented Javascript

Object Constructor
function Cat(name) {
  this.name = name;
  this.talk = function() {
     alert( this.name + " say meeow!" )
  }
}

Creating Objects
  • using constructor of defined object
    myCat = new Cat("Kuting");
    
  • using new Object()
    person = new Object()
    person.name = "Bel"
    person.run = function() {
      this.state = "running"
      alert( this.name + " is running!" )
    }
  • using literal notation
    person = {
       name : "Bel",
       siblings : ["Ana", "Marie"],
       run : function(){this.state = "running"; alert( this.name + " is running!" )}
    };
Prototyping - attaching a method to an object
Cat.prototype.changeName = function(name) {
   this.name = name;
}

References:
http://www.javascriptkit.com/javatutors/oopjs.shtml

Sunday, January 2, 2011

Javascipt Basics

javascript

Getting started with Ext JS

Ext JS is a client-side, JavaScript framework for building web applications.
  1. Download most current Ext JS release
    - http://www.sencha.com/products/js/download.php
  2. Set the URL of s.gif
    Ext.BLANK_IMAGE_URL = '/images/ext/resources/images/default/s.gif';

Reference:
http://www.sencha.com/learn/Learn_About_the_Ext_JavaScript_Library