NEMJ5HXEX73KFHXTZ32GIKDXK6M3YOB3QHLZ3EEXF5JWKLVE7RMAC
[{:dependencies {org.clojure/clojure {:vsn "1.11.1", :native-prefix nil}, org.clojure/spec.alpha {:vsn "0.3.218", :native-prefix nil}, org.clojure/core.specs.alpha {:vsn "0.2.62", :native-prefix nil}, nrepl {:vsn "1.0.0", :native-prefix nil}, org.nrepl/incomplete {:vsn "0.1.0", :native-prefix nil}}, :native-path "target/native"} {:native-path "target/native", :dependencies {org.clojure/clojure {:vsn "1.11.1", :native-prefix nil, :native? false}, org.clojure/spec.alpha {:vsn "0.3.218", :native-prefix nil, :native? false}, org.clojure/core.specs.alpha {:vsn "0.2.62", :native-prefix nil, :native? false}, nrepl {:vsn "1.0.0", :native-prefix nil, :native? false}, org.nrepl/incomplete {:vsn "0.1.0", :native-prefix nil, :native? false}}}]
artifactId=day-1
groupId=day-1
version=0.1.0-SNAPSHOT
(ns day-1.core
(:require [clojure.java.io :as io])
(:require [clojure.string :as str])
(:use [clojure.test :only [is]])
(:gen-class))
(def test-set "3 4
4 3
2 5
1 3
3 9
3 3")
(defn collect-index
([values idx]
(map #(get % idx) values))
([values idx parse]
(map #(parse (get % idx)) values))
)
(defn collect-index-ints [values idx] (collect-index values idx #(Integer/parseInt %)))
(defn solve-first [data]
(let [columns (map #(str/split (str/triml %) #"\s+") (str/split-lines data))]
(apply + (map #(abs (- %1 %2))
(sort (collect-index-ints columns 0))
(sort (collect-index-ints columns 1))))
)
)
(defn solve-second [data]
(let [columns (map #(str/split (str/triml %) #"\s+") (str/split-lines data))]
(apply + (map #(* %1 (get (frequencies (collect-index-ints columns 1)) %1 0))
(collect-index-ints columns 0)
))
)
)
(defn -main
[& args]
(let [data-set (slurp "data/day1.txt")]
(println "(1) Test set...")
(println (solve-first test-set))
(println "(1) Large set...")
(println (solve-first data-set))
(println "(2) Test set...")
(println (solve-second test-set))
(println "(2) Large set...")
(println (solve-second data-set))
))
(defproject day-1 "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "https://www.eclipse.org/legal/epl-2.0/"}
:dependencies [[org.clojure/clojure "1.11.1"]]
:main ^:skip-aot day-1.core
:target-path "target/%s"
:profiles {:uberjar {:aot :all
:jvm-opts ["-Dclojure.compiler.direct-linking=true"]}})
69214 60950
83241 49638
37930 31308
50722 94914
93164 82798
80918 72850
17490 79421
64372 87820
89659 98375
91555 95812
48924 93602
38031 64096
57853 20530
88521 43214
68331 14770
32767 19574
95030 92579
80448 10870
27268 86384
18742 65926
50258 95193
88830 17352
73007 82798
95145 42403
58976 17352
22476 68379
21785 17811
21560 90827
82909 37527
55371 69778
73607 32404
88276 44965
86274 46099
61163 63445
52231 27046
84647 20530
37515 57298
44394 99003
58258 74954
56060 34105
79808 73814
96748 51318
87301 46022
93991 44642
45674 96969
10870 49159
13175 23840
12881 86704
11425 89064
71044 92543
70247 88369
97814 73317
78003 44160
45779 14598
95915 46875
51055 99003
14500 19574
40956 23840
64791 99735
95406 51318
18800 72878
85004 33238
16723 31504
14333 69398
40419 10870
81499 79136
31696 24276
71897 55421
63928 46875
46875 33198
40086 76959
67622 29550
63819 88369
74694 35769
63615 20200
88828 58414
58917 20414
86066 24696
84677 47814
87339 89616
30182 36007
71811 63762
26364 18927
45435 54026
65473 83062
40764 12795
86131 19574
46984 71532
94658 36666
34864 85172
74271 85172
37126 63381
26701 91608
11846 99003
91698 44394
19986 17352
31279 82252
25542 10870
43023 98869
25001 25208
39137 44758
75796 94436
93491 42015
16837 69895
78167 59486
56738 17811
66303 49575
91100 33987
99100 41554
46126 41472
31826 20530
61208 20200
98875 49776
89960 23840
87445 88369
90701 59605
48604 24766
49830 60581
32422 32404
48321 49338
91545 51318
30591 23840
76791 25366
47653 64300
70447 10870
96337 10870
40822 99003
50985 36666
45600 58520
78539 21021
11792 39770
89999 23840
22229 24252
79514 31414
93645 99874
39916 12567
63722 87301
85209 12845
78460 94436
79669 33420
89396 36762
12518 91072
70992 20530
92482 51318
50977 39809
59666 93602
69358 24889
30774 85209
50495 88117
74843 68135
64043 93602
42690 14598
95474 99003
31999 10870
77935 30381
86471 46022
82671 23840
21996 17352
25301 68950
45903 49209
88433 15186
18897 13349
23742 38006
29440 44394
77679 19534
67503 19006
22862 87523
68125 36752
32102 85209
57298 32444
44985 10870
76984 88369
96974 44648
22496 17352
19906 88369
53085 69481
49762 39320
23508 13349
73366 19574
39420 85172
21487 20200
49538 31279
58985 33747
78834 86304
83207 77460
26624 39320
33276 87130
62119 15410
72488 72850
69108 46022
28383 64125
45283 60950
56242 88580
47120 46022
20917 12845
91088 67959
30625 92579
81302 98117
14883 22568
45215 46818
36185 72873
47369 19661
39320 48658
35775 60950
20573 66758
92168 46875
85925 23570
83017 28941
88673 62352
85790 46022
40389 17811
13925 14598
65265 98819
21058 70060
81605 36401
49669 63107
58410 60950
20993 32404
89320 36606
93679 89908
24396 66724
26960 82887
35749 98507
67814 60950
95966 99777
45832 90281
21396 69067
70924 77174
51921 31279
86430 41554
60703 76733
55109 86032
64568 34984
61181 39320
76019 80530
93405 35718
40732 73310
27676 56302
46615 12644
94412 32659
42651 46875
22911 88369
37891 61401
39505 19574
30551 99381
52001 99003
94890 77236
12845 10870
60037 99735
17811 93480
39461 52563
70835 99003
26239 32404
21199 53413
29427 61865
99745 52578
58368 85172
32844 17811
25356 61341
55087 39124
73711 94153
23878 15193
19011 15821
55522 76895
25442 85172
43553 23840
79059 51318
45546 85172
18253 46875
13486 98333
85621 78640
94812 14598
35976 22851
95446 35811
68679 86540
35048 32404
32404 58367
54639 82218
46890 99735
54797 64140
58043 28678
38310 78102
96824 19574
82010 90281
44558 88560
25947 55410
39754 90281
85172 77816
38409 72850
93847 79705
70670 31866
66466 72850
14378 85172
10594 82798
88488 36494
80919 90281
15539 60764
76757 20530
73014 80854
10103 28777
63011 51318
97931 72850
11511 23511
90999 46778
10581 17352
24639 84344
12573 87301
94628 73454
68709 60950
69611 36666
77840 32404
56046 43452
64975 36666
35086 27046
21044 63339
27003 32404
99990 41554
92558 76384
10676 51318
79869 34929
41478 23840
40010 17811
57724 13349
36886 20530
52799 39658
74618 28890
37677 39602
25056 19780
37249 60950
16420 21533
92579 91814
32467 76018
50446 40645
20800 27046
25367 93602
20200 50429
67153 82421
99387 85172
99003 99003
21079 68678
21496 45196
10244 85172
60317 96967
89792 64416
66971 28760
48409 49209
87836 13036
94588 25049
19574 80163
43975 90281
54578 22870
24412 17352
66935 85209
75103 46748
99675 13318
63283 86570
38622 17811
76156 12554
18868 31279
95097 28731
87940 25307
31588 20683
86721 51679
40662 60665
61441 46875
95742 96428
12500 48663
69704 83722
52150 52130
94648 71064
34905 72850
90241 81541
22820 88917
84893 82798
35291 13349
91607 69674
91250 89186
12934 76205
50355 10870
11918 93561
11981 87504
90011 97792
19160 99003
38536 95219
47433 72254
71173 20241
58871 49592
99297 46875
14256 36666
42700 92579
65952 26453
38344 17352
31939 66675
88319 31279
48532 69055
54160 37364
51367 98234
63774 67948
91398 52760
19606 98639
15722 27046
11670 27046
11752 90281
57229 24766
92900 82069
35472 17352
11762 10464
52327 51318
49806 24252
83152 27046
66672 11070
13349 20530
10860 67520
34902 74641
36500 14208
90699 24766
65392 68056
67360 23840
20770 12845
27579 17811
52424 20530
88044 70562
82234 32404
38116 23840
71095 60884
35234 10870
74397 36937
59605 79377
33516 82798
83961 17811
17934 81965
58619 60950
24784 46183
60415 32404
33999 62356
70899 42550
71992 61565
31607 48168
82993 27705
98377 72447
19236 97390
69248 97543
12305 39320
12750 72850
67143 47302
51085 13713
21283 84586
58438 20530
61450 84960
77223 87301
40730 18648
61388 92620
10697 95051
29817 46022
44526 85172
42126 23970
91131 24766
53762 23485
99711 24766
41168 12845
89661 97679
19509 87301
46491 87301
82876 90281
57530 99003
30070 12845
37182 33467
98660 94041
53088 49209
23056 33662
59488 88369
27659 76043
85486 46875
33558 87301
64995 54418
58406 20530
52353 12845
52674 84792
97158 41554
36966 65903
96617 15049
17881 23393
38135 27655
35640 10870
75976 78468
54361 85172
70827 74733
23840 16180
93190 51318
75051 18196
64409 85172
20040 48165
92938 97826
43465 51609
11298 78526
99421 92903
21674 62444
68613 17352
40038 68779
90984 49209
72223 99735
99618 84903
96274 37409
54840 85533
77678 96379
79087 33036
27866 23840
94127 87366
83829 46731
21118 27046
54767 58444
31592 39320
84251 80340
16359 47980
33404 86692
30167 53720
54633 57298
64214 85172
65936 94436
26779 72257
56981 16995
88384 14598
16954 12845
19265 34877
20882 10870
24268 37193
73896 73107
17491 64788
34135 96478
97863 20530
33458 41554
87234 13349
17021 43950
43735 46022
41413 51318
23370 27518
40859 52659
20847 55643
78780 46875
89412 44659
44732 85942
15416 41554
20026 13573
20447 20530
92208 27046
22919 47883
19025 66716
78537 94436
21990 13835
57022 47578
23379 27046
10223 40352
70096 99003
27889 86884
73766 50077
17352 59737
18766 53132
85353 82798
16699 76756
18043 80464
67635 32404
89066 32404
96095 36666
80193 17352
83111 24567
82714 51318
15568 62699
46071 88369
24766 17393
24252 51318
90799 65043
45593 42548
42434 88369
76708 19788
44049 17352
26070 23840
89487 60950
75405 50409
61151 50949
55659 87976
97690 10769
23955 41554
51413 44394
93303 74623
88340 46875
36666 86119
68983 36666
97452 18100
77775 28288
93498 85175
35180 73788
88369 40289
60950 89290
80469 99735
44830 26094
56953 12845
14598 32404
48010 43254
51318 16119
70157 59605
29536 27046
97148 24766
88940 99003
94267 12845
80689 82798
51360 63373
22949 85172
61037 87301
12068 65294
29715 85209
90504 28648
31564 88812
33933 82995
29523 72320
77893 80865
55688 78887
24079 24766
13322 32095
89943 48334
29072 58704
53586 12845
23918 14598
56128 88548
66658 69626
10133 67845
99815 85172
68216 99003
46022 15395
83063 21232
62075 23840
53883 14598
66467 32404
47896 69944
71785 51318
84153 16006
29778 85209
31766 24766
16108 35318
45369 94436
40723 88485
65628 31279
22238 45332
91501 92579
17080 83343
27106 17811
52006 13517
10554 96843
42902 54855
78074 59112
76079 19574
66574 37842
30704 87301
61970 72591
75806 89415
65083 36666
44142 88369
89309 18398
14755 24252
31582 10397
71879 12845
50300 19574
55843 62837
70241 67656
13864 12845
56863 36666
28825 19574
93845 22897
20530 17811
44137 13349
47611 49209
76632 71061
96396 85003
21784 28828
10465 28473
76247 12845
90281 62295
68036 85383
98495 49331
66489 17352
73992 89989
27262 24766
46644 88369
27046 58715
68306 32404
56759 84611
59597 99003
35807 11412
81247 66456
28886 94970
93602 74875
28876 50501
83548 98501
42548 74927
17737 60997
39564 95234
38730 39320
15305 62977
64475 20570
88203 27046
49209 46875
58403 94223
33211 79621
12588 80687
38930 17322
57720 87301
70408 29585
35638 23840
97473 19574
79297 10870
82229 27046
86569 17352
25113 78295
16476 24791
75345 94436
15696 12845
24138 49905
82572 27046
88539 39320
59729 87301
20283 39331
31336 21205
93878 31692
69846 72850
54419 91006
82798 84255
49394 40818
69345 52987
39250 60950
26399 87538
32384 19159
97484 43143
63090 32208
76597 23840
14020 32404
62045 75497
18689 32404
52623 31279
52491 98683
87906 85172
82114 99003
26961 70112
17367 46022
98279 88369
71505 25937
19537 25375
21670 28451
56125 19574
60764 46875
77962 17811
91463 54069
47556 59029
83067 87301
55521 80404
51846 52594
34746 10952
41554 91631
87263 59965
22625 42548
44644 80377
66676 31212
10499 11321
70675 99003
40581 51732
87994 39961
94436 46875
97737 62666
79484 41644
53333 41554
42911 19574
37210 96788
12286 93469
86302 78835
89841 90378
79773 45455
91417 19811
61800 38053
23495 95310
31663 12652
26644 88369
46904 97345
26299 32404
81023 72850
20782 94436
48451 85172
42895 83143
53844 46875
49912 17811
86234 53747
98733 85172
90395 51318
87860 36666
62319 36666
81832 87028
96801 48785
34060 94915
19206 46022
61175 74300
38749 61982
35243 89642
94052 22838
68544 23840
38895 31279
13279 49209
47468 46826
94318 87301
71918 17811
86789 41554
83931 71452
71126 88369
16125 55867
39086 95213
16328 12845
71229 20530
79671 67001
91145 23840
53528 48955
23966 39867
36677 77019
77291 20530
32335 93201
94998 17586
16372 41181
99014 80727
61040 99055
93576 82718
92791 61735
79499 80967
71009 12845
16657 20530
75219 41824
49208 87301
65336 94436
39833 67725
39788 22450
15097 96722
13674 82562
35721 69206
46963 17811
90463 24766
78488 41554
78916 60727
59443 90281
43680 13349
36601 60950
41176 94271
43717 80804
37766 20530
82109 88369
17559 32947
28284 49209
22341 88369
31223 60082
39647 82580
64525 13349
29368 12845
98386 28932
64817 77829
46178 39365
95082 92579
70089 81861
72539 51350
11579 42548
63864 77114
13611 87301
71054 84124
49549 56474
98626 76586
21372 87832
42043 32404
51898 88369
29323 22433
64305 30520
70362 18267
26501 73191
10172 41554
19438 36666
17316 20200
13127 51318
11331 23840
37354 22773
34872 20249
48467 85209
36745 10870
97478 88369
29324 10246
24179 63888
24371 39320
61932 45220
55020 10320
64150 36160
68372 52644
10714 64027
68990 57768
72825 40811
85765 77880
32558 20200
78846 93936
71711 85172
90337 94436
32298 76808
86944 38430
36174 29108
53613 72165
79549 43129
43539 44170
61122 88369
30084 56992
49969 39320
38272 86708
11594 30429
69508 70293
21588 68766
97316 76575
97425 41520
62763 31254
63345 23840
43015 93602
52670 82798
58251 48255
33771 20530
12901 25496
42101 41554
43970 67658
90983 88369
33538 93514
89043 26380
65451 82798
73769 28981
78129 70224
84083 78572
72978 28610
81230 47914
97477 75916
96888 42548
24917 39320
97486 78173
13312 51318
27167 93602
76762 20600
72850 47594
24623 58718
99735 87301
92737 39670
33120 59605
63398 20200
38385 98299
81987 53969
62260 51318
67235 63713
85100 42047
27762 90281
13906 51318
85558 36666
42148 12845
88468 20200
92033 32404
39309 32404
99521 99391
80929 17352
28236 46875
83442 20530
50329 10870
75224 47197
71764 99003
22012 82219
89620 28881
60052 88379
98379 44694
47207 94436
47361 40762
96159 17352
61549 84760
36863 80773
28638 90281
28879 24766
24022 55460
25334 10870
25095 46875
14190 63285
66088 70993
36470 50008
47970 87301
35396 17811
24123 47037
26462 52299
49162 12845
88098 87301
53920 59862
84177 10870
18969 36666
55280 11340
14058 68145
13245 14598
23434 46622
56966 78829
77060 71967
25997 57796
41947 82348
52576 12845
91921 51318
# Advent Of Code
Clojure solutions to [Advent Of Code](https://adventofcode.com/)
Eclipse Public License - v 2.0
THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
1. DEFINITIONS
"Contribution" means:
a) in the case of the initial Contributor, the initial content
Distributed under this Agreement, and
b) in the case of each subsequent Contributor:
i) changes to the Program, and
ii) additions to the Program;
where such changes and/or additions to the Program originate from
and are Distributed by that particular Contributor. A Contribution
"originates" from a Contributor if it was added to the Program by
such Contributor itself or anyone acting on such Contributor's behalf.
Contributions do not include changes or additions to the Program that
are not Modified Works.
"Contributor" means any person or entity that Distributes the Program.
"Licensed Patents" mean patent claims licensable by a Contributor which
are necessarily infringed by the use or sale of its Contribution alone
or when combined with the Program.
"Program" means the Contributions Distributed in accordance with this
Agreement.
"Recipient" means anyone who receives the Program under this Agreement
or any Secondary License (as applicable), including Contributors.
"Derivative Works" shall mean any work, whether in Source Code or other
form, that is based on (or derived from) the Program and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship.
"Modified Works" shall mean any work in Source Code or other form that
results from an addition to, deletion from, or modification of the
contents of the Program, including, for purposes of clarity any new file
in Source Code form that contains any contents of the Program. Modified
Works shall not include works that contain only declarations,
interfaces, types, classes, structures, or files of the Program solely
in each case in order to link to, bind by name, or subclass the Program
or Modified Works thereof.
"Distribute" means the acts of a) distributing or b) making available
in any manner that enables the transfer of a copy.
"Source Code" means the form of a Program preferred for making
modifications, including but not limited to software source code,
documentation source, and configuration files.
"Secondary License" means either the GNU General Public License,
Version 2.0, or any later versions of that license, including any
exceptions or additional permissions as identified by the initial
Contributor.
2. GRANT OF RIGHTS
a) Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free copyright
license to reproduce, prepare Derivative Works of, publicly display,
publicly perform, Distribute and sublicense the Contribution of such
Contributor, if any, and such Derivative Works.
b) Subject to the terms of this Agreement, each Contributor hereby
grants Recipient a non-exclusive, worldwide, royalty-free patent
license under Licensed Patents to make, use, sell, offer to sell,
import and otherwise transfer the Contribution of such Contributor,
if any, in Source Code or other form. This patent license shall
apply to the combination of the Contribution and the Program if, at
the time the Contribution is added by the Contributor, such addition
of the Contribution causes such combination to be covered by the
Licensed Patents. The patent license shall not apply to any other
combinations which include the Contribution. No hardware per se is
licensed hereunder.
c) Recipient understands that although each Contributor grants the
licenses to its Contributions set forth herein, no assurances are
provided by any Contributor that the Program does not infringe the
patent or other intellectual property rights of any other entity.
Each Contributor disclaims any liability to Recipient for claims
brought by any other entity based on infringement of intellectual
property rights or otherwise. As a condition to exercising the
rights and licenses granted hereunder, each Recipient hereby
assumes sole responsibility to secure any other intellectual
property rights needed, if any. For example, if a third party
patent license is required to allow Recipient to Distribute the
Program, it is Recipient's responsibility to acquire that license
before distributing the Program.
d) Each Contributor represents that to its knowledge it has
sufficient copyright rights in its Contribution, if any, to grant
the copyright license set forth in this Agreement.
e) Notwithstanding the terms of any Secondary License, no
Contributor makes additional grants to any Recipient (other than
those set forth in this Agreement) as a result of such Recipient's
receipt of the Program under the terms of a Secondary License
(if permitted under the terms of Section 3).
3. REQUIREMENTS
3.1 If a Contributor Distributes the Program in any form, then:
a) the Program must also be made available as Source Code, in
accordance with section 3.2, and the Contributor must accompany
the Program with a statement that the Source Code for the Program
is available under this Agreement, and informs Recipients how to
obtain it in a reasonable manner on or through a medium customarily
used for software exchange; and
b) the Contributor may Distribute the Program under a license
different than this Agreement, provided that such license:
i) effectively disclaims on behalf of all other Contributors all
warranties and conditions, express and implied, including
warranties or conditions of title and non-infringement, and
implied warranties or conditions of merchantability and fitness
for a particular purpose;
ii) effectively excludes on behalf of all other Contributors all
liability for damages, including direct, indirect, special,
incidental and consequential damages, such as lost profits;
iii) does not attempt to limit or alter the recipients' rights
in the Source Code under section 3.2; and
iv) requires any subsequent distribution of the Program by any
party to be under a license that satisfies the requirements
of this section 3.
3.2 When the Program is Distributed as Source Code:
a) it must be made available under this Agreement, or if the
Program (i) is combined with other material in a separate file or
files made available under a Secondary License, and (ii) the initial
Contributor attached to the Source Code the notice described in
Exhibit A of this Agreement, then the Program may be made available
under the terms of such Secondary Licenses, and
b) a copy of this Agreement must be included with each copy of
the Program.
3.3 Contributors may not remove or alter any copyright, patent,
trademark, attribution notices, disclaimers of warranty, or limitations
of liability ("notices") contained within the Program from any copy of
the Program which they Distribute, provided that Contributors may add
their own appropriate notices.
4. COMMERCIAL DISTRIBUTION
Commercial distributors of software may accept certain responsibilities
with respect to end users, business partners and the like. While this
license is intended to facilitate the commercial use of the Program,
the Contributor who includes the Program in a commercial product
offering should do so in a manner which does not create potential
liability for other Contributors. Therefore, if a Contributor includes
the Program in a commercial product offering, such Contributor
("Commercial Contributor") hereby agrees to defend and indemnify every
other Contributor ("Indemnified Contributor") against any losses,
damages and costs (collectively "Losses") arising from claims, lawsuits
and other legal actions brought by a third party against the Indemnified
Contributor to the extent caused by the acts or omissions of such
Commercial Contributor in connection with its distribution of the Program
in a commercial product offering. The obligations in this section do not
apply to any claims or Losses relating to any actual or alleged
intellectual property infringement. In order to qualify, an Indemnified
Contributor must: a) promptly notify the Commercial Contributor in
writing of such claim, and b) allow the Commercial Contributor to control,
and cooperate with the Commercial Contributor in, the defense and any
related settlement negotiations. The Indemnified Contributor may
participate in any such claim at its own expense.
For example, a Contributor might include the Program in a commercial
product offering, Product X. That Contributor is then a Commercial
Contributor. If that Commercial Contributor then makes performance
claims, or offers warranties related to Product X, those performance
claims and warranties are such Commercial Contributor's responsibility
alone. Under this section, the Commercial Contributor would have to
defend claims against the other Contributors related to those performance
claims and warranties, and if a court requires any other Contributor to
pay any damages as a result, the Commercial Contributor must pay
those damages.
5. NO WARRANTY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS"
BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
PURPOSE. Each Recipient is solely responsible for determining the
appropriateness of using and distributing the Program and assumes all
risks associated with its exercise of rights under this Agreement,
including but not limited to the risks and costs of program errors,
compliance with applicable laws, damage to or loss of data, programs
or equipment, and unavailability or interruption of operations.
6. DISCLAIMER OF LIABILITY
EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
7. GENERAL
If any provision of this Agreement is invalid or unenforceable under
applicable law, it shall not affect the validity or enforceability of
the remainder of the terms of this Agreement, and without further
action by the parties hereto, such provision shall be reformed to the
minimum extent necessary to make such provision valid and enforceable.
If Recipient institutes patent litigation against any entity
(including a cross-claim or counterclaim in a lawsuit) alleging that the
Program itself (excluding combinations of the Program with other software
or hardware) infringes such Recipient's patent(s), then such Recipient's
rights granted under Section 2(b) shall terminate as of the date such
litigation is filed.
All Recipient's rights under this Agreement shall terminate if it
fails to comply with any of the material terms or conditions of this
Agreement and does not cure such failure in a reasonable period of
time after becoming aware of such noncompliance. If all Recipient's
rights under this Agreement terminate, Recipient agrees to cease use
and distribution of the Program as soon as reasonably practicable.
However, Recipient's obligations under this Agreement and any licenses
granted by Recipient relating to the Program shall continue and survive.
Everyone is permitted to copy and distribute copies of this Agreement,
but in order to avoid inconsistency the Agreement is copyrighted and
may only be modified in the following manner. The Agreement Steward
reserves the right to publish new versions (including revisions) of
this Agreement from time to time. No one other than the Agreement
Steward has the right to modify this Agreement. The Eclipse Foundation
is the initial Agreement Steward. The Eclipse Foundation may assign the
responsibility to serve as the Agreement Steward to a suitable separate
entity. Each new version of the Agreement will be given a distinguishing
version number. The Program (including Contributions) may always be
Distributed subject to the version of the Agreement under which it was
received. In addition, after a new version of the Agreement is published,
Contributor may elect to Distribute the Program (including its
Contributions) under the new version.
Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
receives no rights or licenses to the intellectual property of any
Contributor under this Agreement, whether expressly, by implication,
estoppel or otherwise. All rights in the Program not expressly granted
under this Agreement are reserved. Nothing in this Agreement is intended
to be enforceable by any entity that is not a Contributor or Recipient.
No third-party beneficiary rights are created under this Agreement.
Exhibit A - Form of Secondary Licenses Notice
"This Source Code may also be made available under the following
Secondary Licenses when the conditions for such availability set forth
in the Eclipse Public License, v. 2.0 are satisfied: GNU General Public
License as published by the Free Software Foundation, either version 2
of the License, or (at your option) any later version, with the GNU
Classpath Exception which is available at
https://www.gnu.org/software/classpath/license.html."
Simply including a copy of this Agreement, including this Exhibit A
is not sufficient to license the Source Code under Secondary Licenses.
If it is not possible or desirable to put the notice in a particular
file, then You may include the notice in a location (such as a LICENSE
file in a relevant directory) where a recipient would be likely to
look for such a notice.
You may add additional accurate notices of copyright ownership.