Do you stay away from C++ too? You can do this there too
https://en.cppreference.com/w/cpp/utility/source_location/line
Do you stay away from C++ too? You can do this there too
https://en.cppreference.com/w/cpp/utility/source_location/line
This stuff is normally used for creating human readable error messages. E.g. printing the line of your code that actually set off the exception
The add
function in the example above probably traverses the call stack to see what line of the script is currently being executed by the interpreter, then reads in that line in the original script, parses the comment, and subs in the values in the function call.
This functionality exists so when you get a traceback you can see what line of code triggered it in the error message
What does git add xxx
do then
Git doesn’t automatically recursively add all files in the directory to the repository though - VSCode decided that should be the default behavior, while other editors (intellij) ask if you want to add newly created files to version control
Right? it screams wayyyy pre-y2k but MySQL was only release in 95
will it become a relic of the past?
Probably
why YEAR in the first place, who would actually make use of it?
Accounting systems in the 90s that needed to squeeze out every drop of performance imaginable
I expect it won’t
The year datatype is a 1 byte integer, but the engine adds/subtracts 1900 to the value under the hood and has special handling for zero.
If you need to store more than 255 years range, you can use a 2 byte integer, which doesn’t need that special handling under the hood, because with 2 bytes you can store 65000+ years
There are like 10,000 different solutions, but I would just recommend using what’s built in to python
If you have multiple versions installed you should be able to call python3.12
to use 3.12, etc
Best practice is to use a different virtual environment for every project, which is basically a copy of an existing installed python version with its own packages folder. Calling pip with the system python installs it for the entire OS. Calling it with sudo puts the packages in a separate package directory reserved for the operating system and can create conflicts and break stuff (as far as I remember, this could have changed in recent versions)
Make a virtual environment with python3.13 -m venv venv
the 2nd one is the directory name. Instead of calling the system python, call the executable at venv/bin/python3
If you do source venv/bin/activate
it will temporarily replace all your bash commands to point to the executables in your venv instead of the system python install (for pip, etc). deactivate
to revert. IDEs should detect the virtual environment in your project folder and automatically activate it
They aren’t talking about system administrators. They are talking about 3rd party software presenting a privilege escalation prompt (administrator access) and changing your default browser without you knowing about it
Python 3.12’s compiler tells you to fuck off
OSError: File or directory not found “C:WindowsSystem32”
Early mining required a mid-tier gaming PC, the kind you could finance with a paper route
Yeah but then ALL even numbers would be slow to compute because you would have to chain through every odd before you know that 2
is even.
Depends on the expected distribution of input values
It’s not a US thing - it’s also not super obvious from the picture but if you google men’s boxers half the products on the page have a fly
This has already been patched on all 64 bit OSes though - whatever 32 bit systems are still in existence in another 15 years will just roll their dates back 50 years and add another layer of duct tape to their jerry-rigged existence
Disable automatic updates then. snap --help
IMO snaps were prematurely pushed but that’s about it - they were a worse experience like two years ago when canonical started pushing them and almost every app had some quirk due to the sandboxing, but they have improved to the point that I literally can’t remember the last time I encountered an issue with the snap version of a program (granted I only really use snaps when something isn’t available as a .deb or there is a conflict)
It’s a package format that bundles all required libraries, that way you don’t run into the issue with program A requiring library version <1.1 and program B requiring library >1.3.
It leads to larger binaries because these dependencies are bundled, but it solves the issue with old/minimally maintained software not working on new OS versions because they depend on an ancient version of libssl or something.
The webserver that canonical uses to distribute other people’s snaps is, and that’s it. APKs aren’t proprietary just because Google runs the Play store.
If you don’t want to interact with canonical’s servers you can download the snap files from literally anywhere else and install them manually so you don’t have to touch a single line of non open source code.
You should look at how OPs example works before forming an opinion.
The python interpreter isn’t parsing comments, the add() function is just getting the current line number from the call stack context, and using a regex to spit out the numbers to the right of the “#” on the current executing line of the source code.