Monday, May 11, 2026

The importance of competitive programming

What is the value of competitive programming especially in the current time where LLMs can solve the majority of those problems?

A good analogy of this would be a chess player that is striving to play chess on a higher level in order to achieve the title of a chess grand master, even tho the current chess engines like Stockfish have surpassed human players.

What is the point for a person to learn chess? The point is that even at this stage, the human mind and creativity can come with novel ideas that top chess engines cannot find. Human creativity comes from deep within us and cannot be replicated by a computer.

Another analogy would be an elite athlete such as a football or a basketball player that does the same drills over and over again in order to stay sharp and be prepared for the match day, the same applies for an engineer. Competitive programming problems act as drills, in order for the engineer to have a sharp mind. In this way, the engineer will have a better chance to shine when the time comes, when a difficult problem arises, he will be prepared.

Doing competitive programming on daily bases will facilitate the engineer with a good understanding of the fundamentals.

The following quote sums it up:

"I never get bored with the basics." - Kobe Bryant

Thursday, April 23, 2026

Search git users

Let's say we want to change our git username to another one. Instead of checking manually if the username is already taken, we can automate this process by writing a script named fgitusr. The content of the script looks like this:

if [[ !("$1" =~ ^[0-9a-zA-Z]{1}[0-9a-zA-Z\-]*[0-9a-zA-Z]{1}$) ]]; then
    echo "$1 DOESN'T MATCH REGEX"
    exit 1
fi
curl --output /dev/null --silent  --head --fail "https://github.com/$1"
if [ $? -eq 0 ]; then
    echo "USER $1 EXISTS";
else
    echo "USER $1 DOESN'T EXIST";
fi

The main idea is that we use curl to look if the url https://github.com/<username> is a valid link. If it is, then the user exist.

When user is found:

$ fgitusr foo
USER foo EXISTS

When user is not found:

$ fgitusr fobarfoo
USER fobarfoo DOESN'T EXIST

When user doesn't respect regex rules:

$ fgitusr foo_bar
foo_bar DOESN'T MATCH REGEX

The advantage of searching usernames with this method, is that you can automate the process. For example you can use a for loop over multiple usernames to check if every username is available:

$ for u in "abc" "bcd" "cde"; fgitusr $u
USER abc EXISTS
USER bcd EXISTS
USER cde EXISTS

Read Html inside terminal

This can be done by using curl and pandoc.

The command looks like this:

    curl <url> | pandoc -f html -t plain | less

After that you can go up and down with j and k keys. With this command you can read directly in the terminal. If you want to store the information in a text file, you could use this command:

    curl <url> | pandoc -f html -t plain > file.txt

Where file.txt is the name of the file where the information is stored.

To get a complete list of output formats supported by pandoc, you can use the command:

    pandoc --list-output-formats


The importance of competitive programming

What is the value of competitive programming especially in the current time where LLMs can solve the majority of those problems? A good anal...