Re: Need Assistance -- Network Programming

Liste des GroupesRevenir à ol advocacy 
Sujet : Re: Need Assistance -- Network Programming
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.os.linux.advocacy
Date : 27. Jun 2024, 10:01:28
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v5j68n$2ks7o$7@dont-email.me>
References : 1 2 3 4 5 6 7 8 9
User-Agent : Pan/0.158 (Avdiivka; )
On 26 Jun 2024 23:58:30 GMT, rbowman wrote:

Similarly while Python has math.degrees() and math.radians() ...

I’ve long felt those conversion functions are an unnecessarily roundabout
way of doing things. After all, you need two for every angle unit,
assuming you stick with radians as the common basis among all of them.
Otherwise you need even more.

Better to have a single conversion factor for each unit, e.g.

    class ANGLE_UNITS(float, enum.Enum) :
        "standard values for Context.angle_units."
        RADIANS = 1.0
        DEGREES = math.pi / 180
        GRADIANS = math.pi / 200
        CIRCLE = 2 * math.pi
    #end ANGLE_UNITS

so you multiply by the factor to convert the units to radians, and divide
by the same factor to convert radians to those units.

Then all your trig functions can operate exclusively in radians:

    units = ANGLE_UNITS.DEGREES
    θ = float(input("Angle in degrees? "))
    x = math.sin(θ * units)
    print("Angle: ", math.asin(x) / units, "°")

And yes, Python does full multiple inheritance. And yes, you can subclass
from builtin types like float as well. And further yes, enums are not a
built-in language feature, they are provided in a library module that is
written in pure Python.

Date Sujet#  Auteur
19 Jun 24 * Need Assistance -- Network Programming37Lester Thorpe
19 Jun 24 +- Re: Need Assistance -- Network Programming1rbowman
19 Jun 24 +* Re: Need Assistance -- Network Programming21Lester Thorpe
19 Jun 24 i`* Re: Need Assistance -- Network Programming20Tyrone
19 Jun 24 i `* Re: Need Assistance -- Network Programming19vallor
19 Jun 24 i  `* Re: Need Assistance -- Network Programming18Farley Flud
20 Jun 24 i   `* Re: Need Assistance -- Network Programming17vallor
20 Jun 24 i    +* Re: Need Assistance -- Network Programming3rbowman
20 Jun 24 i    i+- Re: Need Assistance -- Network Programming1Farley Flud
20 Jun 24 i    i`- Re: Need Assistance -- Network Programming1rbowman
20 Jun 24 i    +* Re: Need Assistance -- Network Programming3vallor
20 Jun 24 i    i+- Re: Need Assistance -- Network Programming1%
21 Jun 24 i    i`- Re: Need Assistance -- Network Programming1rbowman
21 Jun 24 i    +* Re: Need Assistance -- Network Programming2Lester Thorpe
21 Jun 24 i    i`- Re: Need Assistance -- Network Programming1vallor
26 Jun04:57 i    `* Re: Need Assistance -- Network Programming8Lawrence D'Oliveiro
26 Jun08:30 i     +- Re: Need Assistance -- Network Programming1vallor
26 Jun18:59 i     `* Re: Need Assistance -- Network Programming6DFS
27 Jun01:58 i      `* Re: Need Assistance -- Network Programming5rbowman
27 Jun08:10 i       +* Re: Need Assistance -- Network Programming3candycanearter07
27 Jun20:47 i       i`* Re: Need Assistance -- Network Programming2rbowman
30 Jun16:10 i       i `- Re: Need Assistance -- Network Programming1candycanearter07
27 Jun10:01 i       `- Re: Need Assistance -- Network Programming1Lawrence D'Oliveiro
19 Jun 24 +- Re: Need Assistance -- Network Programming1vallor
20 Jun 24 +* Re: Need Assistance -- Network Programming12candycanearter07
20 Jun 24 i`* Re: Need Assistance -- Network Programming11Lester Thorpe
21 Jun 24 i `* Re: Need Assistance -- Network Programming10candycanearter07
22 Jun 24 i  `* Re: Need Assistance -- Network Programming9Stéphane CARPENTIER
23 Jun 24 i   +* Re: Need Assistance -- Network Programming2candycanearter07
23 Jun 24 i   i`- Re: Need Assistance -- Network Programming1Stéphane CARPENTIER
26 Jun04:54 i   `* Re: Need Assistance -- Network Programming6Lawrence D'Oliveiro
26 Jun08:40 i    `* Re: Need Assistance -- Network Programming5candycanearter07
27 Jun01:53 i     `* Re: Need Assistance -- Network Programming4Lawrence D'Oliveiro
27 Jun08:10 i      `* Re: Need Assistance -- Network Programming3candycanearter07
27 Jun10:02 i       `* Re: Need Assistance -- Network Programming2Lawrence D'Oliveiro
30 Jun16:10 i        `- Re: Need Assistance -- Network Programming1candycanearter07
26 Jun04:52 `- Re: Need Assistance -- Network Programming1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal