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
result = []; | |
function load(url, level) | |
{ | |
console.log("level: "+level+","+url); | |
$.get(url, function(data, status){ | |
var x; | |
if($(data).length>2) | |
{ | |
x=$($(data)[2]); |
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
public static void main(String[] args) { | |
try { | |
TransportClient client = new PreBuiltTransportClient(Settings.EMPTY) | |
.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9300)); | |
String jsonObject = "{\"age\":14,\"dateOfBirth\":1471466076564," | |
+"\"fullName\":\"John Doe\"}"; | |
IndexResponse response = client.prepareIndex("people", "Doe") | |
.setSource(jsonObject, XContentType.JSON).get(); |
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 Docker & Docker Compose - Centos 7 | |
Step 1 — Install Docker | |
Install needed packages: | |
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2 | |
Configure the docker-ce repo: | |
$ sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | |
Install docker-ce: |
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 mhart/alpine-node | |
RUN yarn global add serve | |
WORKDIR /app | |
COPY build . | |
CMD ["serve", "-p", "80", "-s", "."] |
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
# Ignore everything | |
** | |
# Allow files and directories | |
!build/** |
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 com.ldt.test; | |
import java.util.ArrayList; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.Map; | |
public class TestMain2 { | |
public static void main(String[] args) { | |
int[][] datas = new int[][]{ |
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
1. JPA Java Persistence API provides a specification for persisting, reading and managing data from your java object to relational tables in database | |
2. Hibernate is an object ralational mapping solution for java enviroments. ORM is a programming technique to map application domain model objects to relational database tables; | |
Hibernate provides a reference implementation of Java Persistence API that make it a greate choice as ORM tools with benefit of loose coupling. | |
Note that JPA is a specification and Hibernate is a JPA provider of implementation. | |
3. Spring Data is a part of the Spring Framework. The goal of Spring Data repository abstraction is reduce amount of | |
boilerplate code requited to implement data access layer. |
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
1. jpa-entity-class | |
- @javax.persistance.Entity | |
- public, protected no-argument contructor | |
- class not declare final, no method, persistence instance variables is final. | |
- if an entity is passed by value as detached object. such as through a session bean remote. class must by implementaion Serialization | |
- Entity may extends both entity and non-entity class. | |
- fields: not annotated | |
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
version: '3' | |
services: | |
kong-migrations: | |
image: "${KONG_DOCKER_TAG:-kong:latest}" | |
command: kong migrations bootstrap | |
environment: | |
KONG_DATABASE: postgres | |
KONG_PG_DATABASE: ${KONG_PG_DATABASE:-kong} | |
KONG_PG_HOST: 10.148.0.27 | |
KONG_PG_PASSWORD: ${KONG_PG_PASSWORD:-kong} |
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
SessionFactory | |
Session | |
Transaction | |
ConnectionProvider | |
Transaction Factory |
OlderNewer