ImageMagick

# Resize image
convert -resize 50% -quality 80 input.jpg output.jpg
 
# Convert color to gray

Debian - Mount Hot-pluggable devices(SD cards, USB)

  1. In the shell, run fdisk -l and note all the devices listed.
  2. Plug in your device and then re-run fdisk -l. You should see your newly added device appear in the list.
  3. Create a directory for your device.

Debian

Debian is 1 of the oldest free Linux distribution that still exist today. It was first released by Ian Murdock in 1993. It is known to be very stable. As a result, people tend to use it when they are building production servers.

Source.lst generator: http://debgen.simplylinux.ch/generate.php

Ant - Ant Installation

JDK is the software development kit for creating Java programs. Instructions below show you step-by-step how to install and set it up.

  1. Download Java Development Kit(JDK). Install it and follow the instructions shown on the screen.
  2. Create an environment variable JAVA_HOME and set its value to the folder path of you JDK installation(e.g. C:\Program Files\Java\jdk1.6.0_06).

    Java - Multithreaded Programming

    /**
     * Manager.java
     * Multithreaded example:
     * Give a job to each worker. As soon as a worker finishes his job, assign a new 
     *  job to the free worker.
     * @author Xuan Ngo
     */
    import java.util.ArrayList;
     
    public class Manager
    {
      public static void main(String[] args)
      {
        // Variables
        int iNumOfWorkers = 3;// Number of workers.
        int iNumOfJobs = 11;  // Number of jobs.
        long lWaitTime = 1000;// Time lapse before asking who workers are free.
     
        // Create jobs list.
        ArrayList<String> aJobsList = new ArrayList<String>();

    Selenium - Type characters

    /**
     * Type characters.
     * Assume that you have Internet Explorer and Selenium Server is running on your
     *  computer on default port 4444. Otherwise, change accordingly in the constructor.
     *  You need to change the encoding of your editor to support the Chinese characters below.
     * @Author: Xuan Ngo
     */
    import com.thoughtworks.selenium.DefaultSelenium;
     
    public class WritingExample
    {
      private DefaultSelenium m_oBrowser = null;
     
      public static void main(String[] args)
      {
        Writing oWriting = new Writing();
     
        // Type characters.

    Selenium - Select single/multiple options

    /**
     * Select single/multiple options.
     * Assume that you have Internet Explorer and Selenium Server is running on your
     *  computer on default port 4444. Otherwise, change accordingly in the constructor.
     * @Author: Xuan Ngo
     */
    import com.thoughtworks.selenium.DefaultSelenium;
     
    public class Select
    {
      private DefaultSelenium m_oBrowser = null;
     
      public static void main(String[] args)
      {
        Select oSelect = new Select();
     
        // Select single/multiple options.
        oSelect.runExamples();
      }
     
      // Constructor
      public Select()
      {

    Selenium - Check radio buttons and checkboxes

    /**
     * Un/Check radio buttons and checkboxes.
     * Assume that you have Internet Explorer and Selenium Server is running on your
     * computer on default port 4444. Otherwise, change accordingly in the constructor.
     * @Author: Xuan Ngo
     */
    import com.thoughtworks.selenium.DefaultSelenium;
     
    public class Check
    {
      private DefaultSelenium m_oBrowser = null;
     
      public static void main(String[] args)
      {
        Check oCheck = new Check();
     
        // Un/Check radio buttons and checkboxes.
        oCheck.runExamples();
      }
     
      // Constructor
      public Check()
      {

    Selenium - Click on any html element using different locators

    /**
     * Click on any html element in the webpage as long as you can use the locators to identify them.
     * Assume that you have Internet Explorer and Selenium Server is running on your
     *  computer on default port 4444. Otherwise, change accordingly in the constructor.
     * @Author: Xuan Ngo
     */
    import com.thoughtworks.selenium.DefaultSelenium;
     
    public class ClickAny
    {
      private DefaultSelenium m_oBrowser = null;
     
      public static void main(String[] args)
      {
        ClickAny oClickAny = new ClickAny();
     
        // Click on any html element in the webpage.

    Selenium - Click on link

    /**
     * Click on a simple link(e.g Next)
     * Assume that you have Internet Explorer and Selenium Server is running on your
     *  computer on default port 4444. Otherwise, change accordingly in the constructor.
     * @Author: Xuan Ngo
     */
    import com.thoughtworks.selenium.DefaultSelenium;
     
    public class ClickSimple
    {
      private DefaultSelenium m_oBrowser = null;
     
      public static void main(String[] args)
      {
        ClickSimple oClickSimple = new ClickSimple();
     
        // Click on Next link.
        oClickSimple.runExamples();
      }
     
      // Constructor

    Pages

    Subscribe to OpenWritings.net RSS