From 282faafe843a23c29d6ffeee8c0fe885822f367e Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Sun, 4 Jun 2017 16:27:50 -0400 Subject: [PATCH] Kotlin - Word Count (not) complete --- kotlin/accumulate/README.md | 37 + kotlin/accumulate/build.gradle | 28 + kotlin/accumulate/src/main/kotlin/.keep | 0 .../src/test/kotlin/AccumulateTest.kt | 57 + .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../etl/.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/etl/.idea/compiler.xml | 9 + kotlin/etl/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/etl/.idea/misc.xml | 6 + kotlin/etl/.idea/modules.xml | 10 + kotlin/etl/.idea/modules/etl_main.iml | 40 + kotlin/etl/.idea/modules/etl_test.iml | 46 + kotlin/etl/.idea/workspace.xml | 867 ++++++++++++++ kotlin/etl/README.md | 53 + kotlin/etl/build.gradle | 28 + kotlin/etl/build/classes/main/ETL.class | Bin 0 -> 3188 bytes kotlin/etl/build/classes/test/ETLTest.class | Bin 0 -> 2898 bytes .../etl/build/kotlin-build/caches/version.txt | 1 + kotlin/etl/etl.iml | 12 + kotlin/etl/src/main/kotlin/.keep | 0 kotlin/etl/src/main/kotlin/ETL.kt | 9 + kotlin/etl/src/test/kotlin/ETLTest.kt | 54 + .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/fileContent/fileContent.lock | Bin 0 -> 17 bytes .../.gradle/3.5/taskHistory/fileHashes.bin | Bin 0 -> 18897 bytes .../.gradle/3.5/taskHistory/fileSnapshots.bin | Bin 0 -> 22849 bytes .../.gradle/3.5/taskHistory/taskHistory.bin | Bin 0 -> 23138 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/gigasecond/.idea/compiler.xml | 9 + kotlin/gigasecond/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/gigasecond/.idea/misc.xml | 6 + kotlin/gigasecond/.idea/modules.xml | 10 + .../.idea/modules/gigasecond_main.iml | 40 + .../.idea/modules/gigasecond_test.iml | 46 + kotlin/gigasecond/.idea/workspace.xml | 1004 +++++++++++++++++ kotlin/gigasecond/README.md | 13 + kotlin/gigasecond/build.gradle | 28 + .../build/classes/main/Gigasecond.class | Bin 0 -> 2396 bytes .../build/classes/test/GigasecondTest.class | Bin 0 -> 2418 bytes .../caches/artifact-difference.tab | Bin 0 -> 65536 bytes .../caches/artifact-difference.tab.len | Bin 0 -> 8 bytes .../caches/artifact-difference.tab_i | 0 .../build/kotlin-build/caches/version.txt | 1 + .../main/Gigasecond$date$1.class | Bin 0 -> 1900 bytes .../kotlin-classes/main/Gigasecond.class | Bin 0 -> 1602 bytes .../kotlin/class-fq-name-to-source.tab | Bin 0 -> 65536 bytes .../class-fq-name-to-source.tab.keystream | Bin 0 -> 4096 bytes .../class-fq-name-to-source.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/class-fq-name-to-source.tab.len | Bin 0 -> 8 bytes .../class-fq-name-to-source.tab.values.at | Bin 0 -> 271 bytes .../kotlin/class-fq-name-to-source.tab_i | Bin 0 -> 32768 bytes .../kotlin/class-fq-name-to-source.tab_i.len | Bin 0 -> 8 bytes .../kotlin/internal-name-to-source.tab | Bin 0 -> 65536 bytes .../internal-name-to-source.tab.keystream | Bin 0 -> 4096 bytes .../internal-name-to-source.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/internal-name-to-source.tab.len | Bin 0 -> 8 bytes .../internal-name-to-source.tab.values.at | Bin 0 -> 493 bytes .../kotlin/internal-name-to-source.tab_i | Bin 0 -> 32768 bytes .../kotlin/internal-name-to-source.tab_i.len | Bin 0 -> 8 bytes .../kotlin/proto.tab | Bin 0 -> 65536 bytes .../kotlin/proto.tab.keystream | Bin 0 -> 4096 bytes .../kotlin/proto.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/proto.tab.len | Bin 0 -> 8 bytes .../kotlin/proto.tab.values.at | Bin 0 -> 1013 bytes .../kotlin/proto.tab_i | Bin 0 -> 32768 bytes .../kotlin/proto.tab_i.len | Bin 0 -> 8 bytes .../kotlin/source-to-classes.tab | Bin 0 -> 65536 bytes .../kotlin/source-to-classes.tab.keystream | Bin 0 -> 4096 bytes .../source-to-classes.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/source-to-classes.tab.len | Bin 0 -> 8 bytes .../kotlin/source-to-classes.tab.values.at | Bin 0 -> 142 bytes .../kotlin/source-to-classes.tab_i | Bin 0 -> 32768 bytes .../kotlin/source-to-classes.tab_i.len | Bin 0 -> 8 bytes .../kotlin/sources-to-classfiles.tab | Bin 0 -> 65536 bytes .../sources-to-classfiles.tab.keystream | Bin 0 -> 4096 bytes .../sources-to-classfiles.tab.keystream.len | Bin 0 -> 8 bytes .../kotlin/sources-to-classfiles.tab.len | Bin 0 -> 8 bytes .../sources-to-classfiles.tab.values.at | Bin 0 -> 586 bytes .../kotlin/sources-to-classfiles.tab_i | Bin 0 -> 32768 bytes .../kotlin/sources-to-classfiles.tab_i.len | Bin 0 -> 8 bytes .../compileKotlin/caches/lookups/counters.tab | 2 + .../caches/lookups/file-to-id.tab | Bin 0 -> 65536 bytes .../caches/lookups/file-to-id.tab.keystream | Bin 0 -> 4096 bytes .../lookups/file-to-id.tab.keystream.len | Bin 0 -> 8 bytes .../caches/lookups/file-to-id.tab.len | Bin 0 -> 8 bytes .../caches/lookups/file-to-id.tab.values.at | Bin 0 -> 67 bytes .../caches/lookups/file-to-id.tab_i | Bin 0 -> 32768 bytes .../caches/lookups/file-to-id.tab_i.len | Bin 0 -> 8 bytes .../caches/lookups/id-to-file.tab | Bin 0 -> 65536 bytes .../caches/lookups/id-to-file.tab.keystream | Bin 0 -> 4096 bytes .../lookups/id-to-file.tab.keystream.len | Bin 0 -> 8 bytes .../caches/lookups/id-to-file.tab.len | Bin 0 -> 8 bytes .../caches/lookups/id-to-file.tab.values.at | Bin 0 -> 274 bytes .../caches/lookups/id-to-file.tab_i | Bin 0 -> 32768 bytes .../caches/lookups/id-to-file.tab_i.len | Bin 0 -> 8 bytes .../compileKotlin/caches/lookups/lookups.tab | Bin 0 -> 65536 bytes .../caches/lookups/lookups.tab.keystream | Bin 0 -> 4096 bytes .../caches/lookups/lookups.tab.keystream.len | Bin 0 -> 8 bytes .../caches/lookups/lookups.tab.len | Bin 0 -> 8 bytes .../caches/lookups/lookups.tab.values.at | Bin 0 -> 725 bytes .../caches/lookups/lookups.tab_i | Bin 0 -> 32768 bytes .../caches/lookups/lookups.tab_i.len | Bin 0 -> 8 bytes .../data-container-format-version.txt | 1 + .../experimental-format-version.txt | 1 + .../kotlin/compileKotlin/format-version.txt | 1 + .../compileKotlin/gradle-format-version.txt | 1 + .../build/kotlin/compileKotlin/last-build.bin | Bin 0 -> 81 bytes .../sync/kotlin-files-in-java-timestamps.bin | Bin 0 -> 191 bytes .../compileTestKotlin/dirty-sources.txt | 1 + .../kotlin/compileTestKotlin/last-build.bin | Bin 0 -> 81 bytes kotlin/gigasecond/gigasecond.iml | 12 + kotlin/gigasecond/src/main/kotlin/.keep | 0 .../gigasecond/src/main/kotlin/Gigasecond.kt | 17 + .../src/test/kotlin/GigasecondTest.kt | 45 + .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/rna-transcription/.idea/compiler.xml | 9 + kotlin/rna-transcription/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/rna-transcription/.idea/misc.xml | 6 + kotlin/rna-transcription/.idea/modules.xml | 10 + .../.idea/modules/rna-transcription_main.iml | 40 + .../.idea/modules/rna-transcription_test.iml | 46 + kotlin/rna-transcription/.idea/workspace.xml | 839 ++++++++++++++ kotlin/rna-transcription/README.md | 27 + kotlin/rna-transcription/build.gradle | 28 + .../rna-transcription_main.kotlin_module | Bin 0 -> 40 bytes .../classes/main/RnaTranscriptionKt.class | Bin 0 -> 2471 bytes .../classes/test/RnaTranscriptionTest.class | Bin 0 -> 1485 bytes .../build/kotlin-build/caches/version.txt | 1 + .../rna-transcription/rna-transcription.iml | 12 + .../src/main/kotlin/RnaTranscription.kt | 11 + .../src/test/kotlin/RnaTranscriptionTest.kt | 46 + .../.idea/libraries/KotlinJavaRuntime.xml | 12 + kotlin/test/.idea/misc.xml | 6 + kotlin/test/.idea/modules.xml | 8 + kotlin/test/.idea/workspace.xml | 432 +++++++ .../test/out/production/test/Gigasecond.class | Bin 0 -> 1739 bytes .../test/META-INF/test.kotlin_module | Bin 0 -> 28 bytes kotlin/test/out/production/test/MainKt.class | Bin 0 -> 1389 bytes kotlin/test/src/main.kt | 13 + kotlin/test/test.iml | 12 + .../.gradle/3.5/file-changes/last-build.bin | Bin 0 -> 1 bytes .../.gradle/3.5/taskHistory/taskHistory.lock | Bin 0 -> 17 bytes .../.gradle/buildOutputCleanup/built.bin | 0 .../buildOutputCleanup/cache.properties | 2 + .../buildOutputCleanup/cache.properties.lock | 1 + kotlin/word-count/.idea/compiler.xml | 9 + kotlin/word-count/.idea/gradle.xml | 19 + .../libraries/Gradle__junit_junit_4_12.xml | 11 + ...Gradle__org_hamcrest_hamcrest_core_1_3.xml | 11 + ...Gradle__org_jetbrains_annotations_13_0.xml | 11 + ...g_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml | 11 + ...org_jetbrains_kotlin_kotlin_test_1_1_1.xml | 11 + ...tbrains_kotlin_kotlin_test_junit_1_1_1.xml | 11 + kotlin/word-count/.idea/misc.xml | 6 + kotlin/word-count/.idea/modules.xml | 10 + .../.idea/modules/word-count_main.iml | 40 + .../.idea/modules/word-count_test.iml | 46 + kotlin/word-count/.idea/workspace.xml | 940 +++++++++++++++ kotlin/word-count/README.md | 20 + kotlin/word-count/build.gradle | 28 + .../build/classes/test/WordCountTest.class | Bin 0 -> 2755 bytes .../build/kotlin-build/caches/version.txt | 1 + kotlin/word-count/src/main/kotlin/.keep | 0 .../word-count/src/main/kotlin/WordCount.kt | 17 + .../src/test/kotlin/WordCountTest.kt | 64 ++ kotlin/word-count/word-count.iml | 12 + 194 files changed, 5598 insertions(+) create mode 100644 kotlin/accumulate/README.md create mode 100644 kotlin/accumulate/build.gradle create mode 100644 kotlin/accumulate/src/main/kotlin/.keep create mode 100644 kotlin/accumulate/src/test/kotlin/AccumulateTest.kt create mode 100644 kotlin/etl/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/etl/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/etl/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/etl/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/etl/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/etl/.idea/compiler.xml create mode 100644 kotlin/etl/.idea/gradle.xml create mode 100644 kotlin/etl/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/etl/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/etl/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/etl/.idea/misc.xml create mode 100644 kotlin/etl/.idea/modules.xml create mode 100644 kotlin/etl/.idea/modules/etl_main.iml create mode 100644 kotlin/etl/.idea/modules/etl_test.iml create mode 100644 kotlin/etl/.idea/workspace.xml create mode 100644 kotlin/etl/README.md create mode 100644 kotlin/etl/build.gradle create mode 100644 kotlin/etl/build/classes/main/ETL.class create mode 100644 kotlin/etl/build/classes/test/ETLTest.class create mode 100644 kotlin/etl/build/kotlin-build/caches/version.txt create mode 100644 kotlin/etl/etl.iml create mode 100644 kotlin/etl/src/main/kotlin/.keep create mode 100644 kotlin/etl/src/main/kotlin/ETL.kt create mode 100644 kotlin/etl/src/test/kotlin/ETLTest.kt create mode 100644 kotlin/gigasecond/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/gigasecond/.gradle/3.5/fileContent/fileContent.lock create mode 100644 kotlin/gigasecond/.gradle/3.5/taskHistory/fileHashes.bin create mode 100644 kotlin/gigasecond/.gradle/3.5/taskHistory/fileSnapshots.bin create mode 100644 kotlin/gigasecond/.gradle/3.5/taskHistory/taskHistory.bin create mode 100644 kotlin/gigasecond/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/gigasecond/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/gigasecond/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/gigasecond/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/gigasecond/.idea/compiler.xml create mode 100644 kotlin/gigasecond/.idea/gradle.xml create mode 100644 kotlin/gigasecond/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/gigasecond/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/gigasecond/.idea/misc.xml create mode 100644 kotlin/gigasecond/.idea/modules.xml create mode 100644 kotlin/gigasecond/.idea/modules/gigasecond_main.iml create mode 100644 kotlin/gigasecond/.idea/modules/gigasecond_test.iml create mode 100644 kotlin/gigasecond/.idea/workspace.xml create mode 100644 kotlin/gigasecond/README.md create mode 100644 kotlin/gigasecond/build.gradle create mode 100644 kotlin/gigasecond/build/classes/main/Gigasecond.class create mode 100644 kotlin/gigasecond/build/classes/test/GigasecondTest.class create mode 100644 kotlin/gigasecond/build/kotlin-build/caches/artifact-difference.tab create mode 100644 kotlin/gigasecond/build/kotlin-build/caches/artifact-difference.tab.len create mode 100644 kotlin/gigasecond/build/kotlin-build/caches/artifact-difference.tab_i create mode 100644 kotlin/gigasecond/build/kotlin-build/caches/version.txt create mode 100644 kotlin/gigasecond/build/kotlin-classes/main/Gigasecond$date$1.class create mode 100644 kotlin/gigasecond/build/kotlin-classes/main/Gigasecond.class create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab.keystream create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab.keystream.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab.values.at create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab_i create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab_i.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab.keystream create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab.keystream.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab.values.at create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab_i create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab_i.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab.keystream create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab.keystream.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab.values.at create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab_i create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab_i.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab.keystream create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab.keystream.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab.values.at create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab_i create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab_i.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/sources-to-classfiles.tab create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/sources-to-classfiles.tab.keystream create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/sources-to-classfiles.tab.keystream.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/sources-to-classfiles.tab.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/sources-to-classfiles.tab.values.at create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/sources-to-classfiles.tab_i create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/sources-to-classfiles.tab_i.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/counters.tab create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.keystream create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.keystream.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.values.at create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab_i create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab_i.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.keystream create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.keystream.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.values.at create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab_i create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab_i.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/lookups.tab create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/lookups.tab.keystream create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/lookups.tab.keystream.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/lookups.tab.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/lookups.tab.values.at create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/lookups.tab_i create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/lookups.tab_i.len create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/data-container-format-version.txt create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/experimental-format-version.txt create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/format-version.txt create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/gradle-format-version.txt create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/last-build.bin create mode 100644 kotlin/gigasecond/build/kotlin/compileKotlin/sync/kotlin-files-in-java-timestamps.bin create mode 100644 kotlin/gigasecond/build/kotlin/compileTestKotlin/dirty-sources.txt create mode 100644 kotlin/gigasecond/build/kotlin/compileTestKotlin/last-build.bin create mode 100644 kotlin/gigasecond/gigasecond.iml create mode 100644 kotlin/gigasecond/src/main/kotlin/.keep create mode 100644 kotlin/gigasecond/src/main/kotlin/Gigasecond.kt create mode 100644 kotlin/gigasecond/src/test/kotlin/GigasecondTest.kt create mode 100644 kotlin/rna-transcription/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/rna-transcription/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/rna-transcription/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/rna-transcription/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/rna-transcription/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/rna-transcription/.idea/compiler.xml create mode 100644 kotlin/rna-transcription/.idea/gradle.xml create mode 100644 kotlin/rna-transcription/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/rna-transcription/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/rna-transcription/.idea/misc.xml create mode 100644 kotlin/rna-transcription/.idea/modules.xml create mode 100644 kotlin/rna-transcription/.idea/modules/rna-transcription_main.iml create mode 100644 kotlin/rna-transcription/.idea/modules/rna-transcription_test.iml create mode 100644 kotlin/rna-transcription/.idea/workspace.xml create mode 100644 kotlin/rna-transcription/README.md create mode 100644 kotlin/rna-transcription/build.gradle create mode 100644 kotlin/rna-transcription/build/classes/main/META-INF/rna-transcription_main.kotlin_module create mode 100644 kotlin/rna-transcription/build/classes/main/RnaTranscriptionKt.class create mode 100644 kotlin/rna-transcription/build/classes/test/RnaTranscriptionTest.class create mode 100644 kotlin/rna-transcription/build/kotlin-build/caches/version.txt create mode 100644 kotlin/rna-transcription/rna-transcription.iml create mode 100644 kotlin/rna-transcription/src/main/kotlin/RnaTranscription.kt create mode 100644 kotlin/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt create mode 100644 kotlin/test/.idea/libraries/KotlinJavaRuntime.xml create mode 100644 kotlin/test/.idea/misc.xml create mode 100644 kotlin/test/.idea/modules.xml create mode 100644 kotlin/test/.idea/workspace.xml create mode 100644 kotlin/test/out/production/test/Gigasecond.class create mode 100644 kotlin/test/out/production/test/META-INF/test.kotlin_module create mode 100644 kotlin/test/out/production/test/MainKt.class create mode 100644 kotlin/test/src/main.kt create mode 100644 kotlin/test/test.iml create mode 100644 kotlin/word-count/.gradle/3.5/file-changes/last-build.bin create mode 100644 kotlin/word-count/.gradle/3.5/taskHistory/taskHistory.lock create mode 100644 kotlin/word-count/.gradle/buildOutputCleanup/built.bin create mode 100644 kotlin/word-count/.gradle/buildOutputCleanup/cache.properties create mode 100644 kotlin/word-count/.gradle/buildOutputCleanup/cache.properties.lock create mode 100644 kotlin/word-count/.idea/compiler.xml create mode 100644 kotlin/word-count/.idea/gradle.xml create mode 100644 kotlin/word-count/.idea/libraries/Gradle__junit_junit_4_12.xml create mode 100644 kotlin/word-count/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml create mode 100644 kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml create mode 100644 kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml create mode 100644 kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml create mode 100644 kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml create mode 100644 kotlin/word-count/.idea/misc.xml create mode 100644 kotlin/word-count/.idea/modules.xml create mode 100644 kotlin/word-count/.idea/modules/word-count_main.iml create mode 100644 kotlin/word-count/.idea/modules/word-count_test.iml create mode 100644 kotlin/word-count/.idea/workspace.xml create mode 100644 kotlin/word-count/README.md create mode 100644 kotlin/word-count/build.gradle create mode 100644 kotlin/word-count/build/classes/test/WordCountTest.class create mode 100644 kotlin/word-count/build/kotlin-build/caches/version.txt create mode 100644 kotlin/word-count/src/main/kotlin/.keep create mode 100644 kotlin/word-count/src/main/kotlin/WordCount.kt create mode 100644 kotlin/word-count/src/test/kotlin/WordCountTest.kt create mode 100644 kotlin/word-count/word-count.iml diff --git a/kotlin/accumulate/README.md b/kotlin/accumulate/README.md new file mode 100644 index 0000000..a033af6 --- /dev/null +++ b/kotlin/accumulate/README.md @@ -0,0 +1,37 @@ +# Accumulate + +Implement the `accumulate` operation, which, given a collection and an +operation to perform on each element of the collection, returns a new +collection containing the result of applying that operation to each element of +the input collection. + +Given the collection of numbers: + +- 1, 2, 3, 4, 5 + +And the operation: + +- square a number (`x => x * x`) + +Your code should be able to produce the collection of squares: + +- 1, 4, 9, 16, 25 + +Check out the test suite to see the expected function signature. + +## Restrictions + +Keep your hands off that collect/map/fmap/whatchamacallit functionality +provided by your standard library! +Solve this one yourself using other basic tools instead. + +Lisp specific: it's perfectly fine to use `MAPCAR` or the equivalent, +as this is idiomatic Lisp, not a library function. + +## Source + +Conversation with James Edward Gray II [https://twitter.com/jeg2](https://twitter.com/jeg2) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. + diff --git a/kotlin/accumulate/build.gradle b/kotlin/accumulate/build.gradle new file mode 100644 index 0000000..16c36c0 --- /dev/null +++ b/kotlin/accumulate/build.gradle @@ -0,0 +1,28 @@ +buildscript { + ext.kotlin_version = '1.1.1' + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + testCompile 'junit:junit:4.12' + testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" +} +test { + testLogging { + exceptionFormat = 'full' + events = ["passed", "failed", "skipped"] + } +} diff --git a/kotlin/accumulate/src/main/kotlin/.keep b/kotlin/accumulate/src/main/kotlin/.keep new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/accumulate/src/test/kotlin/AccumulateTest.kt b/kotlin/accumulate/src/test/kotlin/AccumulateTest.kt new file mode 100644 index 0000000..665ea44 --- /dev/null +++ b/kotlin/accumulate/src/test/kotlin/AccumulateTest.kt @@ -0,0 +1,57 @@ +import org.junit.Test +import org.junit.Ignore +import kotlin.test.assertEquals + +class AccumulateTest { + + + @Test + fun emptyAccumulateProducesEmptyAccumulation() { + val input = listOf() + val expectedOutput = listOf() + assertEquals(expectedOutput, Accumulate.accumulate(input, { x -> x * x })) + } + + @Ignore + @Test + fun accumulateSquares() { + val input = listOf(1, 2, 3) + val expectedOutput = listOf(1, 4, 9) + assertEquals(expectedOutput, Accumulate.accumulate(input, { x -> x * x })) + } + + @Ignore + @Test + fun accumulateUpperCases() { + val input = listOf("hello", "world") + val expectedOutput = listOf("HELLO", "WORLD") + assertEquals(expectedOutput, Accumulate.accumulate(input, { it.toUpperCase() })) + } + + @Ignore + @Test + fun accumulateReversedStrings() { + val input = "the quick brown fox etc".split(" ") + val expectedOutput = "eht kciuq nworb xof cte".split(" ") + assertEquals(expectedOutput, Accumulate.accumulate(input, { it.reversed() })) + } + + @Ignore + @Test + fun accumulateWithinAccumulate() { + val input1 = listOf("a", "b", "c") + val input2 = listOf("1", "2", "3") + val expectedOutput = listOf("a1 a2 a3", "b1 b2 b3", "c1 c2 c3") + assertEquals(expectedOutput, Accumulate.accumulate(input1, + { c -> Accumulate.accumulate(input2, { d -> c + d }).joinToString(" ") } + )) + } + + @Ignore + @Test + fun accumulateToDifferentType() { + val input = listOf(1, 2, 3) + val expectedOutput = listOf("1", "2", "3") + assertEquals(expectedOutput, Accumulate.accumulate(input, { it.toString() })) + } +} diff --git a/kotlin/etl/.gradle/3.5/file-changes/last-build.bin b/kotlin/etl/.gradle/3.5/file-changes/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/kotlin/etl/.gradle/3.5/taskHistory/taskHistory.lock b/kotlin/etl/.gradle/3.5/taskHistory/taskHistory.lock new file mode 100644 index 0000000000000000000000000000000000000000..32c021bcc8bf92fa901e1d5c969a816f09098097 GIT binary patch literal 17 TcmZQR74}s%RPfgi1}FdkIA{cx literal 0 HcmV?d00001 diff --git a/kotlin/etl/.gradle/buildOutputCleanup/built.bin b/kotlin/etl/.gradle/buildOutputCleanup/built.bin new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/etl/.gradle/buildOutputCleanup/cache.properties b/kotlin/etl/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..fbca5ab --- /dev/null +++ b/kotlin/etl/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Fri Jun 02 17:32:18 EDT 2017 +gradle.version=3.5 diff --git a/kotlin/etl/.gradle/buildOutputCleanup/cache.properties.lock b/kotlin/etl/.gradle/buildOutputCleanup/cache.properties.lock new file mode 100644 index 0000000..40fdece --- /dev/null +++ b/kotlin/etl/.gradle/buildOutputCleanup/cache.properties.lock @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/kotlin/etl/.idea/compiler.xml b/kotlin/etl/.idea/compiler.xml new file mode 100644 index 0000000..0fcf8d4 --- /dev/null +++ b/kotlin/etl/.idea/compiler.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/gradle.xml b/kotlin/etl/.idea/gradle.xml new file mode 100644 index 0000000..20d2df6 --- /dev/null +++ b/kotlin/etl/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/etl/.idea/libraries/Gradle__junit_junit_4_12.xml new file mode 100644 index 0000000..04c10dd --- /dev/null +++ b/kotlin/etl/.idea/libraries/Gradle__junit_junit_4_12.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/etl/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/kotlin/etl/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml new file mode 100644 index 0000000..7b6f562 --- /dev/null +++ b/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml new file mode 100644 index 0000000..1720158 --- /dev/null +++ b/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml new file mode 100644 index 0000000..21c5d19 --- /dev/null +++ b/kotlin/etl/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/misc.xml b/kotlin/etl/.idea/misc.xml new file mode 100644 index 0000000..84da703 --- /dev/null +++ b/kotlin/etl/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/modules.xml b/kotlin/etl/.idea/modules.xml new file mode 100644 index 0000000..75bafc3 --- /dev/null +++ b/kotlin/etl/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/modules/etl_main.iml b/kotlin/etl/.idea/modules/etl_main.iml new file mode 100644 index 0000000..e7436c0 --- /dev/null +++ b/kotlin/etl/.idea/modules/etl_main.iml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/modules/etl_test.iml b/kotlin/etl/.idea/modules/etl_test.iml new file mode 100644 index 0000000..b158ff6 --- /dev/null +++ b/kotlin/etl/.idea/modules/etl_test.iml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/.idea/workspace.xml b/kotlin/etl/.idea/workspace.xml new file mode 100644 index 0000000..8e81173 --- /dev/null +++ b/kotlin/etl/.idea/workspace.xml @@ -0,0 +1,867 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1496439132230 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/README.md b/kotlin/etl/README.md new file mode 100644 index 0000000..683bbcd --- /dev/null +++ b/kotlin/etl/README.md @@ -0,0 +1,53 @@ +# Etl + +We are going to do the `Transform` step of an Extract-Transform-Load. + +### ETL +Extract-Transform-Load (ETL) is a fancy way of saying, "We have some crufty, legacy data over in this system, and now we need it in this shiny new system over here, so +we're going to migrate this." + +(Typically, this is followed by, "We're only going to need to run this +once." That's then typically followed by much forehead slapping and +moaning about how stupid we could possibly be.) + +### The goal +We're going to extract some scrabble scores from a legacy system. + +The old system stored a list of letters per score: + +- 1 point: "A", "E", "I", "O", "U", "L", "N", "R", "S", "T", +- 2 points: "D", "G", +- 3 points: "B", "C", "M", "P", +- 4 points: "F", "H", "V", "W", "Y", +- 5 points: "K", +- 8 points: "J", "X", +- 10 points: "Q", "Z", + +The shiny new scrabble system instead stores the score per letter, which +makes it much faster and easier to calculate the score for a word. It +also stores the letters in lower-case regardless of the case of the +input letters: + +- "a" is worth 1 point. +- "b" is worth 3 points. +- "c" is worth 3 points. +- "d" is worth 2 points. +- Etc. + +Your mission, should you choose to accept it, is to transform the legacy data +format to the shiny new format. + +### Notes + +A final note about scoring, Scrabble is played around the world in a +variety of languages, each with its own unique scoring table. For +example, an "E" is scored at 2 in the Māori-language version of the +game while being scored at 4 in the Hawaiian-language version. + +## Source + +The Jumpstart Lab team [http://jumpstartlab.com](http://jumpstartlab.com) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. + diff --git a/kotlin/etl/build.gradle b/kotlin/etl/build.gradle new file mode 100644 index 0000000..16c36c0 --- /dev/null +++ b/kotlin/etl/build.gradle @@ -0,0 +1,28 @@ +buildscript { + ext.kotlin_version = '1.1.1' + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + testCompile 'junit:junit:4.12' + testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" +} +test { + testLogging { + exceptionFormat = 'full' + events = ["passed", "failed", "skipped"] + } +} diff --git a/kotlin/etl/build/classes/main/ETL.class b/kotlin/etl/build/classes/main/ETL.class new file mode 100644 index 0000000000000000000000000000000000000000..1266ca335dceda3c382f39350e90e255e0b59107 GIT binary patch literal 3188 zcmai0+jARd75{y!%StQRmSs7$QfSp$P~Tcx4mGJ1QXIu0ie)E_j7^e)S<7pCZE0mz zD>p8bhFjWlzeBlGpk;;^7@)Sv3~0(5FFf+V3{TAP$REH=!|z*3mYjH|Bkg|YobTMv z`Ode0d;3p+1~7@&1w1ngc@;t+vZ?Rr<0ai%AHTe^X%rn59)X}^>sEEGVwVLHLwT2{ z=9s1NIej}bd=D-#n6KFDZ9Av|Ak=4+)=M!;`c+msI=An?#u z#VMKA_~uS|+_W6Sw)E0?&T?#uo5iXMP2hpzhEd$QqT71eAV;p+R3-3O)1?l#GYzL) zN^j7(iUZ12`!Vb}Dlxd|5bcPi;aw(-hmi=(meD4?NYinj^k~1xMIH?1qt%ylI>{(zWxo@`_=rV95gPq(!|{ zGh8QfVSEtN8lJ{EZc&H36~_67mKlNWw#B?zWi~$4iqG}YjgNIwkvrnuv~BCV4S`u6 zk7N2G+wKwB9&@sn4@m{{dE>Hu-dNLXC8lejvzJ>YGr3{9e;HRa%;Op6a46U4#)5`C z76f8#*W1QaEQWANR;iIoH;U{A4^WY%RB??5yGXR1qih&A@T`XG_^3e0spKoq8Fp5$ zGK1cs>@c^N@o~AWv%)(vwU^hV%h_g!AGN?nDPmQ!Q@+>ru#rd}@OA0Hx@@srr!0@W z+;SyN4I9{G?Y3*o%jwR%G*7|(=b}^B;ZZ4}EZg0pDt&cTp#KFePtrDuhPh+dElRAzrNiPe_*J9on3g*NTdXG< ztnL_X*Nk&f+FX+s7b+YNohI0~tvvysEM1ko-=Rl#AvO5i((t5IY7Wni9LVoD?I`AT zHcTq?<#`zp?decVEg217Irsv(`NG2Ve0C;`S8zKB1z#lbOp)W;9hAK-TXTk^uj-CY zRZ4ls!>dNfm!Ig0i-IZLBDR_mDA#W#G-W{1lt}%SrUWFA6Dhsyrnb-!sz^r{fRAB-MK@>b5CI^n!fJ%$SzZ7&J{vSHaPX zTg*}u4;IXImb+$?`=w^PwJyvvojua*_tB1A%OZC29G=+BS^n<1OO9te#==>a;lZml z%Q4GF&e}1nCPSHSU(5o@dv_17+9PaQp;EJp#syPmBGy388!NT-nVXKm+q%MY7H_Ir zyw40T0)>4fQy-W8L&(Ex%m+WIKLnH**M3s}I~on{qvsBKukE3KZfqY9?&G09;?dEx zFYY_QkiY?+5J-FD-UGZ(;8pBN=(Io`>G{XgYFs_Q2PF3No5)W2nv@HYaxv|X`|G$Q znbLtf$X|=A5p5q=_weC5meRp^-~bu=&?Q{i;q*dOp{ z9m)RiR9CvYziS^WQ$6wS{+@lT_51d*b%2V87B|wdcwanrfU1I}H}3u>9;6opW}5Q9 zbrbO;zCVvHyn!J&sPS_}LOXa45yp28H<94i%L^Qcy(V8NYjW4*RkWc_Gu{b{_HH~gcc*yC+MLyU0 zEK_m~8f}E=k@U}pzwr4d@qf|tf0O4wwEYvx=iq%C!zz7JF>x2qBBVl5kt9V$nlz!} zqKZrIe~CEoKP=s)2fjl_DN0p8<)h$d_&HZU-BY=~#z*A{aS=s+nh|CTVTvmcH^L)( zczL7_<@fl~?}#gq`3*Prni0!5r9yWW;LC?P9(HLoa0kjBUX|jFq_mhl_yuVSet=(c z{d-|<`ij<=9onq>Evt5D3RqL$tiUD zz;EdcGktB#P)}#tVR-B>>J!tmD_N0A252VI?!CJA>^cd3R>gFh7Nb=5Tm|vPhPRp9YPxoi z6Cjfa-h(K(fwgIQI%TlTuE<;3U^J91oGb1Nn(QHix(({09!3LupYxAR&s+}#%3(&s z*?clL{wTA#LA}(+=;U@IaBMfX-f$dHup6$Q%kRzSL27`J=GcB9>KV%>stH+7MvF89 z+sPFX2mB*6WY8cTWz-wtmzz6|sLv_e zMW4|*MqP1(p;m^|r1BqXtA5k3vdY_x}ean+_3r%v222JUiebO`?f2?M0 zm`x{ORQxEF61tTF&vrK_3kg@dPn90JOcMrOqATENJ>5aWtr~h1#>OO|M8knU9Xz&u z5Ec?d8+ITjztHf)?Tv`D+0_GA6n!uHG=WB-Q#jE~yfm0= z(j-P~8&>Tyqtff=gN8D!7z%&=+)y%Nf+v$6e*Jtxxx}W`H$Q7|&1HCMRJoMCqhqGV zGcBI!;q1*X8jiJ6n_yTL(g)6?x@o(Nj7Zvx+bBPsZ`5#G^cNfJrc*IJ+gx+3vUrIe z*{-$Ntgl&Ke^q_TTSsP z)K;pd`K%mOUJzr8zKx1S)OUyy45E@nu$44bZYRtZO~04XqnOb+&BTn{eT@2P9Go8E zwyV?7JB;!%qqmfiI=@t9ogc>w3{(h!6d}NjAPi2o#TXLDFkQ_2U*=Vf*MK3QAzrDf z^UZ|$Azfa?x~$Mztjo)Nx{T5a?&%kFjDDx%@8~kq)+MzZ>XOpA9t*>b_jDY^FG(SE zeou}WUX&x(_+mKG`ARs+a0mp=co#2=NhI0_RjsNTv_U~a_Gt-`=6N})d_j&HznetV zbR?h=BH>n)a3@NrL<#rhsPn2A+ok9kB=UKMS$p@sOSSnP5HNd)Yvk6)jnz| zecw?#&6eprqOYbjT*Apqm5CogT(IJ*&tVjovO4|;-QK&sdqQUdR3wPs35BW{6)H=} zC3x?^TUe!3f#&4@JQds40vxm`UQ4UQe7Z}^tJLMwHJ?^|(tMhcle|yYeNufY{Rhmo Be#-y= literal 0 HcmV?d00001 diff --git a/kotlin/etl/build/kotlin-build/caches/version.txt b/kotlin/etl/build/kotlin-build/caches/version.txt new file mode 100644 index 0000000..01aabac --- /dev/null +++ b/kotlin/etl/build/kotlin-build/caches/version.txt @@ -0,0 +1 @@ +11001 \ No newline at end of file diff --git a/kotlin/etl/etl.iml b/kotlin/etl/etl.iml new file mode 100644 index 0000000..1551dc7 --- /dev/null +++ b/kotlin/etl/etl.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/etl/src/main/kotlin/.keep b/kotlin/etl/src/main/kotlin/.keep new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/etl/src/main/kotlin/ETL.kt b/kotlin/etl/src/main/kotlin/ETL.kt new file mode 100644 index 0000000..92cfdc0 --- /dev/null +++ b/kotlin/etl/src/main/kotlin/ETL.kt @@ -0,0 +1,9 @@ +object ETL { + fun transform(inpMap: Map>) : Map { + var outMap: MutableMap = emptyMap().toMutableMap() + for ((value, chars) in inpMap){ + chars.map { outMap.put(it.toLowerCase(), value)} + } + return outMap + } +} \ No newline at end of file diff --git a/kotlin/etl/src/test/kotlin/ETLTest.kt b/kotlin/etl/src/test/kotlin/ETLTest.kt new file mode 100644 index 0000000..7036b7a --- /dev/null +++ b/kotlin/etl/src/test/kotlin/ETLTest.kt @@ -0,0 +1,54 @@ +import org.junit.Test +import org.junit.Ignore +import kotlin.test.assertEquals + +class ETLTest { + + + @Test + fun transformOneValue() { + val old = mapOf(1 to listOf('a')) + val expected = mapOf('a' to 1) + + assertEquals(expected, ETL.transform(old)) + } + + @Test + fun transformMoreValues() { + val old = mapOf(1 to listOf('A', 'E', 'I')) + val expected = mapOf('a' to 1, 'e' to 1, 'i' to 1) + + assertEquals(expected, ETL.transform(old)) + } + + @Test + fun moreKeys() { + val old = mapOf(1 to listOf('A', 'E', 'I'), 2 to listOf('D', 'G')) + val expected = mapOf('a' to 1, 'e' to 1, 'i' to 1, 'd' to 2, 'g' to 2) + + assertEquals(expected, ETL.transform(old)) + } + + @Test + fun fullDataset() { + val old = mapOf( + 1 to listOf('A', 'E', 'I', 'O', 'U', 'L', 'N', 'R', 'S', 'T'), + 2 to listOf('D', 'G'), + 3 to listOf('B', 'C', 'M', 'P'), + 4 to listOf('F', 'H', 'V', 'W', 'Y'), + 5 to listOf('K'), + 8 to listOf('J', 'X'), + 10 to listOf('Q', 'Z') + ) + val expected = mapOf( + 'a' to 1, 'b' to 3, 'c' to 3, 'd' to 2, 'e' to 1, + 'f' to 4, 'g' to 2, 'h' to 4, 'i' to 1, 'j' to 8, + 'k' to 5, 'l' to 1, 'm' to 3, 'n' to 1, 'o' to 1, + 'p' to 3, 'q' to 10, 'r' to 1, 's' to 1, 't' to 1, + 'u' to 1, 'v' to 4, 'w' to 4, 'x' to 8, 'y' to 4, + 'z' to 10 + ) + + assertEquals(expected, ETL.transform(old)) + } +} diff --git a/kotlin/gigasecond/.gradle/3.5/file-changes/last-build.bin b/kotlin/gigasecond/.gradle/3.5/file-changes/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/.gradle/3.5/fileContent/fileContent.lock b/kotlin/gigasecond/.gradle/3.5/fileContent/fileContent.lock new file mode 100644 index 0000000000000000000000000000000000000000..289d080e1d785721a1cf3f00bf874d7d5d958980 GIT binary patch literal 17 TcmZS1$vazkATRJ00~7!NH-`j; literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/.gradle/3.5/taskHistory/fileHashes.bin b/kotlin/gigasecond/.gradle/3.5/taskHistory/fileHashes.bin new file mode 100644 index 0000000000000000000000000000000000000000..2f952615f3b2e5de80b7db697cadb413ef271213 GIT binary patch literal 18897 zcmeI(OGs2v9LMov>iEFHF*HY_RD>`egJugsEqtH`E@VImnMIKZN;CLa2qq?qlHf`~ zkQQQtfwUNWWI~W>A{2rofuIQ%B#9viB8Z5dJLlZQ#zkxS9ys?Ne)sY~2i zZRX}#=3mt{jtC%t00IagfB*srAbZXZ2g%lYuJqOa;xrw~D|`nJm7${_5i zJUh-;#3U8v{xy5h!cr7iacl{B9om>MuvKfxw-&$q?5}XY@Ap?& z`(^?wg5LCqo!Rfcm%UT2^dX1Zm3!$#y`!Wfu%f!`V6&huX}RY5<3E+HU*grSZW+5V z#;%$3OIFhNTLwPakIv{y8pSyeReBj=^=TY#r zk?%?*g$Yqkv&3w|Neq6*TzDb?sx3R^YD50 zfBQUtzIzyZ<`6`<^dIks82p3|p28Uz00UqE41fVJ00zJS7ytuc01SWuFaQR?02lxR zU;qq&0Wk2e7%&J6c?>NkJYFK61Qip6GEg{)T)$*T`(9(>Hy?`{ zi}<`*n7^%e_VN{fvWREQ#QdH9C6xzPWp6-y{sGMQ_iV}==lp>|{6#tD4F{&IkJkPj zfw^Ng58f3?+x z__GO^Uue$S5FK$k4)KiLm|t18^LV~0WWod7vzY*Ps zcHoMLatl^TL>U+gG%-b|C)zdzi0Sd&xK>bWS7US#_8ff0Y_?bWd$0 z;yG%}O9JBta!M<`_eH+|b9^KSNi}K%-@yPF00UqE41fVJ00zJS7ytuc01SWuFaQR? z02lxRU;qq&0WbgtzyKHk17H9QfB`T72EYIq00UqE41fVJ00zJS7ytucz?T6vL6D1u z%Jr0_TQWO^GH{HWqc|7Cm??$TO`B~DWui?>8IH0$&C6{JCr_X(tmmjuQBJp2QONK{ zH_bXYMUj)Yu?`9yFiBdAPNimaYE5FI&Z4y>CR&sxoyN!r zKdLQCwdvNza!+GLA?@~)?rB-QFQ_P_W&Et_O%)xT-}<-x-}zFs!{OvLsyA@(c1d%}fd7HnE)DyL8IRT4|0kIUQz-bDJo;pcY?B zzj;Yf#QRB2szXclE`4v$)n@kzO$I@d!VorbJn=maKd~f)$fUP0a*&Cyie!sLk}boS zmvK33GgG|XMHSI5UQL;7G{=csM3}3@GmC}d=9(tdWU)xUlf&-ayNiZ)O_JRs(G4}I zaf+GdnJFrTXB0naf6baE**aO<*@~6l1WWhEknJNp9v-N;>BmmzlZ!g~>YN=D;41e&UvWBtB)?u&G$3XwJJfcfn-m5}w6iY&08uqB(d@(ugE+K(3 zQQB}T9XC@01rzI#7t$+eInUY|j;HM|PGMvneo|*_ecG7AA3w3|ugJRHJ1-P?HtOp> zel;K&ALL~09w_iDyk-MFd2J=&DSlKL~@VA#1JN(HK$;A`}V5P)Fl&* zGwxZK81@{g?OC0)_3`NuvTbwI(>#m4=wn|K5c#)6{;1xi`xg0kta8L7|E`;G)FWS6 z8~)+0%crXKbAu~u4qYpQ$oKW|KJ=0HfqWQVnBL!$%1&xCN78*ct4@y}jmW10!uDOf z@p7m7*zv3~!--e!S>y*#N=rT;etk^B#`@?tKd~Q%$QS?el>2xrz3nM~RPWM#i~KuQ iIpUFj*G)L;k-yG8;ao`lmhYqXe$bU4C~Nc``TqjfK1#m; literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/.gradle/3.5/taskHistory/taskHistory.bin b/kotlin/gigasecond/.gradle/3.5/taskHistory/taskHistory.bin new file mode 100644 index 0000000000000000000000000000000000000000..879a9e3ab99d9fdd400ce69704340d2452667316 GIT binary patch literal 23138 zcmeI)TWl0n7zgmV?24EQD@JULBE&+Pw63j?h(I53w<>JK&{BMGYMt($Zih~1Hgjfo zDe(cKjZhw12}VQ0nov!&mLNU|0hK7e2q}ruCXF#_t4Tp2nnq&0g!;{%ZLRC~b-5^QI=c4}Dm?Ww9 zQN30?$0GzF009U<00Izz00bZa0SG_<0uX=z1Rwwb2tWV=|7C$j>fBADgQb;2BNhdtOUEHU7Y<=eeDB;w;lNSl|EjigCFo!MJN! zx@*{0)Nn>O#j^|K@vVoX(VaK0+L1b9JIU}S=C(MxVexRg?V5%aPC9zRWMNn5?K~XI zw?*uZlwq>wD2v;U?y`g&%Dr@KUv^9X#F6b6V|BdjVMPw5=iKF}!EFO)?&gbky*%&7 zOLy{jNd8EUtk4=cbGXJ+j3qR-nK^NTcW9zBTGB}BoL<#RXf0{OOcdJh&0jj>S_k!9 z?W11VX}VCx8(gPM9NH|dqd8@!leACQ6RYdj?G`@X<&a5>VH$3y`doE*`EFNtlFYqy z14(m_o&Ix4uJMYj^t9_KH{#JVPN=tkTpq9ZU~i&VyzJv?HV_+YptHqr}sJ+9m?+d>iCyCv$oT2SV=nY-OFCu*siD(~ zi&Ji(QTzMDRMZ>!#9tgDEiNWaEI)%ZPF(_PPS<{x0Bg6SdrL$?0&RG?PS?Gji{ zrOGR6QIr}>hwFx%J3cF3RdySaPdi!0~b?hDK6 zdvlRHi}LM + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/gradle.xml b/kotlin/gigasecond/.idea/gradle.xml new file mode 100644 index 0000000..20d2df6 --- /dev/null +++ b/kotlin/gigasecond/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/gigasecond/.idea/libraries/Gradle__junit_junit_4_12.xml new file mode 100644 index 0000000..04c10dd --- /dev/null +++ b/kotlin/gigasecond/.idea/libraries/Gradle__junit_junit_4_12.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/gigasecond/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/kotlin/gigasecond/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml new file mode 100644 index 0000000..7b6f562 --- /dev/null +++ b/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml new file mode 100644 index 0000000..1720158 --- /dev/null +++ b/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml new file mode 100644 index 0000000..21c5d19 --- /dev/null +++ b/kotlin/gigasecond/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/misc.xml b/kotlin/gigasecond/.idea/misc.xml new file mode 100644 index 0000000..84da703 --- /dev/null +++ b/kotlin/gigasecond/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/modules.xml b/kotlin/gigasecond/.idea/modules.xml new file mode 100644 index 0000000..088ac6c --- /dev/null +++ b/kotlin/gigasecond/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/modules/gigasecond_main.iml b/kotlin/gigasecond/.idea/modules/gigasecond_main.iml new file mode 100644 index 0000000..5bc0a34 --- /dev/null +++ b/kotlin/gigasecond/.idea/modules/gigasecond_main.iml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/modules/gigasecond_test.iml b/kotlin/gigasecond/.idea/modules/gigasecond_test.iml new file mode 100644 index 0000000..b62a7bc --- /dev/null +++ b/kotlin/gigasecond/.idea/modules/gigasecond_test.iml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/.idea/workspace.xml b/kotlin/gigasecond/.idea/workspace.xml new file mode 100644 index 0000000..33a82ec --- /dev/null +++ b/kotlin/gigasecond/.idea/workspace.xml @@ -0,0 +1,1004 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1496434180845 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/README.md b/kotlin/gigasecond/README.md new file mode 100644 index 0000000..ca8090b --- /dev/null +++ b/kotlin/gigasecond/README.md @@ -0,0 +1,13 @@ +# Gigasecond + +Calculate the moment when someone has lived for 10^9 seconds. + +A gigasecond is 10^9 (1,000,000,000) seconds. + +## Source + +Chapter 9 in Chris Pine's online Learn to Program tutorial. [http://pine.fm/LearnToProgram/?Chapter=09](http://pine.fm/LearnToProgram/?Chapter=09) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. + diff --git a/kotlin/gigasecond/build.gradle b/kotlin/gigasecond/build.gradle new file mode 100644 index 0000000..16c36c0 --- /dev/null +++ b/kotlin/gigasecond/build.gradle @@ -0,0 +1,28 @@ +buildscript { + ext.kotlin_version = '1.1.1' + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + testCompile 'junit:junit:4.12' + testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" +} +test { + testLogging { + exceptionFormat = 'full' + events = ["passed", "failed", "skipped"] + } +} diff --git a/kotlin/gigasecond/build/classes/main/Gigasecond.class b/kotlin/gigasecond/build/classes/main/Gigasecond.class new file mode 100644 index 0000000000000000000000000000000000000000..1b66ebf0af4d65292663a9d224c45ae74acc9d28 GIT binary patch literal 2396 zcmah~T~`}b6y0}7GD!#!(l0(*z?NDPDxp|)X-X{xN`rycLStLdI)ot%Br`ZOVfo1N zN4S~rqP%YXm)6Tk!vf#{r3 z)EvEFnd>TqKzvKv)zT%+ET-?RZRrJ9MVmliU2}DT-ki7V8f875vkF>ihU#TX8G%bV z%Pyw3ba&0x4AV(#rfIpFYgk+_TJB<{RHBty)LnTw_ z7zIZ~w?J64^;vnHz?CMqHM>8CQ#c((0%rt*mb{=mxFT?>N!h4Kp4^bNq+*nuFJxyHvvYTs znc)U@yrT08E{3--7Qt1d>3kFTD$+GFY;6e4Hj+@Q+)PvCR%Q7%u1EQ9-U;&gAoJ}@ zFnRUMYwS*M+LmcOWCB#Y&!S(NoxZm?v&0NG+}OlA6GH|!BKQE4v~2>s>=#89`a`~s zol=FbU~*)>8FHg}rd3>1xGm$F7PwwxM>05OZH%nDSBI$lXYc!Q{#_la2RG)&l?-E+ zM0h1M`{jlQW>{u<_R`EcfJLh+k1>M!yF*UwjrM%n5S`l&xQC#yx z){WSfub&0_)xqAysM4cEmH5G4l%KZ_QK$!tgYi1!Om7Ud@!2e9C`>>hwXw+YgM`u=b{_^IL|}J9UOSQ zgX%E{2QlOW{Y`$PgR7&7H}-Kk^*csVqt7vrqQe7!A@vP)Tpb|w4CDKF_cY#nhMNbt z^&4g$C+_Sc`vV5679Z{7-qG!kx&0jNzYxF8Bd{9tYAxnfKNB+MvtFiDQWs%%qPRh; zM_g}k?=qBER4A(amLNF4A{&Qtb)KlxC9|xc=#8Iale0z=mwCg(6|`lM_r6c?=umo0 w1)j)ZWd*{)Dn4C7mxB%mpE>At(C1*tLC`_SLD)gWLBE6Z4mv%9a}J*V2eN@l5dZ)H literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/classes/test/GigasecondTest.class b/kotlin/gigasecond/build/classes/test/GigasecondTest.class new file mode 100644 index 0000000000000000000000000000000000000000..3799ea2833c6c5f9bf6a7ee13a6e3a1643ff0266 GIT binary patch literal 2418 zcmbtVTT>%N6#hCPnGgdEm*ui77;#quL_z{AvcXGW!xA>Y8ZL^su0zsE1|~C@nXu~{ zzr_dj)jYVURTi}`R{0MsAFT3kSheNpnQRg+vJX<3zMSrJ`s?p}r}_Qm&%XkQL1k!v zpcWL9XAM2K#Z5~BV~`J&V?3fR| z48w_CLRYTuVvxQ*n z(KLq9kb|d*%6OAyQv@r-$94j^i9tUGaEoEEachg0j*K!LyHy)V7-sM;sKoaN48dA- zo7_u#?XW?-)#lp*`dCZRx z#_6~Mw?w|^KA|g)^Cp})qrMLLQkOp})_V$^&{;+taVQEW@{tBRtTw{twN zR5XhreLcaBdat0oCY|QIh%Ce~?MDEo(v%FP`no@e-*^;~*e|EkRKfO!w=PCXJs=&2GW@#mWl;gR|aO0_J6_-i20{P|< z&#HNq=NM+{h{Zy!Xl5zu-zVQ%#mSnisBUKHi-m(z^rJJ@NCO*7TN{hXOaL3sDUYc9 zt~@27=k60>{4Spu(C72?pPj^9Q*6=m;u|lSR(-Pj zrfaHYMWT_XKJwN_QhnreMlZhiwu(byi~yiR=*xL_pOh3;C%os?G&znZ2oaM`^#!28V zqDcIC=}q)d>q3rZWqSnN{ROSNozkCGbjSmzxUt*ScZ#7iy!o77&ra!|D&A>nktgNQ zDJCX3P>%WXE651X<4QN^O%{dzEibue?6!1NH9URv+F0A}gGzXs{E%#Lftn)NM-4oeO|6bwJN*fELaH>XYMg+=jGu5t3I>G@~ literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin-build/caches/artifact-difference.tab b/kotlin/gigasecond/build/kotlin-build/caches/artifact-difference.tab new file mode 100644 index 0000000000000000000000000000000000000000..325acde41293a2dc235e42cb0db29bfafdf6e4eb GIT binary patch literal 65536 zcmeIu%L#xm3;@uGf}Whn;he)&94@wK(FKGaUZ8D0J%l%J=Q>10J#Un1k63D>yjh~A z?a%n+t!}faCMCZ8yW=K6fB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009F1 z3mlo*|CTl+K!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 y2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk{|Q_w9|^Yr literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin-build/caches/artifact-difference.tab.len b/kotlin/gigasecond/build/kotlin-build/caches/artifact-difference.tab.len new file mode 100644 index 0000000000000000000000000000000000000000..60e2d8aa9e10da6b90c32ba9742bd89d145b31f8 GIT binary patch literal 8 McmZQz0D%S$009sHi2wiq literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin-build/caches/artifact-difference.tab_i b/kotlin/gigasecond/build/kotlin-build/caches/artifact-difference.tab_i new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/gigasecond/build/kotlin-build/caches/version.txt b/kotlin/gigasecond/build/kotlin-build/caches/version.txt new file mode 100644 index 0000000..01aabac --- /dev/null +++ b/kotlin/gigasecond/build/kotlin-build/caches/version.txt @@ -0,0 +1 @@ +11001 \ No newline at end of file diff --git a/kotlin/gigasecond/build/kotlin-classes/main/Gigasecond$date$1.class b/kotlin/gigasecond/build/kotlin-classes/main/Gigasecond$date$1.class new file mode 100644 index 0000000000000000000000000000000000000000..8df3ed289589ac01941335abc8b8c748774c0d1b GIT binary patch literal 1900 zcmaJ>TUQ%Z6#h=`45ga3&}~(n zsY=h7nU6yVSmnCyS*FS#9yju)@(f2wD_@q4N>vv7-|aV*?wPi7^BbL~`Ni^~JeGOS zY#8~ntxIc-xWz%j9jX+UiULzFw-!f4;AY?Z0T$zk3B*iwY}XBe*>u~MB~>l|xN>Od zUNQ53k-+5ve#W5*6gmk1384dWQ5wXML;^_-AzTu8t86>9{Gs7h9BDEyQYqV$?Hp~| z-e%LX7;(t-5=dQ)tefYO@*G|@bvKSNfpPu7(Cb^$kqv{DD7hUNf!hN@?Td8Vhp81a zyGdNZRSlPMjd}78On0UrkSzCVUrb^GlS7PPNFW`K8Z;tdTq za4Sk$q4?tq2#ocTyVi7q_~V!n7_#@b1G>3B;KP2zb3Fpi;FUqJ<_xS}4IkcZymkQ`)UiHZma!{4T^&;i*s|@<99Rr&uWA!&O<2;YF!z^^Bx( z>F4C2K!SX;tnGP|6LoyN|yBMz5|{$h4(5wzGcwgoQrdM8(B&qP-3DzA-{ zO=WC08x_OZkrj)QvEcHqbWH!;5zagzpGlvRIyPOC@@~_w^ri@VXxpqQ=`|hVXxnzv z(Txq$2OU{gx@Eg;dS>>(uCmEXN*T_oC0*BGO(#1BcH8iMs3@@cqs%wwe=6lq13&Aj z6;8GxN_TmhrbdYSP7WL#BnfQ{-EiKf{Ml$38y8qK_5AS6r{PZ{ZUx@dVC-6z=ueiP73q%H!k)Mgo;( ztnk@4I?l_!kHguy-*G(~d5*PT1C=QK@hyb07wli)8}1QKtsQ*JCyfC9MKJX5xNh*g v&WJYl5H8_<@OyyL`RO4A_^gC79_>N6*u>*K#9VB-_}s-47bzF_TqOPlCjRv| literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin-classes/main/Gigasecond.class b/kotlin/gigasecond/build/kotlin-classes/main/Gigasecond.class new file mode 100644 index 0000000000000000000000000000000000000000..e026f4a48a5347d860e1a2fb80218e5e775aedf1 GIT binary patch literal 1602 zcmbVMTW`}y6#mA!IC0&^F_fkS3R?=KDd46ou#j%Ktyo101+}OM^#M&%le$gDl4sKA z{+4~>5hM_Zl~BbaKML&`$8A%HRB0vq%$zfyzjK*${Qbw5uK*VDkiq&pXmjbeLa}Lr zF*w_NmwO#9+TOF~w%<}FQVi)$u6%}zjh#?+0^x1%cD*+}(NaMur1vD*Rcj2-Pk<~n zVh1Yd`d%Y!@y=hwTpMP5L6F)qQC@0Fr$6Z`2=|ymX3`A98G_UA-fca zKrJ(r%0sbp>p2t{rUxn;2<1nDcf7h#5oH{-q=^!_Yi;?ho##B_U7rwjnPks!HQ^q( zx1^@AWlhtxYjf*1rf}B6B+fCU%32@Cw1qS-FcgpSpVikrTQ%_;L!mranEof1EX-i` zc+f-I!Ne7!J-CafzT(8ob#c49DQZBbMTXR7tb&2<=*m|a)c)SIWt0rdaQ62sdg6VK zbZygbE>qgyTQnBfqfs~O7*obV>f1kA!%456cQR9BZrUYFEX{>1o#cpRDxJ$Y`PJef zJTY3%$hWsyTl-#Q6c^lspa)xfa@hUFT}oAIACA%ME_Erx=utUu>`<@d*Mhd-suxj* zo?Yz;JppyG8_1y9@gE+wG&SVoaFal8JRa*j3OFHNXhD7&f$&#)-KHNUmemux{eO(y z?9TxnHr=sEt+lWhwfrZ64$ZC$;YW`W$|0P3IX)@Au^#)u$hqT^_H4}f( znx*>ZXm#}v(SFdDLJ@gbNZ~FaJl!$0W-1?GzoU(TdnE0?5u+F*twyh=)Uxkp=@?~^ zC|&yUXTsAb6K0MP(eDCh5~7!spFu7!%)1kxalY~i7c280ak}y^W?qqYc^_9l!hTPX ze$4tqf+sQST|appy+vnPDpY~wpQM{QYh9rfmPs18jr%c-eton8B|IRxL8vl)Hn)LP z9hLZ*$F&3PIvH?73y+Wz3#e{jRANkGQKBH>NSu+#NZge8T_P`GNfaeqiCg~xod|ET literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab new file mode 100644 index 0000000000000000000000000000000000000000..e91dac6f5e70bc64bfe0c3556c4d159dc7c11f77 GIT binary patch literal 65536 zcmeIu%ME}a3;@vTK|DE-aX9yKI4n`33z&F#O@MwlG_P#OGDgIZ=ZUQLh`BZLtr;!t zf2KR{b)S`%WW4)V$4!6$0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0tEgq zu-01tzoiWc5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N y0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7e?cLFCTv-WLyhvy$&R)rIMH{5!9YimeXAQJwNkaeM{+MEleoLJkfL{bT~aAUg~ K4t1IAjHeCB&1lg8 literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab_i b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab_i new file mode 100644 index 0000000000000000000000000000000000000000..87f82b7037ff0c09ffdb6dba63350ec49cc880a7 GIT binary patch literal 32768 zcmeIu0Sy2k3a^^Y009C72oNAZfB*pk1PBlyK!5-N0t5&U bAV7cs0RjXF5FkK+009C72oNAZ;D3P!^|AtT literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab_i.len b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/class-fq-name-to-source.tab_i.len new file mode 100644 index 0000000000000000000000000000000000000000..131e265740f37d77b7c4a3676d2a7704ca3e4a29 GIT binary patch literal 8 McmZQz0D%Su009U9fdBvi literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab new file mode 100644 index 0000000000000000000000000000000000000000..6bafcf15ae5e6c729e121bfe7ea0d68f26414441 GIT binary patch literal 65536 zcmeIu(Fub<3JhO- zOci8rSv8(JwVxaPRbEwpW1p`15orVn5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAVA>u0_(T6S6=zae*0q`NPqwV0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ MfB*pk1pXkf0~5*(Hvj+t literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab.keystream b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab.keystream new file mode 100644 index 0000000000000000000000000000000000000000..250bb223f956dfd5c882c9e0c299b8fc39b79104 GIT binary patch literal 4096 zcmd;b&rDA&PEF3wOA$mcRZ{ZCwt{sN$lwEBJq4&Af7-)yR({N&YcHGh?@|q zM0c&?Mu=uL6!Wa}jrS+72kusd6MQ#ZdU|O4knTVvydWX#MoYCd7fLy?Hd~3L5@_SL PebDelr^WuJUw3)~HVVI< literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab_i b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab_i new file mode 100644 index 0000000000000000000000000000000000000000..c6a074ad1da7ad100932b17018ae34813f28733a GIT binary patch literal 32768 zcmeIuK@ET~6a~STa_J2%IKW8_R73?KpfZqzjUO_rU^8hsA_4>m5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009EU1o}$OF?X>oI|K+2AV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RmM7R`NdgRb|Hq0RjXF5FkK+ r009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+z&`{&N`?fD literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab_i.len b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/internal-name-to-source.tab_i.len new file mode 100644 index 0000000000000000000000000000000000000000..131e265740f37d77b7c4a3676d2a7704ca3e4a29 GIT binary patch literal 8 McmZQz0D%Su009U9fdBvi literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab new file mode 100644 index 0000000000000000000000000000000000000000..5268e9dd5ac796ebddf3a36e719e8ecbeffe9ba7 GIT binary patch literal 65536 zcmeIu%L#-q5CG6oSXMk(k$r4C+n2RToS;D)5OR0}N#>Ko@V@J|j1e*9xg)E8#8eyk zmW-OVKc6dab(_sK$$0k9j++1h0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PJsm@Y_r2e@hz@AV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ zfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5;&_XG~7 CdkK30 literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab.keystream b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab.keystream new file mode 100644 index 0000000000000000000000000000000000000000..062ab0a4d44fa485ec08852734b4567ab6e67d7c GIT binary patch literal 4096 zcmeIuu?+wa5CA~6#mw4kWmuT9?qWb@oa>{IeDN- zihc4bKt6m!;dD;n5GYXWWOm9GS=8a0vnw|ZO+=i*+0~`UA%1X<1OsWRrkK(tuUG6U zo8nTG6)<>NMzz7w+FeKrs;@+qm1=Pv%0ZqokOvyCF|x(F!6+g5H^v%L wR$`qMQum7S%GrSyGw(|4t%zN4wk>v_(fcDYX+!M)g2y17lqF@z61``bA2ZGQkpKVy literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab_i b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab_i new file mode 100644 index 0000000000000000000000000000000000000000..87f82b7037ff0c09ffdb6dba63350ec49cc880a7 GIT binary patch literal 32768 zcmeIu0Sy2k3a^^Y009C72oNAZfB*pk1PBlyK!5-N0t5&U bAV7cs0RjXF5FkK+009C72oNAZ;D3P!^|AtT literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab_i.len b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/proto.tab_i.len new file mode 100644 index 0000000000000000000000000000000000000000..131e265740f37d77b7c4a3676d2a7704ca3e4a29 GIT binary patch literal 8 McmZQz0D%Su009U9fdBvi literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab new file mode 100644 index 0000000000000000000000000000000000000000..f0d53c1085242d4ba0e554c645179f1cd2ac7287 GIT binary patch literal 65536 zcmeIu!3}^Q3Dme@R|VS!=ZW8cCKSY47r}l+a57jkY~%P zw*RTT`hM?kOEp>V{7&oy2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N z0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkL{ z{{lyA?f+AnkN^P!1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72z)1S0Vo{_ AxBvhE literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab.keystream b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab.keystream new file mode 100644 index 0000000000000000000000000000000000000000..d3f79e7bdbee06c7ccc4ef24bfab84f13984b8cd GIT binary patch literal 4096 zcmeIuF%Ezr5JXW=OmjFH#6dEh^3|E=kQR@klJr@J%cTOUx-v4KB$qN=#3c cW#DqpOiwHZD$h$1L@-rS5=&B53@MWa0KA@~ literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab_i b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/increCache.gigasecond_main/kotlin/source-to-classes.tab_i new file mode 100644 index 0000000000000000000000000000000000000000..563b0c394e9c34c90744acd5a2f25ab555159b18 GIT binary patch literal 32768 zcmeIuF%bYD5X8V^@P#&dB+_%_|5iEd2ah8(!Nnzc%>~kLxU7jbh+9Iaf$hTzF zwEY?GywzYQTbI zcIaXfvx>=Vk<@8M$PMdd!^4sNh&IQ>7WZnuT+l&_LplILxFK~;d%DK#T_Ec$YpDgH l^XR<1`K0r#3ZJQ3{N}Sm-djY w$lk`0tE8N~X=pWy^&rJR-<#Z*=6y^I0R#|0009ILKmY**5I_I{1pX>;1AOHir~m)} literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.keystream.len b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.keystream.len new file mode 100644 index 0000000000000000000000000000000000000000..37934e8b875bb9b7452d1c5da923bac660c11d29 GIT binary patch literal 8 LcmZQz00U0|08s!+ literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.len b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.len new file mode 100644 index 0000000000000000000000000000000000000000..60e2d8aa9e10da6b90c32ba9742bd89d145b31f8 GIT binary patch literal 8 McmZQz0D%S$009sHi2wiq literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.values.at b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab.values.at new file mode 100644 index 0000000000000000000000000000000000000000..9f383b5fab9d5332f3a4a6ffa2b7645a6d9f8af6 GIT binary patch literal 67 zcmdOA@JLNeNi9+cN=?o$N>OmjFH#6dEh^3|E=kQR@klJr@J%cTOUx-v4KB$qN=#2> MVE_Rz$p|Ky0PMOF6951J literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab_i b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/file-to-id.tab_i new file mode 100644 index 0000000000000000000000000000000000000000..563b0c394e9c34c90744acd5a2f25ab555159b18 GIT binary patch literal 32768 zcmeIuF%bYD5X8V^@P#&dB+2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+ z009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+zzqaOYRa6QbMl?M!PrJ5K!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk z1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs z0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZ LfB*pke-k(W5r`7v literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.keystream b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.keystream new file mode 100644 index 0000000000000000000000000000000000000000..636f34a3cbe33411309e4121964a67a0624882df GIT binary patch literal 4096 qcmeIu0Sy2E3<4mvf9Uu4AOh)v0RsjM7%*VKfB^#r3>Yx*d*A>+`v3$0 literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.keystream.len b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.keystream.len new file mode 100644 index 0000000000000000000000000000000000000000..29ce11cc9c2acfbfd357e04485500314b13afbb5 GIT binary patch literal 8 LcmZQz00U+K01E&F literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.len b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.len new file mode 100644 index 0000000000000000000000000000000000000000..58d450dc89fe633ad9175af1bff8cbf07385780c GIT binary patch literal 8 McmZQz0D%Sx00AHXnE(I) literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.values.at b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab.values.at new file mode 100644 index 0000000000000000000000000000000000000000..b02be120209d7b0b54f015a2c3a3498896603a22 GIT binary patch literal 274 zcmd6fK?=e!5Jhv8oIv;83brl^MX{^d49O=AZId!Hg2y)t@eFR?d%Uw7z!Bo_2vwrL zR`C-=vl@yGtjoy9%-ahOtHKF4=lV-WPi+zD0Yt(Z60+{JR@-u+loM;)l}IXqc5dve L`ky+j_MfW{Sx;!x literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab_i b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/id-to-file.tab_i new file mode 100644 index 0000000000000000000000000000000000000000..e651c00e9f8d1bd8e35ba6c7fba0686b98bceb1f GIT binary patch literal 32768 zcmeIup%DNe3iKil##oNAS>{fidAGWAwcqn< zepYARz5f03_k6Wi0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&U zAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C7 z2oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly@UIIz z{5egFKJxpIY1*h?>SjHvC+o+0w%+gFR=ruz*LTe?*H?ABUT=P_Zr2<2Lfx$|+V9mz zb-$iyez)G4rfE61`GdM!AJ;4OS-n)B*VElUs88z4x?kVa+x2ZdSKrt5`k^lBr+Ta& z)r0=$bA4LB)@A)x@71w3#;v-jJ9VRO&2xtU0RjXF5FkK+009C72oNAZfB*pk1PBly zK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF z5FkK+009C72oNAZfB*pk1PBlyK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk R1PBlyK!5-N0tEgmfnT)8k0t;B literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/lookups.tab.keystream b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/lookups.tab.keystream new file mode 100644 index 0000000000000000000000000000000000000000..d20af58c7e2793de98c847e338e7fb00371c1d0c GIT binary patch literal 4096 zcmZQz;F)0Pu;u~?GXO!a+{P^+Hi$mW{ag}6^KAQO0~Y^PqXD8lS9c`qPuV&XCco#U zBqKOmjFH#6dEh^3|E=kQR@klJr@J%cTOUx-v4KB$qN=#2> zVE_U8lN?}sfdu2gv%tP5!yRCKOgwO(02ydJhzi2$2%7;8B}V)7j3MCGKbP<=T(4kJYaVogfE_M(R9IRW=MG&QfgW&QO6r~jDrh|nn ziqyr5pr}wq5EYd`gLbRR33X^ts3nS6-~S*XAAWx~clYf{TkcTves<4K(eQSt`MQ;B-S?cmeeg=R`o-O6ujegX zIzJTm9Qq@W27$tiG&pl-Aq`o{hyVfzAdnw{*Cws3_2>S*pO3rqyOIW zmtN;!e!2uo{@mOuHxH*PHE9vZhCt1vuNQuG{5#F4Uq4bjT@eQY2p|xczFBbTGeqL zfldU@n6&+SuGY!5T!R1t$qI~_RE>()lby=6tO(5e^YiZVqn%mVhdmHL009ILKtO7m z^zh@61{Mg!DNyj|Y;>c(73U0kBam4E|30I!zh2Mmet|A_(WE!4e@6n17h9~V@4cSG zy<-EVF#-r65QxBClb$sH91kQ;ZevXQeK@f=v6)){7DoU91Q0*~0R#|0009ILKmY** zS_rI~|J`9ADzzx%Gy(`9fB*sr1Sl|R()a1;MS#(Wga85vAdq5#ag*LJR98~G0?`pb i009Kr5V&d5&uDg_jZ#VwNKD|GNsDhw&k`Hh;h_K7MQ}j? literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/lookups.tab_i.len b/kotlin/gigasecond/build/kotlin/compileKotlin/caches/lookups/lookups.tab_i.len new file mode 100644 index 0000000000000000000000000000000000000000..131e265740f37d77b7c4a3676d2a7704ca3e4a29 GIT binary patch literal 8 McmZQz0D%Su009U9fdBvi literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/data-container-format-version.txt b/kotlin/gigasecond/build/kotlin/compileKotlin/data-container-format-version.txt new file mode 100644 index 0000000..b01b80f --- /dev/null +++ b/kotlin/gigasecond/build/kotlin/compileKotlin/data-container-format-version.txt @@ -0,0 +1 @@ +2011001 \ No newline at end of file diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/experimental-format-version.txt b/kotlin/gigasecond/build/kotlin/compileKotlin/experimental-format-version.txt new file mode 100644 index 0000000..7289c6b --- /dev/null +++ b/kotlin/gigasecond/build/kotlin/compileKotlin/experimental-format-version.txt @@ -0,0 +1 @@ +4011001 \ No newline at end of file diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/format-version.txt b/kotlin/gigasecond/build/kotlin/compileKotlin/format-version.txt new file mode 100644 index 0000000..2408adb --- /dev/null +++ b/kotlin/gigasecond/build/kotlin/compileKotlin/format-version.txt @@ -0,0 +1 @@ +8011001 \ No newline at end of file diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/gradle-format-version.txt b/kotlin/gigasecond/build/kotlin/compileKotlin/gradle-format-version.txt new file mode 100644 index 0000000..178119c --- /dev/null +++ b/kotlin/gigasecond/build/kotlin/compileKotlin/gradle-format-version.txt @@ -0,0 +1 @@ +3011001 \ No newline at end of file diff --git a/kotlin/gigasecond/build/kotlin/compileKotlin/last-build.bin b/kotlin/gigasecond/build/kotlin/compileKotlin/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..e99e234a0b375844e164f61975853ed93a2df563 GIT binary patch literal 81 zcmZ4UmVvdnh(RmAC|xfrwIr!1F*C1NFFU^^Co@kkGcUO)H8(Y{Br!+NsWdYu#WOE0 lfAeSN$RAJN#WOK5dNHsUmn0UIgalUE za(-S)Oj2oPPD)I2PGWI!YH>_%B2d;HE~}D~Sdyw@s0Ws2U|@{NstM9%@THRJD8?E9 E0A<}qhyVZp literal 0 HcmV?d00001 diff --git a/kotlin/gigasecond/build/kotlin/compileTestKotlin/dirty-sources.txt b/kotlin/gigasecond/build/kotlin/compileTestKotlin/dirty-sources.txt new file mode 100644 index 0000000..6c209a9 --- /dev/null +++ b/kotlin/gigasecond/build/kotlin/compileTestKotlin/dirty-sources.txt @@ -0,0 +1 @@ +C:\Users\speed\exercism\kotlin\gigasecond\src\test\kotlin\GigasecondTest.kt \ No newline at end of file diff --git a/kotlin/gigasecond/build/kotlin/compileTestKotlin/last-build.bin b/kotlin/gigasecond/build/kotlin/compileTestKotlin/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..58144d2b681c9cffed4e83f7118ffd9195723f87 GIT binary patch literal 81 zcmZ4UmVvdnh(RmAC|xfrwIr!1F*C1NFFU^^Co@kkGcUO)H8(Y{Br!+NsWdYu#WOE0 lfAeSN$RAJN#WOK5dNHsUmn0UIgalU + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/gigasecond/src/main/kotlin/.keep b/kotlin/gigasecond/src/main/kotlin/.keep new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/gigasecond/src/main/kotlin/Gigasecond.kt b/kotlin/gigasecond/src/main/kotlin/Gigasecond.kt new file mode 100644 index 0000000..03a7736 --- /dev/null +++ b/kotlin/gigasecond/src/main/kotlin/Gigasecond.kt @@ -0,0 +1,17 @@ +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.LocalTime +import java.time.temporal.ChronoUnit +import java.time.temporal.Temporal + +class Gigasecond(val dt: Temporal) { + val date: LocalDateTime = + if (dt is LocalDate){ + LocalDateTime.of(dt, LocalTime.MIDNIGHT).plus(1000000000, ChronoUnit.SECONDS) + } + else (LocalDateTime.from(dt).plus(1000000000, ChronoUnit.SECONDS)) + + override fun equals(other: Any?): Boolean { + return (this.date == other) + } +} \ No newline at end of file diff --git a/kotlin/gigasecond/src/test/kotlin/GigasecondTest.kt b/kotlin/gigasecond/src/test/kotlin/GigasecondTest.kt new file mode 100644 index 0000000..ade6d2f --- /dev/null +++ b/kotlin/gigasecond/src/test/kotlin/GigasecondTest.kt @@ -0,0 +1,45 @@ +import org.junit.Test +import org.junit.Ignore +import java.time.LocalDate +import java.time.LocalDateTime +import java.time.Month +import kotlin.test.assertEquals + +class GigasecondTest { + + + @Test + fun modernTime() { + val gigaSecond = Gigasecond(LocalDate.of(2011, Month.APRIL, 25)) + + assertEquals(LocalDateTime.of(2043, Month.JANUARY, 1, 1, 46, 40), gigaSecond.date) + } + + @Test + fun afterEpochTime() { + val gigaSecond = Gigasecond(LocalDate.of(1977, Month.JUNE, 13)) + + assertEquals(LocalDateTime.of(2009, Month.FEBRUARY, 19, 1, 46, 40), gigaSecond.date) + } + + @Test + fun beforeEpochTime() { + val gigaSecond = Gigasecond(LocalDate.of(1959, Month.JULY, 19)) + + assertEquals(LocalDateTime.of(1991, Month.MARCH, 27, 1, 46, 40), gigaSecond.date) + } + + @Test + fun withFullTimeSpecified() { + val gigaSecond = Gigasecond(LocalDateTime.of(2015, Month.JANUARY, 24, 22, 0, 0)) + + assertEquals(LocalDateTime.of(2046, Month.OCTOBER, 2, 23, 46, 40), gigaSecond.date) + } + + @Test + fun withFullTimeSpecifiedAndDayRollover() { + val gigaSecond = Gigasecond(LocalDateTime.of(2015, Month.JANUARY, 24, 23, 59, 59)) + + assertEquals(LocalDateTime.of(2046, Month.OCTOBER, 3, 1, 46, 39), gigaSecond.date) + } +} diff --git a/kotlin/rna-transcription/.gradle/3.5/file-changes/last-build.bin b/kotlin/rna-transcription/.gradle/3.5/file-changes/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/kotlin/rna-transcription/.gradle/3.5/taskHistory/taskHistory.lock b/kotlin/rna-transcription/.gradle/3.5/taskHistory/taskHistory.lock new file mode 100644 index 0000000000000000000000000000000000000000..ac97b0933890b45a4c14b1ce055741a2a1f7e8a1 GIT binary patch literal 17 ScmZQ>Wm+OGHNCcs0SW*kk^<@g literal 0 HcmV?d00001 diff --git a/kotlin/rna-transcription/.gradle/buildOutputCleanup/built.bin b/kotlin/rna-transcription/.gradle/buildOutputCleanup/built.bin new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/rna-transcription/.gradle/buildOutputCleanup/cache.properties b/kotlin/rna-transcription/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..4f36e87 --- /dev/null +++ b/kotlin/rna-transcription/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Fri Jun 02 17:15:35 EDT 2017 +gradle.version=3.5 diff --git a/kotlin/rna-transcription/.gradle/buildOutputCleanup/cache.properties.lock b/kotlin/rna-transcription/.gradle/buildOutputCleanup/cache.properties.lock new file mode 100644 index 0000000..40fdece --- /dev/null +++ b/kotlin/rna-transcription/.gradle/buildOutputCleanup/cache.properties.lock @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/compiler.xml b/kotlin/rna-transcription/.idea/compiler.xml new file mode 100644 index 0000000..74259c7 --- /dev/null +++ b/kotlin/rna-transcription/.idea/compiler.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/gradle.xml b/kotlin/rna-transcription/.idea/gradle.xml new file mode 100644 index 0000000..20d2df6 --- /dev/null +++ b/kotlin/rna-transcription/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/rna-transcription/.idea/libraries/Gradle__junit_junit_4_12.xml new file mode 100644 index 0000000..04c10dd --- /dev/null +++ b/kotlin/rna-transcription/.idea/libraries/Gradle__junit_junit_4_12.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/rna-transcription/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/kotlin/rna-transcription/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml new file mode 100644 index 0000000..7b6f562 --- /dev/null +++ b/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml new file mode 100644 index 0000000..1720158 --- /dev/null +++ b/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml new file mode 100644 index 0000000..21c5d19 --- /dev/null +++ b/kotlin/rna-transcription/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/misc.xml b/kotlin/rna-transcription/.idea/misc.xml new file mode 100644 index 0000000..84da703 --- /dev/null +++ b/kotlin/rna-transcription/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/modules.xml b/kotlin/rna-transcription/.idea/modules.xml new file mode 100644 index 0000000..1890bc3 --- /dev/null +++ b/kotlin/rna-transcription/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/modules/rna-transcription_main.iml b/kotlin/rna-transcription/.idea/modules/rna-transcription_main.iml new file mode 100644 index 0000000..83b3f43 --- /dev/null +++ b/kotlin/rna-transcription/.idea/modules/rna-transcription_main.iml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/modules/rna-transcription_test.iml b/kotlin/rna-transcription/.idea/modules/rna-transcription_test.iml new file mode 100644 index 0000000..4afb34a --- /dev/null +++ b/kotlin/rna-transcription/.idea/modules/rna-transcription_test.iml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/.idea/workspace.xml b/kotlin/rna-transcription/.idea/workspace.xml new file mode 100644 index 0000000..0340f52 --- /dev/null +++ b/kotlin/rna-transcription/.idea/workspace.xml @@ -0,0 +1,839 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1496438124537 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/README.md b/kotlin/rna-transcription/README.md new file mode 100644 index 0000000..c0b1a80 --- /dev/null +++ b/kotlin/rna-transcription/README.md @@ -0,0 +1,27 @@ +# Rna Transcription + +Given a DNA strand, return its RNA complement (per RNA transcription). + +Both DNA and RNA strands are a sequence of nucleotides. + +The four nucleotides found in DNA are adenine (**A**), cytosine (**C**), +guanine (**G**) and thymine (**T**). + +The four nucleotides found in RNA are adenine (**A**), cytosine (**C**), +guanine (**G**) and uracil (**U**). + +Given a DNA strand, its transcribed RNA strand is formed by replacing +each nucleotide with its complement: + +* `G` -> `C` +* `C` -> `G` +* `T` -> `A` +* `A` -> `U` + +## Source + +Rosalind [http://rosalind.info/problems/rna](http://rosalind.info/problems/rna) + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. + diff --git a/kotlin/rna-transcription/build.gradle b/kotlin/rna-transcription/build.gradle new file mode 100644 index 0000000..16c36c0 --- /dev/null +++ b/kotlin/rna-transcription/build.gradle @@ -0,0 +1,28 @@ +buildscript { + ext.kotlin_version = '1.1.1' + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + testCompile 'junit:junit:4.12' + testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" +} +test { + testLogging { + exceptionFormat = 'full' + events = ["passed", "failed", "skipped"] + } +} diff --git a/kotlin/rna-transcription/build/classes/main/META-INF/rna-transcription_main.kotlin_module b/kotlin/rna-transcription/build/classes/main/META-INF/rna-transcription_main.kotlin_module new file mode 100644 index 0000000000000000000000000000000000000000..10b4584e00ae33b84d666d91fc0beede56a28117 GIT binary patch literal 40 pcmZQzU|?ooU|@t|HZCzP1|gxKyu^^A#Ju95&%q02dV%7 literal 0 HcmV?d00001 diff --git a/kotlin/rna-transcription/build/classes/main/RnaTranscriptionKt.class b/kotlin/rna-transcription/build/classes/main/RnaTranscriptionKt.class new file mode 100644 index 0000000000000000000000000000000000000000..289cbc069ed07842ed6fcd4b1c3155fd7aadf018 GIT binary patch literal 2471 zcmb7F+g1}-82)xbGI0n9QPf~nDp5Jd37(o*TN(vZ0$PJu#g~cl2~kx7O45%9}=o)Ud!&FAyyoOExtHE{+u2k|obEt@YgKyCi|( zqV24wHw~}s=%(eSb<46nU3zrWi?+AesMT@;;i{#_5ED4NWqUQ#N^kDe)28Jaj-}Vq z1xq?`&5El)6*yVhFe+R3bw{rolqk4?9f3=oQ8nYwy&Kf%avX8=sOUzoz=?Jq`3>DE z8P6JqRWTIw2^{lz4bQBlXBYD!N5mG3vnFBKsWkvf{dG{WqP*+ zx<(4p&nYBT9K)c%@wTnJU8@mVVxZtXfq@`r&v@>on^?N?I?f8jOeUy%wj+@1%&jw0 z;vN{Nys_)1r9>f6&c!i=_f?$3d4Y5PBCH@Kpls;wBE#_$d=ke+TvBlXBaFx*SsM3Q z`8dWfE?E--s{6I+RW_Q;fsy?Yu;sIY{OWMiv%yZwbt<-C>aZ0&!8mT=BNZRwV}X##Y($>-k}^|z zN=w!CZ4wG3u&U}QbBBMv?UZ9w40FeDT9i{Ab`K;a&|fuN&$Rsa+Y&#~6!%|AyR!MH zrQbE_b;%Zpce-I2wRpVC4tGHs2l`Nxrr=%-Oh(Mb@PNxq3`<-d#<0v%x_j?Y44<=Z zO>4VZfBmgTv0!+5RrhoT6sqrp*#L!{qCA%UBWPwzl0qa^HG%B@i#~P#g&OMXZ7y*& z6bldb_U*qI3|$tPXkUn{By9^O_I=dem%G+&sYKxcD zmA9*g1j4T9wPoEgb=LEeoOnG&(=rwt^|Ijvl%A5OSGE=iYg6L%gNEgqb)#VIn662s znRbg6NWIN{(>D)@sU^GNRE$|u`aIq|+&0RM^*hf!gRR$Q@X5f`@;h#z@kw_PLV}1S zB8Vc44I+ISN7!nCwXwvJJscg|M}KjA;TIfxJpKwN1%ATmeVkdG*u!wPE7|oUM!&-a zxlUe-Ob$e@MYHNabPrm#JE|th?p29FW zKc(L+<&r(BF*hB*|;75;94v?DSL zau&I6a-8Qr>ht5&>!Iad`VrLcq0CW~x!~aDtGexz8|wt4!?%6PDpCh)jg|I}mIb7Fi*z!{!~Mv@mmD zJ*2SJdH-9kj+KU5yIFO7NE1G7Ut+a&`icbT1(ro+1;RxY#tIY{Q!cVDp7?XbMa;$8-v8ncUeT=-ocU%>v zAOwcD%!diB#>3dN&rmP9T zfWeyXJzkMz3Y>~M8<$-tXo2Pyihp-qk3!F{tu6kaN+XRECWdg5yZ+tOR>}>D9u`Q; zmjCQiQ`VKh{BdskG;7DOoy_7!8Wu)Pj9^S)Ao}33^h~k)?K@{1sq999@_e_T@=fW} z5fFI;6ErykX9Y%T?R-JyI!pPw(TCketH`dpog&-7ITkqvF7Q%hJ6}+xP*%J;CrSn` zu`=vZil;2)b9OFg=WV;hMf1$qxxAClJ2}U(iCq-XA9xhxQ5sjFn;5_~zE^QOi0Yo7 zeeFiFDkDjyw8l5^U#(w_!tb>{nq^n8Kw zUV2>Lj;L5Js8R&07*u3^Lx!F#*Ig$bc&$ZV`kQ8>?1r7p#Ji>+c@1~NQy!Ptz8^#~ z{sJhvxgIpbiu>HFyI6t7Ym0v=HbxRU+}rJb@G_j zaRHZ6@kg{8TP0S!#O!ruvztg1u-y8uVD(RQg9+S>hg+Kv3b%1*6GIB)3WkENFxzr6 P3Q2`&g*k;8g}c82lE4Cy literal 0 HcmV?d00001 diff --git a/kotlin/rna-transcription/build/kotlin-build/caches/version.txt b/kotlin/rna-transcription/build/kotlin-build/caches/version.txt new file mode 100644 index 0000000..01aabac --- /dev/null +++ b/kotlin/rna-transcription/build/kotlin-build/caches/version.txt @@ -0,0 +1 @@ +11001 \ No newline at end of file diff --git a/kotlin/rna-transcription/rna-transcription.iml b/kotlin/rna-transcription/rna-transcription.iml new file mode 100644 index 0000000..3b0b656 --- /dev/null +++ b/kotlin/rna-transcription/rna-transcription.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/rna-transcription/src/main/kotlin/RnaTranscription.kt b/kotlin/rna-transcription/src/main/kotlin/RnaTranscription.kt new file mode 100644 index 0000000..d87c0fd --- /dev/null +++ b/kotlin/rna-transcription/src/main/kotlin/RnaTranscription.kt @@ -0,0 +1,11 @@ +fun transcribeToRna(dna: String): String = dna.map { switchChar(it) }.joinToString(separator = "") + +fun switchChar(inpChar: Char) : String { + when (inpChar) { + 'G' -> return "C" + 'C' -> return "G" + 'T' -> return "A" + 'A' -> return "U" + else -> return "HOW" + } +} \ No newline at end of file diff --git a/kotlin/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt b/kotlin/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt new file mode 100644 index 0000000..b576c5a --- /dev/null +++ b/kotlin/rna-transcription/src/test/kotlin/RnaTranscriptionTest.kt @@ -0,0 +1,46 @@ +import org.junit.Assert; +import org.junit.Test +import org.junit.Ignore; + +class RnaTranscriptionTest { + + /* + In Kotlin functions can be declared at top level in a file, meaning + you do not need to create a class to hold a function, like languages + such as Java, C# or Scala. + + http://kotlinlang.org/docs/reference/functions.html#function-scope + + */ + + + @Test + fun emptyDnaIsEmptyRna() { + Assert.assertEquals("", transcribeToRna("")) + } + + @Test + fun cytosineIsGuanine() { + Assert.assertEquals("G", transcribeToRna("C")) + } + + @Test + fun guanineIsCytosine() { + Assert.assertEquals("C", transcribeToRna("G")) + } + + @Test + fun thymineIsAdenine() { + Assert.assertEquals("A", transcribeToRna("T")) + } + + @Test + fun adenineIsUracil() { + Assert.assertEquals("U", transcribeToRna("A")) + } + + @Test + fun rnaTranscription() { + Assert.assertEquals("UGCACCAGAAUU", transcribeToRna("ACGTGGTCTTAA")) + } +} diff --git a/kotlin/test/.idea/libraries/KotlinJavaRuntime.xml b/kotlin/test/.idea/libraries/KotlinJavaRuntime.xml new file mode 100644 index 0000000..c630c0b --- /dev/null +++ b/kotlin/test/.idea/libraries/KotlinJavaRuntime.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/test/.idea/misc.xml b/kotlin/test/.idea/misc.xml new file mode 100644 index 0000000..0548357 --- /dev/null +++ b/kotlin/test/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/test/.idea/modules.xml b/kotlin/test/.idea/modules.xml new file mode 100644 index 0000000..ea6e2e7 --- /dev/null +++ b/kotlin/test/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/kotlin/test/.idea/workspace.xml b/kotlin/test/.idea/workspace.xml new file mode 100644 index 0000000..b6e6f18 --- /dev/null +++ b/kotlin/test/.idea/workspace.xml @@ -0,0 +1,432 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1496435516327 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/test/out/production/test/Gigasecond.class b/kotlin/test/out/production/test/Gigasecond.class new file mode 100644 index 0000000000000000000000000000000000000000..5ddb73ca75414342c4beaa9004231993219bca5f GIT binary patch literal 1739 zcmah~TXWi05dMw;NtUq)*z#I8HQ(b+w#Z+E}lv%LA|ufGAT;%f%uvD>t` zV+Vdi17k?FtV7H6EWc@P)mx4&G{hL<4NEu-^OfGIaNCYq32e*TAoUJOC5G#jAZ(f~ zN7O^h^|@*JejqI22DGmRqT2C1veKH4kS{STW^@0EmP7*T1QZzLTI{);Az2v)N;pbG zFkBe{5Kj9b2rbXti8f@Ekj}{N+L)`;mPt%wM!L%|sP|mo755pIvge}bYC5JFuI>lI zbA7XQ*fw2XIH6A=lzkBr1+L9CTxPgz?>YAVb1Ssk4q23WL~J}#XuZa6I4f(es}|7V_2J$6xa8{zz@Emj5NGY>~C+bZ&f$8 ziITID8(No=xPhA!xQ-9V_6*J=SS;RN8j@Xzs*=m;_>}6{YnRRM4?+r`u20SKI?hScB=LE_ z6{x?{m8kokIl`hFYRQYyK8#UIFuABC)_Wqg2iupoW`&{AJz6l7ImJ*?-6Mm(y}eGd z)ai-2?$N4JWDln@YD!s9im}%}s!A&UBArT*q>`l5TMKbrOX;K>m_*8nl=1p!byE5w zX31|{IGpaF)~2aY*r(m%i;gcRNZCJhxm)*~wc(^7^Yx%X(;?HNuV#g=MHV}9VVJ47 zzEkbA>rNPHZoG?ia?8d*jqRWl+Rh_aqRdC{)J}QF3eA8x5l53iP9Tc@iKLO98a*>| zOuVCuAq^dJc045ulTImVB=Wyw@)z1DsL-11E9p5!(lh!=ND$~Kd>SbNI}J4Z|3K;( z5TogEF#>8)9tycyUCvxO#(Vica4o<53bT2NaP|V0e#5OUa(}{%ql=YeeDYo9vt!(Q zg~?y(t$z5I`Up|@@_(bxgG|JrGnGCwluT8oBngmYDcI_*Wjv?nx1{}oLb<<-SQ%gT vz7McAkRFl(>vGxH1>@Mnqg^C9rZ^sROmoa|T;xb_s2n=S1V@S^&GFU0Lk^>L literal 0 HcmV?d00001 diff --git a/kotlin/test/out/production/test/META-INF/test.kotlin_module b/kotlin/test/out/production/test/META-INF/test.kotlin_module new file mode 100644 index 0000000000000000000000000000000000000000..ebc01e5f884e01587cee23f5237f301f4415e23e GIT binary patch literal 28 dcmZQzU|?ooU|@t|HZCqM1|c@z#LPVJ5&#N{0)_wp literal 0 HcmV?d00001 diff --git a/kotlin/test/out/production/test/MainKt.class b/kotlin/test/out/production/test/MainKt.class new file mode 100644 index 0000000000000000000000000000000000000000..11f790531e86a6d5cc5f83597acf94f990b348be GIT binary patch literal 1389 zcmaJ>-)|a65dQYS9Nv-yh?CULkJ314Fs2-bY1)`HE%lG&Vjxy)QNRgGt{u%i%tR#NgkFz0%EwAJ(I;S%gPzcX#?;rh4+CHwoXM>nuB5_HT`S3I;GTRmdPjOY%@_`sL$ zKY_dWiX(-4L}6E|fDU>=_EW{qAs0ltW#?!x>+gu zM3sT!BnmJYE{A2DchIrGFtHy*5X48CB}n-j+~+9cTY~sVQwJR|>e0GXq9c@`2G;rq z5gHm6EHP4Bp$Z1J7nn3MbttFBgJm5 z$i|@GlHSO2=lQ@1F3fTcY~LoQ(?P0^XOqUF=?=WMT(tv~siCqgTZ8V(OC@O*U7Gso z5!B`o=uA9JXoynfLBi9RK#cS!r2T?8Nr0J4PafgY8>F^U`oFJmEgDT0lG!8N+)96O zgxkls^B1zOk*~c%Y5q07`;&q+ShOYxk^l(k0qsxe&*>ya_98A|jdY!OhfYESHCi=1 zMxFMhX1%)3N3`*^@I%9M&CH3k%I7m?=H$E{e)@Q>#?4tXZ!RpFJh#HpARvq27pbVq qHX;@thR^qSbfW!02K;EDil4T@d@Nyk8@i7PA1glM;Yvcx$LjwVr(T`_ literal 0 HcmV?d00001 diff --git a/kotlin/test/src/main.kt b/kotlin/test/src/main.kt new file mode 100644 index 0000000..d11b384 --- /dev/null +++ b/kotlin/test/src/main.kt @@ -0,0 +1,13 @@ +import java.time.LocalDateTime +import java.time.Month +import java.time.temporal.ChronoUnit +import java.time.temporal.Temporal + +class Gigasecond(val dt: Temporal) { + val date: LocalDateTime = LocalDateTime.from(dt.plus(1000000000, ChronoUnit.SECONDS)) + +} + +fun main(args: Array) { + print(Gigasecond(LocalDateTime.of(2043, Month.JANUARY, 1, 1, 46, 40)).date) +} \ No newline at end of file diff --git a/kotlin/test/test.iml b/kotlin/test/test.iml new file mode 100644 index 0000000..245d342 --- /dev/null +++ b/kotlin/test/test.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.gradle/3.5/file-changes/last-build.bin b/kotlin/word-count/.gradle/3.5/file-changes/last-build.bin new file mode 100644 index 0000000000000000000000000000000000000000..f76dd238ade08917e6712764a16a22005a50573d GIT binary patch literal 1 IcmZPo000310RR91 literal 0 HcmV?d00001 diff --git a/kotlin/word-count/.gradle/3.5/taskHistory/taskHistory.lock b/kotlin/word-count/.gradle/3.5/taskHistory/taskHistory.lock new file mode 100644 index 0000000000000000000000000000000000000000..29800490a13265726a14aa79db217afa1dea42f2 GIT binary patch literal 17 TcmZSfU~^beA+l)`0~7!NB-jHg literal 0 HcmV?d00001 diff --git a/kotlin/word-count/.gradle/buildOutputCleanup/built.bin b/kotlin/word-count/.gradle/buildOutputCleanup/built.bin new file mode 100644 index 0000000..e69de29 diff --git a/kotlin/word-count/.gradle/buildOutputCleanup/cache.properties b/kotlin/word-count/.gradle/buildOutputCleanup/cache.properties new file mode 100644 index 0000000..6cfc6d9 --- /dev/null +++ b/kotlin/word-count/.gradle/buildOutputCleanup/cache.properties @@ -0,0 +1,2 @@ +#Fri Jun 02 17:53:36 EDT 2017 +gradle.version=3.5 diff --git a/kotlin/word-count/.gradle/buildOutputCleanup/cache.properties.lock b/kotlin/word-count/.gradle/buildOutputCleanup/cache.properties.lock new file mode 100644 index 0000000..40fdece --- /dev/null +++ b/kotlin/word-count/.gradle/buildOutputCleanup/cache.properties.lock @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/kotlin/word-count/.idea/compiler.xml b/kotlin/word-count/.idea/compiler.xml new file mode 100644 index 0000000..131c0af --- /dev/null +++ b/kotlin/word-count/.idea/compiler.xml @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/gradle.xml b/kotlin/word-count/.idea/gradle.xml new file mode 100644 index 0000000..20d2df6 --- /dev/null +++ b/kotlin/word-count/.idea/gradle.xml @@ -0,0 +1,19 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/libraries/Gradle__junit_junit_4_12.xml b/kotlin/word-count/.idea/libraries/Gradle__junit_junit_4_12.xml new file mode 100644 index 0000000..04c10dd --- /dev/null +++ b/kotlin/word-count/.idea/libraries/Gradle__junit_junit_4_12.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml b/kotlin/word-count/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml new file mode 100644 index 0000000..8262f72 --- /dev/null +++ b/kotlin/word-count/.idea/libraries/Gradle__org_hamcrest_hamcrest_core_1_3.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml b/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml new file mode 100644 index 0000000..4f32fde --- /dev/null +++ b/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_annotations_13_0.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml b/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml new file mode 100644 index 0000000..7b6f562 --- /dev/null +++ b/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_stdlib_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml b/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml new file mode 100644 index 0000000..1720158 --- /dev/null +++ b/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml b/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml new file mode 100644 index 0000000..21c5d19 --- /dev/null +++ b/kotlin/word-count/.idea/libraries/Gradle__org_jetbrains_kotlin_kotlin_test_junit_1_1_1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/misc.xml b/kotlin/word-count/.idea/misc.xml new file mode 100644 index 0000000..84da703 --- /dev/null +++ b/kotlin/word-count/.idea/misc.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/modules.xml b/kotlin/word-count/.idea/modules.xml new file mode 100644 index 0000000..d8e5298 --- /dev/null +++ b/kotlin/word-count/.idea/modules.xml @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/modules/word-count_main.iml b/kotlin/word-count/.idea/modules/word-count_main.iml new file mode 100644 index 0000000..7f29d7a --- /dev/null +++ b/kotlin/word-count/.idea/modules/word-count_main.iml @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/modules/word-count_test.iml b/kotlin/word-count/.idea/modules/word-count_test.iml new file mode 100644 index 0000000..d0549b5 --- /dev/null +++ b/kotlin/word-count/.idea/modules/word-count_test.iml @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/.idea/workspace.xml b/kotlin/word-count/.idea/workspace.xml new file mode 100644 index 0000000..3a0e964 --- /dev/null +++ b/kotlin/word-count/.idea/workspace.xml @@ -0,0 +1,940 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @Ignore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1496440410222 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/kotlin/word-count/README.md b/kotlin/word-count/README.md new file mode 100644 index 0000000..42382ce --- /dev/null +++ b/kotlin/word-count/README.md @@ -0,0 +1,20 @@ +# Word Count + +Given a phrase, count the occurrences of each word in that phrase. + +For example for the input `"olly olly in come free"` + +```plain +olly: 2 +in: 1 +come: 1 +free: 1 +``` + +## Source + +This is a classic toy problem, but we were reminded of it by seeing it in the Go Tour. + +## Submitting Incomplete Solutions +It's possible to submit an incomplete solution so you can see how others have completed the exercise. + diff --git a/kotlin/word-count/build.gradle b/kotlin/word-count/build.gradle new file mode 100644 index 0000000..16c36c0 --- /dev/null +++ b/kotlin/word-count/build.gradle @@ -0,0 +1,28 @@ +buildscript { + ext.kotlin_version = '1.1.1' + repositories { + mavenCentral() + } + dependencies { + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" + } +} + +apply plugin: 'kotlin' + +repositories { + mavenCentral() +} + +dependencies { + compile "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" + + testCompile 'junit:junit:4.12' + testCompile "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version" +} +test { + testLogging { + exceptionFormat = 'full' + events = ["passed", "failed", "skipped"] + } +} diff --git a/kotlin/word-count/build/classes/test/WordCountTest.class b/kotlin/word-count/build/classes/test/WordCountTest.class new file mode 100644 index 0000000000000000000000000000000000000000..7f96de3a73079d835a07b3bef73a1ef45292a234 GIT binary patch literal 2755 zcmbVMTUQfT7~Ll%GeeAsQ&hBGMnwcg0$6QpkcxOi1K1`-DXn%$CSh=xiE{z9H+p^U zZ|GBB+lQ9bwc6$Ku|KM-dnU;cV8yOgR+zKrJKs6qKKt8q{{H8WzW|Kk2Z6m09Jf5> z1h!u^JYR+o=w8v+^sJ@Z)$H8Ticw;;Lm*QMljdwATp-XfFgVZDyyI50D}inL*>HVM zAi2(Y1&YA_t$n6#->4d{jI@BfrdxqAR}nZkFg=*xm6XdMgS~0&L6^Y3CysBKcD5MQ zEW^7;D%}DJ-x0Vt(6Y47Gq*c3m~U)wUpHOutm2I{_M=DOaATt6SQgJ{I<}Xc(Q8qS zg952ly%usjKCo?v2H(IptuUKA_Tq3Fhj2uoGnP`uQ2}Lowosg$ow_NoCm&C7#c`bI z#4%_BQf=AQJwxDh>tPDMYueS^?oy|4I?aWB0=*6LJ~huydY<7%2MG1)7wFNW$jzsL zZh3uWqoN0vFOY97(pIq+4I4zJTSARxgYy{-U@(odILAgC&uWy=D95K{yCm+0@t9gr#QDn|0-Z# z`@#*wOpQr(z@$0|lOm+xHYGBvw&NQ21H0r0de|&(SkheucWDEHn&B(R^MtymV3tL~ z??SsBwyeCM1RkzF+##H3kM3t(1N|#q1 z?KXdN3YK^u=$7TIPu3jIcb(dDsAQ^Qx*nO+<*Bk`pCzmkT6$2Wz$Q=XFB`UkC!rwj za|Nr^^;Wp%iWcQ-QR=W(WLh)C#9;-z1*CD4ch5uyPa&m|giEQLewZFQvrl zS_f}D5k4foE=8~4!C5v@rp2DV+~`RsdK2kH_sflRLJ0x?6}k82##mxRTu;6FNn+@( z(%o?+F_OF^6QyD##Ym2k5~I!-rR(U`&(fZ-@R%Se>|5uRc_H%R<5k_HHM+NbBg0Sl z^(LpBGBs55PD!`sb=TCFETb4c!f(p78x3wm4u8PQ+FUi}P0wV?q-{HXWIJ{wU2p=o zWZW_>1EWY#weU~jwU~m$_pkZ3K%C%sOzli=V&5hXY~s!Q`CoBT?feaAge*33{ud@B z@C}~_IqpR_hH!!B;W7*(%kf+OcOg_g&G`(D^7$R#BxcDR_hTe3`K(cLT>2AZ3mxiP zjlzY6q=xQ5ALoJNPcQI1Qwg)*J*uiKbX7po&QBm2==$c%YrLd4v zuQwSjNa~Fk%j&Hrj+x$R!}LZA)8a0sM{tA66{zZV?WWr@z1OTv?Pg+}Qs-hUsqe>F zRtrrWGyU*?F+D}5ePr6dgXw(CbZ3_zrkXk?)sLDisOiT|95Z^FH*qXZ ztqs%H8!N|lU1hr_wlU>pNTwpX2eKT)4?1=3cX(Uhd!`<2aca1LX}kx%=a|4owB{ + var outMap: MutableMap = emptyMap().toMutableMap() + val stringList: List = str.split(delimiters = " ") + val partiallyCleanedList: List = stringList.filter { it.trim().isNotEmpty() } + // This is where it is broken + val properlyCleanedList: List = partiallyCleanedList.map { it } + val blorp: List = properlyCleanedList.filter { it.isNotEmpty() } + for (word in blorp){ + if (outMap.containsKey(word)){ + outMap[word]!!.inc() + } + else outMap.put(word, 0) + } + return outMap; + } +} \ No newline at end of file diff --git a/kotlin/word-count/src/test/kotlin/WordCountTest.kt b/kotlin/word-count/src/test/kotlin/WordCountTest.kt new file mode 100644 index 0000000..d97f4b1 --- /dev/null +++ b/kotlin/word-count/src/test/kotlin/WordCountTest.kt @@ -0,0 +1,64 @@ +import org.junit.Test +import org.junit.Ignore +import kotlin.test.assertEquals + +class WordCountTest { + + + @Test + fun countOneWord() { + val expectedWordCount = mapOf("word" to 1) + + assertEquals(expectedWordCount, WordCount.phrase("word")) + } + + + @Test + fun countOneOfEach() { + val expectedWordCount = mapOf("one" to 1, "of" to 1, "each" to 1) + + assertEquals(expectedWordCount, WordCount.phrase("one of each")) + } + + + @Test + fun countMultipleOccurences() { + val expectedWordCount = mapOf("one" to 1, "fish" to 4, "two" to 1, "red" to 1, "blue" to 1) + + assertEquals(expectedWordCount, WordCount.phrase("one fish two fish red fish blue fish")) + } + + + @Test + fun ignorePunctuation() { + val expectedWordCount = mapOf("car" to 1, "carpet" to 1, "as" to 1, "java" to 1, "javascript" to 1) + + assertEquals(expectedWordCount, WordCount.phrase("car : carpet as java : javascript!!&@$%^&")) + + } + + + @Test + fun includeNumbers() { + val expectedWordCount = mapOf("testing" to 2, "1" to 1, "2" to 1) + + assertEquals(expectedWordCount, WordCount.phrase("testing, 1, 2 testing")) + } + + + @Test + fun normalizeCase() { + val expectedWordCount = mapOf("go" to 3) + + assertEquals(expectedWordCount, WordCount.phrase("go Go GO")) + } + + + @Test + fun allowApostrophes() { + val expectedWordCount = mapOf("first" to 1, "don't" to 2, "laugh" to 1, "then" to 1, "cry" to 1) + + assertEquals(expectedWordCount, WordCount.phrase("First: don't laugh. Then: don't cry.")) + } + +} diff --git a/kotlin/word-count/word-count.iml b/kotlin/word-count/word-count.iml new file mode 100644 index 0000000..dc03e15 --- /dev/null +++ b/kotlin/word-count/word-count.iml @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file