Thursday, June 21, 2012

Configure Datanucleus Plugin


1. The MANIFEST.MF must have correct content in MANIFEST.MF tag
3. persistence.xml must have all persistencable classes' correct full class names.
2. For datanucleus enhancer running every time you build, right click on project name, go to properties, Maven-> Lifecycle Mapping, change the two lifecycle to process-test-classes

Friday, May 11, 2012

ZooKeeper-Coprocessor-QuickNote

1. In Coprocessor-start, a call on env.getTable will lead to connection refused error.
To solve this, using HTable constructor HTable(configuration, tableName) instead, configuration is necessary since zookeeper port number is not consistant always.
Remember to call htable.close() after operation to salve resource.

2. look for the thread using port 60010
lsof | grep 60010
Then kill the thread

Wednesday, April 25, 2012

mvn quick review

1. Get dependency source: mvn dependency:sources


2. Sometime, better remove the whole thing and install for multiple version updating 
rm -Rf ~/.m2/repository/
In Eclipse, maven build... + insall + skip tests

3. An workaround for "Internal error when enable maven dependence management", check in with svn, them import --> import existing maven project, select local projects as a whole.


4. Switch maven version :
$ cd /usr/share/java
$ ls -q1 | grep maven
 #check if your desired maven version is there
apache-maven-2.0.9
maven-2.2.0
maven-2.2.1
maven-3.0.2

$ cd .. #go up
$ ls -l | grep maven
 #check what current version is
maven -> java/maven-3.0.2$ sudo rm maven #remove unwanted symlink
Password:
$ sudo ln -s java/maven-2.2.1 maven #set it to maven 2.2.1

5. mvn update version

mvn versions:set -DnewVersion=2.50.1-SNAPSHOT
It will adjust all pom versions, parent versions and dependency versions in a multi-module project.
update child module version
mvn versions:update-child-modules
If you made a mistake, do
mvn versions:revert
afterwards, or
mvn versions:commit


Friday, January 20, 2012

OpenSuse install Chrome

1. Download Chrome frome google.com
2. At terminal: sudo zypper in ~/Downloads/[package name]

Thursday, January 19, 2012

Kubuntu Missing Virtical Scoll Bar


sudo modprobe -r psmouse
sudo modprobe psmouse proto=imps
This enables scrolling for your current session - test and make sure it works. If so, you can make it permanent by:
sudo gedit /etc/modprobe.d/options
and adding the line:
options psmouse proto=imps
Then close and reboot.

Tuesday, December 6, 2011

OSX and Mac Quick Note

Add environment variable: apply commands in bash style in ~/.profile,
ex.
ACE_ROOT=~/Documents/ACE_wrappers; export ACE_ROOT
LD_LIBRARY_PATH=$ACE_ROOT/lib; export LD_LIBRARY_PATH




Install wget in OSX


curl -O http://ftp.gnu.org/gnu/wget/wget-1.13.4.tar.gz tar -xzvf wget-1.13.4.tar.gz cd wget-1.13.4 ./configure --with-ssl=openssl make sudo make install which wget #Should output: /usr/local/bin/wget

Sunday, November 27, 2011

Eclipse Shortcuts

My Useful Shortcut

goto line start                         Command + left arrow
goto line end

select to line end                    Command +shift + right arrow

goto line                                 Command + L


delete a line                            Command + D


Edit
Content Assist                          Alt+/         In Dialogs and Windows
Context Information                   Alt+?                        In Windows
Context Information                   Shift+Alt+? In Windows
Context Information                   Shift+Ctrl+Space        In Windows
Copy                                        Alt+W       In Dialogs and Windows
Copy                                        Ctrl+C       In Dialogs and Windows
Copy                                        Ctrl+Insert In Dialogs and Windows
Copy                                        Esc W      In Dialogs and Windows
Cut                                          Ctrl+W      In Dialogs and Windows
Cut                                          Ctrl+X       In Dialogs and Windows
Cut                                          Shift+Del   In Dialogs and Windows
Delete                                      Delete                      In Windows
Find Previous                            Shift+Ctrl+K               Editing Text
Find and Replace                       Alt+R                        In Windows
Find and Replace                       Esc R                       In Windows
Incremental Find                        Ctrl+J                       Editing Text
Incremental Find                        Ctrl+S                       Editing Text
Incremental Find Reverse           Ctrl+R                      Editing Text
Incremental Find Reverse           Shift+Ctrl+J               Editing Text
Paste                                       Ctrl+Y       In Dialogs and Windows
Paste                                       Shift+Ins   In Dialogs and Windows
Quick Diff Toggle                       Shift+Ctrl+Q              Editing Text
Quick Fix                                  Ctrl+1                       In Windows
Redo                                        Ctrl+X R                   In Windows
Redo                                        F10                          In Windows
Redo                                        Shift+Ctrl++               In Windows
Restore Last Selection               Shift+Alt+Down          Editing Java Source
Select All                                  Ctrl+X H    In Dialogs and Windows
Select Enclosing Element            Shift+Alt+Up              Editing Java Source
Select Next Element                   Shift+Alt+Right           Editing Java Source
Select Previous Element             Shift+Alt+Left             Editing Java Source
Show Tooltip Description             F2                            Editing Java Source
Toggle Insert Mode                    Shift+Ctrl+Insert         Editing Text
Undo                                        Ctrl+X U                   In Windows
Undo                                        F9                            In Windows
Undo                                        Shift+Ctrl+-                In Windows

File
Close                                       Ctrl+F4                     In Windows
Close                                       Ctrl+X K                    In Windows
Close All                                   Ctrl+X Ctrl+C             In Windows
Close All                                   Shift+Ctrl+F4             In Windows
Close All                                   Shift+Ctrl+W              In Windows
New menu                                Shift+Alt+N                In Windows
Print                                         Alt+F9                      In Windows
Print                                         Esc F9                     In Windows
Properties                                 Alt+Enter                   In Windows
Refresh                                    F5                            In Windows
Rename                                   F2                            In Windows
Save                                        Ctrl+X Ctrl+S             In Windows
Save All                                    Ctrl+X S                    In Windows
Save All                                    Shift+Ctrl+S               In Windows

Navigate
Backward History                      Alt+Left                     In Windows
Forward History                         Alt+Right                   In Windows
Go to Line                                 Ctrl+L                       Editing Text
Go to Line                                 Ctrl+X G                   Editing Text
Go to Matching Bracket              Shift+Ctrl+P               Editing Java Source
Go to Next Member                   Shift+Ctrl+Down         Editing Java Source
Go to Previous Member              Shift+Ctrl+Up             Editing Java Source
Last Edit Location                      Ctrl+Q                      In Windows
Next                                        Ctrl+.                        In Windows
Open Call Hierarchy                   Ctrl+Alt+H                 In Windows
Open Declaration                       F3                            In Windows
Open External Javadoc               Shift+F2                    In Windows
Open Resource                         Shift+Ctrl+R              In Windows
Open Structure                          Ctrl+F3                     Editing Java Source
Open Type                                Shift+Ctrl+T               In Windows
Open Type Hierarchy                  F4                            In Windows
Open Type in Hierarchy              Shift+Ctrl+H              In Windows
Previous                                   Ctrl+                         In Windows
Quick Hierarchy                         Ctrl+T                       Editing Java Source
Quick Outline                            Ctrl+O                      Editing Java Source
Show In menu                           Shift+Alt+W               In Windows

Refactor - Java
Change Method Signature           Shift+Alt+C                In Windows
Convert Local Variable to Field    Shift+Alt+F                Editing Java Source
Extract Local Variable                 Shift+Alt+L In Windows
Extract Method                          Shift+Alt+M               In Windows
Inline                                        Shift+Alt+I                 In Windows
Move - Refactoring                    Shift+Alt+V                In Windows
Redo - Refactoring                     Shift+Alt+Y                In Windows
Rename - Refactoring                Shift+Alt+R                In Windows
Show Refactor Quick Menu         Shift+Alt+T In Windows
Undo - Refactoring                     Shift+Alt+Z                In Windows


Run/Debug
Debug Ant Build                         Shift+Alt+D Q            In Windows
Debug Eclipse Application           Shift+Alt+D E             In Windows
Debug JUnit Plug-in Test            Shift+Alt+D P             In Windows
Debug JUnit Test                       Shift+Alt+D T             In Windows
Debug Java Applet                     Shift+Alt+D A             In Windows
Debug Java Application              Shift+Alt+D J             In Windows
Debug Last Launched                 F11                          In Windows
Debug SWT Application              Shift+Alt+D S             In Windows
Display                                     Shift+Ctrl+D              In Dialogs&Windows
Display                                     Shift+Ctrl+V               In Dialogs&Windows
Execute                                    Ctrl+U                      In Windows
Inspect                                     Shift+Ctrl+I                In Dialogs&Windows
Resume                                   F8                            Debugging
Run Ant Build                            Shift+Alt+X Q             In Windows
Run Eclipse Application              Shift+Alt+X E             In Windows
Run JUnit Plug-in Test                Shift+Alt+X P             In Windows
Run JUnit Test                          Shift+Alt+X T             In Windows
Run Java Applet                        Shift+Alt+X A             In Windows
Run Java Application                  Shift+Alt+X J             In Windows
Run Last Launched                    Ctrl+F11                   In Windows
Run SWT Application                  Shift+Alt+X S             In Windows
Step Into                                  F5                            Debugging
Step Into Selection                     Ctrl+F5                     Debugging
Step Over                                 F6                            Debugging
Step Return                              F7                            Debugging
Toggle Line Breakpoint                Shift+Ctrl+B               In Windows
Toggle Step Filters                     Shift+F5                    In Windows

Search
Open Search Dialog                   Ctrl+H                      In Windows
References in Workspace           Shift+Ctrl+G              In Windows
Show Occurrences in File Quick Menu         Shift+Ctrl+U In Windows
Source
Add Block Comment                  Shift+Ctrl+/                Editing Java Source
Add Import                                               Shift+Ctrl+M              Editing Java Source
Add Javadoc Comment              Shift+Alt+J In Windows
Format                                     Esc Ctrl+F                Editing Java Source
Format                                     Shift+Ctrl+F               Editing Ant Buildfiles
Indent Line                                               Ctrl+I                        Editing Java Source
Open External Documentation     Shift+F2                    Editing Ant Buildfiles
Organize Imports                       Shift+Ctrl+O              In Windows
Quick Assist - Assign to field       Ctrl+2 F                    Editing Java Source
Quick Assist - Assign to local variable Ctrl+2 L              Editing Java Source
Quick Assist - Rename in file      Ctrl+2 R                    Editing Java Source
Remove Block Comment            Shift+Ctrl+\                Editing Java Source
Remove Occurrence Annotations Shift+Alt+U                Editing Java Source
Rename In File                          Shift+Alt+R                Editing Ant Buildfiles
Show Source Quick Menu           Shift+Alt+S                In Windows
Show Tooltip Description             F2                            Editing Ant Buildfiles
Toggle Ant Mark Occurrences      Shift+Alt+O                Editing Ant Buildfiles
Toggle Comment                       Ctrl+/                        Editing Java Source
Toggle Comment                       Ctrl+7                       Editing Java Source
Toggle Comment                       Esc Ctrl+C                Editing Java Source
Toggle Mark Occurrences           Shift+Alt+O                Editing Java Source

Text Editing
Clear Mark                                               Ctrl+G                      Editing Text
Collapse                                   Ctrl+Numpad_SubtractEditing Text
Copy Lines                                               Ctrl+Alt+Down           Editing Text
Cut to Beginning of Line              Alt+0 Ctrl+K               Editing Text
Cut to Beginning of Line              Esc 0 Ctrl+K              Editing Text
Cut to End of Line                      Ctrl+K                       Editing Text
Delete Next                              Ctrl+D                      Editing Text
Delete Next Word                      Alt+D                        Editing Text
Delete Next Word                      Ctrl+Delete                Editing Text
Delete Next Word                      Esc D                       Editing Text
Delete Previous Word                 Alt+Backspace           Editing Text
Delete Previous Word                 Ctrl+Backspace         Editing Text
Delete Previous Word                 Esc Backspace          Editing Text
Delete to End of Line                  Shift+Ctrl+Delete        Editing Text
Duplicate Lines                          Ctrl+Alt+Up               Editing Text
Expand                                     Ctrl+Numpad_Add      Editing Text
Expand All                                Ctrl+Numpad_Multiply Editing Text
Insert Line Above Current Line     Shift+Ctrl+Enter         Editing Text
Insert Line Below Current Line     Shift+Enter                Editing Text
Line Down                                Ctrl+N                      Editing Text
Line End                                   Ctrl+E                       Editing Text
Line Start                                  Ctrl+A                       Editing Text
Line Up                                    Ctrl+P                       Editing Text
Move Lines Down                      Alt+Down                  Editing Text
Move Lines Up                          Alt+Up                      Editing Text
Next Column                             Ctrl+F                       Editing Text
Next Word                                Alt+F                        Editing Text
Next Word                                Ctrl+Right                 Editing Text
Next Word                                Esc F                       Editing Text
Page Down                               Ctrl+V                       Editing Text
Page Up                                   Alt+V                        Editing Text
Page Up                                   Esc V                       Editing Text
Previous Column                       Ctrl+B                       Editing Text
Previous Word                           Alt+B                        Editing Text
Previous Word                           Ctrl+Left                   Editing Text
Previous Word                           Esc B                       Editing Text
Scroll Line Down                        Ctrl+Down                 Editing Text
Scroll Line Down                        Ctrl+Z                       Editing Text
Scroll Line Up                            Alt+Z                        Editing Text
Scroll Line Up                            Ctrl+Up                     Editing Text