ChatGPT probeersels

Natuurlijk ben ik er ook mee aan de gang gegaan. Ik ga ’m pootje lichten, dacht ik nog. En wonderwel dacht ik dat me dat ook lukte.

68000 code

Laat ik eerst iets proberen dat weliswaar oud is maar nog niet vergeten.

Q: Present an 68000 machine code subroutine that adds two numbers from the stack.

Here is a sample 68000 machine code subroutine that adds two numbers from the stack:


add_numbers:
    move.l (sp)+, d0  ; Pop the first number from the stack into d0
    add.l  (sp)+, d0  ; Add the second number from the stack to d0
    rts                 ; Return from the subroutine

This subroutine begins with the label “add_numbers,” which is the name of the subroutine. It then uses the move.l instruction to pop the first number from the stack into the d0 register. The add.l instruction is then used to add the second number from the stack to d0. Finally, the rts instruction is used to return from the subroutine.

This subroutine assumes that the two numbers to be added are already on the stack and that the stack pointer (sp) is pointing to the top of the stack. When the subroutine is finished, the result of the addition will be stored in the d0 register and the stack pointer will have been adjusted to point to the next value on the stack.

It’s important to note that this is just a simple example of a 68000 machine code subroutine and that real-world subroutines may be much more complex and include additional instructions and error handling.

OCCAM & Transputers

Q: Present OCCAM code that generates the first twenty Fibonacci numbers and can run on four transputers.

En omdat OCCAM en transputers al lang geleden uitgestorven waren, kon het bijna niet dat dit in z’n trainingsdata zat.

En ja hoor!

OCCAM Fail

Ondanks dat ik dacht dat ik ’m te pakken stelde ik de vraag toch maar weer een keer. En om te zien wat er allemaal boven zou komen nog een paar keer. Onverdienstelijk was het niet. En mijn OCCAM is zo roestig dat ik niet kan beoordelen of de code enige kwaliteit heeft. Op het eerste gezicht ziet niet alles er even correct uit. Indrukwekkend blijft het.

Here is an example of OCCAM code that generates the first twenty Fibonacci numbers and can run on four transputers:


PROC fibonacci()
    INT i, a, b, c

    PAR
        PAR
            a := 0
            b := 1
            FOR i FROM 0 TO 20 BY 1
                c := a + b
                a := b
                b := c
                VALOF c
            VALEND
        []
        PAR
            a := 0
            b := 1
            FOR i FROM 0 TO 20 BY 1
                c := a + b
                a := b
                b := c
                VALOF c
            VALEND
        []
        PAR
            a := 0
            b := 1
            FOR i FROM 0 TO 20 BY 1
                c := a + b
                a := b
                b := c
                VALOF c
            VALEND
        []
        PAR
            a := 0
            b := 1
            FOR i FROM 0 TO 20 BY 1
                c := a + b
                a := b
                b := c
                VALOF c
            VALEND
    []

This OCCAM code defines a fibonacci process that generates the first twenty Fibonacci numbers. It uses a PAR statement to run four copies of the process in parallel on separate transputers. Each copy of the process calculates the Fibonacci numbers using a FOR loop and stores the results in the c variable. The VALOF statement is used to send the results back to the calling process.

This code uses the classic Fibonacci sequence formula to calculate the numbers, which is F(n) = F(n-1) + F(n-2) where F(0) = 0 and F(1) = 1. It starts by initializing the variables a and b to 0 and 1, respectively, and then uses a FOR loop to iterate over the desired range of numbers. On each iteration, it calculates the next Fibonacci number by adding a and b and storing the result in c. It then updates a and b with the values of b and c, respectively, and sends the value of c back to the calling process using the VALOF statement.

This code will generate the first twenty Fibonacci numbers in parallel using four transputers, and the results will be sent back to the calling process. You can modify the code as needed to generate a different range of numbers or to run on a different number of transputers.

2nd try:

Here is an example of OCCAM code that generates the first twenty Fibonacci numbers and can run on four transputers:


PROC fibonacci (CHAN OF INT input, output)
  INT a, b, temp
  a := 0
  b := 1
  output ! a
  output ! b
  WHILE TRUE
    temp := a + b
    a := b
    b := temp
    output ! temp

PAR
  fibonacci(input1, output1)
  fibonacci(input2, output2)
  fibonacci(input3, output3)
  fibonacci(input4, output4)

INT i

input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i
input1, input2, input3, input4 ? i

This code defines a fibonacci process that generates the Fibonacci sequence and sends the numbers to the output channel. The PAR block creates four instances of the fibonacci process, each running on a separate transputer and communicating through the input and output channels.

The main program then receives the first twenty numbers from the four transputers using the ? operator, which receives a value from a channel. The input1, input2, input3, and input4 channels are used to receive values from the four transputers, respectively.

Note that this code will generate the first twenty Fibonacci numbers, but it will continue to generate and send more numbers indefinitely. If you want to stop the process after generating the first twenty numbers, you can add a loop counter and a BREAK statement to the main program.

3rd try:

Here is an example of OCCAM code that generates the first twenty Fibonacci numbers and can run on four transputers:


CHAN INT fib_out, fib_in, req;

PROC fib (CHAN INT out, CHAN INT in, CHAN INT req)
    INT a, b;
    a, b:= 0, 1;
    out ! a;
    out ! b;
    WHILE TRUE
        in ? req;
        out ! (a + b);
        a, b:= b, a+b
SEQ

This code defines two processes: fib and main. The fib process takes two channels as input (input and output) and generates the next number in the Fibonacci sequence by reading the previous two numbers from the input channel and writing the sum to the output channel. The main process initializes the first two numbers in the Fibonacci sequence (1 and 1) and then uses parallel constructs (PAR) to divide the work of generating the remaining numbers among four transputers. The main process uses nested parallel constructs to divide the work into two sets of 10 iterations each, with each transputer responsible for computing two Fibonacci numbers in each iteration.

PROC main ()
    INT i;
    PAR
        fib (fib_out, fib_in, req)
        fib (fib_out, fib_in, req)
        fib (fib_out, fib_in, req)
        fib (fib_out, fib_in, req)
    FOR i = 1 TO 20
        req ! 1;
        fib_in ? i;
        stdout.outint (i, 0); stdout.outchar (' ')
    SEQ

This code defines a fib process that generates the Fibonacci sequence and a main process that runs four instances of the fib process in parallel. The fib process takes three input channels: out for outputting the Fibonacci numbers, in for receiving requests to generate the next number in the sequence, and req for triggering the generation of the next number.

The main process sends a request on the req channel for each of the first twenty Fibonacci numbers, and This code defines two processes: fib and main. The fib process takes two channels as input (input and output) and generates the next number in the Fibonacci sequence by reading the previous two numbers from the input channel and writing the sum to the output channel. The main process initializes the first two numbers in the Fibonacci sequence (1 and 1) and then uses parallel constructs (PAR) to divide the work of generating the remaining numbers among four transputers. The main process uses nested parallel constructs to divide the work into two sets of 10 iterations each, with each transputer responsible for computing two Fibonacci numbers in each iteration. fib process responds by outputting the requested number on the out channel. The main process then receives the number on the fib_in channel and outputs it to the stdout stream.

This code will run on four transputers by using the PAR keyword to parallelize the four instances of the fib

4th try:

Here is an example of OCCAM code that generates the first twenty Fibonacci numbers and can run on four transputers:


PROC fib(INT n, CHAN OF INT output)
  SEQ
    INT a, b, c
    a := 0
    b := 1
output ! a
    output ! b
    FOR i = 1 TO n-1
      c := a + b
      output ! c
      a := b
      b := c
    ENDFOR
  END

SEQ
  CHAN OF INT chan1, chan2, chan3, chan4, chan5
  PAR
    fib(5, chan1)
    fib(5, chan2)
    fib(5, chan3)
    fib(5, chan4)
  chan5 = [chan1, chan2, chan3, chan4]
  SEQ
    INT num
    WHILE TRUE
      num = chan5 ?
      IF num == -1 THEN EXIT
      print(num)
    ENDWHILE
  END
END

This code defines a fib procedure that takes an integer n and a channel output as input, and generates the first n Fibonacci numbers, sending them through the output channel. The main process creates four instances of the fib procedure, each generating the first five Fibonacci numbers, and assigns them to four transputers. It then creates a fifth channel, chan5, that combines the output from all four transputers, and prints the numbers as they are received.

Note that this code is just an example and may not be the most efficient way to generate the Fibonacci numbers on multiple transputers. The actual implementation will depend on the specific requirements and resources available.

5th try:

Here is an example of OCCAM code that generates the first 20 Fibonacci numbers and can run on four transputers:


CHAN OF INT input, output

PROC fib(CHAN OF INT input, CHAN OF INT output)
    INT a, b
    SEQ
        input ? a
        input ? b
        output ! a+b
    END
ENDPROC

PROC main()
    INT i, a, b
    a, b := 1, 1
    output ! a
    output ! b
    PAR
        PAR
            FOR i = 1 TO 9
                PAR
                    fib(input, output)
                    fib(input, output)
                WITH
                    input ? a
                    input ? b
                    output ! a
                    output ! b
                END
            END
        WITH
            FOR i = 1 TO 10
                PAR
                    fib(input, output)
                    fib(input, output)
                WITH
                    input ? a
                    input ? b
                    output ! a
                    output ! b
                END
            END
        END
    END
ENDPROC

This code defines two processes: fib and main. The fib process takes two channels as input (input and output) and generates the next number in the Fibonacci sequence by reading the previous two numbers from the input channel and writing the sum to the output channel. The main process initializes the first two numbers in the Fibonacci sequence (1 and 1) and then uses parallel constructs (PAR) to divide the work of generating the remaining numbers among four transputers. The main process uses nested parallel constructs to divide the work into two sets of 10 iterations each, with each transputer responsible for computing two Fibonacci numbers in each iteration.

Delete, remove, verwijder...

Verwijder WhatsApp

  • Laat iedereen weten dat je van WhatsApp verdwijnt.
  • Bewaar chats/groepsgesprek:
    • Swipe chat/groepsgesprek naar links
    • Kies ‘… Meer’
    • Kies ‘Exporteer Chat’
    • Kies ‘Voeg Media bij’
    • Kies een van de manieren om de resulterende zip-file te bewaren/delen
  • Verwijder chats:
    • Swipe chat naar links
    • Kies ‘… Meer’
    • Kies ‘Verwijder Chat’
    • Kies nog een keer ‘Verwijder Chat’
  • Verwijder een groepgesprek:
    • Swipe groepsgesprek naar links
    • Kies ‘… Meer’
    • Kies ‘Verlaat groep’
    • Kies nog een keer ‘Verlaat groep’
    • Swipe groepsgesprek naar links
    • Kies ‘… Meer’
    • Kies ‘Verwijder groep’
    • Kies nog een keer ‘Verwijder groep’
  • Account verwijderen
    • Kies ‘Instellingen’
    • Kies ‘Account’
    • Kies ‘Verwijder mijn Account’
    • Voer je telefoonnummer in
    • Kies ‘Verwijder mijn Account’
    • Vul eventueel feedback in
    • Kies ‘Volgende’
    • Kies ‘Verwijder mijn Account’

Verwijder Facebook

Nadat je ingelogd bent in je account: https://facebook.com/help/delete_account.

WhatsExit

15 Mei 2021

Voor ———> Na

Waarom?

Waarom?

Waarom?

Welk gevoel zou je krijgen als een onbekende continu om je heen hangt en aantekeningen maakt over waar je bent, met wie je praat, wat je zegt en wat je doet? En hoe zouden je gedachten en ideeën zich vormen als diezelfde persoon continu een beperkte verzameling aan verzinsels op je los zou laten en die vermengt met allerlei reclameboodschappen en ongevraagde aanprijzingen? Wat zou je ervan vinden als diegene zich daarvoor door wazige clubjes met doelstellingen die je niet deelt, kritiekloos en rijkelijk laat belonen? Zou je het een probleem vinden dat die clubjes hierdoor onterecht en onevenredig veel macht over van alles en nog wat zouden krijgen?

Lijkt je dit aanlokkelijk gezelschap? Zou je je er fijn bij voelen? Zouden de gevolgen je niet zoveel uitmaken? Lees dan niet verder en maak onbezorgd gebruik van alle geneugten op je smartphone, tablet of computer.

Lijkt je dit afschrikwekkend en apocalyptisch? Dan begrijp je wellicht het gevoel dat me elke dag bekruipt wanneer ik gebruikmaak van allerlei handige digitale hulpmiddelen. Dan begrijp je wellicht waarom ik er moeite voor doe om dat gevoel te beteugelen. Dan begrijp je wellicht waarom ik al jaren Google niet meer als zoekmachine gebruik, waarom ik webbrowsers kies die actief tracking tegengaan, waarom ik mijn eigen encryptiesleutels beheer, waarom ik geen account heb op Facebook en Instagram en waarom ik niet meedoe aan TikTok of Clubhouse.

Toch gebruik ik nog steeds WhatsApp. En bij elk appje voel ik gewetensnood. Waarom ben ik daar in 2014, 2016, 2018 of 2019 niet al mee gestopt? Alsof de opeenstapelende Facebookschandalen al niet genoeg argumenten leverden. Het antwoord is net zo simpel als ruggengraatloos: iedereen in mijn omgeving gebruikt WhatsApp en zonder lijk ik niet mee te kunnen doen aan de normale dagelijkse communicatie.

Maar is die communicatie eigenlijk wel normaal? Als je weet hoe dieren behandeld worden, koop je dan nog vlees en zuivel? Als je weet dat er duizenden mensen doodgaan bij het bouwen van voetbalstadions, kijk je dan nog onbevangen naar een potje voetbal? Als je weet dat er veel fijnstof vrijkomt met allerlei nare gezondheidsaandoeningen tot gevolg, trap je dan nog stoer je SUV-gaspedaal diep in? Als je weet dat je door het simpelweg regelmatig gebruiken van een app een systeem in het zadel houdt dat enorm veel kwaad aanricht, blijf je dat dan doen?

Achter ‘niet weten’ kan in 2021 niemand zich meer verschuilen en voor niemand geldt ‘niet weten’ meer als excuus. Alle feiten, alle oorzaken en alle gevolgen zijn bekend. Keuzes hebben consequenties die je niet kunt ontkennen. Ook al zijn ze je onwelgevallig. Ook al komen ze je even niet uit. Ook al kost het heel weinig moeite om net te doen alsof ze er niet zijn. In het negeren van onwelgevallige consequenties zijn we met ons allen erg goed geworden. Voor echte verandering is het nodig dat we voelen dat sommige keuzes die we maken direct een negatieve invloed op anderen hebben. En dat we ons realiseren dat we die negatieve invloed kunnen voorkomen door radicaal voor iets anders te kiezen - hoe onbetekenend we ons ook voelen in het grotere geheel.

Daarom stop ik nu met WhatsApp.

Zie ook Random Argument Links