Skip to content

Commit 5648013

Browse files
committed
Merge branch 'master' of https://github.com/eugenp/tutorials
# Conflicts: # java-strings/pom.xml
2 parents 955c23f + ef75f0c commit 5648013

File tree

3,387 files changed

+111833
-13795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,387 files changed

+111833
-13795
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,7 @@ jmeter/src/main/resources/*-JMeter.csv
6262
**/dist
6363
**/tmp
6464
**/out-tsc
65+
**/nbproject/
66+
**/nb-configuration.xml
67+
core-scala/.cache-main
68+
core-scala/.cache-tests

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ before_install:
44
- echo "MAVEN_OPTS='-Xmx2048M -Xss128M -XX:+CMSClassUnloadingEnabled -XX:+UseG1GC -XX:-UseGCOverheadLimit'" > ~/.mavenrc
55

66
install: skip
7-
script: travis_wait 60 mvn -q install -Pdefault
7+
script: travis_wait 60 mvn -q install -Pdefault-first,default-second -Dgib.enabled=true
88

99
sudo: required
1010

README.md

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,41 +2,37 @@
22
The "REST with Spring" Classes
33
==============================
44

5-
Here's the Master Class of REST With Spring (price changes permanently next Friday): <br/>
6-
**[>> THE REST WITH SPRING MASTER CLASS](http://www.baeldung.com/rest-with-spring-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=rws#master-class)**
5+
Here's the Master Class of REST With Spring (along with the newly announced Boot 2 material): <br/>
6+
**[>> THE REST WITH SPRING - MASTER CLASS](http://www.baeldung.com/rest-with-spring-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=rws#master-class)**
77

88
And here's the Master Class of Learn Spring Security: <br/>
9-
**[>> LEARN SPRING SECURITY MASTER CLASS](http://www.baeldung.com/learn-spring-security-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=lss#master-class)**
9+
**[>> LEARN SPRING SECURITY - MASTER CLASS](http://www.baeldung.com/learn-spring-security-course?utm_source=github&utm_medium=social&utm_content=tutorials&utm_campaign=lss#master-class)**
1010

1111

1212

13-
Spring Tutorials
13+
Java and Spring Tutorials
1414
================
1515

16-
This project is **a collection of small and focused tutorials** each covering a single and well defined area of development.
17-
Most of the tutorial projects are focused on the `Spring Framework` (and `Spring Security`).
16+
This project is **a collection of small and focused tutorials** - each covering a single and well defined area of development in the Java ecosystem.
17+
A strong focus of these is, of course, the Spring Framework - Spring, Spring Boot and Spring Securiyt.
1818
In additional to Spring, the following technologies are in focus: `core Java`, `Jackson`, `HttpClient`, `Guava`.
1919

20+
2021
Building the project
2122
====================
2223
To do the full build, do: `mvn install -Pdefault -Dgib.enabled=false`
2324

2425

25-
Working with the code in Eclipse
26-
================================
27-
Any IDE can be used to work with the projects, but if you're using Eclipse, consider the following.
26+
Building a single module
27+
====================
28+
To build a specific module run the command: `mvn clean install -Dgib.enabled=false` in the module directory
29+
30+
31+
Running a Spring Boot module
32+
====================
33+
To run a Spring Boot module run the command: `mvn spring-boot:run -Dgib.enabled=false` in the module directory
2834

29-
- import the included **formatter** in Eclipse:
30-
`https://github.com/eugenp/tutorials/tree/master/eclipse`
3135

3236

33-
CI - Jenkins
34-
================================
35-
This tutorials project is being built **[>> HERE](https://rest-security.ci.cloudbees.com/job/tutorials-unit/)**
3637

37-
### Relevant Articles:
38-
================================
3938

40-
- [Apache Maven Standard Directory Layout](http://www.baeldung.com/maven-directory-structure)
41-
- [Apache Maven Tutorial](http://www.baeldung.com/maven)
42-
- [Designing a User Friendly Java Library](http://www.baeldung.com/design-a-user-friendly-java-library)

activejdbc/pom.xml

Lines changed: 0 additions & 90 deletions
This file was deleted.

algorithms-genetic/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target/
2+
.settings/
3+
.classpath
4+
.project

algorithms-genetic/README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
## Relevant articles:
2+
3+
- [Introduction to Jenetics Library](http://www.baeldung.com/jenetics)
4+
- [Ant Colony Optimization](http://www.baeldung.com/java-ant-colony-optimization)
5+
- [Design a Genetic Algorithm in Java](https://www.baeldung.com/java-genetic-algorithm)
6+
- [The Traveling Salesman Problem in Java](https://www.baeldung.com/java-simulated-annealing-for-traveling-salesman)

algorithms-genetic/pom.xml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<artifactId>algorithms-genetic</artifactId>
5+
<version>0.0.1-SNAPSHOT</version>
6+
<name>algorithms-genetic</name>
7+
8+
<parent>
9+
<groupId>com.baeldung</groupId>
10+
<artifactId>parent-modules</artifactId>
11+
<version>1.0.0-SNAPSHOT</version>
12+
</parent>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>org.apache.commons</groupId>
17+
<artifactId>commons-math3</artifactId>
18+
<version>${commons-math3.version}</version>
19+
</dependency>
20+
<dependency>
21+
<groupId>commons-codec</groupId>
22+
<artifactId>commons-codec</artifactId>
23+
<version>${commons-codec.version}</version>
24+
</dependency>
25+
<dependency>
26+
<groupId>org.projectlombok</groupId>
27+
<artifactId>lombok</artifactId>
28+
<version>${lombok.version}</version>
29+
<scope>provided</scope>
30+
</dependency>
31+
<dependency>
32+
<groupId>io.jenetics</groupId>
33+
<artifactId>jenetics</artifactId>
34+
<version>${io.jenetics.version}</version>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.assertj</groupId>
38+
<artifactId>assertj-core</artifactId>
39+
<version>${org.assertj.core.version}</version>
40+
<scope>test</scope>
41+
</dependency>
42+
</dependencies>
43+
44+
<build>
45+
<pluginManagement>
46+
<plugins>
47+
<plugin>
48+
<groupId>org.codehaus.mojo</groupId>
49+
<artifactId>exec-maven-plugin</artifactId>
50+
<version>${exec-maven-plugin.version}</version>
51+
</plugin>
52+
</plugins>
53+
</pluginManagement>
54+
</build>
55+
56+
<properties>
57+
<lombok.version>1.16.12</lombok.version>
58+
<commons-math3.version>3.6.1</commons-math3.version>
59+
<io.jenetics.version>3.7.0</io.jenetics.version>
60+
<org.assertj.core.version>3.9.0</org.assertj.core.version>
61+
<commons-codec.version>1.11</commons-codec.version>
62+
</properties>
63+
64+
65+
</project>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package com.baeldung.algorithms;
2+
3+
import java.util.Scanner;
4+
5+
import com.baeldung.algorithms.ga.annealing.SimulatedAnnealing;
6+
import com.baeldung.algorithms.ga.ant_colony.AntColonyOptimization;
7+
import com.baeldung.algorithms.ga.binary.SimpleGeneticAlgorithm;
8+
9+
public class RunAlgorithm {
10+
11+
public static void main(String[] args) throws InstantiationException, IllegalAccessException {
12+
Scanner in = new Scanner(System.in);
13+
System.out.println("Run algorithm:");
14+
System.out.println("1 - Simulated Annealing");
15+
System.out.println("2 - Simple Genetic Algorithm");
16+
System.out.println("3 - Ant Colony");
17+
int decision = in.nextInt();
18+
switch (decision) {
19+
case 1:
20+
System.out.println(
21+
"Optimized distance for travel: " + SimulatedAnnealing.simulateAnnealing(10, 10000, 0.9995));
22+
break;
23+
case 2:
24+
SimpleGeneticAlgorithm ga = new SimpleGeneticAlgorithm();
25+
ga.runAlgorithm(50, "1011000100000100010000100000100111001000000100000100000000001111");
26+
break;
27+
case 3:
28+
AntColonyOptimization antColony = new AntColonyOptimization(21);
29+
antColony.startAntOptimization();
30+
break;
31+
default:
32+
System.out.println("Unknown option");
33+
break;
34+
}
35+
in.close();
36+
}
37+
38+
}

algorithms-miscellaneous-1/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/target/
2+
.settings/
3+
.classpath
4+
.project

algorithms-miscellaneous-1/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Relevant articles:
2+
3+
- [Validating Input With Finite Automata in Java](http://www.baeldung.com/java-finite-automata)
4+
- [Example of Hill Climbing Algorithm](http://www.baeldung.com/java-hill-climbing-algorithm)
5+
- [Monte Carlo Tree Search for Tic-Tac-Toe Game](http://www.baeldung.com/java-monte-carlo-tree-search)
6+
- [Binary Search Algorithm in Java](http://www.baeldung.com/java-binary-search)
7+
- [Introduction to Minimax Algorithm](http://www.baeldung.com/java-minimax-algorithm)
8+
- [How to Calculate Levenshtein Distance in Java?](http://www.baeldung.com/java-levenshtein-distance)
9+
- [How to Find the Kth Largest Element in Java](http://www.baeldung.com/java-kth-largest-element)
10+
- [Multi-Swarm Optimization Algorithm in Java](http://www.baeldung.com/java-multi-swarm-algorithm)
11+
- [String Search Algorithms for Large Texts](http://www.baeldung.com/java-full-text-search-algorithms)
12+
- [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters)
13+
- [Find the Middle Element of a Linked List](http://www.baeldung.com/java-linked-list-middle-element)

algorithms-miscellaneous-1/pom.xml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
2+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
3+
<modelVersion>4.0.0</modelVersion>
4+
<artifactId>algorithms-miscellaneous-1</artifactId>
5+
<version>0.0.1-SNAPSHOT</version>
6+
<name>algorithms-miscellaneous-1</name>
7+
8+
<parent>
9+
<groupId>com.baeldung</groupId>
10+
<artifactId>parent-modules</artifactId>
11+
<version>1.0.0-SNAPSHOT</version>
12+
</parent>
13+
14+
<dependencies>
15+
<dependency>
16+
<groupId>org.apache.commons</groupId>
17+
<artifactId>commons-math3</artifactId>
18+
<version>${commons-math3.version}</version>
19+
</dependency>
20+
<dependency>
21+
<groupId>com.google.guava</groupId>
22+
<artifactId>guava</artifactId>
23+
<version>${guava.version}</version>
24+
</dependency>
25+
<dependency>
26+
<groupId>commons-codec</groupId>
27+
<artifactId>commons-codec</artifactId>
28+
<version>${commons-codec.version}</version>
29+
</dependency>
30+
<dependency>
31+
<groupId>org.projectlombok</groupId>
32+
<artifactId>lombok</artifactId>
33+
<version>${lombok.version}</version>
34+
<scope>provided</scope>
35+
</dependency>
36+
<dependency>
37+
<groupId>org.assertj</groupId>
38+
<artifactId>assertj-core</artifactId>
39+
<version>${org.assertj.core.version}</version>
40+
<scope>test</scope>
41+
</dependency>
42+
</dependencies>
43+
44+
<build>
45+
<pluginManagement>
46+
<plugins>
47+
<plugin>
48+
<groupId>org.codehaus.mojo</groupId>
49+
<artifactId>exec-maven-plugin</artifactId>
50+
<version>${exec-maven-plugin.version}</version>
51+
</plugin>
52+
</plugins>
53+
</pluginManagement>
54+
</build>
55+
56+
<reporting>
57+
<plugins>
58+
<plugin>
59+
<groupId>org.codehaus.mojo</groupId>
60+
<artifactId>cobertura-maven-plugin</artifactId>
61+
<version>2.7</version>
62+
<configuration>
63+
<instrumentation>
64+
<ignores>
65+
<ignore>com/baeldung/algorithms/dijkstra/*</ignore>
66+
</ignores>
67+
<excludes>
68+
<exclude>com/baeldung/algorithms/dijkstra/*</exclude>
69+
</excludes>
70+
</instrumentation>
71+
</configuration>
72+
</plugin>
73+
</plugins>
74+
</reporting>
75+
76+
<properties>
77+
<lombok.version>1.16.12</lombok.version>
78+
<commons-math3.version>3.6.1</commons-math3.version>
79+
<org.assertj.core.version>3.9.0</org.assertj.core.version>
80+
<commons-codec.version>1.11</commons-codec.version>
81+
<guava.version>25.1-jre</guava.version>
82+
</properties>
83+
84+
</project>

0 commit comments

Comments
 (0)