May 29, 2022

Automatic Tetris player with a cost function

The screenshot shows a Tetris simulator which is controlled by an Artificial Intelligence. The AI works with a feature vector which is visualized as a heatmap. The goal for the solver is to minimize the cost value. blue means that the costs are zero, while red is equal to very high costs.
The AI doesn't analyzes the main window which contains of the grid but the only important information is the feature vector which contains of the height and the holecount information. For the AI the world contains of two single variables.

May 24, 2022

Programming a Tetris game in Python



Tetris is perhaps one of the most common games ever. On the first look it looks simple but it is demanding at the same time. To get a better understanding about games in general it is recommended to program the game from scratch.
In contrast to a simple hello world program in python, the game of tetris can be called an intermediate challenge. For a beginner the difficulty is higher than writing down only some lines of code. The reason is, that the Tetris game consists of many modules which can have bugs everywhere. A good way in handling the complexity is to use object oriented programming technique. That means, the program is divided into smaller classes which are created separately.
For the Tetris game the following classes make sense: Game, GUI, Piece, Board and Physics. If each class consists of 50 lines of code, the overall software will need 250 lines of code. A short look into exiting Tetris clones at github will show, that this estimation fits to the reality. How exactly each class is written depends on the individual choices of the programmer. In case of the python language, it makes sense to use the pygame library and creating the Pieces class can be simplified by using patterns which are stored in a list.
The perhaps most difficult part of the game is the collision detection algorithm. The piece should stay within the border and if it hits other pieces it is not allowed that they overlap. From a technical perspective, such a collision detection system can be realized by comparing the content of a piece with the background. If two fields have the same value, a collision is there.

May 11, 2022

Can we trust Arxiv.org?

 

In the scientific community, there is a debate available about the pros and cons of the preprint server Arxiv. Critics are arguing, that arxiv isn't a peer reviewed journal in the classical sense which is equal to a low quality standard.
To verify or reject the thesis it makes sense to judge about the existing content at Arxiv. Suppose somebody is interested in reading something about Fuzzy logic for diet composition, about the Dean drive (which is some sort of antigravity) and about telepathy which is a psi phenomena known from the Ghost busters film. All these information are available at Arxiv:
Computation of Diet Composition for Patients Suffering from Kidney and Urinary Tract Diseases with the Fuzzy Genetic System arXiv:1306.5960
Experimental Null Test of a Mach Effect Thruster, arXiv:1301.6178
New Resonant Bivacuum Mediated Interaction, as a Possible Explanation of Psi Phenomena arXiv:physics/0003044
So we can say, that the arxiv submission pipeline has a strict quality control system which makes it unlikely that fringe content or non scientific knowledge is hosted on the website.

Learning french vocabulary with the Zettelkasten method

 

First thing to do is to organize the content by subjects. That means words are not simply structured from A to Z but there is a hierarchy available.
In contrast to the Leitner system there is no need to put the cards into bins. Instead the user is using a simple two pane folding editor which is organizing the content in a 1d array. The user has to type in the vocabulary manual and then use the pageup pagedown key to navigate in the information. This allows to memorize the information fast.
Suppose the user likes to know how to greet someone. Then he has to navigate to “2 Introductions” and there is a section for “Salutation”. The correct word is bonjour or salut to say hello.



May 09, 2022

Best practice for note taking

 

Steve: Hi, how are you?
Brian: Fine. You're are looking great.
Steve: Can you explain in easy words how to take notes?
Brian: For a certain subject, or in general?
Steve: In general, because in the past my efficiency was too low.
Brian: A common mistake in note taking is, that the users are trying to reinvent the Luhmann system.
Steve: Are you talking about Folgezettel?
Brian: Not only but also about the Luhmann id.


Steve: It looks like a mess
Brian: Yes, the nodes are sorted in a linear way which makes it hard to find something.
Steve: What can you recommend instead?
Brian: First thing to do is to create folders.


Brian: ... and then the id is removed because the outliner software handles the hierarchy by itself.


Steve: In the new note book it is much easier to write something because there is a clear structure available.
Brian: Exactly, The user can add new information in the existing folders or he can create new folders if he needs more space.
Steve: Can the software handle larger amount of information?
Brian: Sure, there is no limitation for the file size, it is possible to create notes which have 10 MB and more It is even possible to archive longer prose texts.
Steve: What is about search?
Brian: This feature is realized very well in the outliner program. The user types in a term and then he gets a list of all the hits.


Steve: Thanks for the explanation. I will implement the principle as soon as possible in my own note taking system.
Brian: This is recommended. Bye.

May 08, 2022

Linear note taking explained

 

Around the Luhmann note taking system there is a huge amount of confusion available. The reason is, that the Luhmann method is working the opposite of conventional note taking. Instead of trying to understand the advantages of index card and manual created registers, let us take a closer look how conventional linear note taking is working.
The idea is, that the user has a book in which he can write down notes. New information are put at the end. In the advanced setting, the book is divided into sections. But the idea is always, that new information are located only at the end of a section. This has to do with the underlying pipeline. The user is reading something in another book and writes down his ideas and comments into his own note taking book. Then the book gets formatted and will be published as a new scientific work.
Somebody may argue that this pipeline is so common, that there is no need to describe the principle in detail. The reason why it is so common is because the assumption is, that linear note taking is the only principle which is available. The advantage is, that the complexity is very little.
In the easiest case the note book has no sections so there is no decision needed at which position new information have to be added. They are put simply after the existing notes and if the book is full a new note book gets started. In a digital workflow the same principle is used. If the user tries to add something he scrolls with the cursor to the last paragraph, presses the enter key and adds a new paragraph.
If sections are used to structure the note book the pipeline is slightly more complex but not very much. In most cases, the user has created 2 up to 5 different sections so he has to decide at which section he likes to add something. In the example figure only 2 sections are available. The decision for the user is to add something at the end of section “brown fox” or at the end of section “lorem ipsum”.

May 05, 2022

Minimalist note taking

 

Steve: I would like to learn to create notes more efficient.
Benjamin: That's great, and i can tell you how.
Steve: Are you working with the Luhmann system?
Benjamin: Not exactly, I'm using my own principle
Steve: Tell me more about it.
Benjamin: It is hard to explain, but you can take a look. Here is a shoebox.
Steve: I see, there are hundreds of index cards in the box. How do you find something in the box?
Benjamin: I don't.
Steve: But, isn't it the idea of a note taking system that older information can be retrieved?
Benjamin: In the Luhmann system this is the case, but my shoebox is working the other way around.
Steve: Ok, let us make an example, which notes do you have about the LaTeX typesetting language.
Benjamin: LaTeX has at it's first letter an L. Unfortunately, i have no index ...
Steve: Luhmann was using in addition a thematic tree which is working with alphanumberical numbers. So perhaps we search in the cmputer section?
Benjamin: Ops, i have no sections and no IDs. There is no section about computers.
Steve: What?
Benjamin: Sorry, but the notes have no order at all, but i know there are some information about the TeX software in the box, but i doesn't know where exactly.
Steve: And how do you find it?
Benjamin: I will take the note number one from the box, scan the content and put it on a stack. Then i will take the next note from the box scan it and so on.
Steve: This will take endless amount of time.
Benjamin. No problem there is no need to hurry up. And perhaps we will find something else which looks interesting.
Steve: Thanks for the explanation.
Benjamin: See you later.

May 02, 2022

Small sheets or large sheets?

 

John: I'd like to know more about the Luhmann note taking system.
Robert: Are you a scientist?
John: Sure ...
Robert: I doesn't know much about the Luhmann system.
John: Come one, there was a card box, right?
Robert: Many of them.
John: And i have to put the index cards into the boxes?
Robert: Maybe.
John: Is this some sort of quiz?
Robert: Luhmann is death. He doesn't even used a computer, and his books have a low quality. So why are you trying to research the topic in detail?
John: I doesn't understand the advantage of using index cards over normal sheet of paper.
Robert: Can you be more specific?
John: A normal sheet of paper has the size of US-Letter or A4 which is 210mmx297mm. In contrast, an A7 index card has only 74mm by 105mm.
Robert: Luhmann has never used the A7 format but he was preferring A6.
John: The principle is the same. A single a4 paper can be divided into 4 individual sheets in A6. Why should somebody use the smaller size?
Robert: I understand what you mean. Smaller sheets are producing a mess by default.
John: Exactly, Normal A4 paper can be stapled together into a book. The book is a single writing area with unlimited amount of space.
Robert: I will tell you something. The difference between A6 and Aa4 is low. It depends on the content somebody has written.
John: You mean, we can ignore index cards at all?
Robert: Sure, modern database systems and word processing software have replaced former index card. The real debate is around analog vs. digital.
John: Perhaps you're right.
Robert: Yes, I am. Best luck for you. Bye.

May 01, 2022

Note taking with a space limitation

 

Brian: What are you doing?
Steve: Nothing,, i have reorganized my note taking system.
Brian: Sounds interesting, you're using Obsidian right?
Steve: Not really, i have switched over to a Luhmann note box.
Brian: I have seen the clip yesterday. The guy was sitting in a complete mess with endless amount of sheets.
Steve: No, you haven't understood what Luhmann has done. There is a system!
Brian: Right, explain it to me, please.
Steve: At first, you have to write down every idea on a small “post it” note.
Brian: Sure, and then i can arrange them on a wall in a certain shape.
Steve: No, this is the wrong system which is called kanban. Here, you have to put the sheets into a box.
Brian: Ok, that sounds logical. Do i need a certain size?
Steve: Yes, i mean no. It depends on the notecards.
Brian: I prefer a normal outliner software, is this ok?
Steve: Maybe.
Brian: Ok, what's next?
Steve: If the notes are stored in a virtual box, you browse from first to the last one.
Brian: Wouldn't it be easier to write down the notes on a single sheet of paper?
Steve: Nope, hundreds of pieces are better than a single one.
Brian: But then, there is no structure available, for example sections.
Steve: I'm not an expert, but i think this is the goal.
Brian: What is about external literature, how can i cite them?
Steve: The references are stored on notes as well but they are put into a separate box.
Brian: So i will need two outliner files?
Steve: Exactly. It is not recommended to combine normal notes with bibliographic notes. This would produce a complete mess.
Brian: You mean in addition to the existing one ... Sorry for this.
Steve: Tell me something, which sort of project do you like to organize?
Brian: Nothing in special, perhaps I'd like to write a book about sociology, or something like this.
Steve: Very good. Sociology consists of topics like culture, religion and economy. You will have to read a lot of books.
Brian: Thanks for the advice, bye.