Friday, February 24, 2017

angularjs - access value of ng-model in a controller

To access the value of ng-model in a controller, you have to have a dot in there.
With a format like object.property you'll be good to go.

In my case "add.device.storage" does not work. And  "addDevice.storage" is good.

In view(.html):

<input type="text" id="input-id-dd-password" ng-model="addDevice.password"
    placeholder="type here">

In controller(.js): access it with $scope.addDevice.password

Thursday, February 16, 2017

java cmd cheatsheet

1. List files in a jar package:
 $ jar tvf my.jar

2. Extract files out of a jar package:
 $ jar xvf my.jar

3. Package current directory with Manifest file:
 $ jar cvfm my.jar META-INF/MANIFEST.MF ./

 4. javap is like nm in *NIX

5. jps like ps in *NIX
    jps -lvm

6. Print flags of a JVM process
    jinfo -flags

7. jconsole, other than jps/jinfo commands you can use jconsole to monitor a JVM process. It provides lots of information you need to tune your process.

8. jvisualvm, similar as jconsole

9. jstack, print process stack information

Wednesday, February 15, 2017

Adding getter/setter for Java class members

"Source" -> "Generate Getters and Setters".