├── Java9 ├── .gitignore ├── src │ └── main │ │ └── java │ │ ├── module-info.java │ │ └── io │ │ └── github │ │ └── rgra │ │ └── java9 │ │ ├── Flow.java │ │ └── http │ │ └── HTTP.java ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .classpath ├── settings.gradle ├── .project ├── build.gradle └── gradlew.bat ├── jinq ├── .gitignore ├── .gradle │ └── 2.14.1 │ │ └── taskArtifacts │ │ ├── cache.properties │ │ ├── fileHashes.bin │ │ ├── fileSnapshots.bin │ │ ├── taskArtifacts.bin │ │ ├── cache.properties.lock │ │ └── fileSnapshotsToTreeSnapshotsIndex.bin ├── bin │ └── .gitignore ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .settings │ └── org.eclipse.buildship.core.prefs ├── build.gradle ├── src │ ├── test │ │ ├── java │ │ │ └── JooqSchemaGen.java │ │ └── resources │ │ │ ├── dbcreate.sql │ │ │ └── test.xml │ └── main │ │ └── java │ │ ├── test │ │ └── generated │ │ │ ├── Tables.java │ │ │ ├── Test.java │ │ │ ├── Keys.java │ │ │ └── tables │ │ │ └── Author.java │ │ └── de │ │ └── rgra │ │ └── jinq │ │ └── Main.java ├── .project ├── settings.gradle ├── .classpath ├── gradlew.bat └── gradlew ├── JDeferred ├── .gitignore ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .classpath ├── settings.gradle ├── .project ├── src │ └── main │ │ └── java │ │ └── io │ │ └── github │ │ └── rgra │ │ └── jdeferred │ │ └── JDeferredPlayground.java └── gradlew.bat ├── LiveCoding ├── .gitignore ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .classpath ├── settings.gradle ├── .project ├── src │ ├── main │ │ └── java │ │ │ └── io │ │ │ └── github │ │ │ └── rgra │ │ │ └── live │ │ │ ├── RxJavaTimed.java │ │ │ ├── VavrPatternMatching.java │ │ │ ├── VavrBirthday.java │ │ │ ├── VertxRouting.java │ │ │ ├── JoolBirthday.java │ │ │ └── Java8Birthday.java │ └── test │ │ └── java │ │ └── io │ │ └── github │ │ └── rgra │ │ └── live │ │ └── DynamicTestFactory.java ├── build.gradle └── gradlew.bat ├── README.md ├── eclipse-collections ├── src │ └── main │ │ └── java │ │ ├── org │ │ └── eclipse │ │ │ └── collections │ │ │ └── .gitignore │ │ └── de │ │ └── rgra │ │ └── functional │ │ └── eclipse │ │ └── EclipseCollectionsPlayground.java ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore ├── settings.gradle └── gradlew.bat ├── JOOL ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore ├── settings.gradle ├── src │ └── main │ │ └── java │ │ └── de │ │ └── rgra │ │ └── functional │ │ └── jool │ │ ├── JoolTest.java │ │ └── JoolPlayground.java ├── gradlew.bat └── gradlew ├── JUnit5 ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── src │ └── test │ │ ├── resources │ │ └── log4j2-test.xml │ │ └── java │ │ └── de │ │ └── rgra │ │ └── functional │ │ └── junit │ │ ├── FirstTest.java │ │ ├── MyFastTag.java │ │ ├── AssertionsDemo.java │ │ └── DynamicTestFactory.java ├── settings.gradle ├── build.gradle ├── gradlew.bat └── gradlew ├── Java8 ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore ├── settings.gradle ├── src │ ├── main │ │ └── java │ │ │ └── de │ │ │ └── rgra │ │ │ └── functional │ │ │ └── java8 │ │ │ ├── Java8Playground.java │ │ │ ├── Composition.java │ │ │ ├── HigherOrder.java │ │ │ ├── Logging.java │ │ │ ├── Futures.java │ │ │ └── List2Map.java │ └── test │ │ └── java │ │ └── List2Map.java ├── gradlew.bat └── gradlew ├── rxjava ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore ├── src │ └── main │ │ └── java │ │ └── de │ │ └── rgra │ │ └── function │ │ └── rxjava │ │ ├── RxJavaErrorHandling.java │ │ ├── RxJavaPlayground.java │ │ └── RxJavaTimed.java ├── settings.gradle ├── gradlew.bat └── gradlew ├── vertx ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── .gitignore ├── settings.gradle ├── build.gradle ├── src │ └── main │ │ └── java │ │ └── io │ │ └── vertx │ │ └── example │ │ ├── HelloWorldEmbedded.java │ │ ├── FileSystem.java │ │ └── VertxRouting.java ├── gradlew.bat └── gradlew ├── AssertJ ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore ├── settings.gradle ├── src │ └── test │ │ └── java │ │ └── de │ │ └── rgra │ │ └── function │ │ └── assertj │ │ └── AssertJPlayground.java ├── gradlew.bat └── gradlew ├── StreamEx ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore ├── settings.gradle ├── src │ └── main │ │ └── java │ │ └── de │ │ └── rgra │ │ └── functional │ │ └── streamex │ │ ├── StreamExPlayground.java │ │ ├── StreamExFactory.java │ │ ├── StreamExTest2.java │ │ └── StreamExTest.java ├── gradlew.bat └── gradlew ├── Javaslang ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore ├── settings.gradle ├── src │ └── main │ │ └── java │ │ └── io │ │ └── github │ │ └── rgr │ │ └── vavr │ │ ├── VavrTest.java │ │ └── VavrPlayground.java └── gradlew.bat ├── more-spliterators ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore ├── settings.gradle ├── src │ └── main │ │ └── java │ │ └── de │ │ └── rgra │ │ └── functional │ │ ├── spliterators │ │ ├── SpliteratorsPlayground.java │ │ ├── DateCreator.java │ │ └── Elections.java │ │ └── collectors │ │ └── CollectorsPlayground.java └── gradlew.bat ├── talk-functional-model ├── gradle │ └── wrapper │ │ ├── gradle-wrapper.jar │ │ └── gradle-wrapper.properties ├── build.gradle ├── .gitignore ├── settings.gradle ├── src │ └── main │ │ └── java │ │ └── de │ │ └── rgra │ │ └── functional │ │ └── model │ │ ├── EmployeeRegister.java │ │ └── Employee.java └── gradlew.bat └── .project /Java9/.gitignore: -------------------------------------------------------------------------------- 1 | /.gradle/ 2 | /bin/ 3 | /.settings/ 4 | -------------------------------------------------------------------------------- /jinq/.gitignore: -------------------------------------------------------------------------------- 1 | /.gradle/ 2 | /.settings/ 3 | /bin/ 4 | -------------------------------------------------------------------------------- /JDeferred/.gitignore: -------------------------------------------------------------------------------- 1 | /.gradle/ 2 | /.settings/ 3 | /bin/ 4 | -------------------------------------------------------------------------------- /LiveCoding/.gitignore: -------------------------------------------------------------------------------- 1 | /.gradle/ 2 | /.settings/ 3 | /bin/ 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # talk_functional-java-8 2 | Code for Talk: Funtional Java 8 3 | -------------------------------------------------------------------------------- /eclipse-collections/src/main/java/org/eclipse/collections/.gitignore: -------------------------------------------------------------------------------- 1 | /petkata/ 2 | -------------------------------------------------------------------------------- /jinq/.gradle/2.14.1/taskArtifacts/cache.properties: -------------------------------------------------------------------------------- 1 | #Sun Feb 05 12:50:54 CET 2017 2 | -------------------------------------------------------------------------------- /Java9/src/main/java/module-info.java: -------------------------------------------------------------------------------- 1 | 2 | module Java9 { 3 | requires jdk.incubator.httpclient; 4 | } 5 | -------------------------------------------------------------------------------- /jinq/bin/.gitignore: -------------------------------------------------------------------------------- 1 | /JooqSchemaGen.class 2 | /de/ 3 | /library.xml 4 | /test/ 5 | /dbcreate.sql 6 | /test.xml 7 | -------------------------------------------------------------------------------- /JOOL/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/JOOL/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /JUnit5/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/JUnit5/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Java8/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/Java8/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Java9/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/Java9/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /jinq/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/jinq/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /rxjava/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/rxjava/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /vertx/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/vertx/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /AssertJ/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/AssertJ/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /StreamEx/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/StreamEx/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /JDeferred/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/JDeferred/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /Javaslang/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/Javaslang/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /LiveCoding/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/LiveCoding/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /jinq/.gradle/2.14.1/taskArtifacts/fileHashes.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/jinq/.gradle/2.14.1/taskArtifacts/fileHashes.bin -------------------------------------------------------------------------------- /jinq/.gradle/2.14.1/taskArtifacts/fileSnapshots.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/jinq/.gradle/2.14.1/taskArtifacts/fileSnapshots.bin -------------------------------------------------------------------------------- /jinq/.gradle/2.14.1/taskArtifacts/taskArtifacts.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/jinq/.gradle/2.14.1/taskArtifacts/taskArtifacts.bin -------------------------------------------------------------------------------- /more-spliterators/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/more-spliterators/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /eclipse-collections/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/eclipse-collections/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /jinq/.gradle/2.14.1/taskArtifacts/cache.properties.lock: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/jinq/.gradle/2.14.1/taskArtifacts/cache.properties.lock -------------------------------------------------------------------------------- /talk-functional-model/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/talk-functional-model/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /talk-functional-model/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | testCompile 'junit:junit:4.12' 9 | } 10 | -------------------------------------------------------------------------------- /jinq/.gradle/2.14.1/taskArtifacts/fileSnapshotsToTreeSnapshotsIndex.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rgra/talk_functional-java-8/HEAD/jinq/.gradle/2.14.1/taskArtifacts/fileSnapshotsToTreeSnapshotsIndex.bin -------------------------------------------------------------------------------- /JDeferred/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | dependencies { 7 | compile 'org.jdeferred:jdeferred-core:1.2.4' 8 | compile 'org.slf4j:slf4j-simple:1.8.0-beta0' 9 | } -------------------------------------------------------------------------------- /AssertJ/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | testCompile 'junit:junit:4.12' 9 | testCompile 'org.assertj:assertj-core:3.8.0' 10 | } 11 | -------------------------------------------------------------------------------- /JOOL/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | compile 'org.jooq:jool:0.9.12' 9 | compile project(':model') 10 | 11 | testCompile 'junit:junit:4.12' 12 | } 13 | -------------------------------------------------------------------------------- /StreamEx/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | compile 'one.util:streamex:0.6.6' 9 | compile project(':model') 10 | 11 | testCompile 'junit:junit:4.12' 12 | } 13 | -------------------------------------------------------------------------------- /Javaslang/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | compile 'io.vavr:vavr:0.9.1' 9 | compile project(':model') 10 | 11 | testCompile 'junit:junit:4.12' 12 | } 13 | 14 | 15 | -------------------------------------------------------------------------------- /rxjava/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | compile 'io.reactivex.rxjava2:rxjava:2.1.6' 9 | compile project(':model') 10 | 11 | testCompile 'junit:junit:4.12' 12 | } 13 | -------------------------------------------------------------------------------- /LiveCoding/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-bin.zip 6 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | talk_functional-java-8 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /Java9/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Nov 04 14:28:15 CET 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip 7 | -------------------------------------------------------------------------------- /JDeferred/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Nov 04 09:20:28 CET 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-3.5-bin.zip 7 | -------------------------------------------------------------------------------- /JOOL/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 23 09:30:44 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /Java8/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Sep 25 14:06:48 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /jinq/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Feb 05 12:50:54 CET 2017 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-bin.zip 7 | -------------------------------------------------------------------------------- /vertx/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 23 10:09:19 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /AssertJ/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Sep 25 16:49:38 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /JUnit5/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 23 09:36:09 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /Javaslang/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 23 08:45:35 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /StreamEx/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 23 09:20:07 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /rxjava/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 23 10:08:03 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /eclipse-collections/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 23 10:05:24 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /more-spliterators/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 23 09:58:05 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /eclipse-collections/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | compile 'org.eclipse.collections:eclipse-collections-api:9.0.0' 9 | compile 'org.eclipse.collections:eclipse-collections:9.0.0' 10 | 11 | testCompile 'junit:junit:4.12' 12 | } 13 | -------------------------------------------------------------------------------- /more-spliterators/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | compile 'org.paumard:more-spliterators:0.2' 9 | compile 'org.paumard:collectors-utils:1.0' 10 | compile project(':model') 11 | 12 | testCompile 'junit:junit:4.12' 13 | } 14 | -------------------------------------------------------------------------------- /talk-functional-model/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri Sep 23 12:12:58 CEST 2016 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip 7 | -------------------------------------------------------------------------------- /Java8/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | compile 'org.apache.logging.log4j:log4j-api:2.6.2' 9 | compile 'org.apache.logging.log4j:log4j-core:2.6.2' 10 | compile project(':model') 11 | 12 | testCompile 'junit:junit:4.12' 13 | } 14 | -------------------------------------------------------------------------------- /jinq/.settings/org.eclipse.buildship.core.prefs: -------------------------------------------------------------------------------- 1 | build.commands=org.eclipse.jdt.core.javabuilder 2 | connection.arguments= 3 | connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER) 4 | connection.java.home=null 5 | connection.jvm.arguments= 6 | connection.project.dir= 7 | derived.resources=.gradle,build 8 | eclipse.preferences.version=1 9 | natures=org.eclipse.jdt.core.javanature 10 | project.path=\: 11 | -------------------------------------------------------------------------------- /Java9/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /JDeferred/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /jinq/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | 3 | repositories { 4 | jcenter() 5 | } 6 | 7 | dependencies { 8 | compile 'org.jinq:jinq-jooq:1.8.22' 9 | compile 'org.jooq:jooq:3.10.1' 10 | compile 'org.jooq:jooq-meta:3.10.1' 11 | compile 'org.jooq:jooq-codegen:3.10.1' 12 | 13 | compile group: 'mysql', name: 'mysql-connector-java', version: '5.1.44' 14 | 15 | 16 | testCompile 'junit:junit:4.12' 17 | } 18 | -------------------------------------------------------------------------------- /JOOL/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /bin/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | #eclipse 19 | .project 20 | .classpath 21 | /.settings/ -------------------------------------------------------------------------------- /Java8/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /bin/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | #eclipse 19 | .project 20 | .classpath 21 | /.settings/ -------------------------------------------------------------------------------- /vertx/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /bin/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | #eclipse 19 | .project 20 | .classpath 21 | /.settings/ -------------------------------------------------------------------------------- /AssertJ/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /bin/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | #eclipse 19 | .project 20 | .classpath 21 | /.settings/ -------------------------------------------------------------------------------- /JUnit5/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /bin/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | #eclipse 19 | .project 20 | .classpath 21 | /.settings/ -------------------------------------------------------------------------------- /Javaslang/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /bin/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | #eclipse 19 | .project 20 | .classpath 21 | /.settings/ -------------------------------------------------------------------------------- /StreamEx/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /bin/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | #eclipse 19 | .project 20 | .classpath 21 | /.settings/ -------------------------------------------------------------------------------- /rxjava/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /bin/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | #eclipse 19 | .project 20 | .classpath 21 | /.settings/ -------------------------------------------------------------------------------- /JUnit5/src/test/resources/log4j2-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /eclipse-collections/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /bin/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | #eclipse 19 | .project 20 | .classpath 21 | /.settings/ -------------------------------------------------------------------------------- /more-spliterators/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /bin/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | #eclipse 19 | .project 20 | .classpath 21 | /.settings/ -------------------------------------------------------------------------------- /talk-functional-model/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /build/ 3 | /bin/ 4 | 5 | # Ignore Gradle GUI config 6 | gradle-app.setting 7 | 8 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 9 | !gradle-wrapper.jar 10 | 11 | # Cache of project 12 | .gradletasknamecache 13 | 14 | # # Work around https://youtrack.jetbrains.com/issue/IDEA-116898 15 | # gradle/wrapper/gradle-wrapper.properties 16 | 17 | 18 | #eclipse 19 | .project 20 | .classpath 21 | /.settings/ -------------------------------------------------------------------------------- /LiveCoding/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /jinq/src/test/java/JooqSchemaGen.java: -------------------------------------------------------------------------------- 1 | import org.jooq.util.jaxb.Configuration; 2 | 3 | /* 4 | * This Java source file was auto generated by running 'gradle buildInit --type java-library' 5 | * by 'rgra' at '05.02.17 12:50' with Gradle 2.14.1 6 | * 7 | * @author rgra, @date 05.02.17 12:50 8 | */ 9 | public class JooqSchemaGen { 10 | public static void main(String[] args) throws Exception { 11 | 12 | Configuration config = org.jooq.util.GenerationTool.load(JooqSchemaGen.class.getResourceAsStream("test.xml")); 13 | org.jooq.util.GenerationTool.main(config); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /jinq/src/test/resources/dbcreate.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE `test`; 2 | 3 | USE `test`; 4 | 5 | CREATE TABLE `author` ( 6 | `id` int(11) NOT NULL AUTO_INCREMENT, 7 | `first_name` varchar(255) DEFAULT NULL, 8 | `last_name` varchar(255) DEFAULT NULL, 9 | `age` int(11) NOT NULL DEFAULT '20', 10 | PRIMARY KEY (`id`) 11 | ) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=latin1; 12 | 13 | INSERT INTO test.author (id, first_name, last_name, age) VALUES(2, 'Rabea', 'Gransberger', 33); 14 | INSERT INTO test.author (id, first_name, last_name, age) VALUES(3, 'Werder', 'Bremen', 118); 15 | -------------------------------------------------------------------------------- /rxjava/src/main/java/de/rgra/function/rxjava/RxJavaErrorHandling.java: -------------------------------------------------------------------------------- 1 | package de.rgra.function.rxjava; 2 | 3 | import io.reactivex.Observable; 4 | 5 | public class RxJavaErrorHandling { 6 | 7 | public static void main(String[] args) { 8 | Observable errorObservable = Observable.just("1", "2", "3") 9 | .concatWith(Observable.error(new RuntimeException("Test"))); 10 | 11 | errorObservable.doOnError(e -> System.out.println("onErrorResumeNext")) 12 | .onErrorResumeNext(Observable.just("A", "B", "C")) 13 | .subscribe(System.out::println, e -> e.printStackTrace()); 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /jinq/src/main/java/test/generated/Tables.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This class is generated by jOOQ 3 | */ 4 | package test.generated; 5 | 6 | /** 7 | * This class is generated by jOOQ. 8 | * 9 | * Convenience access to all tables in test 10 | */ 11 | @javax.annotation.Generated(value = { "http://www.jooq.org", "3.3.2" }, 12 | comments = "This class is generated by jOOQ") 13 | @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) 14 | public class Tables { 15 | 16 | /** 17 | * The table test.author 18 | */ 19 | public static final test.generated.tables.Author AUTHOR = test.generated.tables.Author.AUTHOR; 20 | } 21 | -------------------------------------------------------------------------------- /Java9/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * In a single project build this file can be empty or even removed. 6 | * 7 | * Detailed information about configuring a multi-project build in Gradle can be found 8 | * in the user guide at https://docs.gradle.org/3.5/userguide/multi_project_builds.html 9 | */ 10 | 11 | /* 12 | // To declare projects as part of a multi-project build use the 'include' method 13 | include 'shared' 14 | include 'api' 15 | include 'services:webservice' 16 | */ 17 | 18 | rootProject.name = 'Java9' 19 | -------------------------------------------------------------------------------- /JDeferred/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * In a single project build this file can be empty or even removed. 6 | * 7 | * Detailed information about configuring a multi-project build in Gradle can be found 8 | * in the user guide at https://docs.gradle.org/3.5/userguide/multi_project_builds.html 9 | */ 10 | 11 | /* 12 | // To declare projects as part of a multi-project build use the 'include' method 13 | include 'shared' 14 | include 'api' 15 | include 'services:webservice' 16 | */ 17 | 18 | rootProject.name = 'JDeferred' 19 | -------------------------------------------------------------------------------- /LiveCoding/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was generated by the Gradle 'init' task. 3 | * 4 | * The settings file is used to specify which projects to include in your build. 5 | * In a single project build this file can be empty or even removed. 6 | * 7 | * Detailed information about configuring a multi-project build in Gradle can be found 8 | * in the user guide at https://docs.gradle.org/4.2.1/userguide/multi_project_builds.html 9 | */ 10 | 11 | /* 12 | // To declare projects as part of a multi-project build use the 'include' method 13 | include 'shared' 14 | include 'api' 15 | include 'services:webservice' 16 | */ 17 | 18 | rootProject.name = 'LiveCoding' 19 | -------------------------------------------------------------------------------- /JUnit5/src/test/java/de/rgra/functional/junit/FirstTest.java: -------------------------------------------------------------------------------- 1 | package de.rgra.functional.junit; 2 | import static org.junit.jupiter.api.Assertions.*; 3 | 4 | import org.junit.jupiter.api.DisplayName; 5 | import org.junit.jupiter.api.Test; 6 | import org.junit.jupiter.api.TestInfo; 7 | import org.junit.platform.runner.JUnitPlatform; 8 | import org.junit.runner.RunWith; 9 | 10 | @RunWith(JUnitPlatform.class) 11 | @MyFastTag 12 | class FirstTest { 13 | 14 | @Test 15 | @DisplayName("My 1st JUnit 5 test! ?") 16 | void myFirstTest(TestInfo testInfo) { 17 | assertEquals("My 1st JUnit 5 test! ?", testInfo.getDisplayName(), () -> "TestInfo is injected correctly"); 18 | } 19 | 20 | } -------------------------------------------------------------------------------- /Java9/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | Java9 4 | Project Java9 created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /JDeferred/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | JDeferred 4 | Project JDeferred created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /LiveCoding/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | LiveCoding 4 | Project LiveCoding created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.jdt.core.javanature 21 | org.eclipse.buildship.core.gradleprojectnature 22 | 23 | 24 | -------------------------------------------------------------------------------- /jinq/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | jinq 4 | Project jinq created by Buildship. 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.buildship.core.gradleprojectbuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.buildship.core.gradleprojectnature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | -------------------------------------------------------------------------------- /AssertJ/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'rgra' at '25.09.16 16:49' with Gradle 2.13 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.13/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'AssertJ' 20 | -------------------------------------------------------------------------------- /jinq/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'rgra' at '05.02.17 12:50' with Gradle 2.14.1 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.14.1/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'jinq' 20 | -------------------------------------------------------------------------------- /JUnit5/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'gransberger' at '9/23/16 9:36 AM' with Gradle 2.13 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.13/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'JUnit5' 20 | -------------------------------------------------------------------------------- /vertx/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'gransberger' at '9/23/16 10:09 AM' with Gradle 2.13 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.13/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'vertx' 20 | -------------------------------------------------------------------------------- /talk-functional-model/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'gransberger' at '9/23/16 12:12 PM' with Gradle 2.13 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.13/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'model' 20 | -------------------------------------------------------------------------------- /vertx/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | id 'application' 4 | id 'com.github.johnrengelman.shadow' version '1.2.3' 5 | } 6 | 7 | repositories { 8 | jcenter() 9 | maven { 10 | url "https://oss.sonatype.org/content/repositories/iovertx-3720/" 11 | } 12 | } 13 | 14 | version = '3.5.0' 15 | sourceCompatibility = '1.8' 16 | 17 | dependencies { 18 | compile "io.vertx:vertx-core:$version" 19 | compile "io.vertx:vertx-web:$version" 20 | } 21 | 22 | mainClassName = 'io.vertx.example.HelloWorldEmbedded' 23 | 24 | shadowJar { 25 | classifier = 'fat' 26 | mergeServiceFiles { 27 | include 'META-INF/services/io.vertx.core.spi.VerticleFactory' 28 | } 29 | } 30 | 31 | task wrapper(type: Wrapper) { 32 | gradleVersion = '4.0' 33 | } -------------------------------------------------------------------------------- /eclipse-collections/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'gransberger' at '9/23/16 10:05 AM' with Gradle 2.13 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.13/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'eclipse-collections' 20 | -------------------------------------------------------------------------------- /JUnit5/src/test/java/de/rgra/functional/junit/MyFastTag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)MyFastTag.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on 25.09.2016 7 | */ 8 | 9 | package de.rgra.functional.junit; 10 | 11 | import static java.lang.annotation.ElementType.*; 12 | import static java.lang.annotation.RetentionPolicy.*; 13 | 14 | import java.lang.annotation.Retention; 15 | import java.lang.annotation.Target; 16 | 17 | import org.junit.jupiter.api.Tag; 18 | 19 | @Retention(RUNTIME) 20 | @Target({ METHOD, TYPE }) 21 | @Tag("fast") 22 | public @interface MyFastTag { 23 | 24 | } 25 | -------------------------------------------------------------------------------- /AssertJ/src/test/java/de/rgra/function/assertj/AssertJPlayground.java: -------------------------------------------------------------------------------- 1 | package de.rgra.function.assertj; 2 | 3 | /* 4 | * @(#)AssertJPlayground.java 5 | * =========================================================================== 6 | * (C) Copyright Rabea Gransberger 2016 7 | * =========================================================================== 8 | * Created on 25.09.2016 9 | */ 10 | import static org.assertj.core.api.Assertions.*; 11 | 12 | import org.junit.Test; 13 | 14 | /** 15 | * @author rgra 16 | */ 17 | public class AssertJPlayground { 18 | 19 | @Test 20 | public void assertJTest() { 21 | String frodo = "Rabea"; 22 | assertThat(frodo).startsWith("Fro") 23 | .endsWith("do") 24 | .isEqualToIgnoringCase("frodo"); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /Java8/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'rgra' at '25.09.16 14:06' with Gradle 2.13 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.13/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'Java8' 20 | include ":model" 21 | project(":model").projectDir = file("../talk-functional-model") -------------------------------------------------------------------------------- /JOOL/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'gransberger' at '9/23/16 9:30 AM' with Gradle 2.13 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.13/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'JOOL' 20 | include ":model" 21 | project(":model").projectDir = file("../talk-functional-model") -------------------------------------------------------------------------------- /StreamEx/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'gransberger' at '9/23/16 9:20 AM' with Gradle 2.13 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.13/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'StreamEx' 20 | include ":model" 21 | project(":model").projectDir = file("../talk-functional-model") -------------------------------------------------------------------------------- /rxjava/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'gransberger' at '9/23/16 10:08 AM' with Gradle 2.13 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.13/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'rxjava' 20 | include ":model" 21 | project(":model").projectDir = file("../talk-functional-model") -------------------------------------------------------------------------------- /Javaslang/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'gransberger' at '9/23/16 8:45 AM' with Gradle 2.13 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.13/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'Javaslang' 20 | include ":model" 21 | project(":model").projectDir = file("../talk-functional-model") -------------------------------------------------------------------------------- /Java8/src/main/java/de/rgra/functional/java8/Java8Playground.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)Java8Playground.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on Sep 26, 2016 7 | */ 8 | 9 | package de.rgra.functional.java8; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | /** 15 | * @author gransberger 16 | */ 17 | public class Java8Playground { 18 | public static void main(String[] args) { 19 | List values = Arrays.asList("A", "B", "C"); 20 | calculateResults(values); 21 | } 22 | 23 | static void calculateResults(List values) { 24 | values.removeIf(s -> s.length() < 2); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /Java8/src/main/java/de/rgra/functional/java8/Composition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)Composition.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on Sep 26, 2016 7 | */ 8 | 9 | package de.rgra.functional.java8; 10 | 11 | import java.util.function.BiFunction; 12 | 13 | /** 14 | * @author gransberger 15 | */ 16 | public class Composition { 17 | 18 | public static void main(String[] args) { 19 | BiFunction add = (x, y) -> x + y; 20 | BiFunction addAndMultBy5 = add.andThen(x -> x * 5); 21 | Integer result = addAndMultBy5.apply(2, 5); 22 | System.out.println(result); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /more-spliterators/settings.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This settings file was auto generated by the Gradle buildInit task 3 | * by 'gransberger' at '9/23/16 9:58 AM' with Gradle 2.13 4 | * 5 | * The settings file is used to specify which projects to include in your build. 6 | * In a single project build this file can be empty or even removed. 7 | * 8 | * Detailed information about configuring a multi-project build in Gradle can be found 9 | * in the user guide at https://docs.gradle.org/2.13/userguide/multi_project_builds.html 10 | */ 11 | 12 | /* 13 | // To declare projects as part of a multi-project build use the 'include' method 14 | include 'shared' 15 | include 'api' 16 | include 'services:webservice' 17 | */ 18 | 19 | rootProject.name = 'more-spliterators' 20 | include ":model" 21 | project(":model").projectDir = file("../talk-functional-model") -------------------------------------------------------------------------------- /vertx/src/main/java/io/vertx/example/HelloWorldEmbedded.java: -------------------------------------------------------------------------------- 1 | package io.vertx.example; 2 | 3 | import io.vertx.core.Vertx; 4 | 5 | /** 6 | * @author Tim Fox 7 | */ 8 | public class HelloWorldEmbedded { 9 | 10 | public static void main(String[] args) { 11 | // Create an HTTP server which simply returns "Hello World!" to each request. 12 | Vertx.vertx() 13 | .createHttpServer() 14 | .requestHandler(req -> req.response().end("Hello World!")) 15 | .listen(8080, handler -> { 16 | if (handler.succeeded()) { 17 | System.out.println("http://localhost:8080/"); 18 | } 19 | else { 20 | System.err.println("Failed to listen on port 8080"); 21 | } 22 | }); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /jinq/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /Java8/src/main/java/de/rgra/functional/java8/HigherOrder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)HigherOrder.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2017 5 | * =========================================================================== 6 | * Created on 04.11.2017 7 | */ 8 | package de.rgra.functional.java8; 9 | 10 | import java.util.function.IntBinaryOperator; 11 | import java.util.function.IntFunction; 12 | 13 | /** 14 | * @author rgra 15 | */ 16 | public class HigherOrder { 17 | 18 | public static void main(String[] args) { 19 | System.out.println(curry(mult(), 5).apply(6)); 20 | } 21 | 22 | private static IntBinaryOperator mult() { 23 | return (a, b) -> a * b; 24 | } 25 | 26 | private static IntFunction curry(IntBinaryOperator op, int a) { 27 | return (b) -> op.applyAsInt(a, b); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /talk-functional-model/src/main/java/de/rgra/functional/model/EmployeeRegister.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)EmployeeRegister.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on Sep 23, 2016 7 | */ 8 | 9 | package de.rgra.functional.model; 10 | 11 | import java.time.LocalDate; 12 | import java.util.Random; 13 | import java.util.stream.Collector; 14 | 15 | /** 16 | * @author gransberger 17 | */ 18 | public class EmployeeRegister { 19 | 20 | public static T getPersons(Collector collector) { 21 | Random random = new Random(); 22 | return random.ints(1, 28) 23 | .limit(1_000) 24 | .mapToObj(i -> LocalDate.of(1983, random.nextInt(11) + 1, i)) 25 | .map(Employee::new) 26 | .collect(collector); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /more-spliterators/src/main/java/de/rgra/functional/spliterators/SpliteratorsPlayground.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)SpliteratorsPlayground.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on 25.09.2016 7 | */ 8 | 9 | package de.rgra.functional.spliterators; 10 | 11 | import java.util.stream.Stream; 12 | 13 | import org.paumard.spliterators.MoreSpliterators; 14 | 15 | /** 16 | * @author rgra 17 | */ 18 | public class SpliteratorsPlayground { 19 | 20 | public static void main(String[] args) { 21 | MoreSpliterators.interrupt(Stream.of("A", "B", "C", "D"), s -> s.equals("C")) 22 | .forEach(System.out::println); 23 | 24 | MoreSpliterators.gate(Stream.of("A", "B", "C", "D"), s -> s.equals("C")) 25 | .forEach(System.out::println); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /rxjava/src/main/java/de/rgra/function/rxjava/RxJavaPlayground.java: -------------------------------------------------------------------------------- 1 | package de.rgra.function.rxjava; 2 | 3 | import io.reactivex.Observable; 4 | 5 | public class RxJavaPlayground { 6 | 7 | public static void main(String[] args) { 8 | 9 | Observable list = Observable.just("Rabea", "vJUG", "RxJava"); 10 | Observable observable = list 11 | .filter(s -> s.startsWith("R")); 12 | observable 13 | .map(s -> s.length()) 14 | .subscribe(System.out::println); 15 | observable 16 | .subscribe(System.out::println); 17 | 18 | // onErrorResumeNext 19 | Observable errorObservable = Observable.just("1", "2", "3") 20 | .concatWith(Observable.error(new RuntimeException("Test"))); 21 | errorObservable.doOnError(e -> System.out.println("onErrorResumeNext")) 22 | .onErrorResumeNext(Observable.just("A", "B", "C")) 23 | .subscribe(System.out::println, e -> e.printStackTrace()); 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /vertx/src/main/java/io/vertx/example/FileSystem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)FileSystem.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on 25.09.2016 7 | */ 8 | 9 | package io.vertx.example; 10 | 11 | import io.vertx.core.Vertx; 12 | 13 | /** 14 | * @author rgra 15 | */ 16 | public class FileSystem { 17 | public static void main(String[] args) { 18 | Vertx vertx = Vertx.vertx(); 19 | vertx 20 | .fileSystem() 21 | .readFile("d:/test.csv", result -> { 22 | if (result.succeeded()) { 23 | System.out.println(result.result()); 24 | } 25 | else { 26 | System.err.println("Oh oh ..." + result.cause()); 27 | } 28 | vertx.close(); 29 | }); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Java9/build.gradle: -------------------------------------------------------------------------------- 1 | /* 2 | * This build file was generated by the Gradle 'init' task. 3 | * 4 | * This generated file contains a sample Java Library project to get you started. 5 | * For more details take a look at the Java Libraries chapter in the Gradle 6 | * user guide available at https://docs.gradle.org/3.5/userguide/java_library_plugin.html 7 | */ 8 | 9 | // Apply the java-library plugin to add support for Java Library 10 | apply plugin: 'java-library' 11 | 12 | // In this section you declare where to find the dependencies of your project 13 | repositories { 14 | // Use jcenter for resolving your dependencies. 15 | // You can declare any Maven/Ivy/file repository here. 16 | jcenter() 17 | } 18 | 19 | dependencies { 20 | // This dependency is exported to consumers, that is to say found on their compile classpath. 21 | api 'org.apache.commons:commons-math3:3.6.1' 22 | 23 | // This dependency is used internally, and not exposed to consumers on their own compile classpath. 24 | implementation 'com.google.guava:guava:21.0' 25 | 26 | // Use JUnit test framework 27 | testImplementation 'junit:junit:4.12' 28 | } 29 | 30 | -------------------------------------------------------------------------------- /jinq/src/main/java/test/generated/Test.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This class is generated by jOOQ 3 | */ 4 | package test.generated; 5 | 6 | /** 7 | * This class is generated by jOOQ. 8 | */ 9 | @javax.annotation.Generated(value = { "http://www.jooq.org", "3.3.2" }, 10 | comments = "This class is generated by jOOQ") 11 | @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) 12 | public class Test extends org.jooq.impl.SchemaImpl { 13 | 14 | private static final long serialVersionUID = -1770500798; 15 | 16 | /** 17 | * The singleton instance of test 18 | */ 19 | public static final Test TEST = new Test(); 20 | 21 | /** 22 | * No further instances allowed 23 | */ 24 | private Test() { 25 | super("test"); 26 | } 27 | 28 | @Override 29 | public final java.util.List> getTables() { 30 | java.util.List result = new java.util.ArrayList(); 31 | result.addAll(getTables0()); 32 | return result; 33 | } 34 | 35 | private final java.util.List> getTables0() { 36 | return java.util.Arrays.>asList( 37 | test.generated.tables.Author.AUTHOR); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /LiveCoding/src/main/java/io/github/rgra/live/RxJavaTimed.java: -------------------------------------------------------------------------------- 1 | package io.github.rgra.live; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | import io.reactivex.Observable; 6 | 7 | public class RxJavaTimed { 8 | 9 | public static void main(String[] args) { 10 | Observable list = Observable.just("+++", "***", "###") 11 | .repeat(20); 12 | 13 | list.subscribe(System.out::println); 14 | 15 | Observable timer = Observable.interval(1, TimeUnit.SECONDS); 16 | Observable timedNameEmitter = timer 17 | .zipWith(list, (x, y) -> y); 18 | 19 | // window 20 | timedNameEmitter.window(10, TimeUnit.SECONDS) 21 | .subscribe(o -> o.startWith("10sec Group: ").toList() 22 | .subscribe(System.out::println)); 23 | 24 | // take 5 sec 25 | timedNameEmitter.take(5, TimeUnit.SECONDS) 26 | .doOnComplete(() -> System.out.println("----Five seconds gone")) 27 | .subscribe(System.out::println); 28 | 29 | // take 30 sec blocking 30 | // timedNameEmitter.take(30, TimeUnit.SECONDS) 31 | // .blockingSubscribe(System.out::println, e -> e.printStackTrace()); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /rxjava/src/main/java/de/rgra/function/rxjava/RxJavaTimed.java: -------------------------------------------------------------------------------- 1 | package de.rgra.function.rxjava; 2 | 3 | import java.util.concurrent.TimeUnit; 4 | 5 | import io.reactivex.Observable; 6 | 7 | public class RxJavaTimed { 8 | 9 | public static void main(String[] args) { 10 | Observable list = Observable.just("+++", "***", "###") 11 | .repeat(20); 12 | 13 | list.subscribe(System.out::println); 14 | 15 | Observable timer = Observable.interval(1, TimeUnit.SECONDS); 16 | Observable timedNameEmitter = timer 17 | .zipWith(list, (x, y) -> y); 18 | 19 | // window 20 | timedNameEmitter.window(10, TimeUnit.SECONDS) 21 | .subscribe(o -> o.startWith("10sec Group: ").toList() 22 | .subscribe(System.out::println)); 23 | 24 | // take 5 sec 25 | timedNameEmitter.take(5, TimeUnit.SECONDS) 26 | .doOnComplete(() -> System.out.println("----Five seconds gone")) 27 | .subscribe(System.out::println); 28 | 29 | // take 30 sec blocking 30 | // timedNameEmitter.take(30, TimeUnit.SECONDS) 31 | // .blockingSubscribe(System.out::println, e -> e.printStackTrace()); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /Java8/src/main/java/de/rgra/functional/java8/Logging.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)Logging.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on 25.09.2016 7 | */ 8 | 9 | package de.rgra.functional.java8; 10 | 11 | import java.util.concurrent.TimeUnit; 12 | 13 | import org.apache.logging.log4j.LogManager; 14 | import org.apache.logging.log4j.Logger; 15 | 16 | /** 17 | * @author rgra 18 | */ 19 | public class Logging { 20 | 21 | private static final Logger logger = LogManager.getLogger(); 22 | 23 | public static void main(String[] args) { 24 | if (logger.isTraceEnabled()) { 25 | logger.trace("Long-running operation: {}", expensiveOperation()); 26 | } 27 | logger.trace("Long-running operation: {}", () -> expensiveOperation()); 28 | 29 | logger.info(() -> "Hello world"); 30 | } 31 | 32 | private static String expensiveOperation() { 33 | try { 34 | TimeUnit.SECONDS.sleep(10L); 35 | } 36 | catch (InterruptedException e) { 37 | logger.error("Error: " + e.getMessage(), e); 38 | } 39 | return "Done"; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /LiveCoding/src/main/java/io/github/rgra/live/VavrPatternMatching.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)VavrPatternMatching.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2017 5 | * =========================================================================== 6 | * Created on 04.11.2017 7 | */ 8 | 9 | package io.github.rgra.live; 10 | 11 | import static io.vavr.API.*; 12 | import static io.vavr.Predicates.*; 13 | 14 | import java.time.LocalDate; 15 | /** 16 | * @author rgra 17 | */ 18 | public class VavrPatternMatching { 19 | public static void main(String[] args) { 20 | int num = 1; 21 | String s = Match(num) 22 | .of(Case($(1), "one"), 23 | Case($(2), "two"), 24 | Case($(), "?")); 25 | System.out.println(s); 26 | 27 | // Object obj = 0.534; 28 | Object obj = LocalDate.now(); 29 | Object plusOne = Match(obj).of( 30 | Case($(instanceOf(Integer.class)), i -> i + 1), 31 | Case($(instanceOf(Double.class)), d -> d + 1), 32 | Case($(instanceOf(LocalDate.class)), d -> d.plusDays(1)), 33 | Case($(), o -> { 34 | throw new NumberFormatException(); 35 | })); 36 | System.out.println(plusOne); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /StreamEx/src/main/java/de/rgra/functional/streamex/StreamExPlayground.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)Main.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on Sep 24, 2016 7 | */ 8 | 9 | package de.rgra.functional.streamex; 10 | 11 | import static java.util.stream.Collectors.*; 12 | 13 | import java.util.stream.Stream; 14 | 15 | import de.rgra.functional.model.Employee; 16 | import de.rgra.functional.model.EmployeeRegister; 17 | 18 | import one.util.streamex.StreamEx; 19 | 20 | /** 21 | * @author gransberger 22 | */ 23 | public class StreamExPlayground { 24 | 25 | public static void main(String[] args) { 26 | println(StreamEx.of(EmployeeRegister.getPersons(toList()))); 27 | printEMail(StreamEx.of(EmployeeRegister.getPersons(toList()))); 28 | 29 | StreamEx.of(1, 2, 1, 1, 2) 30 | .groupRuns((x, y) -> x.equals(y)) 31 | .forEach(System.out::println); 32 | } 33 | 34 | private static void printEMail(Iterable iterable) { 35 | for (Employee element : iterable) { 36 | System.out.println(element.getEmail()); 37 | } 38 | } 39 | 40 | private static void println(Stream stream) { 41 | stream.forEach(System.out::println); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /JDeferred/src/main/java/io/github/rgra/jdeferred/JDeferredPlayground.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)JDeferredPlayground.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2017 5 | * =========================================================================== 6 | * Created on 04.11.2017 7 | */ 8 | 9 | package io.github.rgra.jdeferred; 10 | 11 | import org.jdeferred.Deferred; 12 | import org.jdeferred.impl.DeferredObject; 13 | 14 | /** 15 | * @author rgra 16 | */ 17 | public class JDeferredPlayground { 18 | 19 | public static void main(String[] args) { 20 | Deferred deferred = setup(); 21 | deferred.reject("oops"); 22 | 23 | deferred = setup(); 24 | deferred.notify(50); 25 | deferred.notify(100); 26 | deferred.resolve("done"); 27 | } 28 | 29 | private static Deferred setup() { 30 | Deferred deferred = new DeferredObject<>(); 31 | deferred.promise() 32 | .done(result -> System.out.println("Completed: " + result)) 33 | .fail(rejection -> System.out.println("Rejected: " + rejection)) 34 | .progress(System.out::println) 35 | .always((state, result, rejection) -> System.out.println("Something happend")); 36 | return deferred; 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /talk-functional-model/src/main/java/de/rgra/functional/model/Employee.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)Person.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on Sep 23, 2016 7 | */ 8 | 9 | package de.rgra.functional.model; 10 | 11 | import java.time.LocalDate; 12 | import java.util.concurrent.atomic.AtomicInteger; 13 | 14 | /** 15 | * @author gransberger 16 | */ 17 | public class Employee { 18 | 19 | private static final AtomicInteger personCnt = new AtomicInteger(0); 20 | 21 | private final int employeeNumber; 22 | 23 | private final String email; 24 | 25 | private final LocalDate birthday; 26 | 27 | 28 | public Employee(LocalDate birthday) { 29 | this.employeeNumber = personCnt.incrementAndGet(); 30 | this.email = "person" + employeeNumber + "@email.org"; 31 | this.birthday = birthday; 32 | } 33 | 34 | 35 | public int getEmployeeNumber() { 36 | return employeeNumber; 37 | } 38 | 39 | public String getEmail() { 40 | return email; 41 | } 42 | 43 | public LocalDate getBirthday() { 44 | return birthday; 45 | } 46 | 47 | @Override 48 | public String toString() { 49 | return "Employee [email=" + email + ", birthday=" + birthday + ", employeeNumber=" + employeeNumber + "]"; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /jinq/src/main/java/de/rgra/jinq/Main.java: -------------------------------------------------------------------------------- 1 | package de.rgra.jinq; 2 | 3 | import static test.generated.Tables.*; 4 | 5 | import java.sql.Connection; 6 | import java.sql.DriverManager; 7 | import java.util.List; 8 | 9 | import org.jinq.jooq.JinqJooqContext; 10 | import org.jooq.DSLContext; 11 | import org.jooq.SQLDialect; 12 | import org.jooq.impl.DSL; 13 | 14 | import test.generated.Test; 15 | import test.generated.tables.records.AuthorRecord; 16 | 17 | public class Main { 18 | public static void main(String[] args) { 19 | String userName = "root"; 20 | String password = ""; 21 | String url = "jdbc:mysql://localhost:3306/test"; 22 | 23 | // Connection is the only JDBC resource that we need 24 | // PreparedStatement and ResultSet are handled by jOOQ, internally 25 | try (Connection conn = DriverManager.getConnection(url, userName, password)) { 26 | 27 | // Use jOOQ to talk to the JDBC connection 28 | DSLContext context = DSL.using(conn, SQLDialect.MYSQL); 29 | 30 | // Use Jinq to talk to the jOOQ connection 31 | JinqJooqContext jinq = JinqJooqContext.using(context, Test.TEST); 32 | 33 | List results = jinq.from(AUTHOR) 34 | .where(c -> c.getAge() > 30) 35 | .selectAll() 36 | .toList(); 37 | 38 | results.stream() 39 | .map(a -> a.getFirstName() + " " + a.getLastName()) 40 | .forEach(System.out::println); 41 | } 42 | 43 | // For the sake of this tutorial, let's keep exception handling simple 44 | catch (Exception e) { 45 | e.printStackTrace(); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Javaslang/src/main/java/io/github/rgr/vavr/VavrTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)JavaslangTest.java 3 | * =========================================================================== 4 | * (C) Copyright MEKO-S GmbH 2016 5 | * =========================================================================== 6 | * Created on Sep 23, 2016 7 | */ 8 | 9 | package io.github.rgr.vavr; 10 | 11 | import java.text.MessageFormat; 12 | import java.time.LocalDate; 13 | import java.time.MonthDay; 14 | 15 | import de.rgra.functional.model.Employee; 16 | import de.rgra.functional.model.EmployeeRegister; 17 | 18 | import io.vavr.collection.List; 19 | 20 | /** 21 | * @author gransberger 22 | */ 23 | public class VavrTest { 24 | 25 | public static void main(String[] args) { 26 | List persons = EmployeeRegister.getPersons(List.collector()); 27 | 28 | persons.filter(p -> p.getBirthday().getMonth() == LocalDate.now().getMonth()) 29 | .groupBy(e -> MonthDay.from(e.getBirthday())) 30 | .filter(v -> v._2().size() > 1) 31 | .forEach(VavrTest::sendMail); 32 | } 33 | 34 | private static void sendMail(MonthDay date, List persons) { 35 | String emails = persons.map(Employee::getEmail).mkString(";"); 36 | 37 | String subject = MessageFormat.format("Please organise a birthday breakfast on {0} ", date.atYear(2016).toString()); 38 | System.out.println("-------------"); 39 | System.out.println("To: " + emails); 40 | System.out.println(subject); 41 | // Body 42 | persons 43 | .map(Employee::getEmployeeNumber) 44 | .map(s -> "- Co-Worker #" + s) 45 | .forEach(System.out::println); 46 | 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /JUnit5/src/test/java/de/rgra/functional/junit/AssertionsDemo.java: -------------------------------------------------------------------------------- 1 | package de.rgra.functional.junit; 2 | 3 | import static java.time.Duration.*; 4 | import static org.junit.jupiter.api.Assertions.*; 5 | 6 | import java.io.FileNotFoundException; 7 | import java.net.URL; 8 | import java.util.concurrent.TimeUnit; 9 | 10 | import org.junit.jupiter.api.Test; 11 | import org.junit.platform.runner.JUnitPlatform; 12 | import org.junit.runner.RunWith; 13 | 14 | @RunWith(JUnitPlatform.class) 15 | class AssertionsDemo { 16 | 17 | @Test 18 | void standardAssertions() { 19 | assertEquals(2, 2); 20 | assertEquals(4, 4, "The optional assertion message is now the last parameter."); 21 | assertTrue(2 == 2, () -> "Assertion messages can be lazily evaluated -- " 22 | + "to avoid constructing complex messages unnecessarily."); 23 | } 24 | 25 | @Test 26 | void groupedAssertions() { 27 | String firstname = "Rabea"; 28 | String lastname = "Gransberger"; 29 | // In a grouped assertion all assertions are executed, and any 30 | // failures will be reported together. 31 | assertAll("names", 32 | () -> assertEquals("John", firstname), 33 | () -> assertEquals("User", lastname)); 34 | } 35 | 36 | @Test 37 | void exceptionTesting() { 38 | Throwable exception = assertThrows(FileNotFoundException.class, () -> { 39 | new URL("http://127.0.0.1").openStream().read(); 40 | }); 41 | assertEquals("http://127.0.0.1", exception.getMessage()); 42 | } 43 | 44 | @Test 45 | void timeoutExceeded() { 46 | assertTimeout(ofMillis(10), () -> { 47 | TimeUnit.MILLISECONDS.sleep(100); 48 | }); 49 | } 50 | 51 | } 52 | -------------------------------------------------------------------------------- /Javaslang/src/main/java/io/github/rgr/vavr/VavrPlayground.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)JavaslangPlayground.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on Sep 26, 2016 7 | */ 8 | 9 | package io.github.rgr.vavr; 10 | 11 | import static io.vavr.API.*; 12 | 13 | import io.vavr.Function1; 14 | import io.vavr.Function2; 15 | import io.vavr.control.Option; 16 | 17 | /** 18 | * @author gransberger 19 | */ 20 | public class VavrPlayground { 21 | 22 | public static void main(String[] args) { 23 | 24 | Function2 sum = (a, b) -> a + b; 25 | Function1 add2 = sum.curried().apply(2); 26 | 27 | System.out.println(add2.apply(4)); 28 | 29 | Function2 divide = (a, b) -> a / b; 30 | Function2> safeDivide = Function2.lift(divide); 31 | 32 | try { 33 | System.out.println(divide.apply(5, 0)); 34 | } 35 | catch (Throwable e) { 36 | e.printStackTrace(); 37 | } 38 | 39 | System.out.println(safeDivide.apply(5, 0)); 40 | 41 | int i = 1; 42 | String s = Match(i) 43 | .of(Case($(1), "one"), 44 | Case($(2), "two"), 45 | Case($(), "?")); 46 | System.out.println(s); 47 | } 48 | 49 | static void displayHelp() { 50 | System.out.println("Help"); 51 | } 52 | 53 | static void displayVersion() { 54 | System.out.println("Version"); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /Java8/src/test/java/List2Map.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | import static java.util.Comparator.*; 6 | import static java.util.stream.Collectors.*; 7 | 8 | import java.text.MessageFormat; 9 | import java.time.LocalDate; 10 | import java.time.MonthDay; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | import de.rgra.functional.model.Employee; 15 | import de.rgra.functional.model.EmployeeRegister; 16 | 17 | /** 18 | * @author gransberger 19 | */ 20 | public class List2Map { 21 | 22 | public static void main(String[] args) { 23 | List persons = EmployeeRegister.getPersons(toList()); 24 | 25 | Map> byDate = persons.stream() 26 | .filter(p -> p.getBirthday().getMonth() == LocalDate.now().getMonth()) 27 | .collect(groupingBy(e -> MonthDay.from(e.getBirthday()))); 28 | 29 | byDate.entrySet().stream() 30 | .filter(e -> e.getValue().size() > 1) 31 | .sorted(comparing(Map.Entry::getKey)) 32 | .forEach(e -> sendMail(e.getKey(), e.getValue())); 33 | } 34 | 35 | // TODO methode als Template? 36 | private static void sendMail(MonthDay date, List persons) { 37 | String emails = persons.stream().map(Employee::getEmail) 38 | .collect(joining(";")); 39 | String subject = MessageFormat.format( 40 | "Please organise a birthday breakfast on {0} ", 41 | date.atYear(2016).toString()); 42 | System.out.println("-------------"); 43 | System.out.println("To: " + emails); 44 | System.out.println(subject); 45 | // Body 46 | persons.stream() 47 | .map(Employee::getEmployeeNumber) 48 | .map(s -> "- Co-Worker #" + s) 49 | .forEach(System.out::println); 50 | 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /LiveCoding/src/main/java/io/github/rgra/live/VavrBirthday.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)VavrBirthday.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2017 5 | * =========================================================================== 6 | * Created on 04.11.2017 7 | */ 8 | 9 | package io.github.rgra.live; 10 | 11 | import java.text.MessageFormat; 12 | import java.time.LocalDate; 13 | import java.time.MonthDay; 14 | 15 | import de.rgra.functional.model.Employee; 16 | import de.rgra.functional.model.EmployeeRegister; 17 | 18 | import io.vavr.collection.List; 19 | 20 | /** 21 | * @author rgra 22 | */ 23 | public class VavrBirthday { 24 | public static void main(String[] args) { 25 | List persons = EmployeeRegister.getPersons(List.collector()); 26 | 27 | persons.filter(p -> p.getBirthday().getMonth() == LocalDate.now().getMonth()) 28 | .groupBy(e -> MonthDay.from(e.getBirthday())) 29 | .filter(v -> v._2().size() > 1) 30 | .forEach(VavrBirthday::sendMail); 31 | } 32 | 33 | private static void sendMail(MonthDay date, List persons) { 34 | String emails = persons.map(Employee::getEmail).mkString(";"); 35 | 36 | String subject = MessageFormat.format("Please organise a birthday breakfast on {0} ", 37 | date.atYear(2016).toString()); 38 | System.out.println("-------------"); 39 | System.out.println("To: " + emails); 40 | System.out.println(subject); 41 | // Body 42 | persons 43 | .map(Employee::getEmployeeNumber) 44 | .map(s -> "- Co-Worker #" + s) 45 | .forEach(System.out::println); 46 | 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /vertx/src/main/java/io/vertx/example/VertxRouting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)VertxRouting.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2017 5 | * =========================================================================== 6 | * Created on 04.11.2017 7 | */ 8 | 9 | package io.vertx.example; 10 | 11 | import java.util.concurrent.TimeUnit; 12 | 13 | import io.vertx.core.Vertx; 14 | import io.vertx.core.http.HttpServerOptions; 15 | import io.vertx.ext.web.Router; 16 | 17 | /** 18 | * @author rgra 19 | */ 20 | public class VertxRouting { 21 | 22 | public static void main(String[] args) { 23 | Vertx vertx = Vertx.vertx(); 24 | 25 | Router router = Router.router(vertx); 26 | router.route("/bremen").handler(routingContext -> { 27 | routingContext.response() 28 | .setChunked(true) 29 | .write("Germany") 30 | .end(); 31 | }); 32 | router.route("/copenhagen").handler(routingContext -> { 33 | routingContext.response() 34 | .setChunked(true) 35 | .write("Denmark") 36 | .end(); 37 | }); 38 | 39 | vertx.createHttpServer(new HttpServerOptions()) 40 | .requestHandler(router::accept) 41 | .listen(8080, res -> { 42 | if (res.failed()) { 43 | res.cause().printStackTrace(); 44 | } 45 | }); 46 | } 47 | 48 | private static void sleep() { 49 | try { 50 | TimeUnit.SECONDS.sleep(2); 51 | } 52 | catch (InterruptedException e) { 53 | e.printStackTrace(); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /Java8/src/main/java/de/rgra/functional/java8/Futures.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)Futures.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on 30.10.2016 7 | */ 8 | 9 | package de.rgra.functional.java8; 10 | 11 | import java.io.IOException; 12 | import java.nio.file.Files; 13 | import java.nio.file.Paths; 14 | import java.util.List; 15 | import java.util.concurrent.CompletableFuture; 16 | import java.util.concurrent.ExecutorService; 17 | import java.util.concurrent.Executors; 18 | 19 | /** 20 | * @author rgra 21 | */ 22 | public class Futures { 23 | 24 | public static void main(String[] args) { 25 | CompletableFuture> future = readList(); 26 | 27 | future.thenApply(list -> list.toString()) 28 | .thenAccept(System.out::println); 29 | 30 | future 31 | .thenApply(list -> "List read: " + list.size()) 32 | .exceptionally(t -> "Failed: " + t.getMessage()) 33 | .thenAccept(System.out::println); 34 | } 35 | 36 | private static CompletableFuture> readList() { 37 | CompletableFuture> future = new CompletableFuture<>(); 38 | ExecutorService pool = Executors.newSingleThreadExecutor(); 39 | 40 | pool.submit(() -> { 41 | try { 42 | future.complete(Files.readAllLines(Paths.get("D:", "test.csv"))); 43 | } 44 | catch (IOException e) { 45 | future.completeExceptionally(e); 46 | } 47 | }); 48 | pool.shutdown(); 49 | 50 | return future; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /LiveCoding/src/main/java/io/github/rgra/live/VertxRouting.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)VertxRouting.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2017 5 | * =========================================================================== 6 | * Created on 04.11.2017 7 | */ 8 | 9 | package io.github.rgra.live; 10 | 11 | import java.util.concurrent.TimeUnit; 12 | 13 | import io.vertx.core.Vertx; 14 | import io.vertx.core.http.HttpServerOptions; 15 | import io.vertx.ext.web.Router; 16 | 17 | /** 18 | * @author rgra 19 | */ 20 | public class VertxRouting { 21 | 22 | public static void main(String[] args) { 23 | Vertx vertx = Vertx.vertx(); 24 | 25 | Router router = Router.router(vertx); 26 | router.route("/bremen").handler(routingContext -> { 27 | routingContext.response() 28 | .setChunked(true) 29 | .write("Germany") 30 | .end(); 31 | }); 32 | router.route("/copenhagen").handler(routingContext -> { 33 | routingContext.response() 34 | .setChunked(true) 35 | .write("Denmark") 36 | .end(); 37 | }); 38 | 39 | vertx.createHttpServer(new HttpServerOptions()) 40 | // .requestHandler(router::accept) 41 | .listen(8080, res -> { 42 | if (res.failed()) { 43 | res.cause().printStackTrace(); 44 | } 45 | }); 46 | } 47 | 48 | private static void sleep() { 49 | try { 50 | TimeUnit.SECONDS.sleep(2); 51 | } 52 | catch (InterruptedException e) { 53 | e.printStackTrace(); 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /JUnit5/src/test/java/de/rgra/functional/junit/DynamicTestFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)DynamicTestFactory.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on 25.09.2016 7 | */ 8 | 9 | package de.rgra.functional.junit; 10 | 11 | import static org.junit.jupiter.api.Assertions.*; 12 | import static org.junit.jupiter.api.DynamicTest.*; 13 | 14 | import java.util.stream.IntStream; 15 | import java.util.stream.Stream; 16 | 17 | import org.junit.jupiter.api.DisplayName; 18 | import org.junit.jupiter.api.DynamicTest; 19 | import org.junit.jupiter.api.Test; 20 | import org.junit.jupiter.api.TestFactory; 21 | import org.junit.platform.runner.JUnitPlatform; 22 | import org.junit.runner.RunWith; 23 | 24 | /** 25 | * @author rgra 26 | */ 27 | @RunWith(JUnitPlatform.class) 28 | public class DynamicTestFactory { 29 | 30 | @Test 31 | public void testFibonacci1() { 32 | testIsOdd(fibonacci(1)); 33 | } 34 | 35 | @Test 36 | public void testFibonacci2() { 37 | testIsOdd(fibonacci(2)); 38 | } 39 | 40 | @Test 41 | public void testFibonacci3() { 42 | testIsOdd(fibonacci(3)); 43 | } 44 | 45 | @TestFactory 46 | @DisplayName("all Fibonacci numbers are odd") 47 | Stream testFactory() { 48 | return IntStream.rangeClosed(1, 20) 49 | .mapToObj(n -> dynamicTest("Fibonacci(" + n + ")", 50 | () -> testIsOdd(fibonacci(n)))); 51 | } 52 | 53 | public int fibonacci(int n) { 54 | if (n <= 2) 55 | return 1; 56 | return fibonacci(n - 1) + fibonacci(n - 2); 57 | } 58 | 59 | private void testIsOdd(int i) { 60 | assertTrue(i % 2 == 1, "Should be odd, but was: " + i); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /LiveCoding/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenCentral() 4 | } 5 | dependencies { 6 | classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1' 7 | } 8 | } 9 | 10 | repositories { 11 | mavenCentral() 12 | } 13 | 14 | ext.junit4Version = '4.12' 15 | ext.junitVintageVersion = '4.12.1' 16 | ext.junitPlatformVersion = '1.0.1' 17 | ext.junitJupiterVersion = '5.0.1' 18 | ext.log4jVersion = '2.9.0' 19 | 20 | apply plugin: 'java' 21 | apply plugin: 'org.junit.platform.gradle.plugin' 22 | 23 | dependencies { 24 | compile 'org.jooq:jool:0.9.12' 25 | //compile project(':model') 26 | 27 | compile 'org.jdeferred:jdeferred-core:1.2.4' 28 | compile 'org.slf4j:slf4j-simple:1.8.0-beta0' 29 | 30 | compile 'io.vavr:vavr:0.9.1' 31 | 32 | compile 'io.reactivex.rxjava2:rxjava:2.1.6' 33 | compile "io.vertx:vertx-core:3.5.0" 34 | compile "io.vertx:vertx-web:3.5.0" 35 | 36 | // JUnit Jupiter API and TestEngine implementation 37 | testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}") 38 | testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}") 39 | 40 | // If you also want to support JUnit 3 and JUnit 4 tests 41 | testCompile("junit:junit:${junit4Version}") 42 | testRuntime("org.junit.vintage:junit-vintage-engine:${junitVintageVersion}") 43 | 44 | // To avoid compiler warnings about @API annotations in JUnit code 45 | testCompileOnly('org.apiguardian:apiguardian-api:1.0.0') 46 | 47 | // To use Log4J's LogManager 48 | testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}") 49 | testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}") 50 | 51 | compile("org.junit.platform:junit-platform-launcher:${junitPlatformVersion}") 52 | compile("org.junit.platform:junit-platform-runner:${junitPlatformVersion}") 53 | } 54 | 55 | -------------------------------------------------------------------------------- /eclipse-collections/src/main/java/de/rgra/functional/eclipse/EclipseCollectionsPlayground.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)EclipseCollectionsPlayground.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on 25.09.2016 7 | */ 8 | 9 | package de.rgra.functional.eclipse; 10 | 11 | 12 | import org.eclipse.collections.api.list.MutableList; 13 | import org.eclipse.collections.api.list.primitive.MutableIntList; 14 | import org.eclipse.collections.petkata.Person; 15 | import org.eclipse.collections.petkata.PetDomainForKata; 16 | import org.eclipse.collections.petkata.PetType; 17 | 18 | /** 19 | * @author rgra 20 | */ 21 | public class EclipseCollectionsPlayground extends PetDomainForKata { 22 | 23 | public static void main(String[] args) throws Exception { 24 | EclipseCollectionsPlayground eclipseCollectionsPlayground = new EclipseCollectionsPlayground(); 25 | eclipseCollectionsPlayground.setUp(); 26 | eclipseCollectionsPlayground.test(); 27 | } 28 | 29 | public void test() { 30 | boolean anyPeopleHaveCats = this.people 31 | .anySatisfyWith(Person::hasPet, PetType.CAT); 32 | 33 | int countPeopleWithCats = this.people 34 | .countWith(Person::hasPet, PetType.CAT); 35 | 36 | MutableList peopleWithCats = this.people 37 | .selectWith(Person::hasPet, PetType.CAT) 38 | .drop(10); 39 | 40 | MutableIntList numberOfPets = this.people 41 | .sortThisByInt(p -> p.getNumberOfPets()) 42 | .collectInt(p -> p.getNumberOfPets()); 43 | 44 | Person person = people 45 | .selectWith(Person::hasPet, PetType.CAT) 46 | .detect(p -> p.getFirstName().startsWith("R")); 47 | 48 | System.out.println(person); 49 | 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /JOOL/src/main/java/de/rgra/functional/jool/JoolTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)List2Map.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on Sep 23, 2016 7 | */ 8 | 9 | package de.rgra.functional.jool; 10 | 11 | import static java.util.stream.Collectors.*; 12 | 13 | import java.text.MessageFormat; 14 | import java.time.LocalDate; 15 | import java.time.MonthDay; 16 | import java.util.List; 17 | 18 | import org.jooq.lambda.Seq; 19 | 20 | import de.rgra.functional.model.Employee; 21 | import de.rgra.functional.model.EmployeeRegister; 22 | 23 | /** 24 | * @author gransberger 25 | */ 26 | public class JoolTest { 27 | 28 | public static void main(String[] args) { 29 | List persons = EmployeeRegister.getPersons(toList()); 30 | 31 | Seq.seq(persons) 32 | .filter(p -> p.getBirthday().getMonth() == LocalDate.now().getMonth()) 33 | // Tuple2> 34 | .grouped(e -> MonthDay.from(e.getBirthday()), toList()) 35 | .filter(t -> t.v2.size() > 1) 36 | .sorted(t -> t.v1) 37 | .forEach(t -> sendMail(t.v1, t.v2)); 38 | } 39 | 40 | private static void sendMail(MonthDay date, List persons) { 41 | String emails = Seq.seq(persons) 42 | .map(Employee::getEmail) 43 | .toString(";"); 44 | 45 | String subject = MessageFormat.format("Please organise a birthday breakfast on {0} ", 46 | date.atYear(2016).toString()); 47 | System.out.println("-------------"); 48 | System.out.println("To: " + emails); 49 | System.out.println(subject); 50 | // Body 51 | Seq.seq(persons) 52 | .map(Employee::getEmployeeNumber) 53 | .map(s -> "- Co-Worker #" + s) 54 | .printOut(); 55 | } 56 | 57 | } 58 | -------------------------------------------------------------------------------- /LiveCoding/src/test/java/io/github/rgra/live/DynamicTestFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)DynamicTestFactory.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on 25.09.2016 7 | */ 8 | 9 | package io.github.rgra.live; 10 | 11 | import static org.junit.jupiter.api.Assertions.*; 12 | import static org.junit.jupiter.api.DynamicTest.*; 13 | 14 | import java.util.stream.IntStream; 15 | import java.util.stream.Stream; 16 | 17 | import org.junit.jupiter.api.DisplayName; 18 | import org.junit.jupiter.api.DynamicTest; 19 | import org.junit.jupiter.api.Test; 20 | import org.junit.jupiter.api.TestFactory; 21 | import org.junit.platform.runner.JUnitPlatform; 22 | import org.junit.runner.RunWith; 23 | 24 | /** 25 | * @author rgra 26 | */ 27 | @RunWith(JUnitPlatform.class) 28 | public class DynamicTestFactory { 29 | 30 | @Test 31 | public void testFibonacci1() { 32 | testIsOdd(fibonacci(1)); 33 | } 34 | 35 | @Test 36 | public void testFibonacci2() { 37 | testIsOdd(fibonacci(2)); 38 | } 39 | 40 | @Test 41 | public void testFibonacci3() { 42 | testIsOdd(fibonacci(3)); 43 | } 44 | 45 | @TestFactory 46 | @DisplayName("all Fibonacci numbers are odd") 47 | Stream testFactory() { 48 | return IntStream.rangeClosed(1, 20) 49 | .mapToObj(n -> dynamicTest("Fibonacci(" + n + ")", 50 | () -> testIsOdd(fibonacci(n)))); 51 | } 52 | 53 | public int fibonacci(int n) { 54 | if (n <= 2) 55 | return 1; 56 | return fibonacci(n - 1) + fibonacci(n - 2); 57 | } 58 | 59 | private void testIsOdd(int i) { 60 | assertTrue(i % 2 == 1, "Should be odd, but was: " + i); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /StreamEx/src/main/java/de/rgra/functional/streamex/StreamExFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)StreamExFactory.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on Sep 24, 2016 7 | */ 8 | 9 | package de.rgra.functional.streamex; 10 | 11 | import static java.util.Arrays.*; 12 | 13 | import java.io.IOException; 14 | import java.nio.file.Files; 15 | import java.nio.file.Path; 16 | import java.nio.file.Paths; 17 | import java.util.function.Function; 18 | import java.util.stream.Stream; 19 | 20 | import one.util.streamex.StreamEx; 21 | 22 | /** 23 | * @author gransberger 24 | */ 25 | public class StreamExFactory { 26 | 27 | public static void main(String[] args) { 28 | // ofLines(Path) 29 | // ofValues/Keys(Map) 30 | 31 | StreamEx.cartesianProduct(asList( 32 | asList(1, 2), 33 | asList(-3, -4), 34 | asList(50, 60))) 35 | .forEach(System.out::println); 36 | 37 | StreamEx.split("Firstname-Name-Titel", "-").forEach(System.out::println); 38 | 39 | StreamEx.zip(asList("Rabea", "vJUG"), asList("Gransb.", "24"), (f, l) -> f + " " + l) 40 | .forEach(System.out::println); 41 | 42 | StreamEx.ofTree(Paths.get("D:\\"), 43 | listDirs()) 44 | .limit(20).forEach(System.out::println); 45 | 46 | } 47 | 48 | private static Function> listDirs() { 49 | Function> mapper = dir -> { 50 | if (Files.isDirectory(dir) && !dir.toString().contains("RECYCLE.BIN")) { 51 | try { 52 | return Files.list(dir); 53 | } 54 | catch (IOException e) { 55 | throw new RuntimeException(e); 56 | } 57 | } 58 | else { 59 | return Stream.empty(); 60 | } 61 | }; 62 | return mapper; 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /LiveCoding/src/main/java/io/github/rgra/live/JoolBirthday.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)JoolBirthday.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2017 5 | * =========================================================================== 6 | * Created on 04.11.2017 7 | */ 8 | 9 | package io.github.rgra.live; 10 | 11 | import static java.util.stream.Collectors.*; 12 | 13 | import java.text.MessageFormat; 14 | import java.time.LocalDate; 15 | import java.time.MonthDay; 16 | import java.util.List; 17 | 18 | import org.jooq.lambda.Seq; 19 | 20 | import de.rgra.functional.model.Employee; 21 | import de.rgra.functional.model.EmployeeRegister; 22 | 23 | /** 24 | * @author rgra 25 | */ 26 | public class JoolBirthday { 27 | public static void main(String[] args) { 28 | List persons = EmployeeRegister.getPersons(toList()); 29 | 30 | Seq.seq(persons) 31 | .filter(p -> p.getBirthday().getMonth() == LocalDate.now().getMonth()) 32 | // Tuple2> 33 | .grouped(e -> MonthDay.from(e.getBirthday()), toList()) 34 | .filter(t -> t.v2.size() > 1) 35 | .sorted(t -> t.v1) 36 | .forEach(t -> sendMail(t.v1, t.v2)); 37 | } 38 | 39 | private static void sendMail(MonthDay date, List persons) { 40 | String emails = Seq.seq(persons) 41 | .map(Employee::getEmail) 42 | .toString(";"); 43 | 44 | String subject = MessageFormat.format("Please organise a birthday breakfast on {0} ", 45 | date.atYear(2016).toString()); 46 | System.out.println("-------------"); 47 | System.out.println("To: " + emails); 48 | System.out.println(subject); 49 | // Body 50 | Seq.seq(persons) 51 | .map(Employee::getEmployeeNumber) 52 | .map(s -> "- Co-Worker #" + s) 53 | .printOut(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /StreamEx/src/main/java/de/rgra/functional/streamex/StreamExTest2.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)List2Map.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on Sep 23, 2016 7 | */ 8 | 9 | package de.rgra.functional.streamex; 10 | 11 | import static java.time.MonthDay.*; 12 | import static java.util.stream.Collectors.*; 13 | 14 | import java.text.MessageFormat; 15 | import java.time.LocalDate; 16 | import java.time.MonthDay; 17 | import java.util.List; 18 | 19 | import de.rgra.functional.model.Employee; 20 | import de.rgra.functional.model.EmployeeRegister; 21 | 22 | import one.util.streamex.StreamEx; 23 | 24 | /** 25 | * @author gransberger 26 | */ 27 | public class StreamExTest2 { 28 | 29 | public static void main(String[] args) { 30 | List persons = EmployeeRegister.getPersons(toList()); 31 | 32 | StreamEx.of(persons).filter(p -> p.getBirthday().getMonth() == LocalDate.now().getMonth()) 33 | .sortedBy(e -> from(e.getBirthday())) 34 | .groupRuns((e, n) -> from(e.getBirthday()).equals(from(n.getBirthday()))) 35 | .filter(l -> l.size() > 1) 36 | .forEach(StreamExTest2::sendMail); 37 | } 38 | 39 | 40 | private static void sendMail(List persons) { 41 | MonthDay date = from(persons.get(0).getBirthday()); 42 | String emails = StreamEx.of(persons) 43 | .map(Employee::getEmail) 44 | .joining(";"); 45 | String subject = MessageFormat.format("Please organise a birthday breakfast on {0} ", 46 | date.atYear(2016).toString()); 47 | System.out.println("-------------"); 48 | System.out.println("To: " + emails); 49 | System.out.println(subject); 50 | // Body 51 | StreamEx.of(persons) 52 | .map(Employee::getEmployeeNumber) 53 | .map(s -> "- Co-Worker #" + s) 54 | .forEach(System.out::println); 55 | 56 | } 57 | 58 | } 59 | -------------------------------------------------------------------------------- /StreamEx/src/main/java/de/rgra/functional/streamex/StreamExTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)List2Map.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on Sep 23, 2016 7 | */ 8 | 9 | package de.rgra.functional.streamex; 10 | 11 | import static java.util.stream.Collectors.*; 12 | 13 | import java.text.MessageFormat; 14 | import java.time.LocalDate; 15 | import java.time.MonthDay; 16 | import java.util.List; 17 | import java.util.Map; 18 | 19 | import de.rgra.functional.model.Employee; 20 | import de.rgra.functional.model.EmployeeRegister; 21 | 22 | import one.util.streamex.EntryStream; 23 | import one.util.streamex.StreamEx; 24 | 25 | /** 26 | * @author gransberger 27 | */ 28 | public class StreamExTest { 29 | 30 | public static void main(String[] args) { 31 | List persons = EmployeeRegister.getPersons(toList()); 32 | 33 | Map> byDate = StreamEx.of(persons) 34 | .filter(p -> p.getBirthday().getMonth() == LocalDate.now().getMonth()) 35 | .groupingBy(e -> MonthDay.from(e.getBirthday())); 36 | 37 | EntryStream.of(byDate) 38 | .filterValues(l -> l.size() > 1) 39 | .sortedBy(Map.Entry::getKey) 40 | .forKeyValue(StreamExTest::sendMail); 41 | } 42 | 43 | private static void sendMail(MonthDay date, List persons) { 44 | String emails = StreamEx.of(persons) 45 | .map(Employee::getEmail) 46 | .joining(";"); 47 | String subject = MessageFormat.format("Please organise a birthday breakfast on {0} ", 48 | date.atYear(2016).toString()); 49 | System.out.println("-------------"); 50 | System.out.println("To: " + emails); 51 | System.out.println(subject); 52 | // Body 53 | StreamEx.of(persons) 54 | .map(Employee::getEmployeeNumber) 55 | .map(s -> "- Co-Worker #" + s) 56 | .forEach(System.out::println); 57 | 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /more-spliterators/src/main/java/de/rgra/functional/spliterators/DateCreator.java: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | * @(#)RandomDateCreator.java 4 | * =========================================================================== 5 | * (C) Copyright Rabea Gransberger 2016 6 | * =========================================================================== 7 | * Created on Sep 23, 2016 8 | */ 9 | package de.rgra.functional.spliterators; 10 | import static java.util.stream.Collectors.*; 11 | import static org.paumard.spliterators.MoreSpliterators.*; 12 | 13 | import java.time.DateTimeException; 14 | import java.time.LocalDate; 15 | import java.time.MonthDay; 16 | import java.util.List; 17 | import java.util.Random; 18 | import java.util.stream.IntStream; 19 | 20 | /** 21 | * @author gransberger 22 | */ 23 | public final class DateCreator { 24 | 25 | private DateCreator() { 26 | // only static methods 27 | throw new AssertionError(); 28 | } 29 | 30 | public static void main(String[] args) { 31 | allPossibleMonthDays().forEach(System.out::println); 32 | randomDates().forEach(System.out::println); 33 | } 34 | 35 | public static List allPossibleMonthDays() { 36 | return zip( 37 | repeat(IntStream.rangeClosed(1, 12).boxed(), 31), 38 | cycle(IntStream.rangeClosed(1, 31).boxed()), 39 | DateCreator::secureDate) 40 | .distinct() 41 | .collect(toList()); 42 | } 43 | 44 | public static List randomDates() { 45 | Random random = new Random(); 46 | int numberElements = 100; 47 | 48 | return zip( 49 | random.ints(2014, 2017).boxed(), 50 | random.ints(1, 366).boxed(), 51 | LocalDate::ofYearDay) 52 | .distinct() 53 | .limit(numberElements) 54 | .collect(toList()); 55 | } 56 | 57 | private static MonthDay secureDate(Integer month, Integer dayOfMonth) { 58 | try { 59 | return MonthDay.of(month, dayOfMonth); 60 | } 61 | catch (DateTimeException ignore) { 62 | // ignore exception, supply dummy value instead 63 | return MonthDay.of(1, 1); 64 | } 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /more-spliterators/src/main/java/de/rgra/functional/collectors/CollectorsPlayground.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)CollectorsPlayground.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2017 5 | * =========================================================================== 6 | * Created on 06.02.2017 7 | */ 8 | 9 | package de.rgra.functional.collectors; 10 | 11 | import static java.util.stream.Collectors.*; 12 | import static org.paumard.collectors.CollectorsUtils.*; 13 | 14 | import java.text.MessageFormat; 15 | import java.time.LocalDate; 16 | import java.time.Month; 17 | import java.time.MonthDay; 18 | import java.util.Comparator; 19 | import java.util.List; 20 | import java.util.Map; 21 | 22 | import de.rgra.functional.model.Employee; 23 | import de.rgra.functional.model.EmployeeRegister; 24 | /** 25 | * @author rgra 26 | */ 27 | public class CollectorsPlayground { 28 | 29 | public static void main(String[] args) { 30 | List persons = EmployeeRegister.getPersons(toList()); 31 | Month currentMonth = LocalDate.now().getMonth(); 32 | 33 | persons.stream() 34 | .filter(p -> p.getBirthday().getMonth() == currentMonth) 35 | .collect(groupingByThenStream(p -> MonthDay.from(p.getBirthday()))) 36 | .filter(e -> e.getValue().size() > 1) 37 | .sorted(Comparator.comparing(Map.Entry::getKey)) 38 | .forEach(e -> sendMail(e.getKey(), e.getValue())); 39 | } 40 | 41 | private static void sendMail(MonthDay date, List persons) { 42 | String emails = persons.stream().map(Employee::getEmail) 43 | .collect(joining(";")); 44 | String subject = MessageFormat.format("Please organise a birthday breakfast on {0} ", date.atYear(2016).toString()); 45 | System.out.println("-------------"); 46 | System.out.println("To: " + emails); 47 | System.out.println(subject); 48 | // Body 49 | persons.stream() 50 | .map(Employee::getEmployeeNumber) 51 | .map(s -> "- Co-Worker #" + s) 52 | .forEach(System.out::println); 53 | 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /jinq/src/test/resources/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.mysql.jdbc.Driver 6 | jdbc:mysql://localhost:3306/test 7 | root 8 | 9 | 10 | 11 | 12 | 17 | org.jooq.util.JavaGenerator 18 | 19 | 20 | 22 | org.jooq.util.mysql.MySQLDatabase 23 | 24 | 26 | test 27 | 28 | 31 | .* 32 | 33 | 36 | 37 | 38 | 39 | 40 | 41 | test.generated 42 | 43 | 44 | D:/workspaces/neon/konferenz/jinq/src/main/java 45 | 46 | 47 | -------------------------------------------------------------------------------- /jinq/src/main/java/test/generated/Keys.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This class is generated by jOOQ 3 | */ 4 | package test.generated; 5 | 6 | /** 7 | * This class is generated by jOOQ. 8 | * 9 | * A class modelling foreign key relationships between tables of the test 10 | * schema 11 | */ 12 | @javax.annotation.Generated(value = { "http://www.jooq.org", "3.3.2" }, 13 | comments = "This class is generated by jOOQ") 14 | @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) 15 | public class Keys { 16 | 17 | // ------------------------------------------------------------------------- 18 | // IDENTITY definitions 19 | // ------------------------------------------------------------------------- 20 | 21 | public static final org.jooq.Identity IDENTITY_AUTHOR = Identities0.IDENTITY_AUTHOR; 22 | 23 | // ------------------------------------------------------------------------- 24 | // UNIQUE and PRIMARY KEY definitions 25 | // ------------------------------------------------------------------------- 26 | 27 | public static final org.jooq.UniqueKey KEY_AUTHOR_PRIMARY = UniqueKeys0.KEY_AUTHOR_PRIMARY; 28 | 29 | // ------------------------------------------------------------------------- 30 | // FOREIGN KEY definitions 31 | // ------------------------------------------------------------------------- 32 | 33 | 34 | // ------------------------------------------------------------------------- 35 | // [#1459] distribute members to avoid static initialisers > 64kb 36 | // ------------------------------------------------------------------------- 37 | 38 | private static class Identities0 extends org.jooq.impl.AbstractKeys { 39 | public static org.jooq.Identity IDENTITY_AUTHOR = createIdentity(test.generated.tables.Author.AUTHOR, test.generated.tables.Author.AUTHOR.ID); 40 | } 41 | 42 | private static class UniqueKeys0 extends org.jooq.impl.AbstractKeys { 43 | public static final org.jooq.UniqueKey KEY_AUTHOR_PRIMARY = createUniqueKey(test.generated.tables.Author.AUTHOR, test.generated.tables.Author.AUTHOR.ID); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Java9/src/main/java/io/github/rgra/java9/Flow.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)Flow.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2017 5 | * =========================================================================== 6 | * Created on 04.11.2017 7 | */ 8 | 9 | package io.github.rgra.java9; 10 | 11 | import java.util.Arrays; 12 | import java.util.concurrent.Flow.Subscriber; 13 | import java.util.concurrent.Flow.Subscription; 14 | import java.util.concurrent.SubmissionPublisher; 15 | import java.util.concurrent.TimeUnit; 16 | 17 | /** 18 | * @see https://community.oracle.com/docs/DOC-1006738 19 | */ 20 | public class Flow { 21 | 22 | public static void main(String[] args) throws InterruptedException { 23 | // Create Publisher 24 | SubmissionPublisher publisher = new SubmissionPublisher<>(); 25 | 26 | // Register Subscriber 27 | MySubscriber subscriber = new MySubscriber<>() { 28 | protected void onNextItem(String item) { 29 | System.out.println("Got : " + item); 30 | } 31 | 32 | @Override 33 | public void onError(Throwable t) { 34 | t.printStackTrace(); 35 | } 36 | 37 | @Override 38 | public void onComplete() { 39 | System.out.println("Done"); 40 | } 41 | }; 42 | publisher.subscribe(subscriber); 43 | 44 | // Publish items 45 | System.out.println("Publishing Items..."); 46 | String[] items = { "1", "x", "2", "x", "3", "x" }; 47 | Arrays.asList(items).stream().forEach(i -> publisher.submit(i)); 48 | publisher.close(); 49 | 50 | TimeUnit.SECONDS.sleep(10); 51 | } 52 | 53 | public abstract static class MySubscriber implements Subscriber { 54 | private Subscription subscription; 55 | 56 | @Override 57 | public void onSubscribe(Subscription subscription) { 58 | this.subscription = subscription; 59 | subscription.request(1); 60 | } 61 | 62 | @Override 63 | public final void onNext(T item) { 64 | onNextItem(item); 65 | subscription.request(1); 66 | } 67 | 68 | protected abstract void onNextItem(T item); 69 | 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /JUnit5/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenCentral() 4 | } 5 | dependencies { 6 | classpath 'org.junit.platform:junit-platform-gradle-plugin:1.0.1' 7 | } 8 | } 9 | 10 | repositories { 11 | mavenCentral() 12 | } 13 | 14 | ext.junit4Version = '4.12' 15 | ext.junitVintageVersion = '4.12.1' 16 | ext.junitPlatformVersion = '1.0.1' 17 | ext.junitJupiterVersion = '5.0.1' 18 | ext.log4jVersion = '2.9.0' 19 | 20 | apply plugin: 'java' 21 | apply plugin: 'eclipse' 22 | apply plugin: 'idea' 23 | apply plugin: 'org.junit.platform.gradle.plugin' 24 | 25 | jar { 26 | baseName = 'junit5-gradle-consumer' 27 | version = '1.0.0-SNAPSHOT' 28 | } 29 | 30 | compileTestJava { 31 | sourceCompatibility = 1.8 32 | targetCompatibility = 1.8 33 | options.compilerArgs += '-parameters' 34 | } 35 | 36 | junitPlatform { 37 | // platformVersion '1.0.1' 38 | filters { 39 | engines { 40 | // include 'junit-jupiter', 'junit-vintage' 41 | // exclude 'custom-engine' 42 | } 43 | tags { 44 | // include 'fast' 45 | exclude 'slow' 46 | } 47 | // includeClassNamePattern '.*Test' 48 | } 49 | // configurationParameter 'junit.jupiter.conditions.deactivate', '*' 50 | // enableStandardTestTask true 51 | // reportsDir file('build/test-results/junit-platform') // this is the default 52 | logManager 'org.apache.logging.log4j.jul.LogManager' 53 | } 54 | 55 | dependencies { 56 | // JUnit Jupiter API and TestEngine implementation 57 | testCompile("org.junit.jupiter:junit-jupiter-api:${junitJupiterVersion}") 58 | testRuntime("org.junit.jupiter:junit-jupiter-engine:${junitJupiterVersion}") 59 | 60 | // If you also want to support JUnit 3 and JUnit 4 tests 61 | testCompile("junit:junit:${junit4Version}") 62 | testRuntime("org.junit.vintage:junit-vintage-engine:${junitVintageVersion}") 63 | 64 | // To avoid compiler warnings about @API annotations in JUnit code 65 | testCompileOnly('org.apiguardian:apiguardian-api:1.0.0') 66 | 67 | // To use Log4J's LogManager 68 | testRuntime("org.apache.logging.log4j:log4j-core:${log4jVersion}") 69 | testRuntime("org.apache.logging.log4j:log4j-jul:${log4jVersion}") 70 | 71 | // Only needed to run tests in an (IntelliJ) IDE(A) that bundles an older version 72 | testRuntime("org.junit.platform:junit-platform-launcher:${junitPlatformVersion}") 73 | } 74 | 75 | task wrapper(type: Wrapper) { 76 | description = 'Generates gradlew[.bat] scripts' 77 | gradleVersion = '4.1' 78 | } -------------------------------------------------------------------------------- /JDeferred/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /Java9/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /LiveCoding/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /Java9/src/main/java/io/github/rgra/java9/http/HTTP.java: -------------------------------------------------------------------------------- 1 | package io.github.rgra.java9.http; 2 | 3 | import java.net.URI; 4 | import java.net.URISyntaxException; 5 | import java.nio.charset.StandardCharsets; 6 | import java.util.concurrent.CompletableFuture; 7 | 8 | import jdk.incubator.http.HttpClient; 9 | import jdk.incubator.http.HttpClient.Version; 10 | import jdk.incubator.http.HttpRequest; 11 | import jdk.incubator.http.HttpResponse; 12 | 13 | /** 14 | * @author rgra 15 | */ 16 | public class HTTP { 17 | 18 | public static void main(String[] args) 19 | throws URISyntaxException { 20 | jdk.incubator.http.HttpClient httpClient = HttpClient.newBuilder() 21 | .version(Version.HTTP_2) 22 | .build(); 23 | 24 | CompletableFuture slowResponse = async(httpClient, "http://oredev.org") 25 | .thenApply(response -> "Response Slow: " + response.body().length()) 26 | .exceptionally(t -> "Failed Local: " + t.getMessage()) 27 | .thenAccept(System.out::println); 28 | 29 | CompletableFuture fastResponse = async(httpClient, "http://google.de") 30 | .thenApply(response -> "Response Fast: " + response.body().length()) 31 | .exceptionally(t -> "Failed Local: " + t.getMessage()) 32 | .thenAccept(System.out::println); 33 | 34 | // CompletableFuture slowResponse = async(httpClient, "http://127.0.0.1:8080/slow") 35 | // .thenApply(response -> "Response Slow: " + response.body()) 36 | // .exceptionally(t -> "Failed Local: " + t.getMessage()) 37 | // .thenAccept(System.out::println); 38 | // 39 | // CompletableFuture fastResponse = async(httpClient, "http://127.0.0.1:8080/bremen") 40 | // .thenApply(response -> "Response Fast: " + response.body()) 41 | // .exceptionally(t -> "Failed Local: " + t.getMessage()) 42 | // .thenAccept(System.out::println); 43 | 44 | CompletableFuture.allOf(fastResponse, slowResponse) 45 | .join(); 46 | } 47 | 48 | private static CompletableFuture> async(HttpClient httpClient, String url) 49 | throws URISyntaxException { 50 | return httpClient.sendAsync(get(url), 51 | HttpResponse.BodyHandler.asString(StandardCharsets.UTF_8)); 52 | } 53 | 54 | private static HttpRequest get(String url) throws URISyntaxException { 55 | return HttpRequest.newBuilder() 56 | .uri(new URI(url)) 57 | .GET().build(); 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /Java8/src/main/java/de/rgra/functional/java8/List2Map.java: -------------------------------------------------------------------------------- 1 | package de.rgra.functional.java8; 2 | /* 3 | * @(#)List2Map.java 4 | * =========================================================================== 5 | * (C) Copyright Rabea Gransberger 2016 6 | * =========================================================================== 7 | * Created on Sep 23, 2016 8 | */ 9 | 10 | import static java.util.stream.Collectors.*; 11 | 12 | import java.text.MessageFormat; 13 | import java.time.LocalDate; 14 | import java.time.Month; 15 | import java.time.MonthDay; 16 | import java.util.List; 17 | 18 | import de.rgra.functional.model.Employee; 19 | import de.rgra.functional.model.EmployeeRegister; 20 | 21 | /** 22 | * @author gransberger 23 | */ 24 | public class List2Map { 25 | 26 | // 1. Get list of employees 27 | // 2. Find all birthdays this month 28 | // 3. Group by birthday 29 | // 4. Send E-Mail to each group and ask them to organize breakfast together 30 | public static void main(String[] args) { 31 | List persons = EmployeeRegister.getPersons(toList()); 32 | Month currentMonth = LocalDate.now().getMonth(); 33 | 34 | 35 | 36 | } 37 | 38 | // 39 | // 40 | // 41 | // 42 | // 43 | // 44 | // 45 | // 46 | // 47 | // 48 | // 49 | // 50 | // 51 | // 52 | // 53 | // 54 | // 55 | // 56 | // 57 | // 58 | // 59 | // 60 | // 61 | // 62 | // 63 | // 64 | // 65 | // 66 | // 67 | // 68 | // 69 | // 70 | // 71 | // 72 | // 73 | // 74 | // 75 | // 76 | // 77 | // 78 | // 79 | // 80 | // 81 | // Map> map = persons.stream() 82 | // .filter(p -> p.getBirthday().getMonth() == currentMonth) 83 | // .collect(groupingBy(p -> MonthDay.from(p.getBirthday()))); 84 | // 85 | // map.entrySet().stream() 86 | // .filter(e -> e.getValue().size() > 1) 87 | // .sorted(Comparator.comparing(Map.Entry::getKey)) 88 | // .forEach(e -> sendMail(e.getKey(), e.getValue())); 89 | // 90 | // 91 | private static void sendMail(MonthDay date, List persons) { 92 | String emails = persons.stream().map(Employee::getEmail) 93 | .collect(joining(";")); 94 | String subject = MessageFormat.format("Please organise a birthday breakfast on {0} ", date.atYear(2016).toString()); 95 | System.out.println("-------------"); 96 | System.out.println("To: " + emails); 97 | System.out.println(subject); 98 | // Body 99 | persons.stream() 100 | .map(Employee::getEmployeeNumber) 101 | .map(s -> "- Co-Worker #" + s) 102 | .forEach(System.out::println); 103 | 104 | } 105 | 106 | } 107 | -------------------------------------------------------------------------------- /JOOL/src/main/java/de/rgra/functional/jool/JoolPlayground.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)JoolPlayground.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on Sep 24, 2016 7 | */ 8 | 9 | package de.rgra.functional.jool; 10 | 11 | import static java.util.Comparator.*; 12 | import static org.jooq.lambda.tuple.Tuple.*; 13 | 14 | import java.io.IOException; 15 | import java.math.BigDecimal; 16 | import java.nio.charset.StandardCharsets; 17 | import java.nio.file.Files; 18 | import java.nio.file.Paths; 19 | import java.util.Objects; 20 | 21 | import org.jooq.lambda.Agg; 22 | import org.jooq.lambda.Seq; 23 | import org.jooq.lambda.Unchecked; 24 | import org.jooq.lambda.tuple.Tuple2; 25 | 26 | /** 27 | * @author gransberger 28 | */ 29 | public class JoolPlayground { 30 | 31 | public static void main(String[] args) { 32 | Seq.of(tuple(1, 2, 3, 4)) 33 | .mapToLong(t -> t.v1 * t.v2 * t.v3 * t.v4); 34 | 35 | Seq.of(Paths.get("D:\\test.csv")) 36 | .flatMap(file -> { 37 | try { 38 | return Files.lines(file, StandardCharsets.ISO_8859_1); 39 | } 40 | catch (IOException e) { 41 | throw new RuntimeException(e); 42 | } 43 | }) 44 | .printOut(); 45 | 46 | Seq.of(Paths.get("D:\\test.csv")) 47 | .flatMap(Unchecked.function(Files::lines)) 48 | .printOut(); 49 | 50 | System.out.println("Cross: " + 51 | Seq.of(tuple(1, 10), tuple(2, 20), tuple(3, 20)) 52 | .crossJoin(Seq.of(1, 2)) 53 | .format()); 54 | 55 | System.out.println("Left: " + 56 | Seq.of(tuple(1, 10), tuple(2, 20), tuple(3, 20)) 57 | .leftOuterJoin(Seq.of(1, 2), (x, y) -> Objects.equals(x.v1, y)) 58 | .format()); 59 | 60 | System.out.println("Right: " + 61 | Seq.of(tuple(1, 10), tuple(2, 20)) 62 | .rightOuterJoin(Seq.of(1, 2, 3), (x, y) -> Objects.equals(x.v1, y)) 63 | .format()); 64 | 65 | System.out.println("Inner: " + 66 | Seq.of(tuple(1, 10), tuple(2, 20), tuple(3, 20)) 67 | .innerJoin(Seq.of(1, 2), (x, y) -> Objects.equals(x.v1, y)) 68 | .format()); 69 | 70 | Seq.of(tuple("2016-09-27", new BigDecimal("-5")), tuple("2016-09-20", new BigDecimal("100")), tuple("2016-09-11", new BigDecimal("-20"))) 71 | .window(comparing((Tuple2 t) -> t.v1), Long.MIN_VALUE, 0) 72 | .map(w -> w.value().concat(w.sum(t -> t.v2).orElse(BigDecimal.ZERO))) 73 | .printOut(); 74 | 75 | System.out.println(Seq.of("A", "AA", "BA") 76 | .collect(Agg.commonPrefix())); 77 | System.out.println(Seq.of("A", "AA", "BA") 78 | .collect(Agg.commonSuffix())); 79 | 80 | } 81 | 82 | } 83 | -------------------------------------------------------------------------------- /JOOL/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /JUnit5/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /Java8/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /jinq/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /rxjava/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /vertx/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /AssertJ/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /Javaslang/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /StreamEx/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /eclipse-collections/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /more-spliterators/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /talk-functional-model/gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /LiveCoding/src/main/java/io/github/rgra/live/Java8Birthday.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)Java8Birthday.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2017 5 | * =========================================================================== 6 | * Created on 04.11.2017 7 | */ 8 | 9 | package io.github.rgra.live; 10 | 11 | import static java.util.stream.Collectors.*; 12 | 13 | import java.text.MessageFormat; 14 | import java.time.LocalDate; 15 | import java.time.Month; 16 | import java.time.MonthDay; 17 | import java.util.Comparator; 18 | import java.util.List; 19 | import java.util.Map; 20 | 21 | import de.rgra.functional.model.Employee; 22 | import de.rgra.functional.model.EmployeeRegister; 23 | 24 | /** 25 | * @author rgra 26 | */ 27 | public class Java8Birthday { 28 | // 1. Get list of employees 29 | // 2. Find all birthdays this month 30 | // 3. Group by birthday 31 | // 4. Send E-Mail to each group and ask them to organize breakfast together 32 | public static void main(String[] args) { 33 | List persons = EmployeeRegister.getPersons(toList()); 34 | Month currentMonth = LocalDate.now().getMonth(); 35 | 36 | Map> map = persons.stream() 37 | .filter(p -> p.getBirthday().getMonth() == currentMonth) 38 | .collect(groupingBy(p -> MonthDay.from(p.getBirthday()))); 39 | 40 | map.entrySet().stream() 41 | .filter(e -> e.getValue().size() > 1) 42 | .sorted(Comparator.comparing(Map.Entry::getKey)) 43 | .forEach(e -> sendMail(e.getKey(), e.getValue())); 44 | } 45 | 46 | // 47 | // 48 | // 49 | // 50 | // 51 | // 52 | // 53 | // 54 | // 55 | // 56 | // 57 | // 58 | // 59 | // 60 | // 61 | // 62 | // 63 | // 64 | // 65 | // 66 | // 67 | // 68 | // 69 | // 70 | // 71 | // 72 | // 73 | // 74 | // 75 | // 76 | // 77 | // 78 | // 79 | // 80 | // 81 | // 82 | // 83 | // 84 | // 85 | // 86 | // 87 | // 88 | // 89 | // Map> map = persons.stream() 90 | // .filter(p -> p.getBirthday().getMonth() == currentMonth) 91 | // .collect(groupingBy(p -> MonthDay.from(p.getBirthday()))); 92 | // 93 | // map.entrySet().stream() 94 | // .filter(e -> e.getValue().size() > 1) 95 | // .sorted(Comparator.comparing(Map.Entry::getKey)) 96 | // .forEach(e -> sendMail(e.getKey(), e.getValue())); 97 | // 98 | // 99 | private static void sendMail(MonthDay date, List persons) { 100 | String emails = persons.stream().map(Employee::getEmail) 101 | .collect(joining(";")); 102 | String subject = MessageFormat.format("Please organise a birthday breakfast on {0} ", 103 | date.atYear(2016).toString()); 104 | System.out.println("-------------"); 105 | System.out.println("To: " + emails); 106 | System.out.println(subject); 107 | // Body 108 | persons.stream() 109 | .map(Employee::getEmployeeNumber) 110 | .map(s -> "- Co-Worker #" + s) 111 | .forEach(System.out::println); 112 | 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /jinq/src/main/java/test/generated/tables/Author.java: -------------------------------------------------------------------------------- 1 | /** 2 | * This class is generated by jOOQ 3 | */ 4 | package test.generated.tables; 5 | 6 | /** 7 | * This class is generated by jOOQ. 8 | */ 9 | @javax.annotation.Generated(value = { "http://www.jooq.org", "3.3.2" }, 10 | comments = "This class is generated by jOOQ") 11 | @java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" }) 12 | public class Author extends org.jooq.impl.TableImpl { 13 | 14 | private static final long serialVersionUID = -274097543; 15 | 16 | /** 17 | * The singleton instance of test.author 18 | */ 19 | public static final test.generated.tables.Author AUTHOR = new test.generated.tables.Author(); 20 | 21 | /** 22 | * The class holding records for this type 23 | */ 24 | @Override 25 | public java.lang.Class getRecordType() { 26 | return test.generated.tables.records.AuthorRecord.class; 27 | } 28 | 29 | /** 30 | * The column test.author.id. 31 | */ 32 | public final org.jooq.TableField ID = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, ""); 33 | 34 | /** 35 | * The column test.author.first_name. 36 | */ 37 | public final org.jooq.TableField FIRST_NAME = createField("first_name", org.jooq.impl.SQLDataType.VARCHAR.length(255), this, ""); 38 | 39 | /** 40 | * The column test.author.last_name. 41 | */ 42 | public final org.jooq.TableField LAST_NAME = createField("last_name", org.jooq.impl.SQLDataType.VARCHAR.length(255), this, ""); 43 | 44 | /** 45 | * The column test.author.age. 46 | */ 47 | public final org.jooq.TableField AGE = createField("age", org.jooq.impl.SQLDataType.INTEGER.nullable(false).defaulted(true), this, ""); 48 | 49 | /** 50 | * Create a test.author table reference 51 | */ 52 | public Author() { 53 | this("author", null); 54 | } 55 | 56 | /** 57 | * Create an aliased test.author table reference 58 | */ 59 | public Author(java.lang.String alias) { 60 | this(alias, test.generated.tables.Author.AUTHOR); 61 | } 62 | 63 | private Author(java.lang.String alias, org.jooq.Table aliased) { 64 | this(alias, aliased, null); 65 | } 66 | 67 | private Author(java.lang.String alias, org.jooq.Table aliased, org.jooq.Field[] parameters) { 68 | super(alias, test.generated.Test.TEST, aliased, parameters, ""); 69 | } 70 | 71 | /** 72 | * {@inheritDoc} 73 | */ 74 | @Override 75 | public org.jooq.Identity getIdentity() { 76 | return test.generated.Keys.IDENTITY_AUTHOR; 77 | } 78 | 79 | /** 80 | * {@inheritDoc} 81 | */ 82 | @Override 83 | public org.jooq.UniqueKey getPrimaryKey() { 84 | return test.generated.Keys.KEY_AUTHOR_PRIMARY; 85 | } 86 | 87 | /** 88 | * {@inheritDoc} 89 | */ 90 | @Override 91 | public java.util.List> getKeys() { 92 | return java.util.Arrays.>asList(test.generated.Keys.KEY_AUTHOR_PRIMARY); 93 | } 94 | 95 | /** 96 | * {@inheritDoc} 97 | */ 98 | @Override 99 | public test.generated.tables.Author as(java.lang.String alias) { 100 | return new test.generated.tables.Author(alias, this); 101 | } 102 | 103 | /** 104 | * Rename this table 105 | */ 106 | public test.generated.tables.Author rename(java.lang.String name) { 107 | return new test.generated.tables.Author(name, null); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /more-spliterators/src/main/java/de/rgra/functional/spliterators/Elections.java: -------------------------------------------------------------------------------- 1 | /* 2 | * @(#)Elections.java 3 | * =========================================================================== 4 | * (C) Copyright Rabea Gransberger 2016 5 | * =========================================================================== 6 | * Created on 25.09.2016 7 | */ 8 | 9 | package de.rgra.functional.spliterators; 10 | 11 | import java.util.Arrays; 12 | import java.util.List; 13 | 14 | import org.paumard.spliterators.MoreSpliterators; 15 | 16 | import de.rgra.functional.spliterators.Elections.InvalidVote.Reason; 17 | 18 | /** 19 | * @author rgra 20 | */ 21 | public class Elections { 22 | 23 | public static void main(String[] args) { 24 | List votes = Arrays.asList(new VotingCard("x", null), new VotingCard(null, "x"), new VotingCard(null, null), new VotingCard("x", "I hate him")); 25 | int invalidVotes = MoreSpliterators.validate(votes.stream(), Elections::validate, Elections::validVote, Elections::invalidVote) 26 | .mapToInt(Vote::getInvalid) 27 | .sum(); 28 | System.out.println(invalidVotes); 29 | } 30 | 31 | public static boolean validate(VotingCard card) { 32 | return card.getCandidate1Vote() != null ^ card.getCandidate2Vote() != null && 33 | "x".equalsIgnoreCase(card.getCandidate1Vote()) ^ "x".equalsIgnoreCase(card.getCandidate2Vote()); 34 | } 35 | 36 | public static Vote validVote(VotingCard card) { 37 | return new ValidVote("x".equalsIgnoreCase(card.getCandidate1Vote()), "x".equalsIgnoreCase(card.getCandidate2Vote())); 38 | } 39 | 40 | public static Vote invalidVote(VotingCard card) { 41 | final Reason reason; 42 | String vote1 = card.getCandidate1Vote(); 43 | String vote2 = card.getCandidate2Vote(); 44 | if (vote1 == null && vote2 == null) { 45 | reason = Reason.NO_VOTE; 46 | } 47 | else if (vote1 != null && vote2 != null) { 48 | reason = Reason.TWO_VOTES; 49 | } 50 | else { 51 | reason = Reason.SCIBBLING; 52 | } 53 | 54 | return new InvalidVote(reason); 55 | } 56 | 57 | static class VotingCard { 58 | private final String candidate1Vote; 59 | 60 | private final String candidate2Vote; 61 | 62 | public VotingCard(String candidate1Vote, String candidate2Vote) { 63 | this.candidate1Vote = candidate1Vote; 64 | this.candidate2Vote = candidate2Vote; 65 | } 66 | 67 | public String getCandidate1Vote() { 68 | return candidate1Vote; 69 | } 70 | 71 | public String getCandidate2Vote() { 72 | return candidate2Vote; 73 | } 74 | 75 | @Override 76 | public String toString() { 77 | return "VotingCard [candidate1Vote=" + candidate1Vote + ", candidate2Vote=" + candidate2Vote + "]"; 78 | } 79 | 80 | } 81 | 82 | static interface Vote { 83 | default int getCandiate1() { 84 | return 0; 85 | } 86 | 87 | default int getCandidate2() { 88 | return 0; 89 | } 90 | 91 | default int getInvalid() { 92 | return 0; 93 | } 94 | } 95 | 96 | static class InvalidVote implements Vote { 97 | 98 | enum Reason { 99 | SCIBBLING, 100 | NO_VOTE, 101 | TWO_VOTES; 102 | } 103 | 104 | private final Reason reason; 105 | 106 | public InvalidVote(Reason reason) { 107 | this.reason = reason; 108 | } 109 | 110 | public Reason getReason() { 111 | return reason; 112 | } 113 | 114 | @Override 115 | public int getInvalid() { 116 | return 1; 117 | } 118 | 119 | } 120 | 121 | static class ValidVote implements Vote { 122 | private final boolean candidate1Vote; 123 | 124 | private final boolean candidate2Vote; 125 | 126 | public ValidVote(boolean candidate1Vote, boolean candidate2Vote) { 127 | this.candidate1Vote = candidate1Vote; 128 | this.candidate2Vote = candidate2Vote; 129 | } 130 | 131 | public boolean getCandidate1Vote() { 132 | return candidate1Vote; 133 | } 134 | 135 | public boolean getCandidate2Vote() { 136 | return candidate2Vote; 137 | } 138 | 139 | public int getCandiate1() { 140 | return candidate1Vote ? 1 : 0; 141 | } 142 | 143 | public int getCandidate2() { 144 | return candidate2Vote ? 1 : 0; 145 | } 146 | 147 | } 148 | 149 | } 150 | -------------------------------------------------------------------------------- /AssertJ/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /JOOL/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /JUnit5/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /Java8/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /StreamEx/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /jinq/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /rxjava/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /vertx/gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn ( ) { 37 | echo "$*" 38 | } 39 | 40 | die ( ) { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | --------------------------------------------------------------------------------