Recently I finished Bobby Fischer Teaches Chess. It’s a book explaining the concept of chess and some basic tactics, containing 275 puzzles. In this post, I’ll write a summary about it.
Continue reading “Bobby Fischer Teaches Chess Summary”Author: Boro Sitnikovski
Reflections on anxiety
The what
Anxiety is that feeling when you try to run away from something, but there’s actually nothing to run away from.
Here’s one definition, from Healthline:
Anxiety is your body’s natural response to stress. It’s a feeling of fear or apprehension about what’s to come. The first day of school, going to a job interview, or giving a speech may cause most people to feel fearful and nervous.
But it doesn’t always have to happen before or after some event. It can also happen randomly, e.g. when you chill, when you walk, etc.
The why
There are different anxieties.
In my case, it was/is due to over-analysis of even the most simple events in my daily life. For example, I was/am always considering the worst-case scenarios and how to handle them, should they happen, for each event. But the event can also be something in my head that didn’t really happen, my mind would just wander and start thinking of random possible situations. After thinking about it some more, I believe it relates to my profession, but that’s another topic for discussion.
But more generally, anxieties have to do with being less in the present, and being more in the past/future, or being more in some non-existent universe.
The solution
The obvious solution is to stay more in the present, but this is easier said than done. It is not hard at all, but it just requires practice and patience, as with everything else in life. Here I will share one hack that I found that seems to work.
We have thoughts. You can imagine they happen at one level. But a level above those thoughts is that with our thoughts, we can control our thoughts. (Do these levels really exist? I don’t know, but adding a structure makes it easier to explain for me and visualize for the reader)
One way to stay more in the present is to get rid of negative thoughts, by building a habit of positive thinking. To achieve that, one can build an “observer” in the mind, such that it will observe thoughts, and whenever a negative thought comes to it, it identifies it as soon as possible and switches the mind to something else.
Another way to stay more present is to physically stand up and regain control of your body. This also involves physical activity, like biking, jogging or swimming, or even walking.
Now, it gets a little bit more complex than that. For example, what is a “negative thought”? Sometimes these “negative thoughts” can save our life when the threat is real. The trick is to correctly distinguish fake threats from real threats:
- A very brief example, the thought of a bear chasing you inside a shopping mall is very unlikely, but it is likely in the deep woods (for people that have bear-related anxieties).
- For another example, if shortness of breath is due to anxiety, and not due to some underlying health condition, one should focus on their breathing and convince themselves that their health is okay (for people that have illness-related anxieties).
Personal appendix
Considering the levels again, I believe that a level above our thoughts is God; our very own ability to hack our mind comes from God. Here’s one quote that I like that seems to relate to anxiety:
He who forgets God takes upon himself the care of God, and the care of God is not for the weak human shoulders.
So, have faith and keep hacking!
Re-inventing the Monad wheel
Lately, I spent some time working on one of my Haskell projects: hoare-imp. It is basically an implementation of propositional calculus+first-order logic+number theory (Peano)+Hoare logic, and allows one to reason about computer programs, producing Hoare triples. The source code of this implementation is at around 600 LoC at this moment.
I will explain how I re-implemented a monad, and even used it without knowing about it. And I am sure you have done the same, at some point, too!
Continue reading “Re-inventing the Monad wheel”Algorithmic puzzle: Continuous Increasing Subsequences
In this blog post, we’ll tackle the following puzzle:
Given an array of integers, count the number of continuous subsequences, such that elements of every subsequence are arranged in strictly increasing order.
The optimal solution to this puzzle is to use the dynamic programming (DP) technique. But, in order to apply this technique, we first need to express the solution through a recurrent formula. So, I will start first by expressing it in Haskell, and then translate the implementation to PHP.
Continue reading “Algorithmic puzzle: Continuous Increasing Subsequences”Capturing Number Theory in Haskell
In Chapter VII of GEB, the author gives a description of Gentzen’s Propositional Calculus, along with some examples of applying its rules, and in Chapter VIII, the author gives a description of TNT (Typographical Number Theory).
In this post we’ll provide an implementation of these systems in Haskell.
Continue reading “Capturing Number Theory in Haskell”