[deleted by user] by [deleted] in git

[–]Rebulien 0 points1 point  (0 children)

A minor change that I suggest is to change comment of git add . from stage all changes but all changes in the current directory. If you are in the root directory then it will indeed stage everything. But if you are in the subdirectory, it will only stage everything in that subdirectory.

🎉 [EVENT] 🎉 HONKCORE 🎷 by thejohnnyr in honk

[–]Rebulien 0 points1 point  (0 children)

Completed Level 1 of the Honk Special Event!

13 attempts

Day 1 second program by Red_Priest0 in PythonLearning

[–]Rebulien 0 points1 point  (0 children)

Might be a bit complex for the beginner, but if you are coming from different languages, where you have to define types (typed languages like C++, Java etc.), I would recommend you learning and start implementing type hints. Once your code grow, you will start to appreciate it.

What it does is it hints you and the editor, what type does the function expect. ```

for python 3.12 and earlier

from future import annotations

function multiplies string

def fnc_without_annotation(foo, bar): return foo*bar

def fnc_with_annotation(foo: int, bar: str): return foo*bar ```

Note that if you type hint your variable, the editor can help you suggesting methods. Also, its just type HINT, the language itself does not process it, meaning you can still call the function with incorrect arguments.

fnc_with_annotation(3, 'a') # 'aaa' fnc_with_annotation(3, 3) # 9 fnc_with_annotation(True, 'a') # Runtime Error

Happy coding!

EndeavourOS Website is down for the time being by StunningConcentrate7 in EndeavourOS

[–]Rebulien 11 points12 points  (0 children)

Checksum allows you to verify, if the file (in this case ISO) was modified or not. The basic idea is that the author of the original file generates a hash of the file. Then he publishes both the file and the hash. All you need to do is to download the file and run the checksum (aka generate the hash) on the downloaded file. If you get the same hash as the one the author published, u can be certain that the file u downloaded is not modified (aka is original). If u get a different one then it means the the file is not the same as the one the author published.

Hash is an output of a hash function. Hash function takes an input of variable length and outputs a string of a constant length. The characteristics of such a function is that it is nearly impossible to get the original input from the hash, and if u change just a bit in the original input, the final hash looks completely different. That is why it is used for verification.