Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Victory or defeat!


devel / comp.lang.c / Re: getFirstDayOfMonth()

SubjectAuthor
* getFirstDayOfMonth()Mike Sanders
`* Re: getFirstDayOfMonth()Kenny McCormack
 +* Re: getFirstDayOfMonth()Janis Papanagnou
 |`* Re: getFirstDayOfMonth()Keith Thompson
 | +* Re: getFirstDayOfMonth()Janis Papanagnou
 | |`* Re: getFirstDayOfMonth()Janis Papanagnou
 | | `* Re: getFirstDayOfMonth()Keith Thompson
 | |  `- Re: getFirstDayOfMonth()Janis Papanagnou
 | `- Re: getFirstDayOfMonth()Mike Sanders
 +- Re: getFirstDayOfMonth()Scott Lurndal
 +- Re: getFirstDayOfMonth()Janis Papanagnou
 +- Re: getFirstDayOfMonth()Mike Sanders
 +* Re: getFirstDayOfMonth()Mike Sanders
 |`* Re: getFirstDayOfMonth()Scott Lurndal
 | +* Re: getFirstDayOfMonth()Mike Sanders
 | |`- Re: getFirstDayOfMonth()Tim Rentsch
 | `* Re: getFirstDayOfMonth()Mike Sanders
 |  `* Re: getFirstDayOfMonth()Scott Lurndal
 |   +- Re: getFirstDayOfMonth()Janis Papanagnou
 |   +* Re: getFirstDayOfMonth()Mike Sanders
 |   |+* Re: getFirstDayOfMonth()Janis Papanagnou
 |   ||`* Re: getFirstDayOfMonth()Mike Sanders
 |   || `- Re: getFirstDayOfMonth()Janis Papanagnou
 |   |+* Re: getFirstDayOfMonth()Keith Thompson
 |   ||+* Re: getFirstDayOfMonth()Janis Papanagnou
 |   |||+* Re: getFirstDayOfMonth()David Brown
 |   ||||+* Re: getFirstDayOfMonth()Kaz Kylheku
 |   |||||`- Re: getFirstDayOfMonth()David Brown
 |   ||||+* Re: getFirstDayOfMonth()Malcolm McLean
 |   |||||`- Re: getFirstDayOfMonth()Richard Harnden
 |   ||||`- Re: getFirstDayOfMonth()Janis Papanagnou
 |   |||`* Re: getFirstDayOfMonth()Mike Sanders
 |   ||| +* Re: getFirstDayOfMonth()Scott Lurndal
 |   ||| |`* Re: getFirstDayOfMonth()Mike Sanders
 |   ||| | `* Re: getFirstDayOfMonth()Scott Lurndal
 |   ||| |  +* Re: getFirstDayOfMonth()Kaz Kylheku
 |   ||| |  |`- Re: getFirstDayOfMonth()Scott Lurndal
 |   ||| |  `* Re: getFirstDayOfMonth()Janis Papanagnou
 |   ||| |   `- Re: getFirstDayOfMonth()Scott Lurndal
 |   ||| `* Re: getFirstDayOfMonth()Janis Papanagnou
 |   |||  +- Re: getFirstDayOfMonth()Mike Sanders
 |   |||  `* Re: getFirstDayOfMonth()Mark Bourne
 |   |||   `- Re: getFirstDayOfMonth()Scott Lurndal
 |   ||`* Re: getFirstDayOfMonth()Mike Sanders
 |   || +* Re: getFirstDayOfMonth()Scott Lurndal
 |   || |+- Re: getFirstDayOfMonth()Keith Thompson
 |   || |`* Re: getFirstDayOfMonth()Mike Sanders
 |   || | +- Re: getFirstDayOfMonth()Keith Thompson
 |   || | +* Re: getFirstDayOfMonth()Mike Sanders
 |   || | |`* [OT] Re: getFirstDayOfMonth()Janis Papanagnou
 |   || | | `- Re: [OT] Re: getFirstDayOfMonth()Mike Sanders
 |   || | `* Re: getFirstDayOfMonth()Scott Lurndal
 |   || |  `- Re: getFirstDayOfMonth()Keith Thompson
 |   || `* Re: getFirstDayOfMonth()Lew Pitcher
 |   ||  +* Re: getFirstDayOfMonth()Michael S
 |   ||  |+- Re: getFirstDayOfMonth()Michael S
 |   ||  |`- Re: getFirstDayOfMonth()Tim Rentsch
 |   ||  +- Re: getFirstDayOfMonth()Mike Sanders
 |   ||  `- Re: getFirstDayOfMonth()Janis Papanagnou
 |   |+* Re: getFirstDayOfMonth()James Kuyper
 |   ||`* Re: getFirstDayOfMonth()Mike Sanders
 |   || +- Re: getFirstDayOfMonth()James Kuyper
 |   || +* Re: getFirstDayOfMonth()Keith Thompson
 |   || |`* Re: getFirstDayOfMonth()Mike Sanders
 |   || | +* Re: getFirstDayOfMonth()Kaz Kylheku
 |   || | |+- Re: getFirstDayOfMonth()Mike Sanders
 |   || | |`- Re: getFirstDayOfMonth()Scott Lurndal
 |   || | `* Re: getFirstDayOfMonth()Keith Thompson
 |   || |  `- Re: getFirstDayOfMonth()Mike Sanders
 |   || `* Re: getFirstDayOfMonth()Michael S
 |   ||  `* Re: getFirstDayOfMonth()Mike Sanders
 |   ||   `- Re: getFirstDayOfMonth()Keith Thompson
 |   |`* Re: getFirstDayOfMonth()Scott Lurndal
 |   | `* Re: getFirstDayOfMonth()Michael S
 |   |  `- Re: getFirstDayOfMonth()Scott Lurndal
 |   `- Re: getFirstDayOfMonth()Mark Bourne
 +* Re: getFirstDayOfMonth()jak
 |+* Re: getFirstDayOfMonth()Tim Rentsch
 ||`- Re: getFirstDayOfMonth()jak
 |`* Re: getFirstDayOfMonth()Peter 'Shaggy' Haywood
 | `* Re: getFirstDayOfMonth()bart
 |  `* Re: getFirstDayOfMonth()jak
 |   `* Re: getFirstDayOfMonth()jak
 |    +* Re: getFirstDayOfMonth()Spiros Bousbouras
 |    |`* Re: getFirstDayOfMonth()Keith Thompson
 |    | `- Re: getFirstDayOfMonth()Keith Thompson
 |    `* Re: getFirstDayOfMonth()Keith Thompson
 |     `- Re: getFirstDayOfMonth()Tim Rentsch
 `* Re: getFirstDayOfMonth()Kaz Kylheku
  +- Re: getFirstDayOfMonth()Peter 'Shaggy' Haywood
  `- Re: getFirstDayOfMonth()Kenny McCormack

Pages:1234
Re: getFirstDayOfMonth()

<us765i$3pbtq$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34145&group=comp.lang.c#34145

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: bc...@freeuk.com (bart)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Tue, 5 Mar 2024 13:19:48 +0000
Organization: A noiseless patient Spider
Lines: 59
Message-ID: <us765i$3pbtq$1@dont-email.me>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com>
<uru0k6$1hpdi$1@dont-email.me> <cleibk-jk1.ln1@hendrix.foo>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 5 Mar 2024 13:19:46 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="28429775cc980cc5a26eeb122460720b";
logging-data="3977146"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4AQraA17GrMQmglERAiny"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:oC+bT2Qq5sCLPi32/UMZgA8Q3rI=
In-Reply-To: <cleibk-jk1.ln1@hendrix.foo>
Content-Language: en-GB
 by: bart - Tue, 5 Mar 2024 13:19 UTC

On 05/03/2024 03:03, Peter 'Shaggy' Haywood wrote:
> Groovy hepcat jak was jivin' in comp.lang.c on Sat, 2 Mar 2024 12:49 pm.
> It's a cool scene! Dig it.
>
>> Kenny McCormack ha scritto:
>>> In article <urrj5l$124o9$1@dont-email.me>,
>>> Mike Sanders <porkchop@invalid.foo> wrote:
>>>> Just sharing what I've learned, hope some of you can adapt
>>>> it for your own use.
>>>>
>>>> Calculates the name of the weekday (Sun, Mon, etc) for the
>>>> 1st day of a given month & year...
>>>>
>>>> https://busybox.neocities.org/notes/get-first-day-of-month.txt
>>>
>>> Here's the guts of my version of the Zeller algorithm:
>>>
>>> int day(d,m,y)
>>> int d, m, y;
>>> {
>>> if (m < 3) {
>>> m += 12;
>>> y--;
>>> }
>>> return (d + (13*m-27)/5 + y + y/4 - y/100 + y/400) % 7;
>>
>> Hi,
>> I am referring in particular to this part of the equation:
>> y + y/4 - y/100 + y/400
>> Shouldn't it be calculated in a floating point and then truncated only
>> the final result? Because, for example, if the year is 2024, the
>> floating point calculation is 2514 (2514.82) while executed between
>> integer is 2515.
>
> No. The "+ y/4 - y/100 + y/400" part is adding a day for each leap
> year. You see, a leap year is divisible by 4, but is not divisible by
> 100, but is divisible by 400. So, it's adding the number of years
> divisible by 4, subtracting those divisible by 100 and adding those
> divisible by 400 to determine the number of leap days up to the given
> date.
> So often in the last week or two I've heard people (who ought to know
> better) on news programs on telly say that a leap year comes every 4
> years, and I want to beat them about the head with a humorous object of
> some kind until they get this right! A leap year does NOT come EVERY 4
> years.

For most practical purposes and for the lifetimes of most of the 8
billion people on the planet, leap years do come every four years.

That's the case for years 1901 to 2099.

What exactly do you expect those news readers that reach a massive
audience to do, get into those details of being divisible or not by 100
or 400? Maybe they should also mention odd years like 1752 where there
was a calendar reform for even more exceptions to the rule.

Half the audience probably barely know what a leap year is.

Re: getFirstDayOfMonth()

<us76qj$24ki7$1@news.xmission.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34146&group=comp.lang.c#34146

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!xmission!nnrp.xmission!.POSTED.shell.xmission.com!not-for-mail
From: gaze...@shell.xmission.com (Kenny McCormack)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Tue, 5 Mar 2024 13:30:59 -0000 (UTC)
Organization: The official candy of the new Millennium
Message-ID: <us76qj$24ki7$1@news.xmission.com>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com> <20240301180259.118@kylheku.com>
Injection-Date: Tue, 5 Mar 2024 13:30:59 -0000 (UTC)
Injection-Info: news.xmission.com; posting-host="shell.xmission.com:166.70.8.4";
logging-data="2249287"; mail-complaints-to="abuse@xmission.com"
X-Newsreader: trn 4.0-test77 (Sep 1, 2010)
Originator: gazelle@shell.xmission.com (Kenny McCormack)
 by: Kenny McCormack - Tue, 5 Mar 2024 13:30 UTC

In article <20240301180259.118@kylheku.com>,
Kaz Kylheku <433-929-6894@kylheku.com> wrote:
....
>Pissing on new code using old-style C in 5... 4... 3....

Actually, the code in question says (according to the comments) that it
was written 12/10/99. I suppose even that is fairly modern (by the
standards of CLC newsgroup regs).

Obviously, the algorithm goes much further back than that.

See: https://en.wikipedia.org/wiki/Christian_Zeller

Julius Christian Johannes Zeller (24 June 1822, M�hlhausen am Neckar ? 31
May 1899, Cannstatt)

--
Modern Conservative: Someone who can take time out from demanding more
flag burning laws, more abortion laws, more drug laws, more obscenity
laws, and more police authority to make warrantless arrests to remind
us that we need to "get the government off our backs".

Re: getFirstDayOfMonth()

<bvGFN.115186$m4d.73986@fx43.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34149&group=comp.lang.c#34149

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx43.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: getFirstDayOfMonth()
Newsgroups: comp.lang.c
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com> <urteto$1e55r$1@dont-email.me> <7VrEN.517245$xHn7.96511@fx14.iad> <urtq7q$1ggh0$1@dont-email.me> <pZGEN.500996$7sbb.11881@fx16.iad> <us00f7$21v55$1@dont-email.me> <87ttloqnnk.fsf@nosuchdomain.example.com> <us507s$38rq1$1@dont-email.me> <tCnFN.138324$t8cc.53416@fx06.iad> <us5mj5$3dckj$1@dont-email.me>
Lines: 20
Message-ID: <bvGFN.115186$m4d.73986@fx43.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 05 Mar 2024 15:03:35 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 05 Mar 2024 15:03:35 GMT
X-Received-Bytes: 1544
 by: Scott Lurndal - Tue, 5 Mar 2024 15:03 UTC

porkchop@invalid.foo (Mike Sanders) writes:
>Scott Lurndal <scott@slp53.sl.home> wrote:
>
>> POSIX defines 0 as a successful status "for shell commmands", in
>> the context of this discussion.
>
>Sure enough & Keith as well. Cobbled together a simple solution
>just display more informative error messages as well as sticking
>to zero/one. This satisfies scripting in the unix world:
>
>[ dates -op1 -op2 file || echo no banana ]

One performance note about this.

'[' does a PATH lookup, finding a utility
(actually a link to the 'test' utility) followed by fork(2)
and exec(2)).

'[[' is built into the shell, so more efficient.

Re: getFirstDayOfMonth()

<PwGFN.115187$m4d.39460@fx43.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34150&group=comp.lang.c#34150

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx43.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: getFirstDayOfMonth()
Newsgroups: comp.lang.c
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com> <urteto$1e55r$1@dont-email.me> <7VrEN.517245$xHn7.96511@fx14.iad> <urtq7q$1ggh0$1@dont-email.me> <pZGEN.500996$7sbb.11881@fx16.iad> <us00f7$21v55$1@dont-email.me> <us1ein$2dfo0$1@dont-email.me> <us53ei$3993i$3@dont-email.me> <87le6xr4r2.fsf@nosuchdomain.example.com> <us5pl8$3dsgj$1@dont-email.me> <20240304170756.995@kylheku.com>
Lines: 27
Message-ID: <PwGFN.115187$m4d.39460@fx43.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 05 Mar 2024 15:05:19 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 05 Mar 2024 15:05:19 GMT
X-Received-Bytes: 1954
 by: Scott Lurndal - Tue, 5 Mar 2024 15:05 UTC

Kaz Kylheku <433-929-6894@kylheku.com> writes:
>On 2024-03-05, Mike Sanders <porkchop@invalid.foo> wrote:
>> Interesting stuff. The main thing with me is to (under Windows at least)
>> facilitate an easier way to use my tool in an automated way.
>>
>> The GetExitCodeProcess function documentation specifies that the ExitCode
>> is a "DWORD 32-bits integer". This means that from cmd.exe point of view
>> (remember, cmd.exe *is the primary interface* or shell under win):
>>
>> (emphasis mine)
>>
>> *****
>> an .exe program may return as %ERRORLEVEL% a value from -2147483648 to
>> 2147483647
>> *****
>
>Your reasoning is far from air tight here.
>
>Consider that on Unix, the exit system call takes an "int". Does that
>mean that any value from INT_MIN to INT_MAX will be passed through
>cleanly as a termination status?
>
>For monitoring the status of a child process, you can use waitpid.
>Again, that takes a pointer to an int.

POSIX also supports waitid() which does return the entire
'int' exit code.

Re: getFirstDayOfMonth()

<ayGFN.115188$m4d.8353@fx43.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34151&group=comp.lang.c#34151

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx43.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: getFirstDayOfMonth()
Newsgroups: comp.lang.c
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com> <urteto$1e55r$1@dont-email.me> <7VrEN.517245$xHn7.96511@fx14.iad> <urtq7q$1ggh0$1@dont-email.me> <pZGEN.500996$7sbb.11881@fx16.iad> <us00f7$21v55$1@dont-email.me> <87ttloqnnk.fsf@nosuchdomain.example.com> <us22ac$2hp4u$1@dont-email.me> <us50mq$38rq1$2@dont-email.me> <VHnFN.393318$Ama9.190889@fx12.iad> <us52t1$3993i$2@dont-email.me> <2noFN.519729$xHn7.255625@fx14.iad> <us5ut2$3en3p$1@dont-email.me>
Lines: 23
Message-ID: <ayGFN.115188$m4d.8353@fx43.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Tue, 05 Mar 2024 15:06:46 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Tue, 05 Mar 2024 15:06:46 GMT
X-Received-Bytes: 1916
 by: Scott Lurndal - Tue, 5 Mar 2024 15:06 UTC

Janis Papanagnou <janis_papanagnou+ng@hotmail.com> writes:
>On 04.03.2024 19:26, Scott Lurndal wrote:
>> porkchop@invalid.foo (Mike Sanders) writes:
>>> Scott Lurndal <scott@slp53.sl.home> wrote:
>>>
>>>> As someone who started using unix in an environment where there
>>>> was only one case, I find I prefer lower-case option
>>>> flags, simply because they're easier to type.
>>>>
>>>> (In the old days, to type upper-case characters on a teletype
>>>> required prefixing each upper-case character with a backslash
>>>> character - and the terminal driver would display uppercase
>>>> with the prefix).
>>>
>>> Wow, chuckle, really made you work hard for the results!
>>
>> It does explain why CamelCase never gained traction in Unix.
>
>You mean in Unix commands, or in the Unix source code,

Yes, much of which was written on a teletype originally.

I've seen plenty of camelcase in application code.

Re: getFirstDayOfMonth()

<87ttlkpe0z.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34156&group=comp.lang.c#34156

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Tue, 05 Mar 2024 13:25:16 -0800
Organization: None to speak of
Lines: 37
Message-ID: <87ttlkpe0z.fsf@nosuchdomain.example.com>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com>
<urteto$1e55r$1@dont-email.me> <7VrEN.517245$xHn7.96511@fx14.iad>
<urtq7q$1ggh0$1@dont-email.me> <pZGEN.500996$7sbb.11881@fx16.iad>
<us00f7$21v55$1@dont-email.me>
<87ttloqnnk.fsf@nosuchdomain.example.com>
<us507s$38rq1$1@dont-email.me> <tCnFN.138324$t8cc.53416@fx06.iad>
<us5mj5$3dckj$1@dont-email.me> <bvGFN.115186$m4d.73986@fx43.iad>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="1a8f7ad2f6e687631fe43fc4c823263c";
logging-data="4173432"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/7Eot12mvHGQxmniHKeq+P"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:hZHMJbHmlejBq6zdGz9UnJjKOBs=
sha1:cbJ5ReARI8FLZIfZm96WkDjs4FM=
 by: Keith Thompson - Tue, 5 Mar 2024 21:25 UTC

scott@slp53.sl.home (Scott Lurndal) writes:
> porkchop@invalid.foo (Mike Sanders) writes:
>>Scott Lurndal <scott@slp53.sl.home> wrote:
>>
>>> POSIX defines 0 as a successful status "for shell commmands", in
>>> the context of this discussion.
>>
>>Sure enough & Keith as well. Cobbled together a simple solution
>>just display more informative error messages as well as sticking
>>to zero/one. This satisfies scripting in the unix world:
>>
>>[ dates -op1 -op2 file || echo no banana ]
>
> One performance note about this.
>
> '[' does a PATH lookup, finding a utility
> (actually a link to the 'test' utility) followed by fork(2)
> and exec(2)).
>
> '[[' is built into the shell, so more efficient.

'[' is typically both a shell builtin (in bash, ksh, zsh) and an
executable (/usr/bin/[ and/or /bin/[).

'[[', in shells where it exists, is a pure builtin and not also an
executable.

In any case, there's no reason to use '[' in the above command, and in
fact it's a syntax error. It may be a result of the common
misconception that '[' and ']' are part of the syntax of a shell 'if'
statement. The performance of '[' doesn't matter if it's being used
incorrectly.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: getFirstDayOfMonth()

<usakbd$k2eb$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34185&group=comp.lang.c#34185

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nntp.mbo...@spamgourmet.com (Mark Bourne)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Wed, 6 Mar 2024 20:40:10 +0000
Organization: A noiseless patient Spider
Lines: 43
Message-ID: <usakbd$k2eb$1@dont-email.me>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com>
<urteto$1e55r$1@dont-email.me> <7VrEN.517245$xHn7.96511@fx14.iad>
<urtq7q$1ggh0$1@dont-email.me> <pZGEN.500996$7sbb.11881@fx16.iad>
<us00f7$21v55$1@dont-email.me> <87ttloqnnk.fsf@nosuchdomain.example.com>
<us22ac$2hp4u$1@dont-email.me> <us50mq$38rq1$2@dont-email.me>
<us5u51$3ejjp$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 6 Mar 2024 20:40:13 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="de0fa98a282b036f5968ee0873aeeb9a";
logging-data="657867"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/p4/AOxvxkApUFksA6g0Zk"
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101
SeaMonkey/2.53.18
Cancel-Lock: sha1:GwNWwgUms2lFZHdY3+Fz8nO5db8=
In-Reply-To: <us5u51$3ejjp$1@dont-email.me>
 by: Mark Bourne - Wed, 6 Mar 2024 20:40 UTC

Janis Papanagnou wrote:
> On 04.03.2024 18:34, Mike Sanders wrote:
>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>>
>>> The "problem" is that you may want to have -h as an option character,
>>> especially if your program supports a lot of options and you have no
>>> creative naming way of choosing another character. (An example from
>>> one of my recent implementations is using -h for 'height'.[*])
>>
>> This is my rationale as well: All of the switches have a more/or less
>> mnemonic feel -X (eXport), -H (Holiday), -C (Calendar), -M (Manual).
>>
>> I thought it made good sense at least.
>
> Yes, of course it does. Most software developers obviously try
> to choose memorable mnemonics. (Imagine we'd have -o1 -o2 -o3
> ..., or -a -b -c ..., as option interface design rules.)
>
> I wonder, though, my you've chosen letters in caps; I'd avoided
> the additional <shift> key press. (First I thought it might be
> some Windows/DOS restriction or so.)

From what I've seen, usage help for Windows commands typically shows
options in uppercase, although they tend to be interpreted
case-insensitively (just as file names are on Windows). Windows
utilities also typically use "/" rather than "-" to indicate options (at
least before PowerShell). So "-x" for a *nix utility would more
typically be "/X" for a Windows utility (but typing "/x" would also work).

It's also quite common for Windows utilities to use "/?" rather than
"/H" to get usage help, which might be where the "-?" idea came from
(which I think I saw somewhere earlier in this thread).

Of course, on both platforms, it's up to application code to interpret
the options passed on the command line. There's nothing to stop a
Windows utility from using "-x", or a *nix utility using "/X" - and a
utility ported from one platform to the other might stick with the
option style from the original platform. Using "/" to indicate options
on *nix might cause problems for anyone wanting to pass an absolute
path, though...

--
Mark.

Re: getFirstDayOfMonth()

<AK4GN.403025$Ama9.139980@fx12.iad>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34186&group=comp.lang.c#34186

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!peer02.iad!feed-me.highwinds-media.com!news.highwinds-media.com!fx12.iad.POSTED!not-for-mail
X-newsreader: xrn 9.03-beta-14-64bit
Sender: scott@dragon.sl.home (Scott Lurndal)
From: sco...@slp53.sl.home (Scott Lurndal)
Reply-To: slp53@pacbell.net
Subject: Re: getFirstDayOfMonth()
Newsgroups: comp.lang.c
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com> <urteto$1e55r$1@dont-email.me> <7VrEN.517245$xHn7.96511@fx14.iad> <urtq7q$1ggh0$1@dont-email.me> <pZGEN.500996$7sbb.11881@fx16.iad> <us00f7$21v55$1@dont-email.me> <87ttloqnnk.fsf@nosuchdomain.example.com> <us22ac$2hp4u$1@dont-email.me> <us50mq$38rq1$2@dont-email.me> <us5u51$3ejjp$1@dont-email.me> <usakbd$k2eb$1@dont-email.me>
Lines: 49
Message-ID: <AK4GN.403025$Ama9.139980@fx12.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 06 Mar 2024 20:54:56 UTC
Organization: UsenetServer - www.usenetserver.com
Date: Wed, 06 Mar 2024 20:54:56 GMT
X-Received-Bytes: 2958
 by: Scott Lurndal - Wed, 6 Mar 2024 20:54 UTC

Mark Bourne <nntp.mbourne@spamgourmet.com> writes:
>Janis Papanagnou wrote:
>> On 04.03.2024 18:34, Mike Sanders wrote:
>>> Janis Papanagnou <janis_papanagnou+ng@hotmail.com> wrote:
>>>
>>>> The "problem" is that you may want to have -h as an option character,
>>>> especially if your program supports a lot of options and you have no
>>>> creative naming way of choosing another character. (An example from
>>>> one of my recent implementations is using -h for 'height'.[*])
>>>
>>> This is my rationale as well: All of the switches have a more/or less
>>> mnemonic feel -X (eXport), -H (Holiday), -C (Calendar), -M (Manual).
>>>
>>> I thought it made good sense at least.
>>
>> Yes, of course it does. Most software developers obviously try
>> to choose memorable mnemonics. (Imagine we'd have -o1 -o2 -o3
>> ..., or -a -b -c ..., as option interface design rules.)
>>
>> I wonder, though, my you've chosen letters in caps; I'd avoided
>> the additional <shift> key press. (First I thought it might be
>> some Windows/DOS restriction or so.)
>
> From what I've seen, usage help for Windows commands typically shows
>options in uppercase, although they tend to be interpreted
>case-insensitively (just as file names are on Windows). Windows
>utilities also typically use "/" rather than "-" to indicate options (at
>least before PowerShell). So "-x" for a *nix utility would more
>typically be "/X" for a Windows utility (but typing "/x" would also work).

Ah, Powershell. The COBOL of scripting languages.
>
>It's also quite common for Windows utilities to use "/?" rather than
>"/H" to get usage help, which might be where the "-?" idea came from
>(which I think I saw somewhere earlier in this thread).

In my experience, the '-?' is derived from the getopt(3) semantics
where it returns the option character '?' for any undefined
option flags.

Which means that

switch (getopt(...)) {
case '?':
usage();
break;
}

handles both -? and any undefined flags.

Re: getFirstDayOfMonth()

<usranh$pftj$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34330&group=comp.lang.c#34330

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Wed, 13 Mar 2024 05:40:19 +0100
Organization: A noiseless patient Spider
Lines: 19
Message-ID: <usranh$pftj$1@dont-email.me>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com>
<uru0k6$1hpdi$1@dont-email.me> <cleibk-jk1.ln1@hendrix.foo>
<us765i$3pbtq$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 13 Mar 2024 04:40:18 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="94d36218a310ef5cc776e2007c9d4c70";
logging-data="835507"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18NkRTCj77FBP8bmJTAqc/Q"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock: sha1:S0VQwUQJCIgfmfN18GJaTkp64+E=
In-Reply-To: <us765i$3pbtq$1@dont-email.me>
 by: jak - Wed, 13 Mar 2024 04:40 UTC

bart ha scritto:
> For most practical purposes and for the lifetimes of most of the 8
> billion people on the planet, leap years do come every four years.
>
> That's the case for years 1901 to 2099.
>
> What exactly do you expect those news readers that reach a massive
> audience to do, get into those details of being divisible or not by 100
> or 400? Maybe they should also mention odd years like 1752 where there
> was a calendar reform for even more exceptions to the rule.
>
> Half the audience probably barely know what a leap year is.

You are right, but this usenet is followed by people, professionals and
computer enthusiasts. I would like to try to make a statistics but I
think at least 70% read somewhere how to determine if a year is a leap.
I, example, discovered this by writing my first management program in
Rmcobol almost 40 years ago.

Re: getFirstDayOfMonth()

<usrbv1$pmv9$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34331&group=comp.lang.c#34331

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: nos...@please.ty (jak)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Wed, 13 Mar 2024 06:01:22 +0100
Organization: A noiseless patient Spider
Lines: 30
Message-ID: <usrbv1$pmv9$1@dont-email.me>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com>
<uru0k6$1hpdi$1@dont-email.me> <cleibk-jk1.ln1@hendrix.foo>
<us765i$3pbtq$1@dont-email.me> <usranh$pftj$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Wed, 13 Mar 2024 05:01:21 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="94d36218a310ef5cc776e2007c9d4c70";
logging-data="842729"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+g0WIOapypbhyU2lm5QiSC"
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101
Firefox/91.0 SeaMonkey/2.53.18.1
Cancel-Lock: sha1:4keUhgBuKmS3Bfcadk+ndndqLcs=
In-Reply-To: <usranh$pftj$1@dont-email.me>
 by: jak - Wed, 13 Mar 2024 05:01 UTC

jak ha scritto:
> bart ha scritto:
>> For most practical purposes and for the lifetimes of most of the 8
>> billion people on the planet, leap years do come every four years.
>>
>> That's the case for years 1901 to 2099.
>>
>> What exactly do you expect those news readers that reach a massive
>> audience to do, get into those details of being divisible or not by
>> 100 or 400? Maybe they should also mention odd years like 1752 where
>> there was a calendar reform for even more exceptions to the rule.
>>
>> Half the audience probably barely know what a leap year is.
>
>
> You are right, but this usenet is followed by people, professionals and
> computer enthusiasts. I would like to try to make a statistics but I
> think at least 70% read somewhere how to determine if a year is a leap.
> I, example, discovered this by writing my first management program in
> Rmcobol almost 40 years ago.

Instead, I would be curious to understand why nobody follows a standard
about the dates. Let's take this date for example: January 1, 1580.
On the web 50% of the sites searched with "day of week calculator" say
that the day was Tuesday while the others say it was Friday. Excel and
Calc (OpenOffice) say it was Friday and the same says "cal" on *nix if
the "--iso" option is not used. So, someone follows the ISO convention
and others Julian but I read somewhere that the ISO convention had to be
followed in the computer scope.

Re: getFirstDayOfMonth()

<8mNE3wTqvNvro8cZV@bongo-ra.co>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34338&group=comp.lang.c#34338

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: spi...@gmail.com (Spiros Bousbouras)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Wed, 13 Mar 2024 13:38:36 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <8mNE3wTqvNvro8cZV@bongo-ra.co>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com> <uru0k6$1hpdi$1@dont-email.me>
<cleibk-jk1.ln1@hendrix.foo> <us765i$3pbtq$1@dont-email.me> <usranh$pftj$1@dont-email.me>
<usrbv1$pmv9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
Injection-Date: Wed, 13 Mar 2024 13:38:36 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="e8c6dda9417e0239f3e38398781d261d";
logging-data="1036935"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/4Qe95zoE4/eMwGsulqFS7"
Cancel-Lock: sha1:So5KSdlKihKIxR/EXEBMK5MAvuc=
X-Organisation: Weyland-Yutani
In-Reply-To: <usrbv1$pmv9$1@dont-email.me>
X-Server-Commands: nowebcancel
 by: Spiros Bousbouras - Wed, 13 Mar 2024 13:38 UTC

On Wed, 13 Mar 2024 06:01:22 +0100
jak <nospam@please.ty> wrote:
> Instead, I would be curious to understand why nobody follows a standard
> about the dates. Let's take this date for example: January 1, 1580.
> On the web 50% of the sites searched with "day of week calculator" say
> that the day was Tuesday while the others say it was Friday. Excel and
> Calc (OpenOffice) say it was Friday and the same says "cal" on *nix if
> the "--iso" option is not used. So, someone follows the ISO convention
> and others Julian but I read somewhere that the ISO convention had to be
> followed in the computer scope.

For the year 1580 what would be the appropriate standard ? I don't see any
point using a modern standard for 1580. The day of the week is a cultural
matter depending on era and location so what useful cultural information
would you get by knowing that according to a modern standard , January 1
1580 was whatever day ?

Re: getFirstDayOfMonth()

<87o7bi6vxh.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34339&group=comp.lang.c#34339

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Wed, 13 Mar 2024 07:36:10 -0700
Organization: None to speak of
Lines: 46
Message-ID: <87o7bi6vxh.fsf@nosuchdomain.example.com>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com>
<uru0k6$1hpdi$1@dont-email.me> <cleibk-jk1.ln1@hendrix.foo>
<us765i$3pbtq$1@dont-email.me> <usranh$pftj$1@dont-email.me>
<usrbv1$pmv9$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="3a33dee2b2d0e1e9aaa54021fdfdfa61";
logging-data="1057757"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/+liTQ1Xa3KUE0sZnvSg8P"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:UyBTzVeGf17OxaG2WjANzmgbLtc=
sha1:Yt2PDaAmptUaPXVxfnwKj29gRCo=
 by: Keith Thompson - Wed, 13 Mar 2024 14:36 UTC

jak <nospam@please.ty> writes:
> jak ha scritto:
>> bart ha scritto:
>>> For most practical purposes and for the lifetimes of most of the 8
>>> billion people on the planet, leap years do come every four years.
>>>
>>> That's the case for years 1901 to 2099.
>>>
>>> What exactly do you expect those news readers that reach a massive
>>> audience to do, get into those details of being divisible or not by
>>> 100 or 400? Maybe they should also mention odd years like 1752
>>> where there was a calendar reform for even more exceptions to the
>>> rule.
>>>
>>> Half the audience probably barely know what a leap year is.
>>
>> You are right, but this usenet is followed by people, professionals and
>> computer enthusiasts. I would like to try to make a statistics but I
>> think at least 70% read somewhere how to determine if a year is a leap.
>> I, example, discovered this by writing my first management program in
>> Rmcobol almost 40 years ago.
>
> Instead, I would be curious to understand why nobody follows a standard
> about the dates. Let's take this date for example: January 1, 1580.
> On the web 50% of the sites searched with "day of week calculator" say
> that the day was Tuesday while the others say it was Friday. Excel and
> Calc (OpenOffice) say it was Friday and the same says "cal" on *nix if
> the "--iso" option is not used. So, someone follows the ISO convention
> and others Julian but I read somewhere that the ISO convention had to be
> followed in the computer scope.

Where did you read that? ISO has no police force. Anyone writing a
program or a web page can do whatever they like. Sure, some things you
can do with a web page might be illegal, but using a non-ISO calendar
standard isn't one of them.

As you probably know, the transition from the Julian to the Gregorian
calendar happened at different times in different parts of the world:
1582 in Roman Catholic countries, 1752 in Britain and its posessions
(including what later became the US), and as late as the 1920s in some
places. (The "cal" command on my system has no "--iso" option.)

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: getFirstDayOfMonth()

<87bk7i6smy.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34344&group=comp.lang.c#34344

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Wed, 13 Mar 2024 08:47:17 -0700
Organization: None to speak of
Lines: 32
Message-ID: <87bk7i6smy.fsf@nosuchdomain.example.com>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com>
<uru0k6$1hpdi$1@dont-email.me> <cleibk-jk1.ln1@hendrix.foo>
<us765i$3pbtq$1@dont-email.me> <usranh$pftj$1@dont-email.me>
<usrbv1$pmv9$1@dont-email.me> <8mNE3wTqvNvro8cZV@bongo-ra.co>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="3a33dee2b2d0e1e9aaa54021fdfdfa61";
logging-data="1084707"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19RmMeZNTsB1lIs573VL0EW"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:7vEIHzIks2dC9p/0D5enRJg11Mk=
sha1:70nmIimFLjbEMyL9vmMS85qRFLU=
 by: Keith Thompson - Wed, 13 Mar 2024 15:47 UTC

Spiros Bousbouras <spibou@gmail.com> writes:
> On Wed, 13 Mar 2024 06:01:22 +0100
> jak <nospam@please.ty> wrote:
>> Instead, I would be curious to understand why nobody follows a standard
>> about the dates. Let's take this date for example: January 1, 1580.
>> On the web 50% of the sites searched with "day of week calculator" say
>> that the day was Tuesday while the others say it was Friday. Excel and
>> Calc (OpenOffice) say it was Friday and the same says "cal" on *nix if
>> the "--iso" option is not used. So, someone follows the ISO convention
>> and others Julian but I read somewhere that the ISO convention had to be
>> followed in the computer scope.
>
> For the year 1580 what would be the appropriate standard ? I don't see any
> point using a modern standard for 1580. The day of the week is a cultural
> matter depending on era and location so what useful cultural information
> would you get by knowing that according to a modern standard , January 1
> 1580 was whatever day ?

There's something called the proleptic Gregorian calendar, produced by
extending the rules for the Gregorian calendar back to dates preceding
its introduction. It's used fairly widely.

https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar

Note also that in the US consider George Washington's birthday is
considered to be February 22 (NS, new style), even though that date was
February 11 (OS) under the Julian calender then in effect.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: getFirstDayOfMonth()

<8734su6rio.fsf@nosuchdomain.example.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34347&group=comp.lang.c#34347

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: Keith.S....@gmail.com (Keith Thompson)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Wed, 13 Mar 2024 09:11:27 -0700
Organization: None to speak of
Lines: 17
Message-ID: <8734su6rio.fsf@nosuchdomain.example.com>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com>
<uru0k6$1hpdi$1@dont-email.me> <cleibk-jk1.ln1@hendrix.foo>
<us765i$3pbtq$1@dont-email.me> <usranh$pftj$1@dont-email.me>
<usrbv1$pmv9$1@dont-email.me> <8mNE3wTqvNvro8cZV@bongo-ra.co>
<87bk7i6smy.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain
Injection-Info: dont-email.me; posting-host="3a33dee2b2d0e1e9aaa54021fdfdfa61";
logging-data="1091087"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1//uwnXBwXIz1bf5ICpCiS2"
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
Cancel-Lock: sha1:GiSm/lU3fHteYWx8ndyDDFpHHjc=
sha1:c/GsvFTNymb3BumU4UU2VrecMFI=
 by: Keith Thompson - Wed, 13 Mar 2024 16:11 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:
[...]
> Note also that in the US consider George Washington's birthday is
> considered to be February 22 (NS, new style), even though that date was
> February 11 (OS) under the Julian calender then in effect.

Some day I'll learn to re-read after editing and avoid word jumbles like
the above.

Note also that in the US George Washington's birthday is considered to
be February 22 (NS, new style), even though that date was February 11
(OS) under the Julian calender then in effect.

--
Keith Thompson (The_Other_Keith) Keith.S.Thompson+u@gmail.com
Working, but not speaking, for Medtronic
void Void(void) { Void(); } /* The recursive call of the void */

Re: getFirstDayOfMonth()

<86msr0pgjx.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34377&group=comp.lang.c#34377

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Thu, 14 Mar 2024 15:57:54 -0700
Organization: A noiseless patient Spider
Lines: 44
Message-ID: <86msr0pgjx.fsf@linuxsc.com>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com> <urteto$1e55r$1@dont-email.me> <7VrEN.517245$xHn7.96511@fx14.iad> <urtq7q$1ggh0$1@dont-email.me> <pZGEN.500996$7sbb.11881@fx16.iad> <us00f7$21v55$1@dont-email.me> <87ttloqnnk.fsf@nosuchdomain.example.com> <us507s$38rq1$1@dont-email.me> <us5e0k$37ho2$1@dont-email.me> <20240305003723.000045a3@yahoo.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="c73a7ccbfb7c95d529f92c065d1adb1d";
logging-data="1995588"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/frQnfyCMlAfcGS70/2MC7cQnaZPbEyN8="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:a+pxtb3PyVnuHfDbDfi7aEX2CDI=
sha1:wFz7A3+Pow/NaK6gr8wb8DuY/UM=
 by: Tim Rentsch - Thu, 14 Mar 2024 22:57 UTC

Michael S <already5chosen@yahoo.com> writes:

> On Mon, 4 Mar 2024 21:21:25 -0000 (UTC)
> Lew Pitcher <lew.pitcher@digitalfreehold.ca> wrote:
[...]
>> If you want to /guarantee/ that the return value of strcmp()
>> is -1, 0, or +1 (for "less than", "equal to", or "greater than")
>> you will have to process the return value with something like
>>
>> /*
>> ** Returns -1 if argument < 0, 0 if argument == 0, 1 if argument > 0
>> */
>> int iSignOf(int valu)
>> {
>> return ((valu > 0) - (valu < 0));
>> }
>
> Too tricky to my liking.
> I'd rather write straight-forward code and let compiler to figure
> out the best sequence.
>
> int iSignOf(int val)
> {
> if (val < 0)
> return -1;
> if (val > 0)
> return +1;
> return 0;
> }

I've seen the idiomatic form before, and my reaction to it is
more of it being overly cute than overly tricky. That said,
it is a bit on the tricky side; even so, I'm not sure the cure
suggested is much better than the disease. I would simply write
a single return statement:

return val < 0 ? -1 : val > 0 ? 1 : 0;

(possibly condensed to take advantage of the 0/1 result of the
"greater than" operator for non-negative operands).

I suppose some people prefer the multiple return form to the ?:
form, although I'm not sure why except perhaps as a carryover
from earlier experience.

Re: getFirstDayOfMonth()

<86bk7gp5ii.fsf@linuxsc.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=34386&group=comp.lang.c#34386

  copy link   Newsgroups: comp.lang.c
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: tr.17...@z991.linuxsc.com (Tim Rentsch)
Newsgroups: comp.lang.c
Subject: Re: getFirstDayOfMonth()
Date: Thu, 14 Mar 2024 19:56:21 -0700
Organization: A noiseless patient Spider
Lines: 15
Message-ID: <86bk7gp5ii.fsf@linuxsc.com>
References: <urrj5l$124o9$1@dont-email.me> <urssrf$1vntr$1@news.xmission.com> <uru0k6$1hpdi$1@dont-email.me> <cleibk-jk1.ln1@hendrix.foo> <us765i$3pbtq$1@dont-email.me> <usranh$pftj$1@dont-email.me> <usrbv1$pmv9$1@dont-email.me> <87o7bi6vxh.fsf@nosuchdomain.example.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: dont-email.me; posting-host="ebc16c50d4d7433bc8cd997a3211d402";
logging-data="2194720"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX197iZ4SW1KEn6Z8yhq/Moyz3cZ2037+UTs="
User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.4 (gnu/linux)
Cancel-Lock: sha1:nirZHB5zEYHMmHCKUpH0sddLWhQ=
sha1:Sw3NiVVmWfNuOQlwZuXnH+2ygrU=
 by: Tim Rentsch - Fri, 15 Mar 2024 02:56 UTC

Keith Thompson <Keith.S.Thompson+u@gmail.com> writes:

> jak <nospam@please.ty> writes:

[about different date formats]

>> So, someone follows the ISO convention and others Julian but I
>> read somewhere that the ISO convention had to be followed in the
>> computer scope.
>
> Where did you read that? ISO has no police force. [...]

Note that there are organizations that mandate compliance with
some ISO standards under certain circumstances even though the
organizations themselves have no direct relationship with ISO.

Pages:1234
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor