<commit_before>h1. daycount.js

*daycount.js* includes javascript classes designed to count days.  At present, the following counts are implemented:

* *Gregorian Calendar*, representing each date as a year, a month, and a day of month.
* *Julian Day Number*, in which each day is assigned a unique whole number.
* *Dreamspell Calendar*, counting 13 moons per year and including a 260 day cycle.

For some examples of what can be done, see the "demo":http://yellowseed.org/daycount.js/.

h2. What day is it?

Assuming a count of days as rotations of the planet Earth relative to its Sun, the answer to this question depends on one's position on the surface of Earth as well as when, relative to these rotations, each day begins and ends.  In the Gregorian count, days begin and end at midnight, which depends on the time zone, which depends on one's position on the surface of the Earth.  The Julian Day count, on the other hand, separates one day from the next at noon.  The Dreamspell calendar synchronizes fairly well with the Gregorian, ending its days at nadir (usually a little after local midnight), but skips each Gregorian leap day as though it never happened.

p. *Challenge:* Given a Gregorian Calendar date, what is the associated Julian Day Number?

bq.. A day in the Gregorian Calendar count begins and ends at midnight local time.  This means it will almost always span two days in the Julian Day Number count, which starts and ends days at noon UTC.  Therefore there is not one correct answer to this question.

*Answer:* The class @daycount.counts.julianDay@ calculates a number only from a date _and time_, never from a date alone.

p. *Challenge:* If we calculate the Dreamspell count for the day just before a Gregorian leap day and then move the count forward one day, what should be the result?

bq.. While the Dreamspell Calendar skips Gregorian leap days, it does not represent those leap days within its own count.  Therefore, without additional information from the Gregorian calendar, we cannot reliably answer this question.

*Answer:* The class @daycount.counts.dreamspell@ does not support incrementing or decrementing the count by days.  To do this arithmetic, you must use another count and then convert back to this one.<commit_msg>added build instructions to README, tweaked formatting in challenges section.<commit_after>h1. daycount.js

*daycount.js* includes javascript classes designed to count days.  At present, the following counts are implemented:

* *Gregorian Calendar*, representing each date as a year, a month, and a day of month.
* *Julian Day Number*, in which each day is assigned a unique whole number.
* *Dreamspell Calendar*, counting 13 moons per year and including a 260 day cycle.

For some examples of what can be done, see the "demo":http://yellowseed.org/daycount.js/.

h2. What day is it?

Assuming a count of days as rotations of the planet Earth relative to its Sun, the answer to this question depends on one's position on the surface of Earth as well as when, relative to these rotations, each day begins and ends.

----

*Question:* Given a Gregorian Calendar date, what is the associated Julian Day Number?

*Challenge:* A day in the Gregorian Calendar count begins and ends at midnight in the local time zone.  This means it will almost always span two days in the Julian Day Number count, which starts and ends days at noon UTC.  Therefore there is no one correct answer to this question.

*Response:* The class @daycount.counts.julianDay@ calculates a number only from a date _and time_, never from a date alone.

----

*Question:* If we calculate the Dreamspell count for the day just before a Gregorian leap day and then move the count forward one day, what should be the result?

*Challenge:* While the Dreamspell Calendar skips Gregorian leap days, it does not represent those leap days within its own count.  Therefore, without additional information from the Gregorian calendar, we cannot reliably answer this question.

*Response:* The class @daycount.counts.dreamspell@ does not support incrementing or decrementing the count by days.  To do this arithmetic, you must use another count and then convert back to this one.

h2. Building

On *nix:

bc. cat src/* > daycount.js

or at a DOS prompt:

bc. type src\* > daycount.js
{'fraction_non_alphanumeric': 0.05091839107184376, 'fraction_numerical': 0.0034875610323180655, 'mean_word_length': 4.291512915129151, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '452817', 'n_tokens_mistral': 1129, 'n_tokens_neox': 1061, 'n_words': 682}