Program Development (程序开发)

A programmer’s day-to-day life is generally spent reading code, fixing errors, and writing new pieces of code. Programming is a highly mentally demanding job as it requires constant problem-solving. In addition to these tasks, there are also meetings with other programmers and stakeholders in the project.

Coding - Java Language

Java Language Programming Private methods are final since we cannot override private methods. When a function is static, runtime polymorphism doesn’t happen. The answer for the code below is: Base::show() called class Base { public static void show() { System.out.println("Base::show() called"); } } class Derived extends Base...

Read more

Coding - Java 8 Features

Java 8 Features Java Interface Changes Allow to add default and static methods in Interface. One of the major reason for introducing default methods in interfaces is to enhance the Collections API in Java 8 to support lambda expressions. Liked forEach method: default void forEach(Consumer<? super T> action) { Objects.requireNonN...

Read more

Coding - Java Project

Java Application Memory Leak How to Detect Java Memory Leaks? Use Eclipse memory leak warnings. or plugin Memory Analyzer. Java Visual VM or jconsole, connect with JMX, provides memory and CPU profiling, heap dump analysis, memory leak detection, access to MBeans, and garbage collection. Java Profilers, help you monitor different JVM p...

Read more

Coding - Java Web Application

Anti Cross-Site Scripting (XSS) Here is a good and simple anti cross-site scripting (XSS) filter written for Java web applications. What it basically does is remove all suspicious strings from request parameters before returning them to the application. You should configure it as the first filter in your chain (web.xml) and it’s generally a go...

Read more

Coding - Scala Language

Scala Tutorial Scala is a general-purpose programming language providing support for functional programming and a strong static type system. Designed to be concise, many of Scala’s designs aimed to address the criticisms of Java. Scala is static type system (do type checking at compile-time), and also offer some form of type inference, the ...

Read more

Coding - Operation Systems

Linux/Unix Copy file to another server scp prime.war lchen@ny-sample-002:/home/lchen Grep log with regular expression from the zip file: zgrep –color ‘CCVI[0-9]{12}’ /logs/pl_timings.17-11-01_21.log.gz Check if a domain name accessible from DNS dig +noall +answer 1799 IN C...

Read more