Geek Logbook

Tech sea log book

Common table expressions

Specifies a temporary named result set, known as a common table expression (CTE). Microsoft Documentation Although there are some time around us the first time someone asked me about it I was confused: I haven’t know its proper definition until that momento. In fact, the common table expressions where added to the SQL standard in

Know your String Connection using SQL

I was looking how to know my server on the internet, and I’ve found this interesting question in Stackoverflow: How to get the connection String from a database. And one question give us an example of how do it using SQL: And it Works properly:

What is DOM? Why is it important to understand it?

The DOM tree is a crucial concept that needs to be understood and managed in order to make changes to a website. It allows for the application of styles to HTML elements and the addition of functionalities. By manipulating the DOM structure, content, and styles, we can modify the representation of a webpage. For that

Border Radius in CSS

One of the simples project I’ve found on the internet is change some characteristics of attributes in CSS using a kind of input in a web page. It’s a simple project, but always fun. This kind of useless project, because is not a “production ready” thing teach me some things that are not strictly related

Refactor or rewrite?

While I was reading The elements of programming style found the following quote: Don’t patch bad code – rewrite it The element of programming style – Chapter 4 – Page 1 Its make me think about an informal comments that different professionals have been made during these years: “Don’t touch code that it’s working”. But,

Django Jinja Isn’t a thing

I was reading about Jinja and an article on Wikipedia caught my attention: Jinja (template engine) At the beginning I read: Jinja is similar to the Django So, Django Jinja and Jinja projects are different? I don’t think so because, in the same article, the sources point to the Jinja2 documentation. And this also happens in the Django article

What $ in shell scripts means?

In this video: I saw the weird symbol: When I’m start looking about it on the internet I discovered that a lot of people has asked, and answered the question for a long time. As you can read in these question and its answer: This code is useful in order to know the exist status

Logging in a file to avoid print statements

A video that was enlightening We need to avoid the misuse of the print statements once we master the basic tools and ideas about programming in particular and software developer in general. So, here there are some notes about loggers. Loggers have five levels, by critically: By default we typically set info and above. This

Python calculate seconds and total_seconds

If you want to calculate the total seconds between two dates. You could be tempted to do a time delta and see the seconds. But this approach will give you an unexpected result. You have to use time_second. Return the total number of seconds contained in the duration.  https://docs.python.org/3/library/datetime.html#datetime.timedelta.total_seconds Source: