How to increase the number of recent workspaces in the eclipse based IBM RAD (Rational Application Developer) IDE?

Did you sometimes get annoyed because you had lots of your workspaces and the eclipse IDE just showed last 5 of those workspaces in the recently opened workspace list? I would love to see at least ten or 15 of my recent workspace on that list because it saves my time browsing to that workspace location. There is a simple way to change the number of recently changed workspaces to show more workspaces. Here is how you do it.

  • Open the folder: C:Program Files\IBM\SDP\configuration.settings
  • Edit the file: ‘org.eclipse.ui.ide.prefs’
    • Change MAX_RECENT_WORKSPACES to desired value.

Content of sample file:

#Wed Apr 13 15:24:50 CDT 2011

RECENT_WORKSPACES_PROTOCOL=3

MAX_RECENT_WORKSPACES=15

SHOW_WORKSPACE_SELECTION_DIALOG=true

eclipse.preferences.version=1

RECENT_WORKSPACES=C:\Workspaces\CQCodeReviewnC:\Workspaces\TempWSnC:\Workspaces\CSSVNnC:\Workspaces\CQTempTrunknC:\Workspaces\CQ

Some Keyboard Shortcuts For Macbook Pro With Retina Display

I switched from Windows and Linux platform to Apple’s Mac  in 2012. I am maintaining this shortcut list as I discover them for myself – which are a bit different from the other platforms I used in the past. I hope I will get used to all these commands someday and will no longer have to refer to this page. But hopefully by maintaining this list here, I might help a couple of wandering souls.

  1. Command+Shift+3 –> Take Screenshot of Entire Desktop, Picture saved to Desktop
  2. Command+Control+Shift+3 –> Take Screenshot of Entire Desktop, Picture  Copied To Clipboard
  3. Command+Shift+4 –> Take screenshot of portion of your desktop, picture saved to desktop
  4. Command+Shift+4, Spacebar –> Take Screenshot of selected application, picture saved to desktop
  5. ‘Applications > Utilities > Grab’ tool
  6. Command+Control+Shift+4 –> Take screenshot of portion of your desktop, picture copied to clipboard
  7. Command+Control+Shift+4, Spacebar –> Take screenshot of selected Application, picture copied to clipboard
  8. Fn + F11 –> Minimize All The Windows In Mac
  9. Command + Option + V –> Move The Copied Items (Paste as move)
  10. dscacheutil –flushcacheFlush DNS
  11. unzip filename.zip –> Unzips files in the current folder

More Advanced:

Installing GVM – Groovy Environment Managemnet.
Note: You need to restart terminal after doing this.

curl -s get.gvmtool.net | bash

Installing Grails using GVM:

gvm install grails
gvm install grails 2.3.6
gvm use grails 2.3.7
gvm default grails 1.3.9

Installing Groovy using GVM:

gvm install groovy //latest version
gvm install groovy 2.2.2 //specific version
gvm use groovy 2.2.1 //use specific version

Replacing non-ASCII characters using Java Regular Expressions

The following java code shows how we can replace non-ASCII characters from a file using regular expressions.

package com.kushal.utils;

/**
 * ReplaceNonASCIICharacters.java
 * @author Kushal Paudyal
 * www.sanjaal.com/java
 *
 * This class reads a file with non ASCII Characters in it.
 * Replaces the non ASCII Characters using regular expression.
 * Saves the content with non-ASCII Characters removed to a new file.
 */

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.FileReader;
import java.io.FileWriter;

public class ReplaceNonAsciiCharacters {

	public static void main(String args[]) {

		/**
		 * This is the input file name with some non-ASCII characters in the
		 * content of the file.
		 */
		String fileName = "C:/Temp/WithNonASCIICharacters.txt";
		/**
		 * This is the location of the output file - the content of this file
		 * will be the input file content minus the non-ASCII characters.
		 */
		String outputFileName = "C:/Temp/WithNonASCIICharactersRemoved.txt";

		try {

			/**
			 * Create a reader to read the input file
			 */
			BufferedReader in = new BufferedReader(new FileReader(fileName));
			String line = "";

			String formattedStr = "";
			int count = 0;
			/**
			 * Iterate through each line of content
			 * remove any non-ASCII characters with blank using
			 * regular expression.
			 *
			 * Append the new line character properly.
			 */
			while ((line = in.readLine()) != null) {
				if (count == 0)
					formattedStr += line.replaceAll("[^\p{ASCII}]", "");
				else
					formattedStr += "n" + line.replaceAll("[^\p{ASCII}]", "");

				count++;
			}

			/**
			 * Write the content to the output file using BufferedWriter object.
			 */
			BufferedWriter out = new BufferedWriter(new FileWriter(
					outputFileName));
			out.write(formattedStr);

			/**
			 * Once done, flush the writer and close it.
			 */
			out.flush();
			out.close();

		} catch (Exception e) {
			e.printStackTrace();
		}

	}

	/*
	 * SANJAAL CORPS MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE
	 * SUITABILITY OF THE SOFTWARE, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
	 * LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
	 * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. SANJAAL CORPS SHALL NOT BE
	 * LIABLE FOR ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING,
	 * MODIFYING OR DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
	 *
	 * THIS SOFTWARE IS NOT DESIGNED OR INTENDED FOR USE OR RESALE AS ON-LINE
	 * CONTROL EQUIPMENT IN HAZARDOUS ENVIRONMENTS REQUIRING FAIL-SAFE
	 * PERFORMANCE, SUCH AS IN THE OPERATION OF NUCLEAR FACILITIES, AIRCRAFT
	 * NAVIGATION OR COMMUNICATION SYSTEMS, AIR TRAFFIC CONTROL, DIRECT LIFE
	 * SUPPORT MACHINES, OR WEAPONS SYSTEMS, IN WHICH THE FAILURE OF THE
	 * SOFTWARE COULD LEAD DIRECTLY TO DEATH, PERSONAL INJURY, OR SEVERE
	 * PHYSICAL OR ENVIRONMENTAL DAMAGE ("HIGH RISK ACTIVITIES"). SANJAAL CORPS
	 * SPECIFICALLY DISCLAIMS ANY EXPRESS OR IMPLIED WARRANTY OF FITNESS FOR
	 * HIGH RISK ACTIVITIES.
	 */
}