This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abstract class AbstractDocumentGenerator{ | |
//THIS IS TEMPLATE METHOD | |
public final File generate() { | |
Document defaultDocument = prepareDocumentByDefault(); | |
Document refinedDocument = redefineDocument(defaultDocument); | |
String templatePath = getTemplatePath(); | |
String outputName = getOutputName(); | |
return DocFactory.generate(refinedDocument, templatePath, outputName); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Which the same way to solve a problem | |
//Template Method uses Inheritance | |
//Strategy uses Composition/Delegation | |
abstract class TemplateMethod{ | |
public final void execute() { | |
doFirstThing(); | |
doSecondthing(); | |
} | |
//modifier can be public, private, protected |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package vn.nvanhuong.java_lab; | |
//Inheritance from defined default methods | |
interface Foo{ | |
default void method() { | |
System.out.println("Foo"); | |
}; | |
} | |
interface Bar{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package vn.nvanhuong.coding.exercise; | |
import java.util.Scanner; | |
/** | |
* All squares (original & sub-squares) has these following characteristics: | |
* [1]. sorted entries | |
* + right entry - left entry = 1 | |
* + below entry - above entry = dimension | |
* [2]. if we know smallest entry (T), dimension (N) & orientation -> we can know the rest entries |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package vn.nvanhuong.hellojava.java8inaction; | |
import java.util.stream.IntStream; | |
public class MyMathUtils { | |
public static void main(String[] args) { | |
primes(numbers()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>vn.nvanhuong</groupId> | |
<artifactId>pipelines-axonivy</artifactId> | |
<version>1.0.0-SNAPSHOT</version> | |
<packaging>iar</packaging> | |
<properties> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a sample build configuration for Java (Maven). | |
# Check our guides at https://confluence.atlassian.com/x/zd-5Mw for more examples. | |
# Only use spaces to indent your .yml configuration. | |
# ----- | |
# You can specify a custom docker image from Docker Hub as your build environment. | |
image: vnnvanhuong/axonivy-engine:7.0.1 | |
pipelines: | |
default: | |
- step: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM vnnvanhuong/maven-oracle-jdk:8 | |
MAINTAINER Huong Nguyen vnnvanhuong@gmail.com | |
# Install wget, unzip | |
RUN apt-get update && \ | |
apt-get install -y --no-install-recommends \ | |
wget \ | |
unzip | |
# Download and extract Axon.ivy Engine |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DDP Server | |
// Use an implementation of WebSocket Server such as SockJS | |
ddpServer.socket = WebSocketServer | |
ddpServer.socket.onData = (msg) => { | |
switch(msg): | |
case 'connect': | |
check whether WebSocket connection | |
socket.send({msg: 'connected', ...}) | |
case 'method': | |
result = methodsMap.get(msg.methodID).invoke() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Install Oracle Java 8 | |
FROM ubuntu:16.04 | |
MAINTAINER Huong Nguyen vnnvanhuong@gmail.com | |
# Update the package repository | |
RUN echo "deb http://archive.ubuntu.com/ubuntu xenial main universe" > /etc/apt/sources.list | |
RUN apt-get -y update | |
# Install python-software-properties | |
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q python-software-properties software-properties-common |
OlderNewer