Skip to content

Commit 8300da6

Browse files
authored
Merge branch 'master' into thombergs-patch-30
2 parents 9280b9e + bfe0ded commit 8300da6

544 files changed

Lines changed: 11198 additions & 2669 deletions

File tree

Some content is hidden

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

Twitter4J/pom.xml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4-
5-
<groupId>com.mabsisa</groupId>
64
<artifactId>Twitter4J</artifactId>
75
<packaging>jar</packaging>
8-
<version>1.0-SNAPSHOT</version>
96
<name>Twitter4J</name>
10-
<url>http://maven.apache.org</url>
117

128
<parent>
139
<groupId>com.baeldung</groupId>
@@ -23,27 +19,6 @@
2319
</dependency>
2420
</dependencies>
2521

26-
<build>
27-
<finalName>${project.artifactId}</finalName>
28-
<resources>
29-
<resource>
30-
<directory>src/main/resources</directory>
31-
</resource>
32-
</resources>
33-
<plugins>
34-
<plugin>
35-
<groupId>org.apache.maven.plugins</groupId>
36-
<artifactId>maven-surefire-plugin</artifactId>
37-
<version>${maven-surefire-plugin.version}</version>
38-
<configuration>
39-
<excludes>
40-
<exclude>**/ApplicationTest.java</exclude>
41-
</excludes>
42-
</configuration>
43-
</plugin>
44-
</plugins>
45-
</build>
46-
4722
<properties>
4823
<twitter4j-stream.version>4.0.6</twitter4j-stream.version>
4924
</properties>

activejdbc/pom.xml

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
33
<modelVersion>4.0.0</modelVersion>
4-
<groupId>com.baeldung</groupId>
54
<artifactId>activejdbc</artifactId>
65
<version>1.0-SNAPSHOT</version>
76
<packaging>jar</packaging>
@@ -79,55 +78,11 @@
7978
</dependency>
8079
</dependencies>
8180
</plugin>
82-
<plugin>
83-
<groupId>org.apache.maven.plugins</groupId>
84-
<artifactId>maven-surefire-plugin</artifactId>
85-
<version>${maven-surefire-plugin.version}</version>
86-
<configuration>
87-
<reportFormat>brief</reportFormat>
88-
<trimStackTrace>true</trimStackTrace>
89-
<useFile>false</useFile>
90-
<includes>
91-
<include>**/*Spec*.java</include>
92-
<include>**/*Test*.java</include>
93-
</includes>
94-
<excludes>
95-
<exclude>**/helpers/*</exclude>
96-
<exclude>**/*$*</exclude>
97-
</excludes>
98-
</configuration>
99-
</plugin>
10081
</plugins>
10182
</build>
10283

103-
<repositories>
104-
<repository>
105-
<id>snapshots1</id>
106-
<name>JavaLite Snapshots1</name>
107-
<url>http://repo.javalite.io/</url>
108-
<snapshots>
109-
<enabled>true</enabled>
110-
<updatePolicy>always</updatePolicy>
111-
<checksumPolicy>warn</checksumPolicy>
112-
</snapshots>
113-
</repository>
114-
</repositories>
115-
116-
<pluginRepositories>
117-
<pluginRepository>
118-
<id>snapshots2</id>
119-
<name>JavaLite Snapshots2</name>
120-
<url>http://repo.javalite.io/</url>
121-
<snapshots>
122-
<enabled>true</enabled>
123-
<updatePolicy>always</updatePolicy>
124-
<checksumPolicy>warn</checksumPolicy>
125-
</snapshots>
126-
</pluginRepository>
127-
</pluginRepositories>
128-
12984
<properties>
130-
<activejdbc.version>1.4.13</activejdbc.version>
85+
<activejdbc.version>2.0</activejdbc.version>
13186
<environments>development.test,development</environments>
13287
<mysql.connector.version>5.1.34</mysql.connector.version>
13388
</properties>

activejdbc/src/main/java/com/baeldung/model/Employee.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,8 @@ public Employee(String firstName, String lastName, String gender, String created
1616
set("created_by",createdBy);
1717
}
1818

19+
public String getLastName() {
20+
return getString("last_name");
21+
}
22+
1923
}

activejdbc/src/main/java/com/baeldung/model/Role.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,8 @@ public Role(String role,String createdBy){
1515
set("role_name",role);
1616
set("created_by",createdBy);
1717
}
18+
19+
public String getRoleName() {
20+
return getString("role_name");
21+
}
1822
}

activejdbc/src/test/java/com/baeldung/ActiveJDBCAppTest.java renamed to activejdbc/src/test/java/com/baeldung/ActiveJDBCAppManualTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import java.util.List;
99

10-
public class ActiveJDBCAppTest extends DBSpec
10+
public class ActiveJDBCAppManualTest extends DBSpec
1111
{
1212
@Test
1313
public void ifEmployeeCreated_thenIsValid() {

algorithms/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,7 @@
2424
- [Practical Java Examples of the Big O Notation](http://www.baeldung.com/java-algorithm-complexity)
2525
- [Find the Middle Element of a Linked List](http://www.baeldung.com/java-linked-list-middle-element)
2626
- [An Introduction to the Theory of Big-O Notation](http://www.baeldung.com/big-o-notation)
27+
- [Check If Two Rectangles Overlap In Java](https://www.baeldung.com/java-check-if-two-rectangles-overlap)
28+
- [Calculate the Distance Between Two Points in Java](https://www.baeldung.com/java-distance-between-two-points)
29+
- [Find the Intersection of Two Lines in Java](https://www.baeldung.com/java-intersection-of-two-lines)
30+
- [Check If a String Contains All The Letters of The Alphabet](https://www.baeldung.com/java-string-contains-all-letters)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/bin/
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.java.src;
2+
3+
import java.util.Scanner;
4+
5+
public class RoundUpToHundred {
6+
7+
public static void main(String[] args) {
8+
Scanner scanner = new Scanner(System.in);
9+
double input = scanner.nextDouble();
10+
scanner.close();
11+
12+
RoundUpToHundred.round(input);
13+
}
14+
15+
static long round(double input) {
16+
long i = (long) Math.ceil(input);
17+
return ((i + 99) / 100) * 100;
18+
};
19+
20+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package com.java.src;
2+
3+
import static org.junit.Assert.assertEquals;
4+
5+
import org.junit.Test;
6+
7+
public class RoundUpToHundredTest {
8+
@Test
9+
public void givenInput_whenRound_thenRoundUpToTheNearestHundred() {
10+
assertEquals("Rounded up to hundred", 100, RoundUpToHundred.round(99));
11+
assertEquals("Rounded up to three hundred ", 300, RoundUpToHundred.round(200.2));
12+
assertEquals("Returns same rounded value", 400, RoundUpToHundred.round(400));
13+
}
14+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
package com.baeldung.algorithms.mergesort;
2+
3+
public class MergeSort {
4+
5+
public static void main(String[] args) {
6+
int[] a = { 5, 1, 6, 2, 3, 4 };
7+
mergeSort(a, a.length);
8+
for (int i = 0; i < a.length; i++)
9+
System.out.println(a[i]);
10+
}
11+
12+
public static void mergeSort(int[] a, int n) {
13+
if (n < 2)
14+
return;
15+
int mid = n / 2;
16+
int[] l = new int[mid];
17+
int[] r = new int[n - mid];
18+
19+
for (int i = 0; i < mid; i++) {
20+
l[i] = a[i];
21+
}
22+
for (int i = mid; i < n; i++) {
23+
r[i - mid] = a[i];
24+
}
25+
mergeSort(l, mid);
26+
mergeSort(r, n - mid);
27+
28+
merge(a, l, r, mid, n - mid);
29+
}
30+
31+
public static void merge(int[] a, int[] l, int[] r, int left, int right) {
32+
33+
int i = 0, j = 0, k = 0;
34+
35+
while (i < left && j < right) {
36+
37+
if (l[i] < r[j])
38+
a[k++] = l[i++];
39+
else
40+
a[k++] = r[j++];
41+
42+
}
43+
44+
while (i < left)
45+
a[k++] = l[i++];
46+
47+
while (j < right)
48+
a[k++] = r[j++];
49+
}
50+
}

0 commit comments

Comments
 (0)