Fair enough. Because recursion always has a limit, in any language, the tutorials probably assume you're aware of this already. The specific limit in Python is adjustable, but there's no way to eliminate it altogether.
Do the tutorials actually include data/examples that run into the recursion limit? Or is it only when applying code like that to other data that you run into issues?
I ask because the easiest way to smash the limit is to create a cyclic data structure, which is trivial in Python. If you naively recurse such an object, it goes on forever - until it hits the configured limit or the machine runs out of memory, anyways. i.e. this case:
If you think it's possible your recursion code might have to deal with something like this, you usually end up keeping track of the objects you've already processed, and skip them if you see the same object again (typically by the object ID).
In many cases, you can also rewrite recursive code so that it's not recursive, and cannot run into this problem. As a bonus, problems that can be refactored this way usually run faster without the recursion.
Today's work. Sorry, murky low light photo, finished at sunset as usual.
Still space for more!
Can see the difference between birch and alder nicely there. The orangey stuff on the right is alder. Slightly less energy than birch but easier to light. Good firewood and what mostly grows in our forest as it thrives in the swampy parts near the river.
Those last two stacks are from a few fallen trees that were blocking the forest road.
The video from my #Moodle Academy webinar on #maths education using the #STACK question type. I do get quite excited during the presentation. I can make all sample questions available on request. I amused myself again when I heard me mention what I would do if I were/was independently wealthy.
Hat jemand einen Tipp, wie ich #STACK-Fragen in #moodle erstellen kann, ohne dass der Texteditor alle < maskiert (<) und damit für das CAS unlesbar macht? Aktuell bearbeite ich die xml-Datei extern und importiere sie dann neu, aber das dauert... #moodlebande
I have been using the #Moodle#STACK#maths related question intensely over the last few months. I had idly thought that it would be good to have an automated way of giving inputs and prts “sensible names”, i.e. instead of ans1, ans2 etc I could rename the input fields with things like width, area and have all references updated appropriately.
It turns out that the feature already exists under the menu Tidy inputs and PRT’s, wonderful!
Your exploit dev training journey starts right here!
Corelan’s “Expert-Level Stack” exploit dev course for Windows 11 delivers unmatched depth, quality, and hands-on experience.
What our students say on the #Corelan Stack course:
“Peter will refute about every single thing you might have learned so far related to the topic in other courses… and then teach you it the right way from the ground up”
I have made a short Youtube video about my upcoming Webinar on the #Moodle#STACK question type, which I will be delivering for the Moodle Academy on Tuesday 1st April 2025
The STACK question type is the most powerful and flexible maths related question available for any platform. With that power comes some complexity and this webinar I will address how it can be used by non experts. We will be showing ways of simplifying the question editing process and sharing resources.
#Moodle#stack#maths questions can be configured to “understand” units. This example shows where the answer is set up as 1m but it will also interpret 100cm and 1000mm as the same.
I would be interested in examples that showed real but very simple examples of how this can be used.