Skip to content

Instantly share code, notes, and snippets.

View chingovan's full-sized avatar

Ngô Văn Chí chingovan

View GitHub Profile
<%@page import="com.blogspot.chingovan.database.service.StudentLocalServiceUtil"%>
<%@page import="com.blogspot.chingovan.database.model.Student"%>
<%@ include file="./init.jsp" %>
<%
final DateFormat DD_MM_YYYYY = new SimpleDateFormat("dd/MM/yyyy");
final String DATE_EMPTY_FORMAT = "--/--/----";
final String FEMALE = LanguageUtil.get(request, "database-portlet.student-list.gender.female");
final String MALE = LanguageUtil.get(request, "database-portlet.student-list.gender.male");
List<Student> students = StudentLocalServiceUtil.getStudents(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
package com.blogspot.chingovan.firstreport;
import java.io.FileNotFoundException;
import java.util.HashMap;
import net.sf.jasperreports.engine.JRException;
import net.sf.jasperreports.engine.JasperCompileManager;
import net.sf.jasperreports.engine.JasperExportManager;
import net.sf.jasperreports.engine.JasperFillManager;
import net.sf.jasperreports.engine.JasperPrint;
package com.chingovan.liferay7.test.portlet;
import com.liferay.portal.kernel.portlet.bridges.mvc.MVCPortlet;
import javax.portlet.Portlet;
import org.osgi.service.component.annotations.Component;
/**
* @author ChiNV
jdbc.default.driverClassName=org.postgresql.Driver
jdbc.default.url=jdbc:postgresql://localhost:5432/lportal7
jdbc.default.username=postgres
jdbc.default.password=123456
jdbc.default.maxPoolSize=100
jdbc.default.minPoolSize=10
jdbc.default.numHelperThreads=10
public class Point {
private int x;
public Point() {
}
public int getX() {
return x;
}
public class ThreeRef {
public static void main(String[] argv) {
Point a = new Point();
a.setX(10);
Point b = a;
Point c = b;
System.out.println("a: " + a.getX() + ", b: " + b.getX() + ", c: " + c.getX());
b.setX(100);
System.out.println("a: " + a.getX() + ", b: " + b.getX() + ", c: " + c.getX());
//SwapInt
public static void swap(int a, int b) {
int temp = a;
a = b;
b = temp;
}
//SwapPoint
public static void swap(Point a, Point b) {
public class SwapPointRef {
public static void swap(Point a, Point b) {
int temp = a.getX();
a.setX(b.getX());
b.setX(temp);
}
public static void main(String[] argv) {
/**
* Created by ChiNV on 3/2/2017.
*/
public class SwapPoint {
public static void swap(Point a, Point b) {
Point temp = a;
a = b;
b = temp;
public class SwapInt {
public static void swap(int a, int b) {
int temp = a;
a = b;
b = temp;
}
public static void main(String[] argv) {
int c = 1;