I am not the only person using HTML tags deprecated in HTML4...

March 5, 2021, 5:57 pm
Today, I found these in... nginx error messages. Look, it is real:
<head><title>414 Request-URI Too Large</title></head>
<body bgcolor="white">
<center><h1>414 Request-URI Too Large</h1></center>
Here you see center and bgcolor. I thought that I am the only one using these in 21th century, but - nginx creators suprised me.

Direct link

More about the CA archiver

March 5, 2021, 11:15 am
In previous article I told you about CA, my own file archiver written in C in 30 minutes, but today I want to tell you more about this. First, I will explain the archive file format. Any CA file starts with a CA byte (in hex). After this signature, there is a record list - each file is one record consisting of file name, zero byte, file contents, and again zero byte. There is no compression and CA can store only files that do not contain zero bytes itself (practically they are text files). Even if this is disappointing for you (I expected it), for archiving old projects (source files) it is enough. To create a CA archive, you have to run ca make <archive_name> in the command prompt. It will create an empty CA archive - you can check this fact by listing it (ca list <archive_name>). To add a file, use ca add <archive_name> <file_name>. You can also extract or remove files from the archive using ca extract and ca remove commands. And, if you really want to use it, here is a link to the source code on: https://gist.github.com/Manna5/5d03e55851a5822261616d501354acb5.
Direct link

Writing an archiver in 30 minutes

March 4, 2021, 5:50 pm
The natural way to avoid mess on disk is archiving older files. But, instead of using Windows buit-in ZIP or CAB, I decided to create my own file archiver called CA (compact archiver) and it was very quick task. I written the first working version (list/add/remove/extract) in just 30 minutes. Of course, I will probably spend some more time fixing hidden bugs.
Direct link

Now for subtraction

March 4, 2021, 7:30 am
In the yesterday article describing how to add numbers in Brainf**k, I promised that I will write an article about subtraction tomorrow. As I said when I was five, tomorrow from the point of yesterday yields today. So, you may be suprised a little - to turn our addition algorithm >[<+>-]< to a subtraction algorithm we have to change only one character. The plus sign between < and > will be replaced with minus sign. We are using the same operation counting system, the only thing that we change is the operation itself - it was incrementation, now it is decrementation. But, the mentioned counting system has one big (especially for mathematical purposes) disadvantage - after addition or subtraction the B value is lost because it was used as a counter and it was finally set to zero. Because I currently do not know any BF repeating algorithm that do dot lose the initial counter value, we have to do it another way. Just, we have to use a copying procedure to backup B and restore it after operation. It will require some more BF code than plain addition and subtraction, but I will try to write it and post here today (from the point of tomorrow).
Direct link

Scrolling bug in OpenOffice Impress

March 4, 2021, 6:51 am
When I was making a presentation as computer science homework, I accidentally discovered a current slide scrolling bug in OpenOffice Impress 4 - when I paste a long text into slide and it beats current scrolling limits, scroll range will not expand. However, Ctrl+A still marked the unreachable part of text.
Direct link

Doing maths in Brainf**k

March 3, 2021, 9:12 am
If you do not know Brainf**k (BF), I want to tell you that it is a simple programming language what, despite its ugle name, is quite interesting. Why? It has only 8 instructions (wow!), and they have not got any arguments (woow!), but it is still usable (wooow!). Because I want to move to the main topic of this article now, you can read more at Wikipedia and go back later. Already know all BF instructions? Now I will explain you how to do more advanced mathematical operations than only incrementation and decrementation in BF. First, assume that A is the current cell and B is the cell next to it. Our first task is doing A+=B. The code for it will be >[<+>-]<. I will explain you how it works step-by-step. First, we are moving to B and trying to start the loop. If B=0, the loop will not even start, the interpreter will skip it and back to A. But, if B>0, the loop will add B to A one by one. First, it is going to A and incrementing it. Next, it is decrementing B. Why? Because need to know when stop incrementing A - when the addition is done. Metting the rules of BF, the loop and the operation will end when the additions is done: we have incremented A B times. To do not pass the character limit, I will end and explain you subtraction in BF tomorrow.
Direct link

RSS channel added.

March 3, 2021, 8:10 am
In the past, you could access my blog only with a web browser. Now, I created a RSS channel containing all posts on this blog. If you subscribe it (http://manna5.c1.biz/rssfeed.php), you will be always up to date with newest posts without opening the website every time.
Direct link

This was not vaccine reaction!

March 2, 2021, 7:52 am
When English lessons in my school was cancelled, I thought that it was unexpected vaccine reaction of the teacher, but it was not. She was affected by "real" coronavirus and she was ill. But now all is OK, English lessons also are back.
Direct link

Next >>