Month: April 2013

[QA] How to get clipboard strings in JAVA SWT

Clipboard clipboard = new Clipboard(Display.getDefault());
// copy to clipboard
clipboard.setContents(new String[]{"My Text in Clipboard"}, new Transfer[]{TextTransfer.getInstance()});
// paste from clipboard
String text = clipboard.getContents(TextTransfer.getInstance());
Tags : , ,

[QA] How to use regular expression to find year, month and day of date

String aDate = "date: 04-16-2013";
Pattern datePattern = Pattern.compile("date: (\\d{2})-(\\d{2})-(\\d{4})");
Matcher dateMatcher = datePattern.matcher(aDate);
if (dateMatcher.find()) {
   System.out.println("Month is: " + dateMatcher.group(1));
   System.out.println("Day is: " + dateMatcher.group(2));
   System.out.println("Year is: " + dateMatcher.group(3));
}
Tags : ,

[QA] WordPress permalinks 404 Not Found, but .htaccess is ready

be sure to modify /etc/apache2/sites/xxxxxxxx.conf

AllowOverride None -> AllowOverride ALL

restart apache server after file saved

Tags :