├── day2 ├── sample1 ├── sample2 ├── Cargo.toml ├── input ├── Cargo.lock └── src │ └── main.rs ├── day5 ├── sample ├── doc │ └── intro.md ├── .gitignore ├── project.clj ├── test │ └── day5 │ │ └── core_test.clj ├── README.md ├── CHANGELOG.md ├── src │ └── day5 │ │ └── core.clj ├── input └── LICENSE ├── README.md ├── day1 ├── main.rkt └── input └── LICENSE /day2/sample1: -------------------------------------------------------------------------------- 1 | 5 1 9 5 2 | 7 5 3 3 | 2 4 6 8 -------------------------------------------------------------------------------- /day2/sample2: -------------------------------------------------------------------------------- 1 | 5 9 2 8 2 | 9 4 7 3 3 | 3 8 6 5 -------------------------------------------------------------------------------- /day5/sample: -------------------------------------------------------------------------------- 1 | 0 2 | 3 3 | 0 4 | 1 5 | -3 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # advent-of-code-2017 2 | Solutions of Advent of Code 2017 3 | -------------------------------------------------------------------------------- /day5/doc/intro.md: -------------------------------------------------------------------------------- 1 | # Introduction to day5 2 | 3 | TODO: write [great documentation](http://jacobian.org/writing/what-to-write/) 4 | -------------------------------------------------------------------------------- /day5/.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | /classes 3 | /checkouts 4 | profiles.clj 5 | pom.xml 6 | pom.xml.asc 7 | *.jar 8 | *.class 9 | /.lein-* 10 | /.nrepl-port 11 | /.prepl-port 12 | .hgignore 13 | .hg/ 14 | -------------------------------------------------------------------------------- /day2/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "day2" 3 | version = "0.1.0" 4 | edition = "2021" 5 | 6 | # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html 7 | 8 | [dependencies] 9 | regex = "1.5.4" -------------------------------------------------------------------------------- /day5/project.clj: -------------------------------------------------------------------------------- 1 | (defproject day5 "0.1.0-SNAPSHOT" 2 | :description "FIXME: write description" 3 | :url "http://example.com/FIXME" 4 | :license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0" 5 | :url "https://www.eclipse.org/legal/epl-2.0/"} 6 | :dependencies [[org.clojure/clojure "1.10.3"]] 7 | :main day5.core 8 | :aot [day5.core] 9 | :repl-options {:init-ns day5.core}) 10 | -------------------------------------------------------------------------------- /day5/test/day5/core_test.clj: -------------------------------------------------------------------------------- 1 | (ns day5.core-test 2 | (:require [clojure.test :refer :all] 3 | [day5.core :refer :all])) 4 | 5 | (deftest solution-1 6 | (testing "Solution 1" 7 | (let [input (load-data) 8 | solution1 (solve-maze input)] 9 | (is (= solution1 315613))))) 10 | 11 | (deftest solution-2 12 | (testing "Solution 2" 13 | (let [input (load-data) 14 | solution2 (solve-maze-2 input)] 15 | (is (= solution2 22570529))))) 16 | -------------------------------------------------------------------------------- /day5/README.md: -------------------------------------------------------------------------------- 1 | # day5 2 | 3 | A Clojure library designed to ... well, that part is up to you. 4 | 5 | ## Usage 6 | 7 | FIXME 8 | 9 | ## License 10 | 11 | Copyright © 2022 FIXME 12 | 13 | This program and the accompanying materials are made available under the 14 | terms of the Eclipse Public License 2.0 which is available at 15 | http://www.eclipse.org/legal/epl-2.0. 16 | 17 | This Source Code may also be made available under the following Secondary 18 | Licenses when the conditions for such availability set forth in the Eclipse 19 | Public License, v. 2.0 are satisfied: GNU General Public License as published by 20 | the Free Software Foundation, either version 2 of the License, or (at your 21 | option) any later version, with the GNU Classpath Exception which is available 22 | at https://www.gnu.org/software/classpath/license.html. 23 | -------------------------------------------------------------------------------- /day5/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. This change log follows the conventions of [keepachangelog.com](http://keepachangelog.com/). 3 | 4 | ## [Unreleased] 5 | ### Changed 6 | - Add a new arity to `make-widget-async` to provide a different widget shape. 7 | 8 | ## [0.1.1] - 2022-03-23 9 | ### Changed 10 | - Documentation on how to make the widgets. 11 | 12 | ### Removed 13 | - `make-widget-sync` - we're all async, all the time. 14 | 15 | ### Fixed 16 | - Fixed widget maker to keep working when daylight savings switches over. 17 | 18 | ## 0.1.0 - 2022-03-23 19 | ### Added 20 | - Files from the new template. 21 | - Widget maker public API - `make-widget-sync`. 22 | 23 | [Unreleased]: https://sourcehost.site/your-name/day5/compare/0.1.1...HEAD 24 | [0.1.1]: https://sourcehost.site/your-name/day5/compare/0.1.0...0.1.1 25 | -------------------------------------------------------------------------------- /day2/input: -------------------------------------------------------------------------------- 1 | 4168 3925 858 2203 440 185 2886 160 1811 4272 4333 2180 174 157 361 1555 2 | 150 111 188 130 98 673 408 632 771 585 191 92 622 158 537 142 3 | 5785 5174 1304 3369 3891 131 141 5781 5543 4919 478 6585 116 520 673 112 4 | 5900 173 5711 236 2920 177 3585 4735 2135 2122 5209 265 5889 233 4639 5572 5 | 861 511 907 138 981 168 889 986 980 471 107 130 596 744 251 123 6 | 2196 188 1245 145 1669 2444 656 234 1852 610 503 2180 551 2241 643 175 7 | 2051 1518 1744 233 2155 139 658 159 1178 821 167 546 126 974 136 1946 8 | 161 1438 3317 4996 4336 2170 130 4987 3323 178 174 4830 3737 4611 2655 2743 9 | 3990 190 192 1630 1623 203 1139 2207 3994 1693 1468 1829 164 4391 3867 3036 10 | 116 1668 1778 69 99 761 201 2013 837 1225 419 120 1920 1950 121 1831 11 | 107 1006 92 807 1880 1420 36 1819 1039 1987 114 2028 1771 25 85 430 12 | 5295 1204 242 479 273 2868 3453 6095 5324 6047 5143 293 3288 3037 184 987 13 | 295 1988 197 2120 199 1856 181 232 564 1914 1691 210 1527 1731 1575 31 14 | 191 53 714 745 89 899 854 679 45 81 726 801 72 338 95 417 15 | 219 3933 6626 2137 3222 1637 5312 238 5895 222 154 6649 169 6438 3435 4183 16 | 37 1069 166 1037 172 258 1071 90 497 1219 145 1206 143 153 1067 510 17 | -------------------------------------------------------------------------------- /day2/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "aho-corasick" 7 | version = "0.7.18" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" 10 | dependencies = [ 11 | "memchr", 12 | ] 13 | 14 | [[package]] 15 | name = "day2" 16 | version = "0.1.0" 17 | dependencies = [ 18 | "regex", 19 | ] 20 | 21 | [[package]] 22 | name = "memchr" 23 | version = "2.4.1" 24 | source = "registry+https://github.com/rust-lang/crates.io-index" 25 | checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" 26 | 27 | [[package]] 28 | name = "regex" 29 | version = "1.5.4" 30 | source = "registry+https://github.com/rust-lang/crates.io-index" 31 | checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" 32 | dependencies = [ 33 | "aho-corasick", 34 | "memchr", 35 | "regex-syntax", 36 | ] 37 | 38 | [[package]] 39 | name = "regex-syntax" 40 | version = "0.6.25" 41 | source = "registry+https://github.com/rust-lang/crates.io-index" 42 | checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" 43 | -------------------------------------------------------------------------------- /day1/main.rkt: -------------------------------------------------------------------------------- 1 | #lang racket 2 | 3 | (define read-file (lambda (filename) 4 | (car (file->lines filename)) 5 | )) 6 | 7 | (define chars (map (lambda (x) (string x)) (string->list (read-file "input")))) 8 | (define ints (list->vector (map (lambda (x) (string->number x)) chars))) 9 | 10 | (define (calculate-next-1 cs pos) 11 | (if (= (vector-length cs) (+ pos 1)) 12 | (vector-ref cs 0) 13 | (vector-ref cs (+ pos 1)) 14 | ) 15 | ) 16 | 17 | (define (calculate-next-2 cs pos) 18 | (let ([half (/ (vector-length cs) 2)]) 19 | (if (<= half pos) 20 | (vector-ref cs (- pos half)) 21 | (vector-ref cs (+ pos half)) 22 | ) 23 | ) 24 | ) 25 | 26 | (define (solution cs f) 27 | (solution_ cs (- (vector-length cs) 1) f) 28 | ) 29 | (define (solution_ cs pos f) 30 | (if (= pos 0) 31 | 0 32 | (+ (solution_ cs (- pos 1) f) (microsolution cs pos f)) 33 | ) 34 | ) 35 | (define (microsolution cs pos f) 36 | (let ([current-value (vector-ref cs pos)]) 37 | (if 38 | (= current-value (f cs pos)) 39 | current-value 40 | 0 41 | ) 42 | ) 43 | ) 44 | 45 | (println (solution ints calculate-next-1)) 46 | (println (solution ints calculate-next-2)) -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /day5/src/day5/core.clj: -------------------------------------------------------------------------------- 1 | (ns day5.core 2 | (:require [clojure.string :as str]) 3 | (:gen-class)) 4 | 5 | (defn load-data [] 6 | (let [file (slurp "input") 7 | lines (str/split-lines file)] 8 | (vec (map #(Integer/parseInt %) lines)))) 9 | 10 | (defn solve-maze [input] 11 | (let [maze-length (count input)] 12 | (loop [maze input 13 | pos 0 14 | steps 0] 15 | (if (>= pos maze-length) 16 | steps 17 | (let 18 | [jump (nth maze pos) 19 | new-maze (assoc maze pos (inc jump)) 20 | new-pos (+ pos jump) 21 | new-step (inc steps)] 22 | (recur new-maze new-pos new-step)))))) 23 | 24 | (defn new-maze-2 [maze pos] 25 | (let [jump (nth maze pos)] 26 | (if (< 2 jump) 27 | (assoc maze pos (dec jump)) 28 | (assoc maze pos (inc jump))))) 29 | 30 | (defn solve-maze-2 [input] 31 | (let [maze-length (count input)] 32 | (loop [maze input 33 | pos 0 34 | steps 0] 35 | (if (>= pos maze-length) 36 | steps 37 | (let 38 | [jump (nth maze pos) 39 | new-maze (new-maze-2 maze pos) 40 | new-pos (+ pos jump) 41 | new-step (inc steps)] 42 | (recur new-maze new-pos new-step)))))) 43 | 44 | (defn -main [] 45 | (let [input (load-data) 46 | solution1 (solve-maze input) 47 | solution2 (solve-maze-2 input)] 48 | (println (str "Solution 1: " solution1)) 49 | (println (str "Solution 2: " solution2)))) -------------------------------------------------------------------------------- /day1/input: -------------------------------------------------------------------------------- 1 | 34997744892914653296827871613388552993634935173733597474997393431324121718942484674492133736486619515246829248477836544451943938832848157199224116563715646126431493563772112714741546635764665586452858349326658345524573681224829221829772728531278893357146638772291782796744812479595172578555931968285326741191558735491923682586844185476584124677856856612582263263124715916498254659761312225295947328671873729594182695425852559718922816832816341259695766322357565252335851264933471555351536363944572763621761489944217787785564355131756948331413652646811626742168857634856234347432698931371757454156396432993421795675147273229642441888776517165375965288923515378871773449714189311167849788519479274172617334378412661574885156988171532483385528342851358599792154331889342985168528186562873736117113242271863318873917355428393173152783223727362282169982597123525671895452937118687191281382949335937173323862618172284254741935865963877359477126188879481911148827453781546789437317581568931445259912541273353345254171252588344612386649134562638758915336976347291218848744548755462493981871543949697331735577243658722111371552363179584543521149944247848176793571855164329415143753479297879926959141597695174674386467854776481689314612324534729187335368471697738925271618243312864656442299938886755679996568297498965651652337961837876468596749433454633975722561971935459554979713344313292511447288939379369279487299557326137798219646395436241742751581363752896833892713543627966633788455384129347637693559713174477262914916598991823983686226378396341554219544683439536933338185723832743964258335163993324191589246399535845434167819135413916443764931668386817282279877264296262823999224943974974489892778799656723453849139194948368998995531261224669478559359689167934624681622834931223728318247832134758581882736415334187562342375144693398771223127132562692525629392889723242374746911936313136382354858767169452656224519128287899264831463597663461857119132312578648894815417348364532372836621644176295776978942783714778954864719541832176633892147845693752248565147794357864859961462918847471158244516279178346514129117328285132341339595664283 -------------------------------------------------------------------------------- /day2/src/main.rs: -------------------------------------------------------------------------------- 1 | use std::fs; 2 | use regex::Regex; 3 | 4 | fn load_data(file: &str) -> Vec> { 5 | let re = Regex::new(r"(\d+)").unwrap(); 6 | fs::read_to_string(file) 7 | .unwrap() 8 | .lines() 9 | .map(|line| { 10 | re 11 | .captures_iter(line) 12 | .map(|x| x.get(1).unwrap().as_str().parse().unwrap()) 13 | .collect() 14 | }) 15 | .collect() 16 | } 17 | 18 | fn max(vec: &Vec) -> T { 19 | vec.iter().fold(vec[0], |acc, elem| acc.max(*elem)) 20 | } 21 | 22 | fn min(vec: &Vec) -> T { 23 | vec.iter().fold(vec[0], |acc, elem| acc.min(*elem)) 24 | } 25 | 26 | fn solution1(data: &Vec>) -> u32 { 27 | data 28 | .iter() 29 | .map(|row| max(row) - min(row)) 30 | .sum() 31 | } 32 | 33 | fn solution2(data: &Vec>) -> u32 { 34 | data 35 | .iter() 36 | .filter_map(|row| { 37 | for x in row { 38 | for y in row { 39 | if x != y && x > y { 40 | if x % y == 0 { 41 | return Some(x / y); 42 | } 43 | } 44 | } 45 | } 46 | None 47 | }) 48 | .sum() 49 | } 50 | 51 | fn main() { 52 | let data = load_data("input"); 53 | let result1 = solution1(&data); 54 | println!("Solution 1: {}", result1); 55 | let result2 = solution2(&data); 56 | println!("Solution 2: {}", result2); 57 | } 58 | 59 | #[cfg(test)] 60 | mod tests { 61 | #[test] 62 | fn sample1() { 63 | let data = crate::load_data("sample1"); 64 | let result = crate::solution1(&data); 65 | assert_eq!(18, result); 66 | } 67 | 68 | #[test] 69 | fn sample2() { 70 | let data = crate::load_data("sample2"); 71 | let result = crate::solution2(&data); 72 | assert_eq!(9, result); 73 | } 74 | 75 | #[test] 76 | fn solution1() { 77 | let data = crate::load_data("input"); 78 | let result = crate::solution1(&data); 79 | assert_eq!(51833, result); 80 | } 81 | 82 | #[test] 83 | fn solution2() { 84 | let data = crate::load_data("input"); 85 | let result = crate::solution2(&data); 86 | assert_eq!(288, result); 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /day5/input: -------------------------------------------------------------------------------- 1 | 1 2 | 1 3 | 1 4 | 1 5 | 0 6 | 0 7 | 0 8 | -4 9 | -1 10 | 0 11 | -3 12 | -4 13 | 0 14 | -9 15 | -3 16 | 2 17 | -14 18 | 0 19 | -17 20 | -12 21 | -15 22 | -7 23 | 0 24 | -7 25 | -12 26 | -3 27 | -17 28 | -11 29 | -24 30 | -10 31 | -16 32 | -15 33 | -28 34 | -13 35 | -28 36 | -15 37 | -28 38 | -29 39 | -20 40 | 0 41 | -10 42 | -30 43 | -13 44 | -24 45 | -34 46 | -42 47 | -25 48 | -36 49 | -38 50 | -35 51 | -23 52 | -11 53 | -4 54 | -16 55 | -15 56 | -10 57 | -31 58 | 0 59 | -16 60 | -21 61 | -50 62 | -26 63 | -31 64 | -36 65 | -53 66 | -54 67 | -12 68 | -28 69 | 1 70 | -16 71 | -65 72 | -69 73 | -4 74 | -47 75 | 1 76 | -42 77 | -33 78 | -55 79 | -72 80 | -29 81 | -2 82 | -62 83 | -40 84 | -28 85 | 0 86 | -42 87 | -78 88 | 2 89 | -23 90 | -86 91 | -75 92 | -17 93 | -15 94 | -9 95 | 0 96 | -24 97 | -36 98 | -91 99 | -64 100 | -65 101 | -98 102 | -30 103 | -21 104 | -80 105 | 0 106 | -88 107 | -105 108 | -103 109 | -32 110 | -54 111 | -62 112 | -105 113 | -68 114 | -101 115 | -73 116 | -26 117 | -112 118 | -96 119 | -66 120 | -115 121 | -53 122 | -69 123 | -99 124 | -84 125 | -46 126 | -105 127 | -16 128 | -18 129 | -104 130 | -19 131 | -16 132 | -9 133 | -45 134 | -40 135 | -40 136 | -11 137 | -105 138 | -105 139 | -72 140 | -89 141 | -3 142 | -119 143 | -74 144 | -124 145 | -111 146 | -128 147 | -79 148 | -145 149 | -138 150 | -147 151 | -92 152 | -44 153 | -115 154 | -51 155 | -139 156 | -15 157 | -72 158 | -116 159 | -149 160 | -38 161 | -55 162 | -63 163 | -62 164 | -3 165 | -48 166 | -115 167 | -33 168 | -56 169 | -51 170 | -28 171 | -8 172 | -15 173 | -162 174 | -7 175 | -24 176 | -72 177 | -104 178 | -7 179 | -23 180 | -16 181 | -25 182 | -169 183 | -157 184 | -53 185 | -123 186 | -183 187 | -127 188 | -98 189 | -133 190 | -180 191 | -96 192 | -56 193 | -57 194 | -123 195 | -123 196 | 0 197 | -35 198 | -174 199 | -91 200 | -167 201 | -121 202 | -67 203 | -47 204 | -201 205 | 0 206 | -111 207 | -158 208 | -36 209 | -62 210 | -111 211 | -114 212 | -183 213 | -139 214 | -108 215 | -74 216 | -154 217 | -12 218 | -18 219 | -182 220 | -217 221 | -199 222 | -68 223 | -212 224 | -183 225 | -126 226 | -56 227 | -112 228 | -211 229 | -203 230 | -223 231 | -40 232 | 0 233 | -225 234 | -101 235 | -24 236 | -91 237 | -94 238 | -80 239 | -190 240 | -6 241 | -234 242 | -2 243 | -222 244 | -208 245 | -46 246 | -163 247 | -136 248 | -45 249 | -17 250 | -141 251 | -18 252 | -67 253 | -224 254 | -39 255 | -135 256 | -91 257 | -91 258 | -146 259 | -158 260 | -70 261 | -33 262 | -232 263 | -54 264 | -45 265 | -80 266 | -124 267 | -221 268 | -130 269 | -236 270 | -112 271 | -238 272 | -11 273 | -34 274 | -110 275 | -198 276 | -15 277 | -252 278 | -230 279 | -118 280 | -230 281 | -193 282 | -119 283 | -162 284 | -214 285 | -206 286 | -158 287 | -199 288 | -141 289 | -167 290 | -9 291 | -140 292 | -185 293 | -126 294 | -106 295 | -293 296 | -142 297 | -290 298 | -78 299 | -137 300 | -274 301 | -186 302 | -88 303 | -167 304 | -287 305 | -218 306 | -300 307 | -5 308 | -81 309 | -108 310 | -287 311 | -276 312 | -235 313 | -189 314 | -116 315 | -16 316 | -232 317 | -32 318 | -189 319 | -78 320 | -8 321 | -72 322 | -219 323 | -12 324 | -63 325 | -7 326 | -114 327 | -170 328 | -125 329 | -162 330 | -19 331 | -140 332 | -152 333 | -3 334 | -127 335 | -314 336 | -158 337 | -301 338 | -153 339 | -62 340 | -7 341 | -94 342 | -182 343 | -61 344 | -6 345 | -285 346 | -260 347 | -123 348 | -298 349 | -131 350 | -66 351 | -155 352 | -347 353 | -181 354 | -71 355 | -143 356 | -232 357 | -146 358 | -100 359 | 0 360 | -101 361 | -315 362 | -53 363 | -348 364 | -209 365 | -320 366 | -212 367 | -358 368 | -108 369 | -101 370 | -188 371 | -218 372 | -309 373 | -290 374 | -245 375 | -253 376 | -111 377 | -188 378 | -104 379 | -296 380 | -14 381 | -306 382 | -335 383 | -87 384 | -284 385 | -14 386 | -117 387 | -143 388 | -386 389 | -367 390 | -292 391 | -251 392 | -289 393 | -340 394 | -41 395 | -85 396 | -52 397 | -236 398 | -265 399 | -265 400 | -341 401 | -395 402 | -110 403 | -311 404 | -391 405 | -79 406 | -262 407 | -214 408 | -395 409 | -205 410 | -50 411 | -318 412 | -198 413 | -199 414 | -44 415 | -153 416 | -403 417 | -261 418 | -290 419 | -55 420 | -321 421 | -407 422 | -17 423 | -30 424 | -342 425 | -321 426 | -37 427 | -197 428 | -5 429 | -305 430 | -394 431 | -373 432 | -297 433 | -40 434 | -114 435 | -240 436 | -218 437 | -164 438 | -334 439 | -337 440 | -38 441 | -124 442 | -362 443 | -209 444 | -79 445 | -208 446 | -277 447 | -341 448 | -345 449 | -112 450 | -137 451 | -306 452 | -90 453 | -10 454 | -50 455 | -447 456 | -445 457 | -50 458 | -327 459 | -374 460 | -441 461 | -197 462 | -231 463 | -31 464 | -361 465 | -444 466 | -109 467 | -294 468 | -452 469 | -327 470 | -411 471 | -137 472 | -326 473 | -201 474 | -217 475 | -277 476 | -245 477 | -263 478 | -111 479 | -286 480 | -265 481 | -298 482 | -107 483 | -204 484 | -395 485 | -299 486 | -175 487 | -158 488 | -94 489 | -34 490 | 2 491 | -55 492 | -113 493 | -278 494 | -74 495 | -380 496 | -167 497 | -429 498 | -261 499 | -57 500 | -95 501 | -215 502 | -392 503 | -121 504 | -460 505 | -250 506 | -393 507 | -41 508 | -183 509 | -123 510 | -367 511 | -387 512 | -66 513 | -431 514 | -399 515 | -295 516 | -449 517 | -10 518 | -461 519 | -392 520 | -277 521 | -302 522 | -460 523 | -197 524 | -307 525 | -229 526 | -296 527 | -415 528 | -313 529 | -334 530 | -172 531 | -303 532 | -439 533 | -479 534 | -364 535 | -156 536 | -287 537 | -315 538 | -265 539 | -153 540 | -134 541 | -238 542 | -88 543 | 1 544 | -306 545 | -399 546 | -197 547 | -363 548 | -156 549 | -370 550 | -313 551 | -365 552 | -510 553 | -91 554 | -464 555 | -177 556 | -550 557 | -95 558 | -49 559 | -108 560 | -24 561 | -289 562 | -229 563 | -547 564 | 0 565 | -538 566 | -164 567 | -202 568 | -190 569 | -92 570 | -302 571 | -416 572 | -42 573 | -148 574 | -192 575 | -246 576 | -118 577 | -144 578 | -264 579 | -497 580 | -276 581 | -350 582 | -318 583 | -219 584 | -301 585 | -398 586 | -12 587 | -292 588 | -395 589 | -565 590 | -102 591 | -118 592 | -424 593 | -3 594 | -473 595 | -94 596 | -413 597 | -145 598 | -38 599 | -97 600 | -485 601 | -363 602 | -309 603 | -250 604 | -506 605 | -345 606 | -346 607 | -447 608 | -319 609 | -330 610 | -198 611 | -255 612 | -353 613 | -260 614 | -370 615 | -22 616 | -91 617 | -345 618 | -333 619 | -315 620 | -593 621 | -450 622 | -37 623 | -380 624 | -543 625 | -5 626 | -556 627 | -164 628 | -135 629 | -513 630 | -56 631 | -166 632 | -474 633 | -14 634 | -84 635 | -561 636 | -596 637 | -454 638 | -429 639 | -457 640 | -69 641 | -59 642 | -597 643 | -598 644 | -391 645 | -260 646 | -596 647 | -384 648 | -267 649 | -34 650 | -158 651 | -531 652 | -243 653 | -495 654 | -165 655 | -190 656 | -466 657 | -574 658 | -344 659 | -365 660 | -277 661 | -329 662 | -64 663 | -616 664 | -123 665 | -551 666 | -537 667 | -412 668 | -333 669 | -589 670 | -212 671 | -376 672 | -290 673 | -366 674 | -363 675 | -477 676 | -39 677 | -37 678 | -495 679 | -317 680 | -554 681 | -675 682 | -442 683 | -427 684 | -407 685 | -515 686 | -169 687 | -113 688 | -395 689 | -561 690 | -358 691 | -214 692 | -20 693 | -424 694 | -74 695 | -311 696 | -110 697 | -353 698 | -112 699 | -217 700 | -181 701 | -496 702 | -336 703 | -311 704 | -585 705 | -407 706 | -383 707 | -663 708 | -266 709 | -591 710 | -235 711 | -266 712 | -406 713 | -347 714 | -268 715 | -281 716 | -449 717 | -569 718 | -8 719 | -178 720 | -62 721 | -139 722 | -89 723 | -72 724 | -487 725 | -352 726 | -164 727 | -244 728 | -640 729 | -139 730 | -639 731 | -330 732 | -348 733 | -390 734 | -260 735 | -632 736 | -171 737 | -343 738 | -700 739 | -21 740 | -653 741 | -250 742 | -20 743 | -587 744 | -357 745 | -151 746 | -536 747 | -287 748 | -614 749 | -582 750 | -564 751 | -136 752 | -613 753 | -130 754 | -717 755 | -54 756 | -35 757 | -205 758 | -49 759 | -711 760 | -538 761 | -342 762 | -222 763 | -579 764 | -300 765 | -641 766 | -240 767 | -198 768 | -76 769 | -550 770 | -73 771 | -528 772 | -465 773 | -485 774 | -327 775 | -433 776 | -325 777 | -441 778 | -575 779 | -661 780 | -126 781 | -588 782 | -315 783 | -651 784 | -692 785 | -189 786 | -656 787 | -533 788 | -627 789 | -459 790 | -244 791 | -737 792 | -422 793 | -647 794 | -324 795 | -759 796 | -592 797 | -305 798 | -281 799 | -360 800 | -79 801 | -271 802 | -52 803 | -129 804 | -416 805 | -39 806 | -497 807 | -147 808 | -755 809 | -398 810 | -382 811 | -217 812 | -301 813 | -581 814 | -345 815 | -310 816 | -68 817 | -90 818 | -128 819 | -303 820 | -416 821 | -348 822 | -745 823 | -204 824 | -795 825 | -482 826 | -537 827 | -315 828 | -662 829 | -432 830 | -464 831 | -239 832 | -19 833 | -216 834 | -230 835 | -240 836 | -612 837 | -129 838 | -655 839 | -197 840 | -369 841 | -89 842 | -573 843 | -180 844 | -229 845 | -264 846 | -268 847 | -401 848 | -820 849 | -412 850 | -99 851 | -666 852 | -360 853 | -814 854 | -348 855 | -755 856 | -772 857 | -296 858 | -851 859 | -818 860 | -394 861 | -161 862 | -77 863 | -109 864 | -362 865 | -273 866 | -688 867 | -574 868 | -50 869 | -137 870 | -550 871 | -380 872 | -462 873 | -851 874 | -611 875 | -237 876 | -853 877 | -11 878 | -383 879 | -767 880 | -349 881 | -170 882 | -389 883 | -747 884 | -247 885 | -462 886 | -839 887 | -87 888 | -852 889 | -672 890 | -796 891 | -839 892 | -788 893 | -78 894 | -151 895 | -507 896 | -414 897 | -363 898 | -750 899 | -521 900 | -468 901 | -418 902 | -251 903 | -803 904 | -802 905 | -269 906 | -766 907 | -520 908 | -301 909 | -156 910 | -488 911 | -130 912 | -100 913 | -191 914 | -45 915 | -352 916 | -774 917 | -506 918 | -306 919 | -517 920 | -220 921 | -62 922 | -523 923 | -111 924 | -157 925 | -516 926 | -541 927 | -888 928 | -514 929 | -223 930 | -902 931 | -159 932 | -255 933 | -699 934 | -901 935 | -893 936 | -273 937 | -602 938 | -850 939 | -382 940 | -207 941 | -528 942 | -566 943 | -834 944 | -695 945 | -25 946 | -166 947 | -650 948 | -569 949 | -667 950 | -771 951 | -809 952 | -922 953 | -858 954 | -53 955 | -703 956 | -552 957 | -584 958 | -190 959 | -193 960 | -146 961 | -218 962 | -503 963 | -252 964 | -432 965 | -93 966 | -180 967 | -277 968 | -250 969 | -610 970 | -194 971 | -415 972 | -67 973 | -793 974 | -413 975 | -930 976 | -785 977 | -890 978 | -417 979 | -501 980 | -109 981 | -839 982 | -916 983 | -860 984 | -467 985 | -741 986 | -645 987 | -795 988 | -769 989 | -665 990 | -974 991 | -318 992 | -334 993 | -963 994 | -674 995 | -432 996 | -402 997 | -702 998 | -724 999 | -524 1000 | -753 1001 | -146 1002 | -719 1003 | -953 1004 | -------------------------------------------------------------------------------- /day5/LICENSE: -------------------------------------------------------------------------------- 1 | Eclipse Public License - v 2.0 2 | 3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE 4 | PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION 5 | OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT. 6 | 7 | 1. DEFINITIONS 8 | 9 | "Contribution" means: 10 | 11 | a) in the case of the initial Contributor, the initial content 12 | Distributed under this Agreement, and 13 | 14 | b) in the case of each subsequent Contributor: 15 | i) changes to the Program, and 16 | ii) additions to the Program; 17 | where such changes and/or additions to the Program originate from 18 | and are Distributed by that particular Contributor. A Contribution 19 | "originates" from a Contributor if it was added to the Program by 20 | such Contributor itself or anyone acting on such Contributor's behalf. 21 | Contributions do not include changes or additions to the Program that 22 | are not Modified Works. 23 | 24 | "Contributor" means any person or entity that Distributes the Program. 25 | 26 | "Licensed Patents" mean patent claims licensable by a Contributor which 27 | are necessarily infringed by the use or sale of its Contribution alone 28 | or when combined with the Program. 29 | 30 | "Program" means the Contributions Distributed in accordance with this 31 | Agreement. 32 | 33 | "Recipient" means anyone who receives the Program under this Agreement 34 | or any Secondary License (as applicable), including Contributors. 35 | 36 | "Derivative Works" shall mean any work, whether in Source Code or other 37 | form, that is based on (or derived from) the Program and for which the 38 | editorial revisions, annotations, elaborations, or other modifications 39 | represent, as a whole, an original work of authorship. 40 | 41 | "Modified Works" shall mean any work in Source Code or other form that 42 | results from an addition to, deletion from, or modification of the 43 | contents of the Program, including, for purposes of clarity any new file 44 | in Source Code form that contains any contents of the Program. Modified 45 | Works shall not include works that contain only declarations, 46 | interfaces, types, classes, structures, or files of the Program solely 47 | in each case in order to link to, bind by name, or subclass the Program 48 | or Modified Works thereof. 49 | 50 | "Distribute" means the acts of a) distributing or b) making available 51 | in any manner that enables the transfer of a copy. 52 | 53 | "Source Code" means the form of a Program preferred for making 54 | modifications, including but not limited to software source code, 55 | documentation source, and configuration files. 56 | 57 | "Secondary License" means either the GNU General Public License, 58 | Version 2.0, or any later versions of that license, including any 59 | exceptions or additional permissions as identified by the initial 60 | Contributor. 61 | 62 | 2. GRANT OF RIGHTS 63 | 64 | a) Subject to the terms of this Agreement, each Contributor hereby 65 | grants Recipient a non-exclusive, worldwide, royalty-free copyright 66 | license to reproduce, prepare Derivative Works of, publicly display, 67 | publicly perform, Distribute and sublicense the Contribution of such 68 | Contributor, if any, and such Derivative Works. 69 | 70 | b) Subject to the terms of this Agreement, each Contributor hereby 71 | grants Recipient a non-exclusive, worldwide, royalty-free patent 72 | license under Licensed Patents to make, use, sell, offer to sell, 73 | import and otherwise transfer the Contribution of such Contributor, 74 | if any, in Source Code or other form. This patent license shall 75 | apply to the combination of the Contribution and the Program if, at 76 | the time the Contribution is added by the Contributor, such addition 77 | of the Contribution causes such combination to be covered by the 78 | Licensed Patents. The patent license shall not apply to any other 79 | combinations which include the Contribution. No hardware per se is 80 | licensed hereunder. 81 | 82 | c) Recipient understands that although each Contributor grants the 83 | licenses to its Contributions set forth herein, no assurances are 84 | provided by any Contributor that the Program does not infringe the 85 | patent or other intellectual property rights of any other entity. 86 | Each Contributor disclaims any liability to Recipient for claims 87 | brought by any other entity based on infringement of intellectual 88 | property rights or otherwise. As a condition to exercising the 89 | rights and licenses granted hereunder, each Recipient hereby 90 | assumes sole responsibility to secure any other intellectual 91 | property rights needed, if any. For example, if a third party 92 | patent license is required to allow Recipient to Distribute the 93 | Program, it is Recipient's responsibility to acquire that license 94 | before distributing the Program. 95 | 96 | d) Each Contributor represents that to its knowledge it has 97 | sufficient copyright rights in its Contribution, if any, to grant 98 | the copyright license set forth in this Agreement. 99 | 100 | e) Notwithstanding the terms of any Secondary License, no 101 | Contributor makes additional grants to any Recipient (other than 102 | those set forth in this Agreement) as a result of such Recipient's 103 | receipt of the Program under the terms of a Secondary License 104 | (if permitted under the terms of Section 3). 105 | 106 | 3. REQUIREMENTS 107 | 108 | 3.1 If a Contributor Distributes the Program in any form, then: 109 | 110 | a) the Program must also be made available as Source Code, in 111 | accordance with section 3.2, and the Contributor must accompany 112 | the Program with a statement that the Source Code for the Program 113 | is available under this Agreement, and informs Recipients how to 114 | obtain it in a reasonable manner on or through a medium customarily 115 | used for software exchange; and 116 | 117 | b) the Contributor may Distribute the Program under a license 118 | different than this Agreement, provided that such license: 119 | i) effectively disclaims on behalf of all other Contributors all 120 | warranties and conditions, express and implied, including 121 | warranties or conditions of title and non-infringement, and 122 | implied warranties or conditions of merchantability and fitness 123 | for a particular purpose; 124 | 125 | ii) effectively excludes on behalf of all other Contributors all 126 | liability for damages, including direct, indirect, special, 127 | incidental and consequential damages, such as lost profits; 128 | 129 | iii) does not attempt to limit or alter the recipients' rights 130 | in the Source Code under section 3.2; and 131 | 132 | iv) requires any subsequent distribution of the Program by any 133 | party to be under a license that satisfies the requirements 134 | of this section 3. 135 | 136 | 3.2 When the Program is Distributed as Source Code: 137 | 138 | a) it must be made available under this Agreement, or if the 139 | Program (i) is combined with other material in a separate file or 140 | files made available under a Secondary License, and (ii) the initial 141 | Contributor attached to the Source Code the notice described in 142 | Exhibit A of this Agreement, then the Program may be made available 143 | under the terms of such Secondary Licenses, and 144 | 145 | b) a copy of this Agreement must be included with each copy of 146 | the Program. 147 | 148 | 3.3 Contributors may not remove or alter any copyright, patent, 149 | trademark, attribution notices, disclaimers of warranty, or limitations 150 | of liability ("notices") contained within the Program from any copy of 151 | the Program which they Distribute, provided that Contributors may add 152 | their own appropriate notices. 153 | 154 | 4. COMMERCIAL DISTRIBUTION 155 | 156 | Commercial distributors of software may accept certain responsibilities 157 | with respect to end users, business partners and the like. While this 158 | license is intended to facilitate the commercial use of the Program, 159 | the Contributor who includes the Program in a commercial product 160 | offering should do so in a manner which does not create potential 161 | liability for other Contributors. Therefore, if a Contributor includes 162 | the Program in a commercial product offering, such Contributor 163 | ("Commercial Contributor") hereby agrees to defend and indemnify every 164 | other Contributor ("Indemnified Contributor") against any losses, 165 | damages and costs (collectively "Losses") arising from claims, lawsuits 166 | and other legal actions brought by a third party against the Indemnified 167 | Contributor to the extent caused by the acts or omissions of such 168 | Commercial Contributor in connection with its distribution of the Program 169 | in a commercial product offering. The obligations in this section do not 170 | apply to any claims or Losses relating to any actual or alleged 171 | intellectual property infringement. In order to qualify, an Indemnified 172 | Contributor must: a) promptly notify the Commercial Contributor in 173 | writing of such claim, and b) allow the Commercial Contributor to control, 174 | and cooperate with the Commercial Contributor in, the defense and any 175 | related settlement negotiations. The Indemnified Contributor may 176 | participate in any such claim at its own expense. 177 | 178 | For example, a Contributor might include the Program in a commercial 179 | product offering, Product X. That Contributor is then a Commercial 180 | Contributor. If that Commercial Contributor then makes performance 181 | claims, or offers warranties related to Product X, those performance 182 | claims and warranties are such Commercial Contributor's responsibility 183 | alone. Under this section, the Commercial Contributor would have to 184 | defend claims against the other Contributors related to those performance 185 | claims and warranties, and if a court requires any other Contributor to 186 | pay any damages as a result, the Commercial Contributor must pay 187 | those damages. 188 | 189 | 5. NO WARRANTY 190 | 191 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT 192 | PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS" 193 | BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR 194 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF 195 | TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 196 | PURPOSE. Each Recipient is solely responsible for determining the 197 | appropriateness of using and distributing the Program and assumes all 198 | risks associated with its exercise of rights under this Agreement, 199 | including but not limited to the risks and costs of program errors, 200 | compliance with applicable laws, damage to or loss of data, programs 201 | or equipment, and unavailability or interruption of operations. 202 | 203 | 6. DISCLAIMER OF LIABILITY 204 | 205 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT 206 | PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS 207 | SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 208 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST 209 | PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 210 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 211 | ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE 212 | EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE 213 | POSSIBILITY OF SUCH DAMAGES. 214 | 215 | 7. GENERAL 216 | 217 | If any provision of this Agreement is invalid or unenforceable under 218 | applicable law, it shall not affect the validity or enforceability of 219 | the remainder of the terms of this Agreement, and without further 220 | action by the parties hereto, such provision shall be reformed to the 221 | minimum extent necessary to make such provision valid and enforceable. 222 | 223 | If Recipient institutes patent litigation against any entity 224 | (including a cross-claim or counterclaim in a lawsuit) alleging that the 225 | Program itself (excluding combinations of the Program with other software 226 | or hardware) infringes such Recipient's patent(s), then such Recipient's 227 | rights granted under Section 2(b) shall terminate as of the date such 228 | litigation is filed. 229 | 230 | All Recipient's rights under this Agreement shall terminate if it 231 | fails to comply with any of the material terms or conditions of this 232 | Agreement and does not cure such failure in a reasonable period of 233 | time after becoming aware of such noncompliance. If all Recipient's 234 | rights under this Agreement terminate, Recipient agrees to cease use 235 | and distribution of the Program as soon as reasonably practicable. 236 | However, Recipient's obligations under this Agreement and any licenses 237 | granted by Recipient relating to the Program shall continue and survive. 238 | 239 | Everyone is permitted to copy and distribute copies of this Agreement, 240 | but in order to avoid inconsistency the Agreement is copyrighted and 241 | may only be modified in the following manner. The Agreement Steward 242 | reserves the right to publish new versions (including revisions) of 243 | this Agreement from time to time. No one other than the Agreement 244 | Steward has the right to modify this Agreement. The Eclipse Foundation 245 | is the initial Agreement Steward. The Eclipse Foundation may assign the 246 | responsibility to serve as the Agreement Steward to a suitable separate 247 | entity. Each new version of the Agreement will be given a distinguishing 248 | version number. The Program (including Contributions) may always be 249 | Distributed subject to the version of the Agreement under which it was 250 | received. In addition, after a new version of the Agreement is published, 251 | Contributor may elect to Distribute the Program (including its 252 | Contributions) under the new version. 253 | 254 | Except as expressly stated in Sections 2(a) and 2(b) above, Recipient 255 | receives no rights or licenses to the intellectual property of any 256 | Contributor under this Agreement, whether expressly, by implication, 257 | estoppel or otherwise. All rights in the Program not expressly granted 258 | under this Agreement are reserved. Nothing in this Agreement is intended 259 | to be enforceable by any entity that is not a Contributor or Recipient. 260 | No third-party beneficiary rights are created under this Agreement. 261 | 262 | Exhibit A - Form of Secondary Licenses Notice 263 | 264 | "This Source Code may also be made available under the following 265 | Secondary Licenses when the conditions for such availability set forth 266 | in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public 267 | License as published by the Free Software Foundation, either version 2 268 | of the License, or (at your option) any later version, with the GNU 269 | Classpath Exception which is available at 270 | https://www.gnu.org/software/classpath/license.html." 271 | 272 | Simply including a copy of this Agreement, including this Exhibit A 273 | is not sufficient to license the Source Code under Secondary Licenses. 274 | 275 | If it is not possible or desirable to put the notice in a particular 276 | file, then You may include the notice in a location (such as a LICENSE 277 | file in a relevant directory) where a recipient would be likely to 278 | look for such a notice. 279 | 280 | You may add additional accurate notices of copyright ownership. 281 | --------------------------------------------------------------------------------