Invoking the Incantations Contained in This Book
Invoking the Incantations Contained in This Book#
The role the code incantations play in this book takes various forms.
Firstly, the incantations are used to produce various treasures, assets and databases used in other parts of the book. Secondly, the incantations demonstrate how to work with the magical things we have created. Thirdly, the incantations itself form part of the story, explaining how we can come to create our own tools as we construct them, much like a blacksmith creates their own tools.
As suggested in the previous chapter, some of the incantations are made up and constructed anew, whilst others, often very powerful, third party spells and incantations, are shamelessly borrowed and reused. (As in the world of story, so in the world of code…)
At times, gaining access to some of these third party packages can be…somewhat complicated.
Not because the scripts aren’t readily available. Far from it… But rather because they sometimes take a quite a lot of setting up…
Just like the challenges that keep getting set by a King who really doesn’t want the tinker to marry his daughter, no matter how resourceful or capable the tinker appears to be: just when you think you’ve done everything you’ve needed, there’s always just “one more thing” to do…
Rituals are often performed in very particular order. Get the order wrong, and bad things may happen, if anything happens at all.
So click the Run buttons in the order they appear in the page, at least on your first run through the page. And click every one, just to be safe.
One a wish has been made, it’s outcome may remain available. Once you have created an named invocation by running a cell that defines the invocation, it will be available from all the other cells, wherever they are in the page.
If you break the order, or miss a step out, on your own head be it.
If you get in a pickle, there are a couple of ways out:
click “restart” to push the genie back into their bottle and then summon them again for a fresh start.
click “restart and run all” to to push the genie back into their bottle, summon them again for a fresh start, then make all the wishes in all the code cells in turn.
If you changed any of the incantation words, reload the page to reset them to how they work, and perform the genie summoning “click Live Code button ritual again.
Running the Code Inside the Book#
If you’ve read the previous chapter (How To Read This Book (Do Not Be Afraid)), you’ll know that the rocket themed launch menu in the toolbar at the top of the book page can be used to activate the code cells via a wish granting genie that exists somewhere on the internet.
And that by running the code cells you can execute the code within them, including any changes or additions you may have made to the incantations.
Running the Code Inside a Magical Grimoire Notebook#
As well as running our code invocations inside the online book, we can also open the pages in a magical grimoire that has its own genie attached.
Cells are selected inside the grimoire by clicking on them. The genie is asked to grant the wish by clicking on the grimoire play button when the wish cell is selected.
There are two ways to do this…
Take Me To the Binder#
One is to open the grimoire with an all powerful genie attached: from the rocket signed launch menu select the Binder option. This will summon a magical fairy wind that will carry you off to the far off lands of Jupyter and drop you inside a living notebook, within which you can edit all the text and change all the words of incantation.
Two little cloud icons with up arrows and down arrows let you save any changes you make (down cloud arrow) into a treasure chest buried in a dark dungeon buried deep within your web browser, or recover them from the treasure chest (up cloud arrow).
If you want to revert to the original version of a page after making changes, reload the page and don’t reload the notebook from the browser storage treasure chest.
Grant Me JupyterLite#
The other way is to select the RetroLite option from the rocket signed launch menu. For some pages, this will open a magic room inside your browser powered by a slightly less powerful genie who has been smuggled inside. Some of the more powerful commands, particular ones summoned from elsewhere, may not work inside this room.
One advantage of this second approach is that once the page is loaded in your browser, and until such as a time as you close the tab it resides in, you can take your computer to far off lands where the internet does not reach and, the little genie snuggled inside will still be able to grant some of your wishes.
If you make a mess of the spell page, click the jupyterlite button to take you to the waiting room, double clicj on the name of the notebook page you were editing, AND DELETE IT.
The changes will be gone, but if you double click on the link to reopen it, you find it has reverted to its original state, as if by magic…
At the current time, the How To Read This Book (Do Not Be Afraid) page is the best page to try the lightweight genie approach on.