Re: The joy of FORTRAN

Liste des GroupesRevenir à col misc 
Sujet : Re: The joy of FORTRAN
De : tnp (at) *nospam* invalid.invalid (The Natural Philosopher)
Groupes : alt.folklore.computers comp.os.linux.misc
Date : 05. Mar 2025, 02:26:08
Autres entêtes
Organisation : A little, after lunch
Message-ID : <vq897h$241b2$10@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
User-Agent : Mozilla Thunderbird
On 04/03/2025 14:53, Niklas Karlsson wrote:
On 2025-03-04, The Natural Philosopher <tnp@invalid.invalid> wrote:
On 04/03/2025 12:25, Niklas Karlsson wrote:
On 2025-03-04, The Natural Philosopher <tnp@invalid.invalid> wrote:
On 04/03/2025 06:25, rbowman wrote:
On Mon, 3 Mar 2025 23:02:44 -0500, c186282 wrote:
>
      It's easy to kinda drift into that during development, you always
      think of ONE more thing you need to pass. However stage two, you put
      all that crap in a struct and pass one pointer. Each function can
      extract what it needs from that struct and ignore the rest.
>
I never made it to anywhere close to 60 parameters. We did have one
utility that took 22 command line parameters but it was never meant to be
invoked manually and came with a csh. Even then they all were stuffed into
a struct before the real function was called.
>
Even worse, the parameters were field widths in a positional record. I
truly hate positional records but the damn things live on.
len=sprintf(query,"insert into day set
timestamp='%s',demand='%f',frequency='%f',coal='%f',nuclear='%f',ccgt='%f',ocgt='%f',french_ict='%f',
irish_ict='%f', dutch_ict='%f', ew_ict= '%f',
pumped='%f',hydro='%f',wind='%f',oil='%f',other='%f', north_south='%f',
scotland_england='%f', solar='%f', biomass='%f', nemo='%f',ifa2='%f',
nsl='%f', intelec_ict='%f',vkl_ict=%f",
timestr,total,frequency,coal,
nuclear,ccgt,ocgt,france,ireland,holland,ew,pumped,hydro,wind,oil,other,north_south,scotland_england,
solar, biomass,nemo,ifa2,nsl,intelec,vkl );
>
Not a terribly safe way to build a query. Any database API worth its
salt should have a way to build one with placeholders instead, so the
parameters automatically get special characters escaped and are
generally safer from malicious data.
>
Silly boy. The data is precisely known, and it is all floating point
numbers.
 I see a %s in there, and you are far too trusting. It's not like making
a placeholder call is any more difficult anyhow.
 
The %s is a time string., Utterly predictable in format and not accessible publicly.
time_t t1;
char timestr[256];
int len;
t1=time(NULL); // get current time.
strftime(timestr,254,"%Y-%m-%d %H:%M:%S",gmtime(&t1)); // into SQL format..
Have you ever dine any real life coding, or are you just a computer scientist?

Niklas
--
The lifetime of any political organisation is about three years before its been subverted by the people it tried to warn you about.
Anon.

Date Sujet#  Auteur
29 Sep 24 * Re: The joy of FORTRAN1568186282@ud0s4.net
29 Sep 24 `* Re: The joy of FORTRAN1567Lawrence D'Oliveiro
29 Sep 24  +* Re: The joy of FORTRAN1505rbowman
30 Sep 24  i+- Re: The joy of FORTRAN1Lawrence D'Oliveiro
30 Sep 24  i+* Re: The joy of FORTRAN685186282@ud0s4.net
30 Sep 24  ii`* Re: The joy of FORTRAN684rbowman
30 Sep 24  ii +* Re: The joy of FORTRAN2Lawrence D'Oliveiro
30 Sep 24  ii i`- Re: The joy of FORTRAN1rbowman
30 Sep 24  ii +* Re: The joy of FORTRAN574The Natural Philosopher
30 Sep 24  ii i+* Re: The joy of FORTRAN571Peter Flass
1 Oct 24  ii ii`* Re: The joy of FORTRAN570Stefan Ram
2 Oct 24  ii ii +* Re: The joy of FORTRAN2186282@ud0s4.net
3 Oct 24  ii ii i`- Re: The joy of FORTRAN1moi
25 Feb 25  ii ii `* Re: The joy of FORTRAN567vjp2.at
25 Feb 25  ii ii  +* Re: The joy of FORTRAN378Lawrence D'Oliveiro
25 Feb 25  ii ii  i`* Re: The joy of FORTRAN377Peter Flass
25 Feb 25  ii ii  i +* Re: The joy of FORTRAN369John Ames
25 Feb 25  ii ii  i i+* Re: The joy of FORTRAN236John Ames
25 Feb 25  ii ii  i ii+* Re: The joy of FORTRAN225Peter Flass
26 Feb 25  ii ii  i iii`* Re: The joy of FORTRAN224Lawrence D'Oliveiro
26 Feb 25  ii ii  i iii +* Re: The joy of FORTRAN219John Ames
26 Feb 25  ii ii  i iii i`* Re: The joy of FORTRAN218Lawrence D'Oliveiro
26 Feb 25  ii ii  i iii i +- Re: The joy of FORTRAN1John Ames
27 Feb 25  ii ii  i iii i `* Re: The joy of FORTRAN216Rich Alderson
27 Feb 25  ii ii  i iii i  +* Re: The joy of FORTRAN2Lawrence D'Oliveiro
28 Feb 25  ii ii  i iii i  i`- Re: The joy of FORTRAN1Rich Alderson
27 Feb 25  ii ii  i iii i  `* Re: The joy of FORTRAN213John Ames
27 Feb 25  ii ii  i iii i   +* Re: the end of 18 bits, The joy of FORTRAN6John Levine
27 Feb 25  ii ii  i iii i   i+- Re: the end of 18 bits, The joy of FORTRAN1Lawrence D'Oliveiro
28 Feb 25  ii ii  i iii i   i+* Re: the end of 18 bits, The joy of FORTRAN2John Levine
28 Feb 25  ii ii  i iii i   ii`- Re: the end of 18 bits, The joy of FORTRAN1John Levine
28 Feb 25  ii ii  i iii i   i`* Re: the end of 18 bits, The joy of FORTRAN2Chris Ahlstrom
1 Mar 25  ii ii  i iii i   i `- Re: the end of 18 bits, The joy of FORTRAN1c186282
7 Mar 25  ii ii  i iii i   `* Re: The joy of FORTRAN206Alfred Falk
7 Mar 25  ii ii  i iii i    `* Re: The joy of FORTRAN205Dan Cross
7 Mar 25  ii ii  i iii i     +- Re: The joy of FORTRAN1Lynn Wheeler
7 Mar 25  ii ii  i iii i     `* Re: The joy of FORTRAN203rbowman
8 Mar 25  ii ii  i iii i      +* Re: The joy of FORTRAN3Dan Cross
8 Mar 25  ii ii  i iii i      i`* Re: The joy of FORTRAN2ted@loft.tnolan.com (Ted Nolan
8 Mar 25  ii ii  i iii i      i `- Re: The joy of FORTRAN1rbowman
8 Mar 25  ii ii  i iii i      `* Re: The joy of FORTRAN199c186282
8 Mar 25  ii ii  i iii i       `* Re: The joy of FORTRAN198rbowman
8 Mar 25  ii ii  i iii i        +* Re: The joy of FORTRAN75rbowman
8 Mar 25  ii ii  i iii i        i`* Re: The joy of FORTRAN74The Natural Philosopher
9 Mar 25  ii ii  i iii i        i `* Re: The joy of FORTRAN73c186282
9 Mar 25  ii ii  i iii i        i  `* Re: The joy of FORTRAN72rbowman
9 Mar 25  ii ii  i iii i        i   +* Re: The joy of FORTRAN67c186282
9 Mar 25  ii ii  i iii i        i   i+* Re: The joy of FORTRAN16rbowman
10 Mar 25  ii ii  i iii i        i   ii`* Re: The joy of FORTRAN15c186282
10 Mar 25  ii ii  i iii i        i   ii `* Re: The joy of FORTRAN14rbowman
10 Mar 25  ii ii  i iii i        i   ii  +* Re: The joy of FORTRAN7Sn!pe
10 Mar 25  ii ii  i iii i        i   ii  i+* Re: The joy of FORTRAN5rbowman
10 Mar 25  ii ii  i iii i        i   ii  ii+* Re: The joy of FORTRAN3Sn!pe
10 Mar 25  ii ii  i iii i        i   ii  iii`* Re: The joy of FORTRAN2rbowman
12 Mar 25  ii ii  i iii i        i   ii  iii `- Re: The joy of FORTRAN1c186282
12 Mar 25  ii ii  i iii i        i   ii  ii`- Re: The joy of FORTRAN1c186282
12 Mar 25  ii ii  i iii i        i   ii  i`- Re: The joy of FORTRAN1c186282
11 Mar 25  ii ii  i iii i        i   ii  `* Re: The joy of FORTRAN6c186282
11 Mar 25  ii ii  i iii i        i   ii   +- Re: The joy of FORTRAN1The Natural Philosopher
11 Mar 25  ii ii  i iii i        i   ii   `* Re: The joy of FORTRAN4rbowman
13 Mar 25  ii ii  i iii i        i   ii    `* Re: The joy of FORTRAN3c186282
13 Mar 25  ii ii  i iii i        i   ii     `* Re: The joy of FORTRAN2rbowman
13 Mar 25  ii ii  i iii i        i   ii      `- Re: The joy of FORTRAN1c186282
10 Mar 25  ii ii  i iii i        i   i`* Re: The joy of FORTRAN50Rich Alderson
10 Mar 25  ii ii  i iii i        i   i +* Re: The joy of FORTRAN10c186282
10 Mar 25  ii ii  i iii i        i   i i+* Re: The joy of FORTRAN8rbowman
10 Mar 25  ii ii  i iii i        i   i ii+- Re: The joy of FORTRAN1rbowman
12 Mar 25  ii ii  i iii i        i   i ii`* Re: The joy of FORTRAN6c186282
12 Mar 25  ii ii  i iii i        i   i ii +* Re: The joy of FORTRAN2John Ames
12 Mar 25  ii ii  i iii i        i   i ii i`- Re: The joy of FORTRAN1rbowman
12 Mar 25  ii ii  i iii i        i   i ii `* Re: The joy of FORTRAN3rbowman
12 Mar 25  ii ii  i iii i        i   i ii  `* Re: The joy of FORTRAN2Dan Cross
13 Mar 25  ii ii  i iii i        i   i ii   `- Re: The joy of FORTRAN1c186282
10 Mar 25  ii ii  i iii i        i   i i`- Re: The joy of FORTRAN1ted@loft.tnolan.com (Ted Nolan
10 Mar 25  ii ii  i iii i        i   i +* Re: The joy of FORTRAN33rbowman
10 Mar 25  ii ii  i iii i        i   i i`* Re: The joy of FORTRAN32The Natural Philosopher
10 Mar 25  ii ii  i iii i        i   i i +* Re: The joy of FORTRAN16rbowman
11 Mar 25  ii ii  i iii i        i   i i i+* Re: The joy of FORTRAN13The Natural Philosopher
11 Mar 25  ii ii  i iii i        i   i i ii+* Re: The joy of FORTRAN3rbowman
11 Mar 25  ii ii  i iii i        i   i i iii`* Re: The joy of FORTRAN2The Natural Philosopher
11 Mar 25  ii ii  i iii i        i   i i iii `- Re: The joy of FORTRAN1David LaRue
11 Mar 25  ii ii  i iii i        i   i i ii+- Re: The joy of FORTRAN1The Natural Philosopher
11 Mar 25  ii ii  i iii i        i   i i ii+- Re: The joy of FORTRAN1Lawrence D'Oliveiro
11 Mar 25  ii ii  i iii i        i   i i ii+* Re: The joy of FORTRAN4rbowman
12 Mar 25  ii ii  i iii i        i   i i iii+- Re: The joy of FORTRAN1c186282
12 Mar 25  ii ii  i iii i        i   i i iii`* Re: The joy of FORTRAN2The Natural Philosopher
12 Mar 25  ii ii  i iii i        i   i i iii `- Re: The joy of FORTRAN1The Natural Philosopher
13 Mar 25  ii ii  i iii i        i   i i ii`* Re: The joy of FORTRAN3c186282
13 Mar 25  ii ii  i iii i        i   i i ii `* Re: The joy of FORTRAN2The Natural Philosopher
14 Mar 25  ii ii  i iii i        i   i i ii  `- Re: The joy of FORTRAN1c186282
12 Mar 25  ii ii  i iii i        i   i i i`* Re: The joy of FORTRAN2c186282
12 Mar 25  ii ii  i iii i        i   i i i `- Re: The joy of FORTRAN1The Natural Philosopher
12 Mar 25  ii ii  i iii i        i   i i `* Re: The joy of FORTRAN15c186282
12 Mar 25  ii ii  i iii i        i   i i  `* Re: The joy of FORTRAN14The Natural Philosopher
12 Mar 25  ii ii  i iii i        i   i i   +- Re: The joy of FORTRAN1The Natural Philosopher
13 Mar 25  ii ii  i iii i        i   i i   `* Re: The joy of FORTRAN12rbowman
13 Mar 25  ii ii  i iii i        i   i i    +- Re: The joy of FORTRAN1rbowman
13 Mar 25  ii ii  i iii i        i   i i    +- Re: The joy of FORTRAN1rbowman
14 Mar 25  ii ii  i iii i        i   i i    +* Re: The joy of FORTRAN6Don_from_AZ
14 Mar 25  ii ii  i iii i        i   i i    i+* Re: The joy of FORTRAN2ted@loft.tnolan.com (Ted Nolan
14 Mar 25  ii ii  i iii i        i   i i    ii`- Re: The joy of FORTRAN1c186282
14 Mar 25  ii ii  i iii i        i   i i    i+* Re: The joy of FORTRAN2Lawrence D'Oliveiro
14 Mar 25  ii ii  i iii i        i   i i    i`- Re: The joy of FORTRAN1c186282
15 Mar 25  ii ii  i iii i        i   i i    `* Re: The joy of FORTRAN3Peter Flass
10 Mar 25  ii ii  i iii i        i   i `* Re: The joy of FORTRAN6Don_from_AZ
9 Mar 25  ii ii  i iii i        i   `* Re: The joy of FORTRAN4Kerr-Mudd, John
8 Mar 25  ii ii  i iii i        +* Re: The joy of FORTRAN27Dan Espen
9 Mar 25  ii ii  i iii i        +* Re: The joy of FORTRAN9c186282
9 Mar 25  ii ii  i iii i        `* Re: The joy of FORTRAN86c186282
26 Feb 25  ii ii  i iii +* Re: The joy of FORTRAN3rbowman
27 Feb 25  ii ii  i iii `- Re: The joy of FORTRAN1Rich Alderson
25 Feb 25  ii ii  i ii+- Re: The joy of FORTRAN1Peter Flass
26 Feb 25  ii ii  i ii+* Re: The joy of FORTRAN7Rich
26 Feb 25  ii ii  i ii`* Re: The joy of old small computers, which sort of ran FORTRAN2John Levine
25 Feb 25  ii ii  i i+* Re: The joy of FORTRAN101Peter Flass
26 Feb 25  ii ii  i i+* Re: The joy of FORTRAN27John Levine
26 Feb 25  ii ii  i i+* Re: The joy of FORTRAN3c186282
28 Feb 25  ii ii  i i`- Re: The joy of FORTRAN1c186282
25 Feb 25  ii ii  i +* Re: The joy of FORTRAN4Bob Eager
25 Feb 25  ii ii  i `* Re: The joy of FORTRAN3Lawrence D'Oliveiro
26 Feb 25  ii ii  `* Re: The joy of FORTRAN188c186282
1 Oct 24  ii i`* Re: The joy of FORTRAN2rbowman
30 Sep 24  ii +* OT ; Re: The joy of FORTRAN100Bobbie Sellers
30 Sep 24  ii `* Re: The joy of FORTRAN7Peter Flass
30 Sep 24  i`* Re: The joy of FORTRAN818The Natural Philosopher
30 Sep 24  `* Re: The joy of FORTRAN61186282@ud0s4.net

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal