Talk:Last Friday of each month: Difference between revisions

→‎command line: added a comment.
(→‎1582: why I brought that up, expressed thanks (agein) and corrected typos while reading)
(→‎command line: added a comment.)
 
(25 intermediate revisions by 9 users not shown)
Line 1:
== Java ==
 
The Java example gives me this result (the problem is at the last line):
java LastFridays 2012
2012 Jan 27
2012 Feb 24
2012 Mar 30
2012 Apr 27
2012 May 25
2012 Jun 29
2012 Jul 27
2012 Aug 31
2012 Sep 28
2012 Oct 26
2012 Nov 30
2012 Dec 28
2012 25
[[User:Blue Prawn|Blue Prawn]] 07:30, 31 December 2012 (UTC)
 
: I've had the same problem. getShortMonths() returns 13 elements. I assume this is a bug in certain Java versions. [[User:Fwend|Fwend]] 12:30, 31 December 2012 (UTC)
::Yeah it's happening for me now too (on the Windows and Linux implementations). It must have been changed in a recent update. I hope I would have noticed that when I wrote the example. Do you think we need to fix the example around that? --[[User:Mwn3d|Mwn3d]] 14:11, 31 December 2012 (UTC)
::: When I posted the code, I thought it was a bug in the Java implementation, but according to the documentation it isn't: ''Short month strings. For example: "Jan", "Feb", etc. An array of 13 strings (some calendars have 13 months)...''. [http://www.docjar.com/docs/api/java/text/DateFormatSymbols.html]. I'll fix the example. [[User:Fwend|Fwend]] 14:26, 31 December 2012 (UTC)
 
== command line ==
Why does the task specify that the year is supplied from the command line? This seems to conflate two totally separate language capabilities--date arithmetic and command line handling. For the PHP example, I'm just ignoring the command line requirement. --[[User:Showell|Showell]] 17:37, 20 January 2012 (UTC)
 
: Specifying the year on the command-line makes it easy to check any specified year (or multiple years) without having to change a hard-coded year inside the computer program.   This should be a trivial requirement for most languages.   It also makes it easier to compare how a particular language handles command-line arguments.   -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 17:28, 15 July 2016 (UTC)
 
== task name ==
Line 152 ⟶ 177:
The only "missing days" are when one switches from one calendar to another. The Gregorian calendar is proleptic. October 5th follows 4 Oct in EVERY year in the Gregorian calendar (starting in January 1, year 1). -- [[User:Gerard Schildberger|Gerard Schildberger]] 06:18, 11 August 2012 (UTC)
 
October 4th in year 1582 was the date in the Julian calendercalendar (the day before the switchover in some countries). The next day, the Gregorian calendar was adopted (or put into effect) in various countries, but not everywhere. The new Gregorian calendar says it was October 15th. If we switched to a Mayan calendar, would we be missing ''years'' (or whatever)? Of course not. Once the Gregorian calendar was adopted, it was like the calendar was in effect all along, with a continous calendar (proleptic) backward to January 1st, year 1. No missing days. That is why there are references to ''O.S.'' (''o''ld ''s''tyle) for years previous to the adoption of the new Gregorian calendar for those people who were born before the switchover. If the Gregorian calendar wasn't proleptic, there would be no need for ''O.S.'' type of dates.
 
See: http://en.wikipedia.org/wiki/George_Washington
Line 162 ⟶ 187:
:::proletic should be proleptic?!? --[[User:Walterpachl|Walterpachl]] 17:34, 11 August 2012 (UTC)
 
::::Yes, three misspellings of proleptic corrected. -- [[User:Gerard Schildberger|Gerard Schildberger]] 17:45, 11 August 2012 (UTC)
 
:: I don't know what the Java language says (as per its documentation) concerning ''what'' it returns from its date/time functions; does it reportedly return a Gregorian date, or does it switch to a Julian date at a certain point (date), and if so, why assume ''any'' date as the chosen switchover date would be, more-or-less, capricious as different countries adopted the Gregorian calendar at different times. But if it's for a Gregorian calendar, then yes, it's wrong. There's a lot (time, ego, emotions, reputations, ...) invested in the existing Java code (and others), and the resistance in changing/correcting it will be great. -- [[User:Gerard Schildberger|Gerard Schildberger]] 17:45, 11 August 2012 (UTC)
Line 197 ⟶ 222:
 
-----
 
:While I found this discussion of 1582 most enlightening I am thrilled by the 'real' calendar of 1582 shown under Calendar for Scala.
:( http://rosettacode.org/mw/index.php?title=Calendar&action=edit&section=17 )
:I wonder if such a calendar page was ever printed.
<pre>
Snippet from there:
1582
September October
Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su
1 2 1 2 3 4 15 16 17
3 4 5 6 7 8 9 18 19 20 21 22 23 24
10 11 12 13 14 15 16 25 26 27 28 29 30 31
17 18 19 20 21 22 23
24 25 26 27 28 29 30
</pre>
 
:--[[User:Walterpachl|Walterpachl]] 05:12, 22 August 2012 (UTC)
 
No, I don't think so. The October "month" shown above is a mixture of two types of calendars:
<br>Julian (O.S.) and Gregorian (N.S.); furthermore, neither the old or new style is indicated.
<br>The Julian calendar continues after any certain date, and is still used today for various purposes.
<br>The Gregorian calendar is proleptic (so there're no "missing" days in it, no matter when it was adopted).
 
:Nevertheless, the Gregorian calendar is discontinuous.
 
:First, it's discontinuous based on where the results of the program are being understood. Second, it's discontinuous because it was not used before certain dates (which depend on location).
 
:: No, both calendars are continuous. Just because one was adopted at a certain date, doesn't mean the calendar is discontinous. Both calendars have current day usage, and the Gregorian calendar is proleptic, that is, dates previous to its ''inception'' are "present" down to January 1st, year 1 --- no matter when that calendar was adopted. The only discontinuity is when showing a specific calendar, and then a different calendar, during the switchover (when one calendar was "dropped", another adopted for common use).
The problem would be solved if, when showing that "split" calendar, which dates are Julian, which dates are Gregorian. -- [[User:Gerard Schildberger|Gerard Schildberger]] 18:55, 22 August 2012 (UTC)
-- [[User:Gerard Schildberger|Gerard Schildberger]] 18:55, 22 August 2012 (UTC)
 
::: Except, it's not really "two calendars". It's "two classes of calendar standards". Another way of looking at this is that each country has a calendar and at some point they changed standards. So, if you look at this geographically for any single day during the transition periods (or, even now), you have discontinuities because of partial adoption of the Gregorian calendar. Alternatively, if you look at this as a stretch of time at one specific location you have discontinuity because at one point in time the Julian standard was used and at a later time the Gregorian standard was used (there's an exception here, for institutions which never adopted the Gregorian standard -- and of course that means that the calendar has drifted from having much of anything to do with the usual meaning in the context of seasons).
 
::: Your point, I think, is that you can take the Gregorian calendar and project it backwards -- assigning dates to events which took place before the calendar was invented. And, from this point of view, the dating system is self consistent. But it achieves this by assigning dates to events that have nothing to do with any dates which would have been expressed at the time represented by those dates. And, yes, this point of view is internally self-consistent. But that internal self consistency does not mean that people talking about historical calendar gaps are incorrect. It's more like nit-picking. --[[User:Rdm|Rdm]] 14:34, 23 August 2012 (UTC)
 
:It's true that some of these discontinuities can be interpreted as being an artifact of the transition from Julian calendar to Gregorian calendar, but that doesn't eliminate the discontinuities, it only labels them. (And, also, we can legitimately say that all days before its adoption are "missing" from it.)
:Also, "where the results of the program are being understood" can be awkward to implement. --[[User:Rdm|Rdm]] 18:26, 22 August 2012 (UTC)
 
:: Again, there are no missing days, no discontinuites. It only appears missing (or discontinuous) because a calendar is shown in one format (O.S. or old style or Julian) and then another format (N.S. or new style or Gregorian) during the switchover. If we switched over to a Mayan calendar, there won't be 12,000 missing years (or whatever). Both (er, all three) calendars are continuous (up to the present day). I don't want to go into the exception of the Mayan calendar when it "starts over" later this year (2012). -- [[User:Gerard Schildberger|Gerard Schildberger]] 18:55, 22 August 2012 (UTC)
 
:::I still like the calendar page shown which is about the same as the full 31 October days with 5 to 14 October rossed out with a felt pen which wasn't available then. Neither did they know the word 'proleptic'. However, it's a pity that they (well, Gregor) dropped my birthday :-( --[[User:Walterpachl|Walterpachl]] 19:21, 22 August 2012 (UTC)
 
:::: Felt pen was, of course, no good because days of the week would have been wrong. Better: Snowpake and correct the numbers on the days! --[[User:Walterpachl|Walterpachl]] 09:26, 23 August 2012 (UTC)
 
:::: You were born in 1752? Sheesh, you're almost as old as dirt. Aside from that, Pope Gregory XIII (and his [or a] scientific advisor and primary author of the reformed calendar: Aloysius Lilius, AKA: Luigi Lilio, or Liuigi Giglio, or Aluise Baldassar Lilio) didn't know about the word ''proleptic'', but it was proclaimed (via a ''papal bull'') that the reformed calendar was as if it was in effect (back) to January 1st, year 1. Note that the reformed calendar (later called the Gregorian calendar) was made effective the 24th of February in 1582 for the Catholic clergy, and it furthermore exhorted Catholic sovereigns to adopt the reformed calendar. -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:29, 22 August 2012 (UTC)
 
-----
::::: So this calender page was printed in February and everyone knew that there would not be these days. Fine with me. What's your point in misspelling ''proleptic''? --[[User:Walterpachl|Walterpachl]] 06:25, 23 August 2012 (UTC) And is it correct that 5 October 1582 was a Friday?
 
:::::: I never said that any calendar was printed (in February or at any time). Not ''everyone'' knew; the papal bull was issued primarily to the (Catholic) clergy (the bishops). At the time of the issuance of the papal bull, it wasn't known when the reformed calendar would be adopted (or even ''if'' it would be adopted) by the various states/countries/principalities. Because of the origin of the reformed calendar, there was great resistance to the new calendar. Certainly the Catholic church knew that when the reformed calender would be adopted (the switchover), there would be a gap between the Julian calender date (O.S.) and the reformed calendar date (N.S.), later called the Gregorian calendar. The Catholic Church didn't observe the gap between the two calendars (in October) since they were already using the reformed calendar much earlier that year. Actually, according to the Julian calender, it was the "previous year" (due to the start of the new year in March 25th). You can see a good explanation of this at the Wikipedia page of George Washington [http://en.wikipedia.org/wiki/George_Washington], read '''Note 1'''. Note that George Washington was born February 22nd, 1732 (N.S.), which was February 11th, 1731 (O.S.). The year difference has caused so many incorrect "corrections" that the Wikipedia page has to be locked (put into semi-protected mode which can only be edited by established registered users) so misinformed people wouldn't "correct" the O.S. year. Also, read (view the source): [http://en.wikipedia.org/w/index.php?title=George_Washington&action=edit], particurily the extra-large bold print. -- [[User:Gerard Schildberger|Gerard Schildberger]] 18:22, 23 August 2012 (UTC)
 
:::::: As for your question about misspelling a word ... there was no point, it was a typo. -- [[User:Gerard Schildberger|Gerard Schildberger]] 18:22, 23 August 2012 (UTC)
 
-----
It is really amazing how much misinformation (that's a code word for bad or incorrect information) concerning the subject of the Gregorian calendar, the various switchovers (adoptions), and the subject of the translations of the two styles of dates ('''O.S.''' vs. '''N.S.'''). One website states that Pope Gregory ''ordered'' ten days to be dropped ... and whatnot. As for the Wikipedia's article, it is suprisingly factual and well-formed. Kudos to those authors. -- [[User:Gerard Schildberger|Gerard Schildberger]] 20:36, 22 August 2012 (UTC)
 
 
-----
May I recommen a fantastic url showing all those things brilliantly?
http://emr.cs.iit.edu/home/reingold/calendar-book/Calendrica.html
It's an offspring of a book I own:
Calendrical Calculations by Edward M. Reingold and Nachum Dershowitz
 
--[[User:Walterpachl|Walterpachl]] 11:49, 29 August 2012 (UTC)
 
== Proposed amendment & rename: [[Find a first or last day of week in a month]] ==
 
Wots say we rename [[Last Friday of each month]] to [[Find a first or last day of week in a month]](?)...
Then use Tuesday and Thursday January 2038 (Vis-à-vis [wp:Year 2038 problem]) as test cases...
 
e.g.
<lang algol68>PROC find day of week in month year = (INT wday, month, year)INT: (
¢ Where wday=1,2,3,4... is first Mon,Tue,Wed... ¢
¢ Where wday=-1,-2,-3,... is last Mon,Tue,Wed... ¢
code...
¢ found ¢ day of month EXIT
);</lang>
 
Actually: I'm curious... is this first/last day of week issue specifically addressed in any library, or "[[wp:ICalendar#Events_.28VEVENT.29|icalendar]]" standard?
 
On another topic: We have "Last Friday" snacks every month, and need to order the food 2 days before. AFAIK no calendar program out there automatically caters for a recurrent order like this. (I've failed in google calendar and cron) Any hints.
 
[[User:NevilleDNZ|NevilleDNZ]] ([[User talk:NevilleDNZ|talk]]) 05:53, 17 April 2013 (UTC)