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
What (widely popular) race could possibly be a better metric of endurance than the marathon?
It’s not necessary but there is no reason not to.
Pros:
Cons:
venv/bin/python3
instead of just python3
in the run line of your dockerfileRight? 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
If you need a video to explain your graph, is it really that good of a visualization?
Probably because the week input is just a date picker that applies Math.floor()
on the result, and month inputs are better suited for a <select>
Chrome implements features that aren’t standards track into their browser, and lazy/oblivious devs use these features to build their products - only to realize wayyy too late it won’t work in Safari/Firefox because it uses APIs that are chrome only
You should be able to search by class name, find something salient in the Dom tree nearby and step over/up/down to your desired element
I mean I’m speaking from first hand experience in academia. Like I mentioned, this obviously isn’t the case for people running prohibitively costly experiments, but is absolutely the case for teams where acquiring more data just means throwing a few more weeks of time at the lab, the grunt work is being done by the students usually anyways. There are a lot more labs in existence that consist of just a PI and 5-10 grad students/post-docs than there are mega labs working cern.
There were a handful of times I remember rerunning an experiment that was on the cusp, either to solidify a result or to rule out a significant finding that I correctly suspected was just luck - what is another 3 weeks of data collection when you are spending up to a year designing/planning/iterating/writing to get the publication?
the danger is that valuable data from studies straddling the arbitrary p=0.05 line is simply being discarded by researchers
Or maybe experimenters are opting to do further research themselves rather than publish ambiguous results. If you aren’t doing MRI or costly field work, fine tuning your experimental design to get a conclusive result is a more attractive option than publishing a null result that could be significant, or a significant result that you fear might need retracting later.
Problem with that is that when you click a link in the teams PWA it opens in edge rather than your default browser. I just use the unofficial teams electron app
I’m aware, I’m just saying that if you make $5 worth of hummus you are going to be spending about the same amount (if not more) on pita. Compared to, e.g. a baked brie, where you need $3 worth of dipping instruments to consume $10-15 worth of dip
You should look at how OPs example works first maybe
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.