Wednesday, June 27, 2012

File for windows 7 default regional theme

Here's various location for windows theme

Here's file for regional theme

Thursday, June 21, 2012

Install windows 7 on macbook pro and how to get the required drivers

如何在Mac Book Pro 下安装Windows 7 和所需的驱动程序

2 days ago a friend of mine has bought a 13 inches Mac Book Pro.
How to install Windows 7 on Mac OS with Bootcamp 

How to obtain and install the drivers?

After installing the Windows 7, we found  it is difficult to get the required hardware driver for apple, as there is no drivers CD comes with Mac Book Pro. After calling the technical consultant, we found out, those drivers could be easily gotten from the Bootcamp  Utility preinstalled with Mac OS X.

Hold down the Option key during the starting of machine, you will be able to boot into Mac OS X. Open the Bootcamp Utility, you will discover there is an option to "Download the Latest Windows Support Software from Apple". Select that option, put a USB drive in, it will download all the necessary drivers to the USB drivers.

Then Boot to windows again, open USB drive, click "setup" in USB drive, and voila, All the required drivers will be installed!

Complete information could be found here

Tuesday, June 19, 2012

Antlr opened remote debugger instead of local debugger

When running the Debug for Antlr, you see this following output message in Debugger Tab/Output Message

I looked around and found this:
java.lang.UnsupportedClassVersionError: __Test__ : Unsupported major.minor version 51.0
               at java.lang.ClassLoader.defineClass1(Native Method)
               at java.lang.ClassLoader.defineClassCond(Unknown Source)
               at java.lang.ClassLoader.defineClass(Unknown Source)
               at Source)
               at Source)
               at$000(Unknown Source)
               at$ Source)
               at Method)
               at Source)
               at java.lang.ClassLoader.loadClass(Unknown Source)
               at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
               at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: __Test__.  Program will exit.
Exception in thread "main" 

And it opened Remote Debugger instead of using local Debugger

The problem that this occurred for me is due to several version of Java is installed in my machine.
e.g. java 1.6(x86) and java1.7(x64) i am using 64 bits machine.
I delete all the java version I have, and installed again java1.7, i works.

Originally in Help>About>Information tab, it shows java 1.6.
After unstalling and reinstall, it shows the correct version java 1.7.

Regular Expression

A good tool for leaning regular expression

    Self Summary
  1. Intro
  2. Word Boundary- \bA\w*\b match a word that starts with 'A'.
  3. \b denotes the word boundary(start and end of word). \b has zero length.
  4. Input Boundary - ^w*$ match a word if it is the only word. ^ and $ matched beginning and end of an input. Both have zero length.
  5. Repeat - \d{3} digit repeat for 3 times, \d{3,5} 3 to 5 times, \d{3,} at least 3 times
  6. Whitespace - \s any whitespace character
  7. Escape - escapes character \ for character ^  .  \   (   ) uses \^   \.  \\  \(  \) instead
  8. One of it - [abcde] any one character in the bracket
  9. none of it - [^abcde] no character in the bracket
  10. Greedy and lazy
  11. a.*b The longest string starting with a and ending with b
    a.*?b The shortest string starting with a and ending with b
  12. [.]* means ….
  13. but (.)* 12345

    Positive Matched
    Match any alphanumeric character
    Match any character except newline
    Match any whitespace character
    Match any digit
    Match the beginning or end of a word
    Match the beginning of the string
    Match the end of the s

    Negative Matched
    Match any character that is NOT alphanumeric
    Match any character that is NOT whitespace
    Match any character that is NOT a digit
    Match a position that is NOT the beginning or end of a word
    Match any character that is NOT x
    Match any character that is NOT one of the characters aeiou

    Repeat any number of times
    Repeat one or more times
    Repeat zero or one time
    Repeat n times
    Repeat at least n, but no more than m times
    Repeat at least n times

    Greedy and lazy
    Repeat any number of times, but as few as possible
    Repeat one or more times, but as few as possible
    Repeat zero or one time, but as few as possible
    Repeat at least n, but no more than m times, but as few as possible
    Repeat at least n times, but as few as possible

    Match exp and capture it in an automatically numbered group
    Match exp and capture it in a group named name
    Match exp, but do not capture it
    Match any position before a suffix exp (ing below)(not including exp)
    Say \b\w+(?=ing\b) it matches any words ending with ing
    working abcing -> working abcing
    (purple is the matching one)

    Match any position after prefix exp (re below)(including exp)
    Say (?<=\bre)\w+\b it matches any words starts with re
    reduction -> reduction
    (purple is the matching one)

    Match any position after which the suffix exp (123 below)  is not found

    work123->work1234 (no match)

    work123 ->work1234

    Reason is for work1, it goes to
    work1|23, where it is follows by 23 instead of 123

    Match any position before which the prefix exp is not found

    123work->123work (no match)

    123work->123work (no match)

    Reason is for 3work, it goes to
    12|3work, where it is prefix by 12 instead of 123


    Special Character

    opening square bracket [\[
    the backslash \\\
    the caret ^\^
    the dollar sign $, \$
    the period or dot .\.
    the vertical bar or pipe symbol |, \|
     the question mark ?, \?
     the asterisk or star *\*
    the plus sign +\+
    the opening round bracket ( and \(
    the closing round bracket ). \)

  14. About Replacement
  15. (?<named>pattern) denote a grouping with a name named
    (pattern) denote a grouping with No Name(refer by number)

    Named example
    strInput = Regex.Replace(strInput,"(?<first>abc)","def${first})
    Replace "abc" becomes "defabc"

    UnNamed Example
    strInput = Regex.Replace(strInput,"(abc)","def$(1))
    Replace "abc" becomes "defabc"

    Summary of symbol
    matched text
    original source string
    text before match
    text after match
    text matched by named group
    $1, $2   
    text matched by numbered group
    the literal "$"

    Another example

    sResult = Regex.Replace("The price is 31.95","\d+\.\d{2}","$$$&")
    It Put $ in front of monetary values

  16. About Lookaround
  17. The advantage for lookaround is not including the word that matched.

  18.  Misc
  19. Match {…} where … not containing word hede

Monday, June 11, 2012

Add UltraEdit to Right-click Context Menu

Open UltraEdit, Click Menu Advanced->Configuration->File Associations -> Check Intergrate with Explorer as check box

Wednesday, May 30, 2012

Configure Line Wrap for Ultraedit


Advanced>configuration>Editor>Word Wrap/Tab Settings
Select "change list" to change the extension

Then Checked
1)"Wrap after column #, insert CR/LF"
2)"Automatically insert CR/LF when file is opened"
Wrap Column #

Make sure the "edit> toggle work wrap" is selected

You can also choose "View>set column marker" to visually create the marker

Saturday, May 12, 2012

Viewing a PDF book on Iphone

Sometimes I feel that viewing a pdf file is too big for a IPhone, and difficult to view.

And I discover this posts
, which could convert a pdf file to an ebook which can be view on IPhone,

Have tried it, this is indeed great. It converts the PDF books into epubs format.

Btw, I use to use the IBook device to store the pdf books that I phave.

Wednesday, May 9, 2012

How to forget the network services

Once you provide your credential for network services (like network printer), you seem to not able to let the network services forgetting your password, even by deleting the services and add it again, your password seems to be remembered, this makes difficult if you wish to login the network services with another user account. Below provide a way to "logout" from the network services.

Go to Start Menu –> Run –> control userpasswords2 and press Enter.

User Accounts Dialog Box will appear, Go to Advance Tab and Click on the Manage Password Button. In Stored User Names and Password press  the Remove Button and Remove all users information that you want to delete.

In Windows 7, select Remove from Vault

 In windows XP, select Remove