Hi! My name is Eduardo Ochs, I'm the author
of an Emacs package called eev
and the main idea behind eev is that you
can save
executable notes for everything that you
do and you can share these notes with
other people... possibly by putting your
notes on the web.
All the material about this video is
going to be in this page here, and the
title of this video is: "Running
executable notes from [my home page, which
is this one]
with `find-angg' and `find-wget'.
Let me explain what this means. Oh, by the
way, by the way -
this image is totally unrelated to the
presentation, it is just one of my favorite
CDs ever.
Let me use a smaller font here. These are
the things that I'm going to present.
I put all my executable notes on the web.
Practically everything - I mean, just a
couple of files that I don't put there.
Most of my notes are in these files with
.e at the end, in this directory here...
if we visit this directory -
let's wait one second, because it needs
to open Google Chrome... we see that it
contains many, many, many files...
Some of them
end with just the .e, and some of them
end with .e.html,
and the ones with .e.html are
converted versions. We can see this
header here, that explains that this is
an htmlized version...
and here you have a link to the original
version without the .html...
and here you have a very messy page
explaining the conversion rules.
One second, let me go back...
So, I'm going to show how to execute
executable notes from my site, and I'm
going to use one specific example that
is in my notes about Maxima, Maxima is
a program for
doing symbolic computation, and
numeric computation, and graphics, and
lots of things from Mathematics,
and my day job is as a teacher of
Mathematics, and so i've been using
Maxima a lot... I started using it
a few months ago and I'm finding it
really fascinating.
So, my notes are in
this file here...
if we open it in the browser we are
going to see that
it has some strange characters here... my
site doesn't even recognize that this
thing is UTF-8, and so some characters
look really wrong...
but if we run -
if we download a copy of this with
wget everything looks right...
actually I'm going to do something
different - I'm going to run wget to
download a copy of this thing
in a way that
sends the output to
the standard output, and I'm going to put
this output in a temporary buffer.
So, this sexp does that...
it takes a few seconds,
and then it downloads this file here -
you can see here the command - more or
less the command that was run,
this is an abbreviation, because it
doesn't say
exactly the command line arguments that
were used...
but you can see that
these characters appear right,
the red stars also appear
in the right way, and so on...
and note that when I'm in my machine I
can access the local copy of this file
with this sexp here...
this other sexp here is an abbreviation
to the previous one... so
this one essentially runs the same thing,
it adds a ~/ to the beginning... and this
third one is an abbreviation to this one...
so it takes this string, and it adds
a ~/e/ to the beginning
and a .e to the end.
So all these three are more or less
equivalent,
but there's a detail here.
When we call these
two sexps here with other arguments
these arguments are
interpreted as the tags in anchors.
So, if I run this...
if I run just this -
let me make a copy here - if I run just
this...
this argument here says that
we need to start at the beginning of the
file and then look for the first
occurrence of this string,
and it is here on line 112...
and if we if we run this other sexp here,
with `find-angg'...
this thing here is converted
to an anchor,
with these characters here
at the beginning and at the end...
and this sexp searches for the first
occurrence of that anchor in the file -
so it goes to this section here.
And this is the example that I'm going
to show in a few seconds.
This other one is equivalent, it's an
even shorter form of this one...
so it points to this example here...
and let me show what this example does.
If we type `f8' here several times
the `f8's on the lines that start with red
stars will set up a target buffer here,
running Maxima...
here we just got a new
Maxima session, here...
and the `f8's on lines that do not
start with red stars
will send these lines to
Maxima, and Maxima will run each of them.
So: here I'm doing some tests, then I'm
going to define a few functions...
then I'm going to run plot2d,
that shows a two-dimensional plot
of one of the functions that I've
defined... and then here I run plot3d,
that runs...
that displays a 3D plot that I can
rotate in several ways.
So: these files are on my machine,
and in principle if you want to find
these notes at the internet you need to
visit this thing here on the browser...
note that this anchor here...
ah, sorry -
this anchor here is in green, which is a
convention that I use to indicate that
this thing here was converted to an
anchor...
so, this
#2021-2-C3-diag-nums etc points
exactly to this anchor...
if we run either this or this...
this `find-wget' here, or the second one...
we get...
the wget downloads the html file,
which is not exactly what we want,
because it has these headers here... it has
some things that for humans
are usually garbage...
but if I run this `find-wgeta' here
it will download the
copy of this thing here, which is the
version without the .html, the version
that is not converted to html...
and the `a' here means to
look in this temporary buffer -
in the temporary buffer with the output
of wget - for the first occurrence of this
anchor here.
So let's test.
It opens the output of wget blah blah
blah, of this file with maxima.e at
the end, not maxima.e.html, and it
opens this section here...
note that this is a temporary buffer,
we haven't downloaded a copy
these maxima.e...
but even
this being a temporary buffer we can
execute these things by just typing f8
several times...
so if I type `f8's here -
in this temporary buffer! This is not a
file...
the first `f8's
create the Maxima session here, and then
the other `f8's send commands here...
and this command here
shows a nice 2D plot,
and this one shows a very nice 3D plot.
So these are my notes on a specific
thing on Maxima, a demo of
how a function looks...
and you can run this demo without
having to to download this file,
and this is what I mean with the title...
this is a way to run my executable notes
from my site with `find-wget'.
Let me now show something else.
I showed that when I run this
I run something that opens the
local copy of this file... it opens this
file here -
and when I run this thing here I open
this local file and I look for
the first anchor with this thing
between the
double angle brackets...
But here is a trick.
if you are not on my machine you can use
this thing
to make `find-angg' behave in another way.
This thing here will create a temporary
buffer with lots of instructions and
executable things...
and this first block
explains that this `progn' here
is how I define `find-angg' and `find-es'
on my machine to point to local files...
and here's a comment about how this
thing searches for anchors, and so on...
and this second section here
explains that in this `progn' here...
I mean, sorry... if we run this `progn'
here it will redefine `find-angg' and
`find-es'
in ways that use `find-wgata'
to download these files with
wget into temporary buffers...
and if there are extra arguments
here, like anchors, and other
strings, and so on...
this function will search for that
anchor and the other strings after that.
Let me first explain what I mean by
other strings.
If I execute this the `find-wgeta'
searches for this anchor,
and if I add this to the sexp...
this is a word in Portuguese, "Sejam"...
means "let"... then this sexp here will
first search for an anchor with
this name and then for the first
occurrence of the the word "Sejam" after
that...
so it goes to this position.
Anyway, let me go back.
We were here, and the thing is that if we
run this `progn' here it will run these
two `defun's, that will redefine
`find-angg' and `find-es' in a certain way,
and after running these `defun's,
`find-angg' will run `find-wgeta'
with the right arguments, and
`find-es' will run `find-wgeta' with the
right arguments...
so if we run this
we redefine `find-angg' and `find-es'...
and now if we run for example this sexp
here, it will run wget,
it will download this
URL here, and spit the output to the
standard output, and
`find-wget' will show that in the temporary
buffer, and in this case this thing will
search for the first occurrence of this
anchor in this file.
So: this is a temporary buffer with a copy
of this file from my site...
and this `find-angg' searches for
this anchor here...
and this `find-es' here does the same
thing, it's just a bit shorter...
so it runs `find-wget' in a
certain way and searches for
this anchor here...
and then we can run this thing here...
let me run it again just because it's
nice -
Here we have a 2D plot, and here we
have our 3D plot, that we can rotate
in very nice ways, blah blah blah...
so my notes are very hyperlinked,
with lots of links like this one,
that points to
another file in this directory here...
and to a certain section... oops,
usually to sections in these files,
using anchors...
and if you run this block here
you'll be able to use these things
even without being in my machine,
because you'll replace the definition of
`find-angg' and `find-es' by things that
download local copies and show them in
temporary buffers...
and in this way
you can follow links like this
to examples, and...
for example, if you're chatting
with me on IRC I can just send you a
link like this to show for example
how I do something in Maxima...
and you can run this to
download the local copy, show it in a
temporary buffer, and then you can
execute this to run the example.
So this is an easy way to run examples
without having to download anything,
and in many cases my
executable notes do not need any
installation,
they just need you to have some program
installed... in this case you just need to
have Maxima installed -
usually something like this will do
the job: "sudo apt-get install maxima"
this will probably
install everything that you need to run
this specific example.
Yeah, so that's it! That's what I
wanted to show... this page does not exist
yet, but it's going to exist in,
I guess, one hour or so...
and there you're going to
have notes like this and you'll
be able to try some sexps like this, and
see if you can run the examples...
and that's it! That's what i wanted to
show. Bye! =)