• (N)Curses to slow and to difficult to use? (was: ncurses and "applicati

    From Rainer Weikusat@21:1/5 to DozingDog@thekennel.co on Thu Nov 11 16:40:43 2021
    DozingDog@thekennel.co writes:
    On Wed, 10 Nov 2021 18:00:53 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    DozingDog@thekennel.co writes:
    On Wed, 10 Nov 2021 15:28:22 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    Richard Kettlewell <invalid@invalid.invalid> writes:
    Rainer Weikusat <rweikusat@talktalk.net> writes:
    The ncurses library apparently (ie, it happens but I'm just assuming >>>>>> it's done by it) switches a terminal into so-called "application mode" >>>>>> and back, with the effect of programs using it expecting the arrow keys >>>>>> to generate escape sequences starting with ESC O instead of ESC ]. This >>>>>> single character exchange seems a most useless exercise to me (and I've >>>>>> just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for? >>>>>
    https://invisible-island.net/ncurses/ncurses.faq.html and search down >>>>> for ‘Keyboard Problems’.

    Short version: Workaround for crappy, long obsolete hardware text >>>>terminals. That much I guessed. :-)

    When 99.9% of terminals now are ansi why bother using curses? Skip the middle

    man and write the ansi codes direct , its much faster.

    Could you please refrain from attaching your unrelated opinion
    statements to texts I wrote? The given situation is such that I have to

    No, I couldn't. Newsflash - this is usenet. If you want a private conversation
    use email otherwise stop whining.

    If you want to start a discussion about some topic, post something. If
    all you can manage is to add random stuff to something that's not
    related to it, don't 'whine' about being told that this was pretty
    useless.

    Semirandom reply to your statement: Considering that computers are >>thousands of times (presumably too little) faster today than they used
    to be in 1985 or even in the 1990s, why bother with hard-coding a
    certain set of escape sequences "because that's faster"? Talk about
    solving a non-problem ...

    An array containing a few escape codes then just using printf() instead of juggling curses specific API calls is IMO a lot simpler from a coding POV
    as well as being faster.

    So far, I've written one program using curses and something like

    static void curses_start(int c)
    {
    int attr, color;

    attr = A_BOLD;

    switch (c) {
    case CHR_PROBLEM:
    color = CP_PROBLEM;
    break;

    case CHR_PROGRESS:
    color = CP_PROGRESS;
    break;

    case CHR_FINE:
    attr = A_NORMAL;
    color = CP_FINE;
    }

    attr_set(attr, color, NULL);
    }

    is vastly easier to understand and work with than the equivalent 'machine
    code' (which terminal control escape sequences are).

    "Being faster" is still a non-point. If it was fast enough on VAXen or
    25Mhz PCs - and it was - it's going to be much more than 'fast enough'
    on the hardware of today.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Kenny McCormack@21:1/5 to DozingDog@thekennel.co on Thu Nov 11 16:22:38 2021
    In article <smipnq$1kki$1@gioia.aioe.org>, <DozingDog@thekennel.co> wrote:
    ...
    Could you please refrain from attaching your unrelated opinion
    statements to texts I wrote? The given situation is such that I have to

    No, I couldn't. Newsflash - this is usenet. If you want a private conversation >use email otherwise stop whining.

    Your position is identical to the following exchange:

    Me: Would you please stop shitting on my lawn?

    You: No, I won't. This is America! There is nothing you can do to stop me from shitting on your lawn. Stop whining!

    Me: Yes, you are right. But you're still an asshole.

    --
    The scent of awk programmers is a lot more attractive to women than
    the scent of perl programmers.

    (Mike Brennan, quoted in the "GAWK" manual)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DozingDog@thekennel.co@21:1/5 to Rainer Weikusat on Fri Nov 12 10:44:22 2021
    On Thu, 11 Nov 2021 16:40:43 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    DozingDog@thekennel.co writes:
    On Wed, 10 Nov 2021 18:00:53 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    DozingDog@thekennel.co writes:
    On Wed, 10 Nov 2021 15:28:22 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    Richard Kettlewell <invalid@invalid.invalid> writes:
    Rainer Weikusat <rweikusat@talktalk.net> writes:
    The ncurses library apparently (ie, it happens but I'm just assuming >>>>>>> it's done by it) switches a terminal into so-called "application mode" >>>>>>> and back, with the effect of programs using it expecting the arrow keys >>>>>>> to generate escape sequences starting with ESC O instead of ESC ]. This >>>>>>> single character exchange seems a most useless exercise to me (and I've >>>>>>> just written code to handle it ... grrr).

    Does anybody have some insight re: what that's supposed to be good for? >>>>>>
    https://invisible-island.net/ncurses/ncurses.faq.html and search down >>>>>> for ‘Keyboard Problems’.

    Short version: Workaround for crappy, long obsolete hardware text >>>>>terminals. That much I guessed. :-)

    When 99.9% of terminals now are ansi why bother using curses? Skip the >middle

    man and write the ansi codes direct , its much faster.

    Could you please refrain from attaching your unrelated opinion
    statements to texts I wrote? The given situation is such that I have to

    No, I couldn't. Newsflash - this is usenet. If you want a private >conversation
    use email otherwise stop whining.

    If you want to start a discussion about some topic, post something. If
    all you can manage is to add random stuff to something that's not
    related to it, don't 'whine' about being told that this was pretty
    useless.

    Its not random and its not my fault if you're too thick to see the connection. But instead of just ignoring it you put your ignorance on display for all. Congratulations.

    An array containing a few escape codes then just using printf() instead of >> juggling curses specific API calls is IMO a lot simpler from a coding POV
    as well as being faster.

    So far, I've written one program using curses and something like

    static void curses_start(int c)
    {
    int attr, color;

    attr = A_BOLD;

    switch (c) {
    case CHR_PROBLEM:
    color = CP_PROBLEM;
    break;

    case CHR_PROGRESS:
    color = CP_PROGRESS;
    break;

    case CHR_FINE:
    attr = A_NORMAL;
    color = CP_FINE;
    }

    attr_set(attr, color, NULL);
    }

    is vastly easier to understand and work with than the equivalent 'machine >code' (which terminal control escape sequences are).

    Thats your opinion, plenty of others may differ. However using escape codes
    I can change colours and effects multiple times in a single printf but with curses it would be god knows how many API calls to do the same thing.

    "Being faster" is still a non-point. If it was fast enough on VAXen or
    25Mhz PCs - and it was - it's going to be much more than 'fast enough'
    on the hardware of today.

    Any decent programmer cares about efficiency.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DozingDog@thekennel.co@21:1/5 to Kenny McCormack on Fri Nov 12 10:41:24 2021
    On Thu, 11 Nov 2021 16:22:38 -0000 (UTC)
    gazelle@shell.xmission.com (Kenny McCormack) wrote:
    In article <smipnq$1kki$1@gioia.aioe.org>, <DozingDog@thekennel.co> wrote: >....
    Could you please refrain from attaching your unrelated opinion
    statements to texts I wrote? The given situation is such that I have to

    No, I couldn't. Newsflash - this is usenet. If you want a private conversation

    use email otherwise stop whining.

    Your position is identical to the following exchange:

    Me: Would you please stop shitting on my lawn?

    You: No, I won't. This is America! There is nothing you can do to stop me >from shitting on your lawn. Stop whining!

    Me: Yes, you are right. But you're still an asshole.

    Its spelt arsehole, unless you're refering to a donkey. And no, its not the same. Usenet exists for people to join a discussion. Are they supposed to ask permission first or only post if they think the poster will agree with them? Fuck that.

    Go to your safe space snowflake and cuddle a teddy bear if you can't handle it.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joe Pfeiffer@21:1/5 to DozingDog@thekennel.co on Fri Nov 12 09:14:13 2021
    DozingDog@thekennel.co writes:
    On Thu, 11 Nov 2021 16:40:43 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    DozingDog@thekennel.co writes:

    An array containing a few escape codes then just using printf() instead of >>> juggling curses specific API calls is IMO a lot simpler from a coding POV >>> as well as being faster.

    So far, I've written one program using curses and something like

    static void curses_start(int c)
    {
    int attr, color;

    attr = A_BOLD;

    switch (c) {
    case CHR_PROBLEM:
    color = CP_PROBLEM;
    break;

    case CHR_PROGRESS:
    color = CP_PROGRESS;
    break;

    case CHR_FINE:
    attr = A_NORMAL;
    color = CP_FINE;
    }

    attr_set(attr, color, NULL);
    }

    is vastly easier to understand and work with than the equivalent 'machine >>code' (which terminal control escape sequences are).

    Thats your opinion, plenty of others may differ. However using escape codes
    I can change colours and effects multiple times in a single printf but with curses it would be god knows how many API calls to do the same thing.

    "Being faster" is still a non-point. If it was fast enough on VAXen or >>25Mhz PCs - and it was - it's going to be much more than 'fast enough'
    on the hardware of today.

    Any decent programmer cares about efficiency.

    Do you also still program in assembly code for the same reason?
    ncurses, in particular the panel library on top of it, saves me from
    having to try to write basically the same functionality as panel within
    my application. Maybe you've never done anything more complicated in a
    tui than changing colors?

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rainer Weikusat@21:1/5 to DozingDog@thekennel.co on Fri Nov 12 16:09:36 2021
    DozingDog@thekennel.co writes:
    On Fri, 12 Nov 2021 15:30:14 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    DozingDog@thekennel.co writes:
    On Thu, 11 Nov 2021 16:40:43 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:

    [...]

    If you want to start a discussion about some topic, post something. If >>>>all you can manage is to add random stuff to something that's not >>>>related to it, don't 'whine' about being told that this was pretty >>>>useless.

    Its not random and its not my fault if you're too thick to see the >>connection.
    But instead of just ignoring it you put your ignorance on display for all. >>> Congratulations.

    People being very convinced that something which doesn't exist must be >>there nevertheless isn't an uncommon occurence. Especially in software >>development, cf Kees Cooks witchhunt for the mass of accidentally
    forgotten breaks in the Linux source which didn't exist but he
    nevertheless dutifully found.

    I'm sure that gibberish meant something to you when you wrote it. Perhaps something got lost in translation from German.

    I'm sorry to be so blunt but you're nothing but an idiot repeating
    phrases from several years ago. Have a nice life.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DozingDog@thekennel.co@21:1/5 to Rainer Weikusat on Fri Nov 12 16:06:40 2021
    On Fri, 12 Nov 2021 15:30:14 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    DozingDog@thekennel.co writes:
    On Thu, 11 Nov 2021 16:40:43 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:

    [...]

    If you want to start a discussion about some topic, post something. If >>>all you can manage is to add random stuff to something that's not
    related to it, don't 'whine' about being told that this was pretty >>>useless.

    Its not random and its not my fault if you're too thick to see the >connection.
    But instead of just ignoring it you put your ignorance on display for all. >> Congratulations.

    People being very convinced that something which doesn't exist must be
    there nevertheless isn't an uncommon occurence. Especially in software >development, cf Kees Cooks witchhunt for the mass of accidentally
    forgotten breaks in the Linux source which didn't exist but he
    nevertheless dutifully found.

    I'm sure that gibberish meant something to you when you wrote it. Perhaps something got lost in translation from German.

    Thats your opinion, plenty of others may differ. However using escape codes >> I can change colours and effects multiple times in a single printf but with >> curses it would be god knows how many API calls to do the same thing.

    One for each change plus setting up the colour pairs. And it cleanly >separates the actual output from binary gibberish (as viewed from a
    human perspective) which just exists because it's an artefact of some >machine.

    #include <string>
    #include <iostream>

    const char *RED = "\033[31m";
    const char *GREEN = "\033[32m";
    const char *BLUE = "\033[34m";
    const char *MAGENTA = "\033[35m";
    const char *TURQ = "\033[36m";
    const char *RESET = "\033[0m";

    using namespace std;

    int main()
    {
    cout << RED << "You " << GREEN << "don't " << BLUE << "have "
    << MAGENTA << "a " << TURQ << "clue. " << RESET << endl;
    cout << "Ok?\n";
    return 0;
    }


    Any decent programmer cares about efficiency.

    A decent programmer would use an argument here instead of a general
    platitude referring to the person who posted an opinion. That's because >decent programmer would have to be decent logicans instead of innuendo >experts.

    More gibberish.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Rainer Weikusat@21:1/5 to DozingDog@thekennel.co on Fri Nov 12 15:30:14 2021
    DozingDog@thekennel.co writes:
    On Thu, 11 Nov 2021 16:40:43 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:

    [...]

    If you want to start a discussion about some topic, post something. If
    all you can manage is to add random stuff to something that's not
    related to it, don't 'whine' about being told that this was pretty
    useless.

    Its not random and its not my fault if you're too thick to see the connection.
    But instead of just ignoring it you put your ignorance on display for all. Congratulations.

    People being very convinced that something which doesn't exist must be
    there nevertheless isn't an uncommon occurence. Especially in software development, cf Kees Cooks witchhunt for the mass of accidentally
    forgotten breaks in the Linux source which didn't exist but he
    nevertheless dutifully found.

    An array containing a few escape codes then just using printf() instead of >>> juggling curses specific API calls is IMO a lot simpler from a coding POV >>> as well as being faster.

    So far, I've written one program using curses and something like

    static void curses_start(int c)
    {
    int attr, color;

    attr = A_BOLD;

    switch (c) {
    case CHR_PROBLEM:
    color = CP_PROBLEM;
    break;

    case CHR_PROGRESS:
    color = CP_PROGRESS;
    break;

    case CHR_FINE:
    attr = A_NORMAL;
    color = CP_FINE;
    }

    attr_set(attr, color, NULL);
    }

    is vastly easier to understand and work with than the equivalent 'machine >>code' (which terminal control escape sequences are).

    Thats your opinion, plenty of others may differ. However using escape codes
    I can change colours and effects multiple times in a single printf but with curses it would be god knows how many API calls to do the same thing.

    One for each change plus setting up the colour pairs. And it cleanly
    separates the actual output from binary gibberish (as viewed from a
    human perspective) which just exists because it's an artefact of some
    machine.

    "Being faster" is still a non-point. If it was fast enough on VAXen or >>25Mhz PCs - and it was - it's going to be much more than 'fast enough'
    on the hardware of today.

    Any decent programmer cares about efficiency.

    A decent programmer would use an argument here instead of a general
    platitude referring to the person who posted an opinion. That's because
    decent programmer would have to be decent logicans instead of innuendo
    experts.

    Yesterday, I did a C/ XS implementation of some 'inner loop'-routine of
    a certain program. Depending on the use-case, this sped it up by a
    factor of 2.2 or 2.7. However, in absolute terms, this comes down to
    saving about 5E-7 seconds of running time per invocation. I'm going to
    keep it because I have it now but hindsight, this likely wasn't really
    worth the effort.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DozingDog@thekennel.co@21:1/5 to Rainer Weikusat on Fri Nov 12 16:49:19 2021
    On Fri, 12 Nov 2021 16:09:36 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    DozingDog@thekennel.co writes:
    On Fri, 12 Nov 2021 15:30:14 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    DozingDog@thekennel.co writes:
    On Thu, 11 Nov 2021 16:40:43 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:

    [...]

    If you want to start a discussion about some topic, post something. If >>>>>all you can manage is to add random stuff to something that's not >>>>>related to it, don't 'whine' about being told that this was pretty >>>>>useless.

    Its not random and its not my fault if you're too thick to see the >>>connection.
    But instead of just ignoring it you put your ignorance on display for all. >>>> Congratulations.

    People being very convinced that something which doesn't exist must be >>>there nevertheless isn't an uncommon occurence. Especially in software >>>development, cf Kees Cooks witchhunt for the mass of accidentally >>>forgotten breaks in the Linux source which didn't exist but he >>>nevertheless dutifully found.

    I'm sure that gibberish meant something to you when you wrote it. Perhaps
    something got lost in translation from German.

    I'm sorry to be so blunt but you're nothing but an idiot repeating
    phrases from several years ago. Have a nice life.

    Your lack of response , particularly to the example code I wrote, says it all.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From James Kuyper@21:1/5 to DozingDog@thekennel.co on Fri Nov 12 11:58:09 2021
    On 11/12/21 5:41 AM, DozingDog@thekennel.co wrote:
    ...
    Its spelt arsehole, unless you're refering to a donkey. And no, its not the

    Nearly 2/3 of all of the native speakers of English speak the American
    variant of that language, for which your preferred spelling is
    incorrect, and his is correct. If you didn't want to have so many people speaking such a wide variety of versions of your language, you shouldn't
    have started a colonial empire in the first place.

    Can you cite any rule obligating him to write according to the rules of
    British English? Since the treaty of Paris (1783), we're no longer bound
    by any such rules. :-)

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From DozingDog@thekennel.co@21:1/5 to Joe Pfeiffer on Fri Nov 12 16:51:55 2021
    On Fri, 12 Nov 2021 09:14:13 -0700
    Joe Pfeiffer <pfeiffer@cs.nmsu.edu> wrote:
    DozingDog@thekennel.co writes:
    On Thu, 11 Nov 2021 16:40:43 +0000
    Rainer Weikusat <rweikusat@talktalk.net> wrote:
    DozingDog@thekennel.co writes:
    Thats your opinion, plenty of others may differ. However using escape codes >> I can change colours and effects multiple times in a single printf but with >> curses it would be god knows how many API calls to do the same thing.

    "Being faster" is still a non-point. If it was fast enough on VAXen or >>>25Mhz PCs - and it was - it's going to be much more than 'fast enough'
    on the hardware of today.

    Any decent programmer cares about efficiency.

    Do you also still program in assembly code for the same reason?

    Its non portable, but yes, I have done in the past for that reason.

    ncurses, in particular the panel library on top of it, saves me from
    having to try to write basically the same functionality as panel within
    my application. Maybe you've never done anything more complicated in a
    tui than changing colors?

    For complicated windowing functionality using curses makes sense. For just changing colours or other simple ansi code operations then its overkill and using just the codes also leads to simpler code as my example in another post demonstrates.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From pk@21:1/5 to DozingDog@thekennel.co on Fri Nov 12 18:31:58 2021
    On Fri, 12 Nov 2021 10:41:24 -0000 (UTC), DozingDog@thekennel.co wrote:

    Its spelt arsehole

    It's spelt "it's". You should probably write correctly yourself before correcting others (even if those others are, indeed, real arseholes).

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Joe Pfeiffer@21:1/5 to pk@pk.invalid on Fri Nov 12 20:53:09 2021
    pk <pk@pk.invalid> writes:

    On Fri, 12 Nov 2021 10:41:24 -0000 (UTC), DozingDog@thekennel.co wrote:

    Its spelt arsehole

    It's spelt "it's". You should probably write correctly yourself before correcting others (even if those others are, indeed, real arseholes).

    A classic example of Muphry's Law.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Meredith Montgomery@21:1/5 to Kenny McCormack on Sat Nov 13 23:15:28 2021
    gazelle@shell.xmission.com (Kenny McCormack) writes:

    In article <smipnq$1kki$1@gioia.aioe.org>, <DozingDog@thekennel.co> wrote: ...
    Could you please refrain from attaching your unrelated opinion
    statements to texts I wrote? The given situation is such that I have to

    No, I couldn't. Newsflash - this is usenet. If you want a private conversation
    use email otherwise stop whining.

    Your position is identical to the following exchange:

    Me: Would you please stop shitting on my lawn?

    You: No, I won't. This is America! There is nothing you can do to stop me from shitting on your lawn. Stop whining!

    Me: Yes, you are right. But you're still an asshole.

    Lol. I loved it. Meanwhile in Australia, speaking of lawn...

    Australian man interrupts PM Morrison to say 'get off my lawn' [...]
    https://www.youtube.com/watch?v=t17O2AKa2FU

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Thomas Jahns@21:1/5 to James Kuyper on Mon Nov 15 16:03:27 2021
    On 2021-11-12 17:58, James Kuyper wrote:
    On 11/12/21 5:41 AM, DozingDog@thekennel.co wrote:
    ...
    Its spelt arsehole, unless you're refering to a donkey. And no, its not the

    Nearly 2/3 of all of the native speakers of English speak the American variant of that language, for which your preferred spelling is
    incorrect, and his is correct. If you didn't want to have so many people speaking such a wide variety of versions of your language, you shouldn't
    have started a colonial empire in the first place.

    If only there was any process to update spelling. I can only speak for my native
    language, but German is spoken in multiple countries and there are active efforts to keep the written language having some correspondence to the spoken one. That obviously is not easily accepted by anyone suffering from 'grumpy old man syndrome'[1] and the far higher number of English-speaking countries would make the effort even harder, but if you could mutually agree that you are speaking more or less the same language, perhaps some better approach than sticking to 16th century norms makes sense?

    I assume there is even more lecturer's for English language texts at public universities than for Geman, so people might demand to get more than preserving the status quo out of employing so many. ;-)

    Thomas

    [1] <https://en.wikipedia.org/wiki/German_orthography_reform_of_1996>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)