Monday, 15 June 2009

Money Class for use in Currency Calculations. Based on Martin Fowler's Value Object

This is my own implementation of the Money value object from Martin Fowler's book Partterns of Enterprise Application Architecture. Enjoy

package com.console.utils.value;

import com.console.core.exceptions.UnknownCurrencyCodeException;
import java.io.Serializable;
import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.text.NumberFormat;
import java.util.Currency;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.junit.Assert;
import static java.math.RoundingMode.HALF_UP;

/**
 *
 * @author farouka
 */
public class Money implements Serializable {

  /**
   * Why me
   */
  private static final int[] cents = new int[]{1, 10, 100, 1000};
  
  private BigDecimal amount;
  
  private Currency currency;

  //private MathContext DEFAULT_CONTEXT = new MathContext( 2, HALF_UP );

  private MathContext DEFAULT_CONTEXT = new MathContext( 10, RoundingMode.HALF_DOWN );

  public Money(long amount, Currency currency) {
    this.currency = currency;
    this.amount = BigDecimal.valueOf(amount, currency.getDefaultFractionDigits()); 
  }

  /**
   * Creates a currency object from the long value provided assuming the long value
   * represents the base currency in the least monetary unit. For eg, new Money(500, "GBP")
   * is assumed to mean 5.00 great british pounds
   * @param amount in base monetary unit
   * @param currCode
   * @throws com.console.core.exceptions.UnknownCurrencyCodeException
   */
  public Money(long amount, String currCode) throws UnknownCurrencyCodeException {
    this( amount, Currency.getInstance(currCode) );
  }
  
  /**
   * Construct an IMMUTABLE money object from a double. It is assumed that 
   * the whole part of the double is the Money with the fractional part representing
   * lowest denominator of the currency. For eg, new Money (50.99, "GBP") is assumed
   * to be 50 pounds and 99 pence.
   * PS. 89.788 will be truncated to 89.78 based on the defaultcurrencydigit of the currency
   * @param amount
   * @param curr
   */
  public Money(double amount, Currency curr) {
    this.currency = curr;
    BigDecimal bd = BigDecimal.valueOf( amount );
    this.amount = bd.setScale(centFactor(), HALF_UP);
  }

  private Money() {
  }

  /**
   * Construct an IMMUTABLE money object from a double. It is assumed that 
   * the whole part of the double is the Money with the fractional part representing
   * lowest denominator of the currency. For eg, new Money (50.99, "GBP") is assumed
   * to be 50 pounds and 99 pence.
   * PS. 89.788 will be truncated to 89.78 based on the defaultcurrencydigit of the currency
   * code supplied
   * @param amount
   * @param currCode iso 4217 currency code
   * @throws com.console.core.exceptions.UnknownCurrencyCodeException
   */
  public Money(double amount, String currCode) throws UnknownCurrencyCodeException {
    this.currency = Currency.getInstance(currCode);
    BigDecimal bd = BigDecimal.valueOf( amount );
    this.amount = bd.setScale( currency.getDefaultFractionDigits(), HALF_UP);
  }
  
  /**
   * Constructs an IMMUTABLE money from a BigDecimal. the BigDecimal provided is only scaled
   * to used the default digits in currency object represented by the sting parameter
   * @param bigDecimal
   * @param currCode ISO 4217 cuurency code
   * @throws com.console.core.exceptions.UnknownCurrencyCodeException
   */
  public Money(BigDecimal bigDecimal, String currCode ) throws UnknownCurrencyCodeException {    
    this.currency = Currency.getInstance(currCode);
    this.amount = bigDecimal.setScale( currency.getDefaultFractionDigits(), HALF_UP);
  }

  /**
   * Constructs an IMMUTABLE money from a BigDecimal. the BigDecimal provided is only scaled
   * to used the default digits in currency object represented by the sting parameter
   * @param multiply
   * @param currency
   */
  public Money(BigDecimal bigDecimal, Currency currency) {
    this.currency = currency;   
    this.amount = bigDecimal.setScale( currency.getDefaultFractionDigits(), HALF_UP);
  }

//  public  boolean assertSameCurrencyAs(Money arg) {
//    return  this.currency.getCurrencyCode().equals(arg.currency.getCurrencyCode());
//  }
//  
  public boolean assertSameCurrencyAs(Money money) throws IncompatibleCurrencyException{
  if ( this.currency == null ) {
   throw new IncompatibleCurrencyException( "currency.invalid" );
  }
  if ( money == null ) {
   throw new IncompatibleCurrencyException( "currency.invalid" );
  }
    Assert.assertEquals("money math mismatch", currency, money.currency);
    return true;
  }

  private int centFactor() {
    return cents[ getCurrency().getDefaultFractionDigits() ];
  }

  public BigDecimal amount() {
    return amount;
  }
  
  public long amountAsLong(){
    return amount.unscaledValue().longValue();
  }

  public Currency getCurrency() {
    return currency;
  }
//    common currencies
  public static Money dollars(double amount) {
    Money result = null;
    try {
      result = new Money(amount, "USD");
    } catch (UnknownCurrencyCodeException ex) {
      Logger.getLogger(Money.class.getName()).log(Level.SEVERE, null, ex);
    }
    return result;
  }
  
  public static Money dollars(long amount) {
    Money result = null;
    try {
      result = new Money(amount, "USD");
    } catch (UnknownCurrencyCodeException ex) {
      Logger.getLogger(Money.class.getName()).log(Level.SEVERE, null, ex);
    }
    return result;
  }

  public static Money pounds(double amount) {
    Money result = null;
    try {
      result = new Money(amount, "GBP");
    } catch (UnknownCurrencyCodeException ex) {
      Logger.getLogger(Money.class.getName()).log(Level.SEVERE, null, ex);
    }
    return result;
  }
  
  public static Money pounds(long amount) {
    Money result = null;
    try {
      result = new Money(amount, "GBP");
    } catch (UnknownCurrencyCodeException ex) {
      Logger.getLogger(Money.class.getName()).log(Level.SEVERE, null, ex);
    }
    return result;
  }
  
  public static Money pounds(BigDecimal amount) {
    Money result = null;
    try {
      result = new Money(amount, "GBP");
    } catch (UnknownCurrencyCodeException ex) {
      Logger.getLogger(Money.class.getName()).log(Level.SEVERE, null, ex);
    }
    return result;
  }


  @Override
  public int hashCode() {
    int hash = (int) ( amount.hashCode() ^ (amount.hashCode() >>> 32) );
    return hash;
  }

  @Override
  public boolean equals(Object other) {
    return (other instanceof Money && equals((Money) other));
  }

  public boolean equals(Money other) {
    return ( currency.equals(other.currency) && (amount.equals(other.amount)) );
  }

  public Money add(Money other) throws Exception{
    assertSameCurrencyAs( other );
    return newMoney(amount.add(other.amount, DEFAULT_CONTEXT));
  }

  private int compareTo(Money money) throws Exception {
    assertSameCurrencyAs( money );
    return amount.compareTo( money.amount ); 
  }

  public Money multiply(BigDecimal amount) {
    return new Money( this.amount().multiply(amount, DEFAULT_CONTEXT), currency);
  }

  public Money multiply( BigDecimal amount, RoundingMode roundingMode ) {
    MathContext ct = new MathContext( currency.getDefaultFractionDigits(), roundingMode );
    return new Money( amount().multiply(amount, ct), currency);
  }

  private Money newMoney(BigDecimal amount) {
    return new Money( amount, this.currency );
  }
  
  public Money multiply(double amount) {
    return multiply( new BigDecimal( amount ) );
  }

  public Money subtract(Money other) throws Exception {
    assertSameCurrencyAs(other);
    return newMoney( amount.subtract(other.amount, DEFAULT_CONTEXT) );
  }
  
  public int compareTo(Object other) throws Exception {
    return compareTo((Money) other);
  }

  public boolean greaterThan(Money other)throws Exception {
    return (compareTo(other) > 0);
  }
  
//  public Money[] allocate(int n){
//    Money lowResult = newMoney( amount.unscaledValue().longValue()/n );
//    Money highResult = newMoney(lowResult.amount + 1);
//    Money[] results = new Money[n];  
//    int remainder = (int) amount % n;
//    
//    for(int i = 0; i < remainder; i++)results[i] = highResult;
//    for(int i = 0; i < n; i++) results[i] = lowResult;
//    
//    return results;
//  }
//  
//  public Money[]allocate(long[] ratios){
//    long total = 0;
//    for (int i = 0; i < ratios.length; i++) {
//      total += ratios[i];
//    }
//    long remainder = amount;
//    Money[] results = new Money[ratios.length];
//    for (int i = 0; i < results.length; i++) {
//      results[i] = newMoney(amount * ratios[i]/total);
//      remainder -= results[i].amount;
//    }
//    for (int i = 0; i < remainder; i++) {
//      results[i].amount++;
//    }
//    return results;
//
//  }
  
  public Money divideByNumber( double divisor){
     BigDecimal div = BigDecimal.valueOf( divisor );
     BigDecimal ans = this.amount.divide(div, DEFAULT_CONTEXT);
     return new Money(ans, this.currency);
  }
  
  public int getQuotient( Money divisor ){
    BigDecimal ans = this.amount.divide(divisor.amount, RoundingMode.DOWN);
    return ans.intValue();
  }
  
  /**
   * divides toe moneys and return the quotient and Remainder this method has been customised,
   * for my money transfer needs...sorry
   * @param divisor
   * @return
   */
  public int[] getQuotientandRemainder(Money divisor){
    int[] ans = new int[2];
    BigDecimal[] bdArr = this.amount.divideAndRemainder(divisor.amount, DEFAULT_CONTEXT);
    BigDecimal quo = bdArr[0];
    BigDecimal rem = bdArr[1];
    ans[0] = quo.intValue();
    if( rem.compareTo(BigDecimal.ZERO) == 0 ){
      ans[1] =0;
    }else{
      ans[1] = 1;
    }
    return ans;
  }
  
 public String toFormattedString() {
  NumberFormat nf = NumberFormat.getCurrencyInstance();
  nf.setCurrency( currency );
  nf.setGroupingUsed( true );
  nf.setMaximumFractionDigits( currency.getDefaultFractionDigits() );
  return nf.format( this.amount.doubleValue() );
 }
  
 /**
  * Returns the ISO-4217 currency code of the currency
  * attached to this money.
  * 
  * @return The ISO-4217 currency code.
  */
 public String getCurrencyCode() {
  return currency.getCurrencyCode();
 }
  
  @Override
  public String toString() {
      return amount.toString();
  }
  
 /**
  * Returns the precision for this money. The precision is the total number
  * of digits that the value can represent. This includes the integer part.
  * So, 18 would be able to represent:
  * 

* 1234567890.12345678
  * 

* 1234567890123456.78
  * 

* 123456789012345678
  * 

* 0.123456789012345678
  * 
  * @return The precision. 
  */ 
 public int precision() {
  return amount.precision();
 }

 /**
  * Returns the 'scale' for this money. The scale is the number of 
  * digits that are moved to the fractional part, assuming that all
  * digits are represented by a single integer value. For example:
  * 

* If: 123456789012345678 has scaling 2, it would be :
  * 

* 1234567890123456.78
  * 
  * @return The scale value. 
  */
 public int scale() {
  return amount.scale();
 }

 /**
  * Returns the sign for the money (negative or positive).
  * -1 if negative, 0 if 0.00 (zero), 1 if positive.
  * 
  * @return The sign of the money. 
  */ 
 public int signum() {
  return amount.signum();
 }
}


And here is the UnknownCurrencyCodeException class
package com.console.lib.utils;

/**
 * An exception which is raised when an unrecognised currency code is passed to the
 * Currency class.
 *
 * @author Farouk Alhassan
 * @see Currency
 */
public class UnknownCurrencyCodeException extends Exception {

    // Reason for exception
    private String reason = null;

    /**
     * Create a new unknown currency code exception.
     *
     * @param reason for the exception
     */
    public UnknownCurrencyCodeException(String reason) {
        this.reason = reason;
    }

    /**
     * Return the reason this exception was raised.
     *
     * @return the reason why the string isn't a valid currency code
     */
    public String getReason() {
        return reason;
    }

    /**
     * Convert the exception to a string
     *
     * @return string version of the exception
     */
    public String toString() {
 return getReason();
    }
}

Sunday, 14 June 2009

Sending Email with Java Mail with attachments Example

Here I am sharing my EmailManager class that handles Email. Hope you find it useful.
package com.console.app.service;

import com.console.app.mtgapi.ApiRequest;
import com.console.app.mtgapi.ApiResponse;
import com.console.core.biz.MtEmailAuthenticator;
import com.sun.mail.smtp.SMTPSSLTransport;
import java.util.Properties;
import javax.ejb.Stateless;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;

/**
 *
 * @author Farouk Alhassan
 */
@Stateless
public class EmailManagerImpl implements EmailManager {
  
  private static String SMTP_HOST_SERVER = "plus.smtp.mail.yahoo.com";
  
  private static String POP3_SERVER = " plus.pop.mail.yahoo.com";
  
  private static String SMTP_PORT = "465";
  
  private static String POP3_PORT = "995";
  
  private static String ACCOUNT_NAME ="MY_ACCOUNT_NAME";
  
  private static String EMAIL_ADDRESS = "MY_ACCOUNT_NAME@yahoo.com";
  
  private static String ACCOUNT_PASSWORD = "MY_PASSWORD";
  
  private static String USE_AUTHENTICATION = "true";
  
  private static String SMTP_USE_SSL = "true";
  
  private static String POP3_USE_SSL = "true";

  public void sendEmail(String to,
          String subject, String messageBody ) throws
          MessagingException, AddressException {

    // Setup mail server
    Properties props = System.getProperties();
    props.put("mail.smtps.host", SMTP_HOST_SERVER);
    props.put("mail.smtps.port", SMTP_PORT);
    props.put("mail.smtps.auth", USE_AUTHENTICATION);
    props.put("mail.smtps.user", ACCOUNT_NAME);

    // Get a mail session
    Session session = Session.getDefaultInstance(props,null);
      //new MtEmailAuthenticator());
    session.setDebug(true);

    // Define a new mail message 
    Message message = new MimeMessage(session);
    message.setFrom(new InternetAddress(EMAIL_ADDRESS));
    message.addRecipient(Message.RecipientType.TO, new InternetAddress(to));
    message.setSubject(subject);

    // Create a message part to represent the body text
    BodyPart messageBodyPart = new MimeBodyPart();
    messageBodyPart.setContent(messageBody,"text/html");

    //use a MimeMultipart as we need to handle the file attachments 
    Multipart multipart = new MimeMultipart();

    //add the message body to the mime message
    multipart.addBodyPart(messageBodyPart);

    // Put all message parts in the message 
    message.setContent(multipart);

    // Send the message
    SMTPSSLTransport tr = (SMTPSSLTransport) session.getTransport("smtps");
    tr.connect(SMTP_HOST_SERVER, ACCOUNT_NAME, ACCOUNT_PASSWORD);
    message.saveChanges();
    tr.sendMessage(message, message.getAllRecipients());
    tr.close();
  }

  protected void addAtachments(String[] attachments, Multipart multipart)
          throws MessagingException, AddressException {
    for (int i = 0; i <= attachments.length - 1; i++) {
      String filename = attachments[i];
      MimeBodyPart attachmentBodyPart = new MimeBodyPart();

      //use a JAF FileDataSource as it does MIME type detection
      DataSource source = new FileDataSource(filename);
      attachmentBodyPart.setDataHandler(new DataHandler(source));

      //assume that the filename you want to send is the same as the
      //actual file name - could alter this to remove the file path
      attachmentBodyPart.setFileName(filename);

      //add the attachment
      multipart.addBodyPart(attachmentBodyPart);
    }
  }
}


Feel free to comment and let me know how I could have done this better

How To Get Top Ranking in Search Engines

The tutorial is all about getting your site listed on top in Search Engines i.e Search Engine Optimization

First thing you need to do is find the keywords you want to optimize for.

There is great tool by Overture (/http://inventory.overture.com/d/sea...ory/suggestion/)

But I would suggest using this free tool called GoodKeywords (/http://www.goodkeywords.com/products/gkw/)

This one does the same job as Overture does but it also supports other Search Engines (Lycos and Teoma etc..)

For example if you want to optimize for the keyword "tech news", just search for the keyword in any of the tools specified above... It would show you keywords related to that and not of the searches..

Pick the keywords which are related to your site.

For example when you search for "Tech News" you'll see the following results:

Count Search Term
11770 tech news
351 itt news tech
191 high tech news
60 news tech texas
49 computer tech news
42 bio news tech
34 in itt news tech
30 news tech virginia
29 asia news tech
25 hi tech news
25 sci tech news

Now see what other terms are related to your keyword technology news

Do couple of searches like that and note down around 15-20 keywords.
Then, keep the keywords which are searched most on the top.

Now you need Title Tag for the page.

Title tag should include top 3 keywords, like for "tech news" it can be like :

"Latest Tech News, Information Technology News and Other computer raleted news here."

Remember that characters should not be more than 95 and should not have more than 3 "," commas - some search engines might cosider more than 3 commas as spam

Now move on to Meta Tags

You need following Meta Tags in web page

<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<META name="keywords" content="keyword1,keyword2,keyword3">
<META name="description" content="brief description about the site">
<META name="robots" Content="Index,Follow">


No need to have other meta tags like abstract, re-visit and all, most people dont read it.

Now...

<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

This tag is tells content type is html and character set used it iso-8859-1 there are other character sets also but this is the one mosty used..

<META name="keywords" content="keyword1,keyword2,keyword3">

This one should have all your keywords inside starting from keyword with most counts...

keyword tag for our example would be something like :

<META name="keywords" content="tech news,technology news, computer technology news,information technology,software news">

Remember to put around 15-20 keywords max not more than that. Dont repeat keywords or dont put keywords like, "tech news", "info tech news", "latest tech news" and so on...

<META name="description" content="brief description about the site">

Provide short decription about your site and include all the keywords mentioned in the title tag.

Decription tag should be:

<META name="description" content="One Stop for Latest Tech News, Information Technology News, Computer Related and Software news.">

It can be upto 255 characters and avoid using more than 3 "," commas

<META name="robots" Content="Index,Follow">

This is used for search robots..following explanation will help you :

index,follow = index the page as well as follow the links
noindex,follow = dont index the page but follow the links
index,nofollow = index the page but dont follow the links
noindex,nofollow = dont index page, dont follow the links
all = same as index,follow
none = same as noindex,nofollow

Now move on to body part of the page

Include all top 3 keywords here,
I would suggest to break the keyword and use it...

For example

YourSiteName.com one stop for all kind of Latest Tech News and Computer Related information and reviews.................

Include main keywords in <h#> tags <h1><h2> etc..
and start with <h1> and then move to <h2> <h3> etc..

<h1> tag will be too big but CSS can help you there, define small font size in css for H1,H2,... tags

When done with page copy, then you need to provide title and alt tags for images and links.

Use some keywords in the tags but dont add all the keywords and if not neccessary then dont use keywords in it, basically it should explain what is image all about.

Remember to add Top keyword atleast 4 times in the body and other 2 keywords thrice and twice respectively.

Now move on to Footer Part
Try to include top keywords here and see the effect, use site keywords as links i.e.

<a href="news.php">Tech News</a> <a href="software-news.php">Software News</a> etc..

Now finally, you need to read some more stuff..may be you can all it as bottom lines...

Site Map - This is page where you need to put all the links present in your site, this is will help Search Engines to find the links easily and also provide link for site map in footer, as search engines start scanning the page from bottom.

Robots.txt - This file contains address of directories which should not be scanned by search engines.. more info can be found here : /http://www.robotstxt.org/wc/exclusion.html search engines line google, yahoo ask for robots.txt file.

Valid HTML - Your code should have valid html and doc type, Its kind of diffucult to follow all the standards but you can atleast open and close all the tags properly, you can check your page's html online here : /http://validator.w3.org/ or you can use this free software called HTML Tidy : /http://tidy.sourceforge.net/

All done now, you just need to check your site with this script, its called SEO Doctor : /http://www.instantposition.com/seo_doctor.cfm

It'll show you the report of your site with solution.

Now, correct the errors and start submitting the site :

Start with google : /http://google.com/addurl.html
then yahoo : /http://submit.search.yahoo.com/free/request
then move to altavista,alltheweb and other search engies..

Also submit your site to direcories like /http://dmoz.org , /http://jayde.com etc...
Dmoz is must, as google, yahoo and may more search engines uses same directory

And remember, dont try to SPAM with keywords in these directories, dmoz is handled by Human Editors

Submitted the sites, but still i cant see you site on top?

Wait for sometime may be a month or so but keep an eye on your search term, use /http://GoogleAlert.com - this will show whenever google updates for your keywords, it will mail you the new results.

And also check whether your site is listed on google..
use this tool called Google Monitor, it can be downloaded for free from : /http://www.cleverstat.com/google-monitor.htm

Change The Default Location For Installing Apps

As the size of hardrives increase, more people are using partitions to seperate and store groups of files.

XP uses the C:\Program Files directory as the default base directory into which new programs are installed. However, you can change the default installation drive and/ or directory by using a Registry hack.

Run the Registry Editor (regedit)and go to

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion

Look for the value named ProgramFilesDir. by default,this value will be C:\Program Files. Edit the value to any valid drive or folder and XP will use that new location as the default installation directory for new programs.

Thursday, 11 June 2009

All About Movie Tags (What Is A Dvdrip, Cam, Screener Etc.)

CAM -
A cam is a theater rip usually done with a digital video camera. A mini tripod is sometimes used, but a lot of the time this wont be possible, so the camera make shake. Also seating placement isn't always idle, and it might be filmed from an angle. If cropped properly, this is hard to tell unless there's text on the screen, but a lot of times these are left with triangular borders on the top and bottom of the screen. Sound is taken from the onboard microphone of the camera, and especially in comedies, laughter can often be heard during the film. Due to these factors picture and sound quality are usually quite poor, but sometimes we're lucky, and the theater will be fairly empty and a fairly clear signal will be heard.


TELESYNC (TS) - A telesync is the same spec as a CAM except it uses an external audio source (most likely an audio jack in the chair for hard of hearing people). A direct audio source does not ensure a good quality audio source, as a lot of background noise can interfere. A lot of the times a telesync is filmed in an empty cinema or from the projection booth with a professional camera, giving a better picture quality. Quality ranges drastically, check the sample before downloading the full release. A high percentage of Telesyncs are CAMs that have been mislabeled.


TELECINE (TC) -
A telecine machine copies the film digitally from the reels. Sound and picture should be very good, but due to the equipment involved and cost telecines are fairly uncommon. Generally the film will be in correct aspect ratio, although 4:3 telecines have existed. A great example is the JURASSIC PARK 3 TC done last year. TC should not be confused with TimeCode , which is a visible counter on screen throughout the film.


SCREENER (SCR) -
A pre VHS tape, sent to rental stores, and various other places for promotional use. A screener is supplied on a VHS tape, and is usually in a 4:3 (full screen) a/r, although letterboxed screeners are sometimes found. The main draw back is a "ticker" (a message that scrolls past at the bottom of the screen, with the copyright and anti-copy telephone number). Also, if the tape contains any serial numbers, or any other markings that could lead to the source of the tape, these will have to be blocked, usually with a black mark over the section. This is sometimes only for a few seconds, but unfortunately on some copies this will last for the entire film, and some can be quite big. Depending on the equipment used, screener quality can range from excellent if done from a MASTER copy, to very poor if done on an old VHS recorder thru poor capture equipment on a copied tape. Most screeners are transferred to VCD, but a few attempts at SVCD have occurred, some looking better than others.


DVD-SCREENER (DVDscr) -Same premise as a screener, but transferred off a DVD. Usually letterbox , but without the extras that a DVD retail would contain. The ticker is not usually in the black bars, and will disrupt the viewing. If the ripper has any skill, a DVDscr should be very good. Usually transferred to SVCD or DivX/XviD.


DVDRip - A copy of the final released DVD. If possible this is released PRE retail (for example, Star Wars episode 2) again, should be excellent quality. DVDrips are released in SVCD and DivX/XviD.


VHSRip -Transferred off a retail VHS, mainly skating/sports videos and XXX releases.


TVRip -TV episode that is either from Network (capped using digital cable/satellite boxes are preferable) or PRE-AIR from satellite feeds sending the program around to networks a few days earlier (do not contain "dogs" but sometimes have flickers etc) Some programs such as WWF Raw Is War contain extra parts, and the "dark matches" and camera/commentary tests are included on the rips. PDTV is capped from a digital TV PCI card, generally giving the best results, and groups tend to release in SVCD for these. VCD/SVCD/DivX/XviD rips are all supported by the TV scene.


WORKPRINT (WP) -A workprint is a copy of the film that has not been finished. It can be missing scenes, music, and quality can range from excellent to very poor. Some WPs are very different from the final print (Men In Black is missing all the aliens, and has actors in their places) and others can contain extra scenes (Jay and Silent Bob) . WPs can be nice additions to the collection once a good quality final has been obtained.



DivX Re-Enc -A DivX re-enc is a film that has been taken from its original VCD source, and re-encoded into a small DivX file. Most commonly found on file sharers, these are usually labeled something like Film.Name.Group(1of2) etc. Common groups are SMR and TND. These aren't really worth downloading, unless you're that unsure about a film u only want a 200mb copy of it. Generally avoid.


Watermarks -
A lot of films come from Asian Silvers/PDVD (see below) and these are tagged by the people responsible. Usually with a letter/initials or a little logo, generally in one of the corners. Most famous are the "Z" "A" and "Globe" watermarks.



Asian Silvers / PDVD -
These are films put out by eastern bootleggers, and these are usually bought by some groups to put out as their own. Silvers are very cheap and easily available in a lot of countries, and its easy to put out a release, which is why there are so many in the scene at the moment, mainly from smaller groups who don't last more than a few releases. PDVDs are the same thing pressed onto a DVD. They have removable subtitles, and the quality is usually better than the silvers. These are ripped like a normal DVD, but usually released as VCD.


Formats

VCD -
VCD is an mpeg1 based format, with a constant bitrate of 1150kbit at a resolution of 352x240 (NTCS). VCDs are generally used for lower quality transfers (CAM/TS/TC/Screener(VHS)/TVrip(analogue) in order to make smaller file sizes, and fit as much on a single disc as possible. Both VCDs and SVCDs are timed in minutes, rather than MB, so when looking at an mpeg, it may appear larger than the disc capacity, and in reality u can fit 74min on a CDR74.


SVCD -
SVCD is an mpeg2 based (same as DVD) which allows variable bit-rates of up to 2500kbits at a resolution of 480x480 (NTSC) which is then decompressed into a 4:3 aspect ratio when played back. Due to the variable bit-rate, the length you can fit on a single CDR is not fixed, but generally between 35-60 Mins are the most common. To get a better SVCD encode using variable bit-rates, it is important to use multiple "passes". this takes a lot longer, but the results are far clearer.



XVCD/XSVCD -
These are basically VCD/SVCD that don't obey the "rules". They are both capable of much higher resolutions and bit-rates, but it all depends on the player to whether the disc can be played. X(S)VCD are total non-standards, and are usually for home-ripping by people who don't intend to release them.


KVCD Thanks for lardo4life for the info
KVCD is a modification to the standard MPEG-1 and MPEG-2 GOP structure and Quantization Matrix. It enables you to create over 120 minutes of near DVD quality video, depending on your material, on a single 80 minute CD-R/CD-RW. We have published these specifications as KVCDx3, our official resolution, which produce 528x480 (NTSC) and 528x576 (PAL) MPEG-1 variable bit rate video, from 64Kbps to 3,000Kbps. Using a resolution of 352x240 (NTSC) or 352x288 (PAL), it's possible to encode video up to ~360 minutes of near VCD quality on a single 80 minute CD-R. The mpeg files created will play back in most modern standalone DVD players. You must burn the KVCD MPEG files as non-standard VCD or non-standard SVCD (depends on your player) with Nero or VCDEasy.



DivX / XviD -
DivX is a format designed for multimedia platforms. It uses two codecs, one low motion, one high motion. most older films were encoded in low motion only, and they have problems with high motion too. A method known as SBC (Smart Bit-rate Control) was developed which switches codecs at the encoding stage, making a much better print. The format is Ana orphic and the bit-rate/resolution are interchangeable. Due to the higher processing power required, and the different codecs for playback, its unlikely we'll see a DVD player capable of play DivX for quite a while, if at all. There have been players in development which are supposedly capable, but nothing has ever arisen. The majority of PROPER DivX rips (not Re-Encs) are taken from DVDs, and generally up to 2hours in good quality is possible per disc. Various codecs exist, most popular being the original Divx3.11a and the new XviD codecs.


CVD -
CVD is a combination of VCD and SVCD formats, and is generally supported by a majority of DVD players. It supports MPEG2 bit-rates of SVCD, but uses a resolution of 352x480(ntsc) as the horizontal resolution is generally less important. Currently no groups release in CVD.


DVD-R -
Is the recordable DVD solution that seems to be the most popular (out of DVD-RAM, DVD-R and DVD+R). it holds 4.7gb of data per side, and double sided discs are available, so discs can hold nearly 10gb in some circumstances. SVCD mpeg2 images must be converted before they can be burnt to DVD-R and played successfully. DVD>DVDR copies are possible, but sometimes extras/languages have to be removed to stick within the available 4.7gb.



MiniDVD -
MiniDVD/cDVD is the same format as DVD but on a standard CDR/CDRW. Because of the high resolution/bit-rates, its only possible to fit about 18-21 mins of footage per disc, and the format is only compatible with a few players.


Misc Info

Regional Coding -
This was designed to stop people buying American DVDs and watching them earlier in other countries, or for older films where world distribution is handled by different companies. A lot of players can either be hacked with a chip, or via a remote to disable this.


RCE -
RCE (Regional Coding Enhancement) was designed to overcome "Multiregion" players, but it had a lot of faults and was overcome. Very few titles are RCE encoded now, and it was very unpopular.



Macrovision -
Macrovision is the copy protection employed on most commercial DVDs. Its a system that will display lines and darken the images of copies that are made by sending the VHS signals it can't understand. Certain DVD players (for example the Dansai 852 from Tescos) have a secret menu where you can disable the macrovision, or a "video stabaliser" costs about 30UKP from Maplin (www.maplin.co.uk)


NTSC/PAL -
NTSC and PAL are the two main standards used across the world. NTSC has a higher frame rate than pal (29fps compared to 25fps) but PAL has an increased resolution, and gives off a generally sharper picture. Playing NTSC discs on PAL systems seems a lot easier than vice-versa, which is good news for the Brits An RGB enabled scart lead will play an NTSC picture in full colour on most modern tv sets, but to record this to a VHS tape, you will need to convert it to PAL50 (not PAL60 as the majority of DVD players do.) This is either achieved by an expensive converter box (in the regions of £200+) an onboard converter (such as the Dansai 852 / certain Daewoos / Samsung 709 ) or using a World Standards VCR which can record in any format.


About Release Files

RARset -
The movies are all supplied in RAR form, whether its v2 (rar>.rxx) or v3 (part01.rar > partxx.rar) form.



BIN/CUE -
VCD and SVCD films will extract to give a BIN/CUE. Load the .CUE into notepad and make sure the first line contains only a filename, and no path information. Then load the cue into Nero/CDRWin etc and this will burn the VCD/SVCD correctly. TV rips are released as MPEG. DivX files are just the plain DivX - .AVI



NFO -
An NFO file is supplied with each movie to promote the group, and give general iNFOrmation about the release, such as format, source, size, and any notes that may be of use. They are also used to recruit members and acquire hardware for the group.

SFV -
Also supplied for each disc is an SFV file. These are mainly used on site level to check each file has been uploaded correctly, but are also handy for people downloading to check they have all the files, and the CRC is correct. A program such as pdSFV or hkSFV is required to use these files.


Usenet Information

Access -
To get onto newsgroups, you will need a news server. Most ISPs supply one, but this is usually of poor retention (the amount of time the files are on server for) and poor completition (the amount of files that make it there). For the best service, a premium news server should be paid for, and these will often have bandwidth restrictions in place.



Software -
You will need a newsreader to access the files in the binary newsgroups. There are many different readers, and its usually down to personal opinion which is best. Xnews / Forte Agent / BNR 1 / BNR 2 are amongst the popular choices. Outlook has the ability to read newsgroups, but its recommended to not use that.


Format -
Usenet posts are often the same as those listed on VCDQUALiTY (i.e., untouched group releases) but you have to check the filenames and the description to make sure you get what you think you are getting. Generally releases should come down in .RAR sets. Posts will usually take more than one day to be uploaded, and can be spread out as far as a week.



PAR files -
As well as the .rxx files, you will also see files listed as .pxx/.par . These are PARITY files. Parity files are common in usenet posts, as a lot of times, there will be at least one or two damaged files on some servers. A parity file can be used to replace ANY ONE file that is missing from the rar set. The more PAR files you have, the more files you can replace. You will need a program called SMARTPAR for this.


Scene Tags

PROPER -
Due to scene rules, whoever releases the first Telesync has won that race (for example). But if the quality of that release is fairly poor, if another group has another telesync (or the same source in higher quality) then the tag PROPER is added to the folder to avoid being duped. PROPER is the most subjective tag in the scene, and a lot of people will generally argue whether the PROPER is better than the original release. A lot of groups release PROPERS just out of desperation due to losing the race. A reason for the PROPER should always be included in the NFO.


SUBBED -
In the case of a VCD, if a release is subbed, it usually means it has hard encoded subtitles burnt throughout the movie. These are generally in malaysian/chinese/thai etc, and sometimes there are two different languages, which can take up quite a large amount of the screen. SVCD supports switch able subtitles, so some DVDRips are released with switch able subs. This will be mentioned in the NFO file if included.



UNSUBBED -
When a film has had a subbed release in the past, an Unsubbed release may be released

LIMITED -
A limited movie means it has had a limited theater run, generally opening in less than 250 theaters, generally smaller films (such as art house films) are released as limited.


INTERNAL -
An internal release is done for several reasons. Classic DVD groups do a lot of .INTERNAL. releases, as they wont be dupe'd on it. Also lower quality theater rips are done INTERNAL so not to lower the reputation of the group, or due to the amount of rips done already. An INTERNAL release is available as normal on the groups affiliate sites, but they can't be traded to other sites without request from the site ops. Some INTERNAL releases still trickle down to IRC/Newsgroups, it usually depends on the title and the popularity. Earlier in the year people referred to Centropy going "internal". This meant the group were only releasing the movies to their members and site ops. This is in a different context to the usual definition.



STV -
Straight To Video. Was never released in theaters, and therefore a lot of sites do not allow these.


OTHER TAGS -

*WS* for widescreen (letterbox)
*FS* for Fullscreen.



RECODE -
A recode is a previously released version, usually filtered through TMPGenc to remove subtitles, fix color etc. Whilst they can look better, its not looked upon highly as groups are expected to obtain their own sources.


REPACK -
If a group releases a bad rip, they will release a Repack which will fix the problems.


NUKED -
A film can be nuked for various reasons. Individual sites will nuke for breaking their rules (such as "No Telesyncs") but if the film has something extremely wrong with it (no soundtrack for 20mins, CD2 is incorrect film/game etc) then a global nuke will occur, and people trading it across sites will lose their credits. Nuked films can still reach other sources such as p2p/usenet, but its a good idea to check why it was nuked first in case. If a group realise there is something wrong, they can request a nuke.

NUKE REASONS :: this is a list of common reasons a film can be nuked for (generally DVDRip)

** BAD A/R ** :: bad aspect ratio, ie people appear too fat/thin
** BAD IVTC ** :: bad inverse telecine. process of converting framerates was incorrect.
** INTERLACED ** :: black lines on movement as the field order is incorrect.

DUPE -
Dupe is quite simply, if something exists already, then theres no reason for it to exist again without proper reason.

AribaWeb MetaUI Explained - Part 1

AribaWeb is a full stack Java Ajax framework for developing applications, mostly on the web. It comes with so many features and tools so the issues you would have to deal with in your day to day web development is already sorted out.
Among its many features it the ability to generate your UI from metadata defined in stylesheet like OSS files and also from annotations defined on your classes.
This is very beautiful because you can generate different UI based on the device or the context in use. One very practical application is for web applications that will have to run on mobile devices - and this is the area I want to explore most once I have full grasp on AribaWeb.

Read More

Monday, 8 June 2009

How Linux boots

As it turns out, there isn't much to the boot process:

   1. A boot loader finds the kernel image on the disk, loads it into memory, and starts it.
   2. The kernel initializes the devices and its drivers.
   3. The kernel mounts the root filesystem.
   4. The kernel starts a program called init.
   5. init sets the rest of the processes in motion.
   6. The last processes that init starts as part of the boot sequence allow you to log in.

Identifying each stage of the boot process is invaluable in fixing boot problems and understanding the system as a whole. To start, zero in on the boot loader, which is the initial screen or prompt you get after the computer does its power-on self-test, asking which operating system to run. After you make a choice, the boot loader runs the Linux kernel, handing control of the system to the kernel.

There is a detailed discussion of the kernel elsewhere in this book from which this article is excerpted. This article covers the kernel initialization stage, the stage when the kernel prints a bunch of messages about the hardware present on the system. The kernel starts init just after it displays a message proclaiming that the kernel has mounted the root filesystem:

VFS: Mounted root (ext2 filesystem) readonly.

Soon after, you will see a message about init starting, followed by system service startup messages, and finally you get a login prompt of some sort.

NOTE On Red Hat Linux, the init note is especially obvious, because it "welcomes" you to "Red Hat Linux." All messages thereafter show success or failure in brackets at the right-hand side of the screen.

Most of this chapter deals with init, because it is the part of the boot sequence where you have the most control.
init

There is nothing special about init. It is a program just like any other on the Linux system, and you'll find it in /sbin along with other system binaries. The main purpose of init is to start and stop other programs in a particular sequence. All you have to know is how this sequence works.

There are a few different variations, but most Linux distributions use the System V style discussed here. Some distributions use a simpler version that resembles the BSD init, but you are unlikely to encounter this.

Runlevels

At any given time on a Linux system, a certain base set of processes is running. This state of the machine is called its runlevel, and it is denoted with a number from 0 through 6. The system spends most of its time in a single runlevel. However, when you shut the machine down, init switches to a different runlevel in order to terminate the system services in an orderly fashion and to tell the kernel to stop. Yet another runlevel is for single-user mode, discussed later.

The easiest way to get a handle on runlevels is to examine the init configuration file, /etc/inittab. Look for a line like the following:

id:5:initdefault:

This line means that the default runlevel on the system is 5. All lines in the inittab file take this form, with four fields separated by colons occurring in the following order:
# A unique identifier (a short string, such as id in the preceding example)
# The applicable runlevel number(s)
# The action that init should take (in the preceding example, the action is to set the default runlevel to 5)
# A command to execute (optional)

There is no command to execute in the preceding initdefault example because a command doesn't make sense in the context of setting the default runlevel. Look a little further down in inittab, until you see a line like this:

l5:5:wait:/etc/rc.d/rc 5

This line triggers most of the system configuration and services through the rc*.d and init.d directories. You can see that init is set to execute a command called /etc/rc.d/rc 5 when in runlevel 5. The wait action tells when and how init runs the command: run rc 5 once when entering runlevel 5, and then wait for this command to finish before doing anything else.

There are several different actions in addition to initdefault and wait, especially pertaining to power management, and the inittab(5) manual page tells you all about them. The ones that you're most likely to encounter are explained in the following sections.

respawn

The respawn action causes init to run the command that follows, and if the command finishes executing, to run it again. You're likely to see something similar to this line in your inittab file:

1:2345:respawn:/sbin/mingetty tty1

The getty programs provide login prompts. The preceding line is for the first virtual console (/dev/tty1), the one you see when you press ALT-F1 or CONTROL-ALT-F1. The respawn action brings the login prompt back after you log out.

ctrlaltdel

The ctrlaltdel action controls what the system does when you press CONTROL-ALT-DELETE on a virtual console. On most systems, this is some sort of reboot command using the shutdown command.

sysinit

The sysinit action is the very first thing that init should run when it starts up, before entering any runlevels.

How processes in runlevels start

You are now ready to learn how init starts the system services, just before it lets you log in. Recall this inittab line from earlier:

l5:5:wait:/etc/rc.d/rc 5

This small line triggers many other programs. rc stands for run commands, and you will hear people refer to the commands as scripts, programs, or services. So, where are these commands, anyway?

For runlevel 5, in this example, the commands are probably either in /etc/rc.d/rc5.d or /etc/rc5.d. Runlevel 1 uses rc1.d, runlevel 2 uses rc2.d, and so on. You might find the following items in the rc5.d directory:

S10sysklogd       S20ppp          S99gpm
S12kerneld        S25netstd_nfs   S99httpd
S15netstd_init    S30netstd_misc  S99rmnologin
S18netbase        S45pcmcia       S99sshd
S20acct           S89atd
S20logoutd        S89cron

The rc 5 command starts programs in this runlevel directory by running the following commands:

S10sysklogd start
S12kerneld start
S15netstd_init start
S18netbase start
...
S99sshd start

Notice the start argument in each command. The S in a command name means that the command should run in start mode, and the number (00 through 99) determines where in the sequence rc starts the command.

The rc*.d commands are usually shell scripts that start programs in /sbin or /usr/sbin. Normally, you can figure out what one of the commands actually does by looking at the script with less or another pager program.

You can start one of these services by hand. For example, if you want to start the httpd Web server program manually, run S99httpd start. Similarly, if you ever need to kill one of the services when the machine is on, you can run the command in the rc*.d directory with the stop argument (S99httpd stop, for instance).

Some rc*.d directories contain commands that start with K (for "kill," or stop mode). In this case, rc runs the command with the stop argument instead of start. You are most likely to encounter K commands in runlevels that shut the system down.

Adding and removing services

If you want to add, delete, or modify services in the rc*.d directories, you need to take a closer look at the files inside. A long listing reveals a structure like this:

lrwxrwxrwx . . . S10sysklogd -> ../init.d/sysklogd
lrwxrwxrwx . . . S12kerneld -> ../init.d/kerneld
lrwxrwxrwx . . . S15netstd_init -> ../init.d/netstd_init
lrwxrwxrwx . . . S18netbase -> ../init.d/netbase
...

The commands in an rc*.d directory are actually symbolic links to files in an init.d directory, usually in /etc or /etc/rc.d. Linux distributions contain these links so that they can use the same startup scripts for all runlevels. This convention is by no means a requirement, but it often makes organization a little easier.

To prevent one of the commands in the init.d directory from running in a particular runlevel, you might think of removing the symbolic link in the appropriate rc*.d directory. This does work, but if you make a mistake and ever need to put the link back in place, you might have trouble remembering the exact name of the link. Therefore, you shouldn't remove links in the rc*.d directories, but rather, add an underscore (_) to the beginning of the link name like this:

mv S99httpd _S99httpd

At boot time, rc ignores _S99httpd because it doesn't start with S or K. Furthermore, the original name is still obvious, and you have quick access to the command if you're in a pinch and need to start it by hand.

To add a service, you must create a script like the others in the init.d directory and then make a symbolic link in the correct rc*.d directory. The easiest way to write a script is to examine the scripts already in init.d, make a copy of one that you understand, and modify the copy.

When adding a service, make sure that you choose an appropriate place in the boot sequence to start the service. If the service starts too soon, it may not work, due to a dependency on some other service. For non-essential services, most systems administrators prefer numbers in the 90s, after most of the services that came with the system.

Linux distributions usually come with a command to enable and disable services in the rc*.d directories. For example, in Debian, the command is update-rc.d, and in Red Hat Linux, the command is chkconfig. Graphical user interfaces are also available. Using these programs helps keep the startup directories consistent and helps with upgrades.

HINT: One of the most common Linux installation problems is an improperly configured XFree86 server that flicks on and off, making the system unusable on console. To stop this behavior, boot into single-user mode and alter your runlevel or runlevel services. Look for something containing xdm, gdm, or kdm in your rc*.d directories, or your /etc/inittab.

Controlling init

Occasionally, you need to give init a little kick to tell it to switch runlevels, to re-read the inittab file, or just to shut down the system. Because init is always the first process on a system, its process ID is always 1.

You can control init with telinit. For example, if you want to switch to runlevel 3, use this command:

telinit 3

When switching runlevels, init tries to kill off any processes that aren't in the inittab file for the new runlevel. Therefore, you should be careful about changing runlevels.

When you need to add or remove respawning jobs or make any other change to the inittab file, you must tell init about the change and cause it to re-read the file. Some people use kill -HUP 1 to tell init to do this. This traditional method works on most versions of Unix, as long as you type it correctly. However, you can also run this telinit command:

telinit q

You can also use telinit s to switch to single-user mode.

Shutting down

init also controls how the system shuts down and reboots. The proper way to shut down a Linux machine is to use the shutdown command.

There are two basic ways to use shutdown. If you halt the system, it shuts the machine down and keeps it down. To make the machine halt immediately, use this command:

shutdown -h now

On most modern machines with reasonably recent versions of Linux, a halt cuts the power to the machine. You can also reboot the machine. For a reboot, use -r instead of -h.

The shutdown process takes several seconds. You should never reset or power off a machine during this stage.

In the preceding example, now is the time to shut down. This argument is mandatory, but there are many ways of specifying it. If you want the machine to go down sometime in the future, one way is to use +n, where n is the number of minutes shutdown should wait before doing its work. For other options, look at the shutdown(8) manual page.

To make the system reboot in 10 minutes, run this command:

shutdown -r +10

On Linux, shutdown notifies anyone logged on that the machine is going down, but it does little real work. If you specify a time other than now, shutdown creates a file called /etc/nologin. When this file is present, the system prohibits logins by anyone except the superuser.

When system shutdown time finally arrives, shutdown tells init to switch to runlevel 0 for a halt and runlevel 6 for a reboot. When init enters runlevel 0 or 6, all of the following takes place, which you can verify by looking at the scripts inside rc0.d and rc6.d:

   1. init kills every process that it can (as it would when switching to any other runlevel).

# The initial rc0.d/rc6.d commands run, locking system files into place and making other preparations for shutdown.
# The next rc0.d/rc6.d commands unmount all filesystems other than the root.
# Further rc0.d/rc6.d commands remount the root filesystem read-only.
# Still more rc0.d/rc6.d commands write all buffered data out to the filesystem with the sync program.
# The final rc0.d/rc6.d commands tell the kernel to reboot or stop with the reboot, halt, or poweroff program.

The reboot and halt programs behave differently for each runlevel, potentially causing confusion. By default, these programs call shutdown with the -r or -h options, but if the system is already at the halt or reboot runlevel, the programs tell the kernel to shut itself off immediately. If you really want to shut your machine down in a hurry (disregarding any possible damage from a disorderly shutdown), use the -f option.

Computer Acronyms

ADSL - Asymmetric Digital Subscriber Line
AGP - Accelerated Graphics Port
ALI - Acer Labs, Incorporated
ALU - Arithmetic Logic Unit
AMD - Advanced Micro Devices
APC - American Power Conversion
ASCII - American Standard Code for Information Interchange
ASIC - Application Specific Integrated Circuit
ASPI - Advanced SCSI Programming Interface
AT - Advanced Technology
ATI - ATI Technologies Inc.
ATX - Advanced Technology Extended

--- B ---
BFG - BFG Technologies
BIOS - Basic Input Output System
BNC - Barrel Nut Connector

--- C ---
CAS - Column Address Signal
CD - Compact Disk
CDR - Compact Disk Recorder
CDRW - Compact Disk Re-Writer
CD-ROM - Compact Disk - Read Only Memory
CFM - Cubic Feet per Minute (ft�/min)
CMOS - Complementary Metal Oxide Semiconductor
CPU - Central Processing Unit
CTX - CTX Technology Corporation (Commited to Excellence)

--- D ---

DDR - Double Data Rate
DDR-SDRAM - Double Data Rate - Synchronous Dynamic Random Access Memory
DFI - DFI Inc. (Design for Innovation)
DIMM - Dual Inline Memory Module
DRAM - Dynamic Random Access Memory
DPI - Dots Per Inch
DSL - See ASDL
DVD - Digital Versatile Disc
DVD-RAM - Digital Versatile Disk - Random Access Memory

--- E ---
ECC - Error Correction Code
ECS - Elitegroup Computer Systems
EDO - Extended Data Out
EEPROM - Electrically Erasable Programmable Read-Only Memory
EPROM - Erasable Programmable Read-Only Memory
EVGA - EVGA Corporation

--- F ---
FC-PGA - Flip Chip Pin Grid Array
FDC - Floppy Disk Controller
FDD - Floppy Disk Drive
FPS - Frame Per Second
FPU - Floating Point Unit
FSAA - Full Screen Anti-Aliasing
FS - For Sale
FSB - Front Side Bus

--- G ---
GB - Gigabytes
GBps - Gigabytes per second or Gigabits per second
GDI - Graphical Device Interface
GHz - GigaHertz

--- H ---
HDD - Hard Disk Drive
HIS - Hightech Information System Limited
HP - Hewlett-Packard Development Company
HSF - Heatsink-Fan

--- I ---
IBM - International Business Machines Corporation
IC - Integrated Circuit
IDE - Integrated Drive Electronics
IFS- Item for Sale
IRQ - Interrupt Request
ISA - Industry Standard Architecture
ISO - International Standards Organization

--- J ---
JBL - JBL (Jame B. Lansing) Speakers
JVC - JVC Company of America

- K ---
Kbps - Kilobits Per Second
KBps - KiloBytes per second

--- L ---
LG - LG Electronics
LAN - Local Are Network
LCD - Liquid Crystal Display
LDT - Lightning Data Transport
LED - Light Emitting Diode

--- M ---
MAC - Media Access Control
MB � MotherBoard or Megabyte
MBps - Megabytes Per Second
Mbps - Megabits Per Second or Megabits Per Second
MHz - MegaHertz
MIPS - Million Instructions Per Second
MMX - Multi-Media Extensions
MSI - Micro Star International

--- N ---
NAS - Network Attached Storage
NAT - Network Address Translation
NEC - NEC Corporation
NIC - Network Interface Card

--- O ---
OC - Overclock (Over Clock)
OCZ - OCZ Technology
OEM - Original Equipment Manufacturer

--- P ---
PC - Personal Computer
PCB - Printed Circuit Board
PCI - Peripheral Component Interconnect
PDA - Personal Digital Assistant
PCMCIA - Peripheral Component Microchannel Interconnect Architecture
PGA - Professional Graphics Array
PLD - Programmable Logic Device
PM - Private Message / Private Messaging
PnP - Plug 'n Play
PNY - PNY Technology
POST - Power On Self Test
PPPoA - Point-to-Point Protocol over ATM
PPPoE - Point-to-Point Protocol over Ethernet
PQI - PQI Corporation
PSU - Power Supply Unit

--- R ---
RAID - Redundant Array of Inexpensive Disks
RAM - Random Access Memory
RAMDAC - Random Access Memory Digital Analog Convertor
RDRAM - Rambus Dynamic Random Access Memory
ROM - Read Only Memory
RPM - Revolutions Per Minute

--- S ---
SASID - Self-scanned Amorphous Silicon Integrated Display
SCA - SCSI Configured Automatically
SCSI - Small Computer System Interface
SDRAM - Synchronous Dynamic Random Access Memory
SECC - Single Edge Contact Connector
SODIMM - Small Outline Dual Inline Memory Module
SPARC - Scalable Processor ArChitecture
SOHO - Small Office Home Office
SRAM - Static Random Access Memory
SSE - Streaming SIMD Extensions
SVGA - Super Video Graphics Array
S/PDIF - Sony/Philips Digital Interface

--- T ---
TB - Terabytes
TBps - Terabytes per second
Tbps - Terabits per second
TDK - TDK Electronics
TEC - Thermoelectric Cooler
TPC - TipidPC
TWAIN - Technology Without An Important Name

--- U ---
UART - Universal Asynchronous Receiver/Transmitter
USB - Universal Serial Bus
UTP - Unshieled Twisted Pair

--- V ---
VCD - Video CD
VPN - Virtual Private Network

--- W ---
WAN - Wide Area Network
WTB - Want to Buy
WYSIWYG - What You See Is What You Get

--- X ---
XGA - Extended Graphics Array
XFX - XFX Graphics, a Division of Pine
XMS - Extended Memory Specification
XT - Extended Technology

Best Keyboard Shortcuts

Getting used to using your keyboard exclusively and leaving your mouse behind will make you much more efficient at performing any task on any Windows system. I use the following keyboard shortcuts every day:

Windows key + R = Run menu

This is usually followed by:
cmd = Command Prompt
iexplore + "web address" = Internet Explorer
compmgmt.msc = Computer Management
dhcpmgmt.msc = DHCP Management
dnsmgmt.msc = DNS Management
services.msc = Services
eventvwr = Event Viewer
dsa.msc = Active Directory Users and Computers
dssite.msc = Active Directory Sites and Services
Windows key + E = Explorer

ALT + Tab = Switch between windows

ALT, Space, X = Maximize window

CTRL + Shift + Esc = Task Manager

Windows key + Break = System properties

Windows key + F = Search

Windows key + D = Hide/Display all windows

CTRL + C = copy

CTRL + X = cut

CTRL + V = paste

Also don't forget about the "Right-click" key next to the right Windows key on your keyboard. Using the arrows and that key can get just about anything done once you've opened up any program.


Keyboard Shortcuts

[Alt] and [Esc] Switch between running applications

[Alt] and letter Select menu item by underlined letter

[Ctrl] and [Esc] Open Program Menu

[Ctrl] and [F4] Close active document or group windows (does not work with some applications)

[Alt] and [F4] Quit active application or close current window

[Alt] and [-] Open Control menu for active document

Ctrl] Lft., Rt. arrow Move cursor forward or back one word

Ctrl] Up, Down arrow Move cursor forward or back one paragraph

[F1] Open Help for active application

Windows+M Minimize all open windows

Shift+Windows+M Undo minimize all open windows

Windows+F1 Open Windows Help

Windows+Tab Cycle through the Taskbar buttons

Windows+Break Open the System Properties dialog box


Acessability shortcuts

Right SHIFT for eight seconds........ Switch FilterKeys on and off.

Left ALT +left SHIFT +PRINT SCREEN....... Switch High Contrast on and off.

Left ALT +left SHIFT +NUM LOCK....... Switch MouseKeys on and off.

SHIFT....... five times Switch StickyKeys on and off.

NUM LOCK...... for five seconds Switch ToggleKeys on and off.

Explorer shortcuts

END....... Display the bottom of the active window.

HOME....... Display the top of the active window.

NUM LOCK+ASTERISK....... on numeric keypad (*) Display all subfolders under the selected folder.

NUM LOCK+PLUS SIGN....... on numeric keypad (+) Display the contents of the selected folder.

NUM LOCK+MINUS SIGN....... on numeric keypad (-) Collapse the selected folder.

LEFT ARROW...... Collapse current selection if it's expanded, or select parent folder.

RIGHT ARROW....... Display current selection if it's collapsed, or select first subfolder.


Type the following commands in your Run Box (Windows Key + R) or Start Run

devmgmt.msc = Device Manager
msinfo32 = System Information
cleanmgr = Disk Cleanup
ntbackup = Backup or Restore Wizard (Windows Backup Utility)
mmc = Microsoft Management Console
excel = Microsoft Excel (If Installed)
msaccess = Microsoft Access (If Installed)
powerpnt = Microsoft PowerPoint (If Installed)
winword = Microsoft Word (If Installed)
frontpg = Microsoft FrontPage (If Installed)
notepad = Notepad
wordpad = WordPad
calc = Calculator
msmsgs = Windows Messenger
mspaint = Microsoft Paint
wmplayer = Windows Media Player
rstrui = System Restore
netscp6 = Netscape 6.x
netscp = Netscape 7.x
netscape = Netscape 4.x
waol = America Online
control = Opens the Control Panel
control printers = Opens the Printers Dialog

For Windows XP:

Copy. CTRL+C
Cut. CTRL+X
Paste. CTRL+V
Undo. CTRL+Z
Delete. DELETE
Delete selected item permanently without placing the item in the Recycle Bin. SHIFT+DELETE
Copy selected item. CTRL while dragging an item
Create shortcut to selected item. CTRL+SHIFT while dragging an item
Rename selected item. F2
Move the insertion point to the beginning of the next word. CTRL+RIGHT ARROW
Move the insertion point to the beginning of the previous word. CTRL+LEFT ARROW
Move the insertion point to the beginning of the next paragraph. CTRL+DOWN ARROW
Move the insertion point to the beginning of the previous paragraph. CTRL+UP ARROW
Highlight a block of text. CTRL+SHIFT with any of the arrow keys
Select more than one item in a window or on the desktop, or select text within a document. SHIFT with any of the arrow keys
Select all. CTRL+A
Search for a file or folder. F3
View properties for the selected item. ALT+ENTER
Close the active item, or quit the active program. ALT+F4
Opens the shortcut menu for the active window. ALT+SPACEBAR
Close the active document in programs that allow you to have multiple documents open simultaneously. CTRL+F4
Switch between open items. ALT+TAB
Cycle through items in the order they were opened. ALT+ESC
Cycle through screen elements in a window or on the desktop. F6
Display the Address bar list in My Computer or Windows Explorer. F4
Display the shortcut menu for the selected item. SHIFT+F10
Display the System menu for the active window. ALT+SPACEBAR
Display the Start menu. CTRL+ESC
Display the corresponding menu. ALT+Underlined letter in a menu name
Carry out the corresponding command. Underlined letter in a command name on an open menu
Activate the menu bar in the active program. F10
Open the next menu to the right, or open a submenu. RIGHT ARROW
Open the next menu to the left, or close a submenu. LEFT ARROW
Refresh the active window. F5
View the folder one level up in My Computer or Windows Explorer. BACKSPACE
Cancel the current task. ESC
SHIFT when you insert a CD into the CD-ROM drive Prevent the CD from automatically playing.

Use these keyboard shortcuts for dialog boxes:

To Press
Move forward through tabs. CTRL+TAB
Move backward through tabs. CTRL+SHIFT+TAB
Move forward through options. TAB
Move backward through options. SHIFT+TAB
Carry out the corresponding command or select the corresponding option. ALT+Underlined letter
Carry out the command for the active option or button. ENTER
Select or clear the check box if the active option is a check box. SPACEBAR
Select a button if the active option is a group of option buttons. Arrow keys
Display Help. F1
Display the items in the active list. F4
Open a folder one level up if a folder is selected in the Save As or Open dialog box. BACKSPACE

If you have a Microsoft Natural Keyboard, or any other compatible keyboard that includes the Windows logo key and the Application key , you can use these keyboard shortcuts:


Display or hide the Start menu. WIN Key
Display the System Properties dialog box. WIN Key+BREAK
Show the desktop. WIN Key+D
Minimize all windows. WIN Key+M
Restores minimized windows. WIN Key+Shift+M
Open My Computer. WIN Key+E
Search for a file or folder. WIN Key+F
Search for computers. CTRL+WIN Key+F
Display Windows Help. WIN Key+F1
Lock your computer if you are connected to a network domain, or switch users if you are not connected to a network domain. WIN Key+ L
Open the Run dialog box. WIN Key+R
Open Utility Manager. WIN Key+U

Accessibility keyboard shortcuts:

Switch FilterKeys on and off. Right SHIFT for eight seconds
Switch High Contrast on and off. Left ALT+left SHIFT+PRINT SCREEN
Switch MouseKeys on and off. Left ALT +left SHIFT +NUM LOCK
Switch StickyKeys on and off. SHIFT five times
Switch ToggleKeys on and off. NUM LOCK for five seconds
Open Utility Manager. WIN Key+U

Shortcuts you can use with Windows Explorer:


Display the bottom of the active window. END
Display the top of the active window. HOME
Display all subfolders under the selected folder. NUM LOCK+ASTERISK on numeric keypad (*)
Display the contents of the selected folder. NUM LOCK+PLUS SIGN on numeric keypad (+)
Collapse the selected folder. NUM LOCK+MINUS SIGN on numeric keypad (-)
Collapse current selection if it's expanded, or select parent folder. LEFT ARROW
Display current selection if it's collapsed, or select first subfolder. RIGHT ARROW

COMMON FTP ERROR CODES

110 Restart marker reply. In this case, the text is exact and not left to the particular implementation; it must read: MARK yyyy = mmmm where yyyy is User-process data stream marker, and mmmm server's equivalent marker (note the spaces between markers and "=").

120 Service ready in nnn minutes.

125 Data connection already open; transfer starting.

150 File status okay; about to open data connection.

200 Command okay.

202 Command not implemented, superfluous at this site.

211 System status, or system help reply.

212 Directory status.

213 File status.

214 Help message.On how to use the server or the meaning of a particular non-standard command. This reply is useful only to the human user.

215 NAME system type. Where NAME is an official system name from the list in the Assigned Numbers document.

220 Service ready for new user.

221 Service closing control connection.

225 Data connection open; no transfer in progress.

226 Closing data connection. Requested file action successful (for example, file transfer or file abort).

227 Entering Passive Mode (h1,h2,h3,h4,p1,p2).

230 User logged in, proceed. Logged out if appropriate.

250 Requested file action okay, completed.

257 "PATHNAME" created.

331 User name okay, need password.

332 Need account for login.

350 Requested file action pending further information

421 Service not available, closing control connection.This may be a reply to any command if the service knows it must shut down.

425 Can't open data connection.

426 Connection closed; transfer aborted.

450 Requested file action not taken.

451 Requested action aborted. Local error in processing.

452 Requested action not taken. Insufficient storage space in system.File unavailable (e.g., file busy).

500 Syntax error, command unrecognized. This may include errors such as command line too long.

501 Syntax error in parameters or arguments.

502 Command not implemented.

503 Bad sequence of commands.

504 Command not implemented for that parameter.

530 Not logged in.

532 Need account for storing files.

550 Requested action not taken. File unavailable (e.g., file not found, no access).

551 Requested action aborted. Page type unknown.

552 Requested file action aborted. Exceeded storage allocation (for current directory or dataset).

553 Requested action not taken. File name not allowed.

Saturday, 6 June 2009

General Keyboard Shortcuts, Windows Keyboard Shortcuts

General Keyboard Shortcuts
CTRL+C (Copy)
CTRL+X (Cut)
CTRL+V (Paste)
CTRL+Z (Undo)
DELETE (Delete)
SHIFT+DELETE (Delete the selected item permanently without placing the item in the Recycle Bin)
CTRL while dragging an item (Copy the selected item)
CTRL+SHIFT while dragging an item (Create a shortcut to the selected item)
F2 key (Rename the selected item)
CTRL+RIGHT ARROW (Move the insertion point to the beginning of the next word)
CTRL+LEFT ARROW (Move the insertion point to the beginning of the previous word)
CTRL+DOWN ARROW (Move the insertion point to the beginning of the next paragraph)
CTRL+UP ARROW (Move the insertion point to the beginning of the previous paragraph)
SHIFT with any of the arrow keys (Select more than one item in a window or on the desktop, or select text in a document)
CTRL+A (Select all)
F3 key (Search for a file or a folder)
ALT+ENTER (View the properties for the selected item)
ALT+F4 (Close the active item, or quit the active program)
ALT+ENTER (Display the properties of the selected object)
ALT+SPACEBAR (Open the shortcut menu for the active window)
CTRL+F4 (Close the active document in programs that enable you to have multiple documents open simultaneously)
ALT+TAB (Switch between the open items)
ALT+ESC (Cycle through items in the order that they had been opened)
F6 key (Cycle through the screen elements in a window or on the desktop)
F4 key (Display the Address bar list in My Computer or Windows Explorer)
SHIFT+F10 (Display the shortcut menu for the selected item)
ALT+SPACEBAR (Display the System menu for the active window)
CTRL+ESC (Display the Start menu)
ALT+Underlined letter in a menu name (Display the corresponding menu)
Underlined letter in a command name on an open menu (Perform the corresponding command)
F10 key (Activate the menu bar in the active program)
RIGHT ARROW (Open the next menu to the right, or open a submenu)
LEFT ARROW (Open the next menu to the left, or close a submenu)
F5 key (Update the active window)
BACKSPACE (View the folder one level up in My Computer or Windows Explorer)
ESC (Cancel the current task)
SHIFT when you insert a CD-ROM into the CD-ROM drive (Prevent the CD-ROM from automatically playing)

Dialog Box Keyboard Shortcuts
CTRL+TAB (Move forward through the tabs)
CTRL+SHIFT+TAB (Move backward through the tabs)
TAB (Move forward through the options)
SHIFT+TAB (Move backward through the options)
ALT+Underlined letter (Perform the corresponding command or select the corresponding option)
ENTER (Perform the command for the active option or button)
SPACEBAR (Select or clear the check box if the active option is a check box)
Arrow keys (Select a button if the active option is a group of option buttons)
F1 key (Display Help)
F4 key (Display the items in the active list)
BACKSPACE (Open a folder one level up if a folder is selected in the Save As or Open dialog box)

Microsoft Natural Keyboard Shortcuts
Windows Logo (Display or hide the Start menu)
Windows Logo+BREAK (Display the System Properties dialog box)
Windows Logo+D (Display the desktop)
Windows Logo+M (Minimize all of the windows)
Windows Logo+SHIFT+M (Restore the minimized windows)
Windows Logo+E (Open My Computer)
Windows Logo+F (Search for a file or a folder)
CTRL+Windows Logo+F (Search for computers)
Windows Logo+F1 (Display Windows Help)
Windows Logo+ L (Lock the keyboard)
Windows Logo+R (Open the Run dialog box)
Windows Logo+U (Open Utility Manager)

Accessibility Keyboard Shortcuts
Right SHIFT for eight seconds (Switch FilterKeys either on or off)
Left ALT+left SHIFT+PRINT SCREEN (Switch High Contrast either on or off)
Left ALT+left SHIFT+NUM LOCK (Switch the MouseKeys either on or off)
SHIFT five times (Switch the StickyKeys either on or off)
NUM LOCK for five seconds (Switch the ToggleKeys either on or off)
Windows Logo +U (Open Utility Manager)
Windows Explorer Keyboard Shortcuts
END (Display the bottom of the active window)
HOME (Display the top of the active window)
NUM LOCK+Asterisk sign (*) (Display all of the subfolders that are under the selected folder)
NUM LOCK+Plus sign (+) (Display the contents of the selected folder)
NUM LOCK+Minus sign (-) (Collapse the selected folder)
LEFT ARROW (Collapse the current selection if it is expanded, or select the parent folder)
RIGHT ARROW (Display the current selection if it is collapsed, or select the first subfolder)

Shortcut Keys for Character Map
After you double-click a character on the grid of characters, you can move through the grid by using the keyboard shortcuts:
RIGHT ARROW (Move to the right or to the beginning of the next line)
LEFT ARROW (Move to the left or to the end of the previous line)
UP ARROW (Move up one row)
DOWN ARROW (Move down one row)
PAGE UP (Move up one screen at a time)
PAGE DOWN (Move down one screen at a time)
HOME (Move to the beginning of the line)
END (Move to the end of the line)
CTRL+HOME (Move to the first character)
CTRL+END (Move to the last character)
SPACEBAR (Switch between Enlarged and Normal mode when a character is selected)

Microsoft Management Console (MMC) Main Window Keyboard Shortcuts
CTRL+O (Open a saved console)
CTRL+N (Open a new console)
CTRL+S (Save the open console)
CTRL+M (Add or remove a console item)
CTRL+W (Open a new window)
F5 key (Update the content of all console windows)
ALT+SPACEBAR (Display the MMC window menu)
ALT+F4 (Close the console)
ALT+A (Display the Action menu)
ALT+V (Display the View menu)
ALT+F (Display the File menu)
ALT+O (Display the Favorites menu)

MMC Console Window Keyboard Shortcuts
CTRL+P (Print the current page or active pane)
ALT+Minus sign (-) (Display the window menu for the active console window)
SHIFT+F10 (Display the Action shortcut menu for the selected item)
F1 key (Open the Help topic, if any, for the selected item)
F5 key (Update the content of all console windows)
CTRL+F10 (Maximize the active console window)
CTRL+F5 (Restore the active console window)
ALT+ENTER (Display the Properties dialog box, if any, for the selected item)
F2 key (Rename the selected item)
CTRL+F4 (Close the active console window. When a console has only one console window, this shortcut closes the console)

Remote Desktop Connection Navigation
CTRL+ALT+END (Open the Microsoft Windows NT Security dialog box)
ALT+PAGE UP (Switch between programs from left to right)
ALT+PAGE DOWN (Switch between programs from right to left)
ALT+INSERT (Cycle through the programs in most recently used order)
ALT+HOME (Display the Start menu)
CTRL+ALT+BREAK (Switch the client computer between a window and a full screen)
ALT+DELETE (Display the Windows menu)
CTRL+ALT+Minus sign (-) (Place a snapshot of the active window in the client on the Terminal server clipboard and provide the same functionality as pressing PRINT SCREEN on a local computer.)
CTRL+ALT+Plus sign (+) (Place a snapshot of the entire client window area on the Terminal server clipboard and provide the same functionality as pressing ALT+PRINT SCREEN on a local computer.)

Microsoft Internet Explorer Navigation
CTRL+B (Open the Organize Favorites dialog box)
CTRL+E (Open the Search bar)
CTRL+F (Start the Find utility)
CTRL+H (Open the History bar)
CTRL+I (Open the Favorites bar)
CTRL+L (Open the Open dialog box)
CTRL+N (Start another instance of the browser with the same Web address)
CTRL+O (Open the Open dialog box, the same as CTRL+L)
CTRL+P (Open the Print dialog box)
CTRL+R (Update the current Web page)
CTRL+W (Close the current window)

How To Add A Url Address Bar To The Taskbar

You can add an Internet URL Link bar to your Windows XP taskbar. Doing so will let you type in URLs and launch Web

pages without first launching a browser. It will also let you launch some native Windows XP applications in much the

same way as you would via the Run menu (so you could type in calc to launch the calculator or mspaint to launch Microsoft Paint.

Here's how you add the Link bar:
1. Right-click on the taskbar, select Toolbars, and then click Link.

2. The word Link will appear on your taskbar.

3. Double click it to access it.

4. If that doesn't work, your taskbar is locked. You can unlock it by right-clicking on the taskbar again and uncheck Lock the Taskbar.

5. To customize the link, right click it and select properties.

6. On the properties screen, click General tab and change the name.

7. On the web document tab, change the link. You can also change the Icon

NOTE: You may also need to grab the vertical dotted lines beside the word Link and drag it to the left to make the Link window appear.

Monday, 1 June 2009

Start, stop and debug Tomcat with Ant

This script shows how to start, stop and restart tomcat for the purpose of
development.

Enjoy!

<condition property="tomcat.started">
      <socket server="localhost" port="8180"/>
  </condition>

  <target name="tomcat-start" unless="tomcat.started">
    <java jar="${tomcat.dir}/bin/bootstrap.jar" fork="true">
      <jvmarg value="-Dcatalina.home=${tomcat.dir}"/>
    </java>
  </target>

  <target name="tomcat-stop" if="tomcat.started">
    <java jar="${tomcat.dir}/bin/bootstrap.jar" fork="true">
      <jvmarg value="-Dcatalina.home=${tomcat.dir}"/>
      <arg line="stop"/>
    </java>
  </target>

  <target name="tomcat-start-debug" description="start tomcat in debug mode" unless="tomcat.started">
    <java jar="${tomcat.dir}/bin/bootstrap.jar" fork="true">
      <jvmarg value="-Dcatalina.home=${tomcat.dir}"/>
      <jvmarg value="-Xdebug"/>
      <jvmarg value="-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n"/>
    </java>
  </target>

  <target name="redeploy" description="Stop, redeploy, start" >
    <antcall target="tomcat-stop"/>
    <sleep seconds="10"/>
    <antcall target="deploy_dev"/>
    <sleep seconds="10"/>
    <antcall target="tomcat-start"/>
  </target>

  <target name="redeploy-debug" description="Stop, redeploy, start with debugging turned on">
    <antcall target="tomcat-stop"/>
    <sleep seconds="10"/>
    <antcall target="deploy_dev"/>
    <sleep seconds="10"/>
    <antcall target="tomcat-start-debug"/>
  </target>

Ant macrodef to generate web service stubs for various wsdls

This is an ant macrodef I wrote to create wsdls since I had to deal with about 10 wsdls in one project. I have provided an example of usage as well.

Enjoy.

My IzPack Installation Script

Izpack is a java installer that is very useful, dynamic and easy. Its free and open source. In a project I worked on, I have used it to create a very dynamic and complex installer that handles a lot of configurations and installation files based on conditions. Th dynamic nature is due to the fact that i have to handle integration into more than 10 third party systems and clients have the option to choose which ever third party they have acquired. This installer has made it so easy thanks to FOSS I want to share the script.

This will also help me in case I have to make references at some point in the future.

Enjoy!

Main Installer:


<installation version="1.0">
  <info>
    <appname>[APP-NAME]</appname>
    <appversion>[APP-VERSION]</appversion>
    <appsubpath>[APP-PATH]</appsubpath>
    <javaversion>[JAVA-VERSION]</javaversion>
    <url>[APP-URL]</url>
    <requiresjdk>yes</requiresjdk>
    <authors>
      <author name="[APP-AUTHOR]" email="[APP-CONTACT]"/>
    </authors>
  </info>
  <guiprefs width="640" height="480" resizable="no">
    <modifier key="useLabelIcons" value="no"/>
    <modifier key="useHeadingPanel" value="yes"/>
    <modifier key="headingLineCount" value="1"/>
    <modifier key="headingFontSize" value="1.5"/>
    <modifier key="useFlags" value="no"/>
    <modifier key="langDisplayType" value="native"/>
    <modifier key="allYGap" value="8"/>
    <modifier key="allXGap" value="4"/>
    <modifier key="labelGap" value="2"/>
    <modifier key="layoutAnchor" value="NORTHWEST"/>
    <modifier key="headingPanelCounter" value="progressbar"/>
    <modifier key="headingPanelCounterPos" value="inNavigationPanel"/>
  </guiprefs>
  <locale>
    <langpack iso3="eng"/>
  </locale>
  <native name="ShellLink.dll" type="izpack">
    <os family="windows"/>
  </native>
  <native name="COIOSHelper.dll" stage="both" type="3rdparty">
    <os family="windows"/>
  </native>
  <listeners>
    <listener installer="RegistryInstallerListener" uninstaller="RegistryUninstallerListener">
      <os family="windows"/>
    </listener>
  </listeners>
  <conditions>
    <condition type="variable" id="condition.qas.v1">
      <name>connector.type</name>
      <value>QAS</value>
    </condition>
    <condition type="variable" id="condition.qas.v2">
      <name>connector.type</name>
      <value>QAS_V2</value>
    </condition>
    <condition type="variable" id="start.addresshub">
      <name>start_addresshub</name>
      <value>true</value>
    </condition>
  </conditions>
  <dynamicvariables>
    <variable name="TOMCAT_HOME" value="$INSTALL_PATH\$TOMCAT_VER"/>
    <variable name="JDK_HOME" value="${jdk.home}"/>
    <variable name="TEMP_HOME" value="$INSTALL_PATH\temp"/>
    <variable name="QAS_DATA_DIR" value="${qas.data.dir}"/>
    <variable name="QAS_HOME" value="${qas.install.dir}"/>
    <variable name="CONNECTOR_TYPE" value="${connector.type}"/>
    <variable name="JDKPathPanel.minVersion" value="1.5"/>
    <variable name="JDKPathPanel.maxVersion" value="1.5"/>
    <variable name="JDKPathPanel.skipIfValid" value="yes"/>
    <variable name="SERVER_NAME" value="${server.name}"/>
    <variable name="SERVER_START_PORT" value="${server.start.port}"/>
    <variable name="SERVER_SHUTDOWN_PORT" value="${server.shutdown.port}"/>

    <!-- QAS -->
    <variable name="CONNECTOR_NAME" value="QAS" condition="condition.qas.v1"/>
    <variable name="CONNECTOR_NAME" value="QAS Version 2" condition="condition.qas.v2"/>
    <variable name="QAS_INI_FILE" value="$TOMCAT_HOME\shared\lib\qapro.ini" condition="condition.qas.v1"/>
    <variable name="OS_MULTIPLIER" value="10" condition="condition.qas.v2"/>
    <variable name="OS_MULTIPLIER" value="10" condition="condition.qas.v1"/>
    <variable name="CONNECTOR_VERSION" value="2.0"/>

    <!-- SQL CONNECTOR -->
    <variable name="CONNECTOR_NAME" value="SQL" condition="condition.sql"/>
    <variable name="JDBC_URL" value="${jdbcURL}" condition="condition.sql"/>
    <variable name="JDBC_DRIVER" value="${jdbcDriver}" condition="condition.sql"/>
    <variable name="DATABASE_VIEWNAME" value="${viewName}" condition="condition.sql"/>
    <variable name="USERNAME" value="${dbUserName}" condition="condition.sql"/>
    <variable name="PASSWORD" value="${dbPassword}" condition="condition.sql"/>
    <variable name="FILENAME" value="${filename}" condition="condition.sql"/>
    <variable name="OS_MULTIPLIER" value="10" condition="condition.sql"/>
    
  </dynamicvariables>
  <variables>
    <variable name="TOMCAT_VER" value="[CATALINA-VERSION]"/>
  </variables>
  <resources>
    <res src="installer/ProcessPanel.Spec.xml" id="ProcessPanel.Spec.xml"/>
    <res src="installer/shortcutSpec.xml" id="shortcutSpec.xml"/>
    <res src="installer/UserInput.Spec.xml" id="userInputSpec.xml"/>
    <res id="Heading.image" src="src/web/lalpac-logo-cms.png"/>
  </resources>
  <panels>
    <panel classname="HelloPanel"/>
    <panel classname="TargetPanel"/>
    <panel classname="JDKPathPanel"/>
    <panel classname="UserInputPanel" id="Connector.Select"/>
    <panel classname="UserInputPanel" id="Connector.QAS.v1.Conf" condition="condition.qas.v1"/>
    <panel classname="UserInputPanel" id="Connector.QAS.v2.Conf" condition="condition.qas.v2"/>
    <panel classname="PacksPanel"/>
    <panel classname="InstallPanel"/>
    <panel classname="ProcessPanel"/>
    <panel classname="ShortcutPanel"/>
    <panel classname="SimpleFinishPanel"/>
  </panels>
  <packs>
    <pack name="Tomcat" required="yes">
      <description>Tomcat Installation</description>
      <file targetdir="$INSTALL_PATH" src="[CATALINA-SOURCE]" unpack="true"/>
      <file targetdir="$INSTALL_PATH/temp" src="DEPLOY/lalpac-tomcat-customised.zip" unpack="true"/>
      <file targetdir="$INSTALL_PATH/temp" src="DEPLOY/lalpac-tomcat-nt-service.zip" unpack="true"/>
      <file targetdir="$INSTALL_PATH/temp/bin" src="runtime/sleep.exe"/>
      <file targetdir="$INSTALL_PATH/temp/bin" src="runtime/lalpacenv.bat"/>
      <file targetdir="$TEMP_HOME" src="installer/tomcatconfig.bat"/>
      <file targetdir="$INSTALL_PATH/temp/bin" src="runtime/restartlpah.bat"/>
      <file targetdir="$INSTALL_PATH/temp/bin" src="runtime/stoplpah.bat"/>
      <file targetdir="$INSTALL_PATH/temp/bin" src="runtime/runlpah.bat"/>
      <parsable type="shell" parse="yes" targetfile="$INSTALL_PATH/temp/bin/lalpacenv.bat"/>
      <parsable type="shell" targetfile="$TEMP_HOME/tomcatconfig.bat" parse="yes"/>
      <parsable type="shell" targetfile="$INSTALL_PATH/temp/bin/restartlpah.bat" parse="yes"/>
      <parsable type="shell" parse="yes" targetfile="$INSTALL_PATH/temp/bin/stoplpah.bat"/>
      <parsable type="shell" parse="yes" targetfile="$INSTALL_PATH/temp/bin/runlpah.bat"/>
    </pack>
    <pack name="Core" required="yes">
      <description>Core Files</description>
      <file targetdir="$INSTALL_PATH/temp" src="DEPLOY/lalpac-tomcat.zip" unpack="true"/>
      <file targetdir="$INSTALL_PATH/temp" src="installer/ConnectorInstall.bat"/>
      <singlefile os="windows" target="$INSTALL_PATH/temp/addresshub.properties" src="src/conf/win.addresshub.properties"/>
      <singlefile target="$INSTALL_PATH/temp/web.xml" src="src/conf/dist.web_1.xml"/>
      <singlefile target="$INSTALL_PATH/temp/server.xml" src="src/conf/dist.server.win.xml"/>
      <parsable type="shell" targetfile="$INSTALL_PATH/temp/ConnectorInstall.bat" parse="yes"/>
      <parsable type="plain" parse="yes" targetfile="$INSTALL_PATH/temp/addresshub.properties"/>
      <parsable type="xml" targetfile="$INSTALL_PATH/temp/web.xml" parse="yes"/>
      <parsable type="xml" parse="yes" targetfile="$INSTALL_PATH/temp/server.xml"/>
    </pack>
    <pack name="QAS Connector V1" preselected="no" os="windows" required="no" id="pack.qas.v1" condition="condition.qas.v1">
      <description>Install files required for QAS Version 1 Connector</description>
      <file targetdir="$INSTALL_PATH/temp/qas" src="src/conf/qas/QABSF.INI"/>
      <file targetdir="$INSTALL_PATH/temp/qas" src="src/conf/qas/QABSFED.DLL"/>
      <file targetdir="$INSTALL_PATH/temp/qas" src="src/conf/qas/QABSFED.REV"/>
      <file targetdir="$INSTALL_PATH/temp/qas" src="src/conf/qas/qabsfed.isu"/>
      <singlefile target="$INSTALL_PATH/temp/qas/qapro.ini" src="src/conf/qas/qapro.v1.ini"/>
      <file targetdir="$INSTALL_PATH/temp/qas" src="src/conf/qas/qapuieb.dll"/>
      <file targetdir="$INSTALL_PATH/temp/qas" src="src/conf/qas/qapuieb.rev"/>
      <parsable type="plain" targetfile="$INSTALL_PATH/temp/qas/qapro.ini" parse="yes"/>
    </pack>
    <pack name="QAS Connector V2" preselected="no" os="windows" required="no" id="pack.qas.v2" condition="condition.qas.v2">
      <description>Install files required for QAS Version 2 Connector</description>
      <file targetdir="$INSTALL_PATH/temp/qas" src="src/conf/qas/QAWSERVE.INI"/>
      <parsable type="plain" targetfile="$INSTALL_PATH/temp/qas/QAWSERVE.INI" parse="yes"/>
    </pack>
  </packs>
</installation>

My Processing Spec as required

<processing>
  <logfiledir>$INSTALL_PATH</logfiledir>
  <job name="Installing Configuration Files">
    <executefile name="$INSTALL_PATH/temp/tomcatconfig.bat">
    </executefile>
  </job>
  <job name="Installing Connectors">
    <executefile name="$INSTALL_PATH/temp/ConnectorInstall.bat">
      <env>AH_TYPE=$INSTALL_TYPE</env>
    </executefile>
  </job>

  <!-- Always install as windows service. Don't give user the option -->
  <job name="Installing Windows Services" conditionid="windows.service">
    <os family="windows" />
    <executefile name="$TOMCAT_HOME\bin\installService.bat">
    </executefile>
  </job>  
</processing>


and ShortcutSpec

<shortcuts>
    <skipIfNotSupported/>
    <programGroup location="applications" defaultName="$APP_NAME $APP_VER"/>
    <shortcut startMenu="no" name="Start" encoding="UTF-8" initialState="noShow" applications="no" startup="no" workingDirectory="$TOMCAT_HOME\bin" target="$TOMCAT_HOME\bin\runlpah.bat" programGroup="yes" description="Start Addresshub" iconIndex="0" desktop="no"/>
    <shortcut startMenu="no" name="Stop" encoding="UTF-8" initialState="noShow" applications="no" startup="no" workingDirectory="$TOMCAT_HOME\bin" target="$TOMCAT_HOME\bin\stoplpah.bat" programGroup="yes" description="Stop Addresshub" iconIndex="1" desktop="no"/>
    <!-- <shortcut startMenu="no" name="StartService" encoding="UTF-8" initialState="noShow" applications="no" startup="no" workingDirectory="$TOMCAT_HOME\bin" target="$TOMCAT_HOME\bin\installService.bat" programGroup="yes" description="Start Addresshub Windows Service" iconIndex="2" desktop="no"/> -->
    <shortcut startMenu="no" name="Restart" encoding="UTF-8" initialState="noShow" applications="no" startup="no" workingDirectory="$TOMCAT_HOME\bin" target="$TOMCAT_HOME\bin\restartlpah.bat" programGroup="yes" description="Restart Addresshub" iconIndex="2" desktop="no"/>
    <shortcut startMenu="no" name="Uninstaller" encoding="UTF-8" initialState="noShow" applications="no" startup="no" workingDirectory="$TOMCAT_HOME\bin" target="$TOMCAT_HOME\bin\removeService.bat" programGroup="yes" description="Remove Addresshub" iconIndex="3" desktop="no"/>
    <!-- <shortcut startMenu="no" name="Uninstaller" encoding="UTF-8" applications="no" commandLine="" startup="no" target="$INSTALL_PATH\Uninstaller\uninstaller.jar" programGroup="yes" description="Addresshub uninstaller" iconIndex="5" desktop="no"/> -->
</shortcuts>


And UserInputSpec.xml
<userInput>
  <panel order="0" id="Connector.Select">
    <field type="title" txt="Select Configuration File" bold="true" size="1" />
    <field type="divider" align="top"/>

    <field type="space"/>

    <field type="dir" align="left" variable="jdk.home">
        <spec txt="Java Install Directory" size="25" set=""/>
        <validator class="com.izforge.izpack.util.NotEmptyValidator" txt="You must select your Java Installation Directory!"/>
    </field>
    <field type="staticText" align="left" txt="Directory where Java Runtime has been installed to."/>

    <field type="space"/>

    <field type="staticText" align="left" txt="Supplied Addresshub Configuration file:"/>
    <field type="file" align="left" variable="addresshub.file">
        <spec txt="" size="30" set=""/>
        <validator class="com.izforge.izpack.util.NotEmptyValidator" txt="Please select the Addresshub Configuration file received from LalPac!"/>
    </field>

    <field type="space"/>


    <field type="combo" align="left" variable="connector.type">
      <spec txt="Available Connectors">
        <choice txt="" value="None"/>
        <choice txt="QAS Connector for V6 LPG" value="QAS_LPG_V6"/>
        <choice txt="QAS Connector for V6 GBR/Pointer" value="QAS_GBR_V6"/>
        <!-- <choice txt="Accolaid Connector Version 1" value="Acolaid"/>
        <choice txt="Accolaid Soap Connector" value="Acolaid_Soap"/>
        <choice txt="GGP Connector Version 1" value="GGP"/>
        <choice txt="GGP Soap Connector " value="GGP_Soap"/>
        <choice txt="SQL Connector " value="SQL"/>
        <choice txt="GWS Connector " value="GWS"/>
        <choice txt="SX3 Connector " value="SX3"/>-->
        <choice txt="MVM Connector " value="MVM"/>
        <!-- <choice txt="CAPS Connector " value="CAPS"/> -->
      </spec>
      <validator class="com.izforge.izpack.util.NotEmptyValidator" txt="You must select the Connector to be installed!"/>
    </field>
    <field type="staticText" align="left" txt="The type of LalPac Connector to be installed"/>

    <field type="space"/>
    
    <field type="divider" align="bottom"/>
  </panel>

  <panel order="0" id="Connector.QAS.v1.Conf">
    <field type="title" txt="Please select where your QAS Data is installed to " bold="true" size="1" />
    <field type="divider" align="top"/>
    <field type="dir" align="left" variable="qas.data.dir">
      <spec txt="QAS Data Folder" size="25" set="C:\qaddress\pafdata"/>
    </field>
    <field type="divider" align="bottom"/>
  </panel>

  <panel order="1" id="Connector.QAS.v2.Conf">
    <field type="title" txt="Please specify the following QAS Installation folders. " bold="true" size="1" />
    <field type="divider" align="top"/>
    <field type="dir" align="left" variable="qas.data.dir">
      <spec txt="LPG Data Directory" size="25" set="C:\Program Files\QAS\Data\Gbr.001"/>
    </field>
    <field type="dir" align="left" variable="qas.install.dir">
      <spec txt="QAS Install Folder" size="25" set="C:\Program Files\QAS\QuickAddress Pro API"/>
    </field>
    <field type="divider" align="bottom"/>
  </panel>

  <panel order="3" id="Connector.mvm.Conf">

    <field type="title" txt="Please specify the configuration parameters for your installation " bold="true" size="1" />

    <field type="space"/>
    
    <field type="divider" align="top"/>

    <field type="space"/>

    <field type="text" align="left" variable="endpoint">
      <spec txt="Endpoint" size="40" set=""/>
      <validator class="com.izforge.izpack.util.NotEmptyValidator" txt="No EndPoint Specified"/>
    </field>
    <field type="staticText" align="left" txt="The URL of the Address Data Source. See LalPac Configuration file for details."/>

    <field type="space"/>

    <field type="text" align="left" variable="namespace">
      <spec txt="Target-namespace" size="25" set=""/>
      <validator class="com.izforge.izpack.util.NotEmptyValidator" txt="Target-namespace is Required"/>
    </field>
    <field type="staticText" align="left" txt="The Target Namespace. See LalPac Configuration file for details."/>

    <field type="space"/>

    <field type="text" align="left" variable="os-multiplier">
      <spec txt="Multiplier" size="25" set=""/>
      <validator class="com.izforge.izpack.util.NotEmptyValidator" txt="Data Multiplier is Required"/>
    </field>
    <field type="staticText" align="left" txt="The Data Multplier. See LalPac Configuration file for details."/>

    <field type="space"/>
    
    <field type="divider" align="bottom"/>

    <field type="space"/>
    
    <field type="title" txt="The  LalPac Configuration file should be included with the package you received from LalPac Ltd. " bold="true" size="1" />

    <field type="space"/>
  </panel>
  
</userInput>