• I now have to take off my Garmin watch before I start drawing art, because when I come into a flow, the watch registers it as “asleep.” It messed up my training readiness, since a three hours sleep period is deemed “too short and detrimental.” That is computers judging personal health for you.

  • I drew this stylized head of B.A. Baracus of the 1980s hit series The A-Team, played by Mr T.

    A pixel art portrait depicts a person with a mohawk and a beard against a gradient background.
  • Testing primality with Free Pascal

    I refined my Free Pascal program to accept 64-bit unsigned integers, which allows up to 19 decimal digits. However, testing with Big Primes, it is only usable up to 15 decimal digits on my Raspberry Pi 4. Any bigger primes take forever to test, in human perspective. The problem seems to be in how primes are generated in the primality test. The prime number generator uses a simple algorithm of odd numbers greater than one, and less than the square root of of the number of which its primality is tested. For small numbers it’s fine, but for larger numbers testing with odd numbers instead of actual prime numbers is a bit of waste of precious CPU time.

    Still, being able to test primality with a relatively simple algorithm is rather awesome as a first attempt.

    The slow-down in the algorithm is not caused by testing primality, but by the inefficiency of generating prime numbers. So I need a faster algorithm to do just that. I’ve looked around, but it requires me to learn new concepts in mathematics. I could do that, or, come back to it later when I’m more versed in writing in Pascal, or even stop here, since I don’t really have any incentives to create a full-blown efficient prime number generator, in other words, reinvent the wheel.

    program isPrime3;
    uses crt;
    
    const
      zero  : qword = 0;
      one   : qword = 1;
      two   : qword = 2;
      three : qword = 3;
    
    var
      num   : qword;
      again : char;
      
    function isprime(num : qword) : boolean;
    var
      iscomposite : boolean;
      test        : qword;
    
    begin
      if num = one then 
        isprime := false
      else 
        if (num = two) or (num = three) then
          isprime := true
        else
          if (num mod two) = zero then
            isprime := false
          else begin
            iscomposite := false;
            test     := three;
            while (test * test) <= num do begin
              if (num mod test) = zero then
                iscomposite := true;
              test := test + two;
            end;
            isprime := not iscomposite;
          end;
    end;
    
    begin
      again := 'Y';
      while (again ='y') or (again = 'Y') or (again = chr(13)) do begin
        num := zero;
        while num < one do begin
          write('Give a whole positive number: ');
          readln(num);
        end;
        if isprime(num) then
          writeln(num, ' is prime')
        else
          writeln(num, ' is not prime');
        write('again? [Y/n] ');
        again := readkey;
        writeln(again);
      end;
    end.
    

    P.S. I fixed a bug that caused a press on the Enter key to exit the program, instead of continuing it as I meant it to do. Checking additionally for the Enter key chr(13) was easy enough. There are still bugs, though, but it’s usable enough for now, as throw-away code, not meant for application in a realworld app.

    P.P.S.S. You can test this code on TutorialsPoint, which has a Pascal IDE, you could type the source code in, or copy and paste it from this article.

  • I refined yesterday’s Pascal program to have somewhat more functionality, and found a way to turn the contents of a terminal window into a PNG. It is a bit unwieldy, though. I’m curious how Timeline will possibly balk on this. I suppose @manton will have to tweak things a bit.

    The image shows a code editor containing a Pascal program that checks if a number is prime, with highlighted comments and test outputs.
  • More Pascal programming in Free Pascal on Raspberry Pi OS. Apparently, the robot understands programming, since the alt description is spot on.

    A terminal window on a Raspberry Pi is displaying a program written in Pascal to test if numbers are prime, with examples of its execution for the numbers 3 and 1021.
  • Remember Pascal? It’s still around. Here I’m running Free Pascal in a RaspberryPi OS terminal window.

    A terminal window displays a user compiling and running a Pascal program called hello.pas on a Raspberry Pi, resulting in the output Hello world!.
  • A modest place to relax in the mornings. Most of this was given to me, both new and second-hand, except for the plants, which I bought a month ago for less than 30 Euros.

    Two chairs and a small table are situated in a corner patio area, surrounded by flowering plants in pots.
  • It seems the basis of good 2D animation is solid drawing skills. Without it, the result will be poor, or, at best, occasionally hit, but mostly miss. I know where to spend my time in the coming months. I only hope I don’t lose my Divoom Master Pixel Artist status with still images.

  • I made a rough animation in the Animatic app on iPad and traced the frames into a pixel animation with Pixaki. It took much longer than I expected, but I’m pleased with the (very rough) result running on my Pixoo64 LED panel.

    A pixelated character is carrying a pink round object, wearing large brown shoes, and walking outdoors against a simple landscape.
  • I can’t escape the thought that BlueSky verification is another nail in the coffin of anonymity, which can be legit. Those up to no good just use identity theft to get around this trend of spying on people.

  • Not sure why servicing the connection to the Internet by one’s provider requires an outage, but I did have one of those for somewhat less than an hour. It was announced, but I missed it. Still, why the required outage?

  • While it’s fun to run races, it’s the training to prepare for those race which takes up most of the time. It also takes a lot of time to make one’s own training schedule that is balanced, tough enough to improve (or maintain) one’s fitness, yet flexible enough to appear recovered at the race.

    A runner wearing a bright green shirt and a race bib is participating in a marathon event, with spectators and event staff visible in the background.
  • I’m happy I ditched Strava in time, with their AI cr!$p. Now they’ve bought Runna as well, another AI-powered service. I’m sure free users will be bombarded with “promotions” to join Strava, because, guess what, the customers have to pay for all of that. The general consensus is Strava’s AI is bad.

  • I finished my marathon in Rotterdam, The Netherlands. Despite the worst preparation in years, I beat the time Runalyze predicted by more than 3 minuten. My official nett time was 4h42m48s (6:43 min/km, 10:48 min/mi). Especially after the 32 K mark it became exceedingly hard to keep running.

    A group of people, including a man in the foreground wearing glasses and a cap, gather outdoors likely for an event.
  • About task lists. Once I’ve finished a task, I’m done with it. I keep forgetting I’ll have to update the list constantly. This hasn’t changed since iOS 7 and before. I get no kick out of checking off items, and find it a bore.

  • I’ll be running a marathon on 13 April 2025. It almost didn’t happen because of injuries, which only healed a week ago. To celebrate in advance I made this jumble of legs, arms, and a confused head. Its animation lives on the Divoom community, where I became a master pixel artist, also this week.

    A pixel art character with a round head is performing a dynamic jump while wearing a green shirt and red-and-white sneakers against a blue background.
  • Using Quick Poses I found a reference for a pose. After pixeling the nude I put some clothes on her to avoid flagging on the Divoom community. BTW, it wasn’t quick at all.

    A pixel art illustration shows a person kneeling with their head tilted back, wearing a yellow top and purple pants, set against a gradient background.
  • A larger piece, and Fate/Apocrypha fan art. I know I can do better, if I weren’t so out of practice. I also might have traced a little to get it done, after spending more than 12 hours on it today,

    An animated character with blonde hair is wearing an orange sweater, dark shorts, and thigh-high socks, standing against a grid background.
  • It’s been a while since I posted some pixel art on here, while I’ve been inundating the Divoom community with my creations, being mostly recommended by the staff. I don’t judge it high art, but I can see why they want to see more of it. Most don’t seem to post anything, or at best it’s low-effort.

    A small pixel art house with a red roof and smoking chimney sits on a snail, set against a simple, muted background.
  • Seen on my 8 km long walk today. This obelisk commemorates 75 years of independence of the Kingdom of the Netherlands on 17 November 1813.

    A stone monument stands amidst lush greenery and trees, with inscriptions commemorating a historical event.