Posts

Java Data Structure

Array dataType [ ] arrayRefVar ; List List和数组类似,可以动态增长,根据实际存储的数据的长度自动增长List的长度。查找元素效率高,插入删除效率低,因为会引起其他元素位置改变  <实现类有ArrayList,LinkedList,Vector>  。 ArrayList 该类也是实现了List的接口,实现了可变大小的数组,随机访问和遍历元素时,提供更好的性能。该类也是非同步的,在多线程的情况下不要使用。ArrayList 增长当前长度的50%,插入删除效率低。 Vector  该类和ArrayList非常相似,但是该类是同步的,可以用在多线程的情况,该类允许设置默认的增长长度,默认扩容方式为原来的2倍。 Arrays 能方便地操作数组,它提供的所有方法都是静态的。 Final fix size https://www.youtube.com/watch?v=V1qNQb01lSU 具有以下功能: 给数组赋值:通过 fill 方法。 对数组排序:通过 sort 方法,按升序。 比较数组:通过 equals 方法比较数组中元素值是否相等。 查找数组元素:通过 binarySearch 方法能对排序好的数组进行二分查找法操作。 String vs StringBfer 和 StringBuilder  和 String 类不同的是,StringBuffer 和 StringBuilder 类的对象能够被多次的修改,并且不产生新的未使用对象。 StringBuilder 类在 Java 5 中被提出,它和 StringBuffer 之间的最大不同在于 StringBuilder 的方法不是线程安全的(不能同步访问)。 由于 StringBuilder 相较于 StringBuffer 有速度优势,所以多数情况下建议使用 StringBuilder 类。然而在应用程序要求线程安全的情况下,则必须使用 StringBuffer 类 This is a block for code: StringBuffer sBuffer = new StringBuffer("original str:"); ...

Mockito

ways to mock injectMock spy doNothing,doAnswer Mockito cannot instantiate inner classes, local classes, abstract classes and of course interfaces.   Beware of private nest static classes too The same stands for setters or fields, they can be declared with private visibility, Mockito will see them through reflection. However, fields that are static or final will be ignored. https://static.javadoc.io/org.mockito/mockito-core/2.23.0/org/mockito/InjectMocks.html It has been two months in Telstra, with this lovely team, and its my honor to be a member and observe the massive achievements of TPN and AWS projects. I see how we demonstrate  our value by behavior,  our customer success is our success, and  strive for excellence.  today is the last day in Telstra, I wish you  all the best for your future endeavors . I am looking forward to have more opportunities to work together and achieve anotehr success.

Interactive presentation design tools

Prezi: https://prezi.com/ Prezi free templates: https://prezibase.com/free-prezi-templates/ Key points: content, view, path Videoscribe: https://www.videoscribe.co/en/?utm_expid=.EqJRK-K6RkupPDwqPxtceA.0&utm_referrer=https%3A%2F%2Fwww.google.com.au%2F Tutorial https://www.youtube.com/watch?v=QP_Q9_YZWHU&t=445s Key point:Content, Annimation, Music and timing.

How to update password in SourceTree

Go to: C:\Users\Username\AppData\Local\Atlassian\SourceTree And delete the passwd file under this folder

Before push ur code

Working in a team, we don't want to get troubles for our teammates. As a developer, it is possible to break the whole environment for personal mistakes, which you don't want to see. Things before push your code. 1. Run it locally to make sure it can run successfully. 2. Format the code and optimize the package. 3. Check other dependent Projects

Git - comflict solving

Some common usage of git with SourceTree -> pull to local pull to local  - if no conflict -> pull successfully  - if has conflict     option 1. commit to local repo -> stash changes  -> pull    option 2. prof read  -> push to remote If already commit, but don't want to push the code to the remote. :) Simple delete ur local repo, and clone again.

Work note

Created on 3rd Oct 2018 Some notes: JDK setting in IntelliJ  - menu project structure-> project -> modules Maven  setting.xml    profile    username & password -clean: clean all files generated by mvn -compile: compile -test: run test -package: compile and generate executed file (e.g.war/ .jar) -install: install to the local machine -deploy: deploy to remote server Sourcetree  checkout branch In sourcetree, we can see both local and remote repositories. After clone the repo to local, there is only one branch in local, that is master. If you want to checkout to another branch. Go to the remote and right click the branch you want to switch to.  Select Checkout new branch. Then the new branch will be created locally.  git stash Swagger in body? in path time stamp: number Springboot injection annotation @autowired --- 12th Oct Jenkins pipeline Sonar (code report) Jacoco plugin: code cov...