Category: computer constructs

  • Computer constructs: loops

    Loops probably aren’t new to most readers here. Yet, they are used in some less obvious scenarios.

    The following is by my understanding.

    Probably a lot of us have written a program that finds a number to a certain exponent. Therein, one might use a loop to continue multiplying the starting value by itself until it’s done so the exponent number of times. Then, the loop exits and the program tells the result.

    For me, learning programming, the loop idea like above was straightforward enough. It became obvious why some operations needed to be repeated until a certain condition was reached. I came to really like loops and what they could do.

    When I learned that input devices, such as a PC or smartphone, or even a calculator, typically use a loop to discover if the user has entered something, I was surprised. It seems a background loop is always running: during said cycle, the device checks every potential input, such as the keys and the ports, for activity. Detecting activity, it responds. Else, it “waits” by just continuing the loop.

    I wondered about the reason for the looping design, but it seems it’s because it simplifies the question of which key or port is being triggered that instant. The device discovers the key press, for instance, when it checks if that key is pressed as part of its routine loop. Finding it is pressed, it knows which key has been activated because of the position in the loop when the impulse was discovered.

    With the speed of computers, it’s easy to tell which key was pressed first, etc. Let’s imagine a “low” scan rate of 125Hz. That means 125 times per second the computer checks each key to see if it’s pressed.

    Interesting, eh?

    Source:

    akkogear.eu (Dec 26, 2025). “Keyboard Scan Rate Explained: What You Need to Know.”

    Eweadn.com (Apr 16, 2026). “What Are Polling Rate, Scan Rate, and Latency? Keyboard Performance Specs Explained.”

    -js

  • Computer constructs: what is a virtual machine?

    One often hears about virtual machines. What are they, and why would one need one?

    The following is by my understanding.

    A virtual machine acts like a computer inside another computer. It has its own operating system, which can be different from that of the computer it’s running on. For instance, on a virtual machine, one can run Linux on a Windows PC. Or, one can run Windows XP on a Windows 11 PC.

    The reason for the versatility of virtual machines is that one first loads the software to run virtual machines in general. In many cases, said software is open source. Then, once said software is loaded, one can pick from a list the operating system one wants, and even how much ram, CPU power, and disk space for it. One has to download an image of the operating system desired, but in my understanding many are available, including proprietary, older ones such as Windows XP.

    I’ve created virtual machines to run Linux on a Windows PC, but not the other way around – yet. However, I do have an old scanner compatible with Windows XP. It seems possible I could install virtual machine software on this Linux PC, then download an XP iso file and install XP to a virtual machine. I haven’t gotten around to it yet, but it’s on the list. Otherwise, the scanner will need to be recycled.

    Source:

    Buchanan, Ian (2026). “Containers vs Virtual Machines.” Atlassian.com. https://www.atlassian.com/microservices/cloud-computing/containers-vs-vms

    azure.microsoft.com: “What is a Virtual Machine?

    docs.oracle.com

    -js

  • WordPress: plugin update says failed, yet json response says success:true

    Working with WordPress, plugins continue to raise questions…and perhaps mixed messages.

    The following is by my understanding.

    Today, when I went to post to a WordPress site, I was told by a plugin that an update was available. One is meant to update a plugin when possible, similar to other updates, because often updates are motivated by security. So, I updated the plugin.

    I got a response back: update failed. Yet, in the json response, I read “success”:”true”. Was the update a failure or a success?

    I went to Tools->Site Health, where it would be indicated if a plugin update were available: none was. I decided that, in fact, the update had been successful.

    -js

  • Computer constructs: caches, part 0

    What is a cache? What are some types of them?

    The following is my understanding about caches.

    In French, cacher means “to hide.” However, in woods-person terms, “to hide” and “to store” are closely related, because storing food means hiding it from foragers. Hence, a cache is, functionally, a place to store stuff.

    In computer terms, a cache typically means a place where results are stored so the CPU doesn’t have to figure them out again. Rather, said responses can just be brought from storage immediately. Cache storage needs to be fast in order to effectively save time.

    Types of caches have evolved. They may be classified on how fast they are to retrieve from, as well as by what they store. In the web world, for instance, page caches store pre-built pages that are called for often. Object caches store answers to database queries, for instance, that are often requested. Opcode caches store parts of computer programs that are run often. In each case, the code has been refined into a finished solution, or closer to one, so the CPU doesn’t have to start from scratch to respond to a request.

    On a website that delivers complex content, such as a WordPress site might become, all three of the caches described above might be used. Typically, without a cache, the content may be delivered noticeably slower compared to when a cache is used. At high levels, caches can be calibrated to be even more efficient.

    Source:

    php.net: OPcache

    gxmediagy.com: “OPcache, Object Cache, and Page Cache: The Three Layers That Make Websites Feel Instant”

    -JS