Warning: this is an htmlized version!
The original is here, and
the conversion rules are here.
-- This file:
--   http://anggtwu.net/SUBTITLES/2024-find-luaso-links.lua.html
--   http://anggtwu.net/SUBTITLES/2024-find-luaso-links.lua
--          (find-angg "SUBTITLES/2024-find-luaso-links.lua")
-- Author: Eduardo Ochs <eduardoochs@gmail.com>
--
-- (defun l () (interactive) (find-angg "SUBTITLES/2024-find-luaso-links.lua"))
-- (defun b () (interactive) (find-TH             "2024-find-luaso-links"))
-- (defun p () (interactive) (find-TH             "find-luaso-links"))
-- (defun R () (interactive) (ee-recompile-SUBTITLES-0))
-- (defun r () (interactive) (ee-recompile-SUBTITLES-3))
-- (defun r () (interactive) (ee-recompile-SUBTITLES-1))
--  (define-key eev-mode-map (kbd "M-r") 'r)
--
-- Skel: (find-subs-links "2024luaso")
-- Old:  (find-editeevsubtitles-links-1 "2024luaso")
--       (find-efunction 'find-editeevsubtitles-links-1)
-- Yttr: (find-yttranscript-links       "2024luaso" "zUW-6atPvUQ")
-- Info: (find-1stclassvideo-links      "2024luaso")
-- Play: (find-2024luasovideo "0:00")
--
-- I use the code below to generate the subtitles in .vtt.
--

ee_dofile "~/LUA/Subtitles.lua" -- (find-angg "LUA/Subtitles.lua")

--[[
-- (find-angg "LUA/Subtitles.lua")

** Run the .lua and tell it to
** write the .vtt - by default in /tmp/
*
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
dofile "2024-find-luaso-links.lua"
sts = Subtitles.fromsexps(subs_bigstr):addtime("14:16")
-- sts.lang = "pt-BR"
= sts
outfname = "$S/http/anggtwu.net/eev-videos/2024-find-luaso-links.vtt"
outfname =                           "/tmp/2024-find-luaso-links.vtt"
out = sts:vtt().."\n\n"
ee_writefile(outfname, out)
-- (find-fline                       "/tmp/2024-find-luaso-links.vtt")

** Test the .vtt
** (find-2024luasovideo "0:00")

** Select /tmp/ or ee-eevvideosdir
** (find-eevvideosfile "")
** (find-eevvideosfile ""   "2024-find-luaso-links.mp4")
** (find-eevvideossh0 "cp -v 2024-find-luaso-links.mp4 /tmp/")
** (code-video "2024luasovideo"                           "/tmp/2024-find-luaso-links.mp4")
** (code-video "2024luasovideo" "$S/http/anggtwu.net/eev-videos/2024-find-luaso-links.mp4")
** (find-2024luasovideo "0:00")

** Upload the 2024-find-luaso-links.vtt
** to http://anggtwu.net/eev-videos/
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd /tmp/
scp    2024-find-luaso-links.vtt $LINP/eev-videos/
scp    2024-find-luaso-links.vtt $LINS/eev-videos/
Scp-np 2024-find-luaso-links.vtt $TWUP/eev-videos/
Scp-np 2024-find-luaso-links.vtt $TWUS/eev-videos/

** Upload the subtitles to youtube
** http://www.youtube.com/watch?v=zUW-6atPvUQ

** Check that the "psne subtitles" thing works
** (find-1stclassvideo-links "2024luaso")

--]]

--[[
* (eepitch-lua51)
* (eepitch-kill)
* (eepitch-lua51)
dofile "2024-find-luaso-links.lua"
for li in subs_bigstr:gmatch("([^\n]+)") do
  local time,text = li:match('^.-"(.-)".-"(.*)"%)$')
  text = text:gsub("\\(.)", "%1")
  if time then print("  "..time.."  "..text) end
end

--]]


subs_bigstr = [==[
% (find-2024luasovideo "00:00" "Hi! My name is Eduardo Ochs, I'm the")
% (find-2024luasovideo "00:02" "author of an Emacs package called eev,")
% (find-2024luasovideo "00:04" "and the title of this video is:")
% (find-2024luasovideo "00:07" "Two ways of creating \".so\"s")
% (find-2024luasovideo "00:10" "for Lua, one of them very fast, both")
% (find-2024luasovideo "00:13" "using Emacs and eev.")

% (find-2024luasovideo "00:15" "And remember that a \".so\"")
% (find-2024luasovideo "00:18" "is one thing that you can produce")
% (find-2024luasovideo "00:21" "from a C file - for example you can start")
% (find-2024luasovideo "00:23" "with a C file like this one, and then")
% (find-2024luasovideo "00:26" "compile it to a shared object and then it")
% (find-2024luasovideo "00:30" "can be dynamically loaded by other")
% (find-2024luasovideo "00:32" "programs - for example from Lua...")

% (find-2024luasovideo "00:34" "Let me start by the \"very fast way\"")
% (find-2024luasovideo "00:38" "way of producing a \".so\", in which all the")
% (find-2024luasovideo "00:42" "details are hidden.")

% (find-2024luasovideo "00:44" "Suppose that I want to create a \".so\"")
% (find-2024luasovideo "00:46" "that defines a Lua function called")
% (find-2024luasovideo "00:47" "\"minusdiv\", and the body of the Lua")
% (find-2024luasovideo "00:53" "function is this thing here, these three")
% (find-2024luasovideo "00:55" "lines here. We can run this eepitch block")
% (find-2024luasovideo "00:59" "here... eepitch is explained in this page,")
% (find-2024luasovideo "01:03" "by the way...")

% (find-2024luasovideo "01:06" "we run it by typing f8 on each line...")
% (find-2024luasovideo "01:16" "this thing here created a C file")
% (find-2024luasovideo "01:20" "with lots of things besides the body")
% (find-2024luasovideo "01:23" "of this function, and then compiled it")
% (find-2024luasovideo "01:26" "using GCC, and then listed the...")
% (find-2024luasovideo "01:30" "sorry, the file is in the directory")
% (find-2024luasovideo "01:35" "/tmp/ - this one... and the \".so\" is here.")
% (find-2024luasovideo "01:40" "And it also loaded this file... so now the")
% (find-2024luasovideo "01:43" "function minusdiv is available... and if")
% (find-2024luasovideo "01:46" "we type f8 on this line here it says")
% (find-2024luasovideo "01:49" "that the result of of running minusdiv")
% (find-2024luasovideo "01:51" "with the arguments 20 and 2 is")
% (find-2024luasovideo "01:55" "18 and 10.")

% (find-2024luasovideo "02:00" "The details here are a bit boring...")
% (find-2024luasovideo "02:03" "they are all in a file called CLua1.lua,")
% (find-2024luasovideo "02:07" "that has an introduction... and then some")
% (find-2024luasovideo "02:10" "templates, and then the programs that use")
% (find-2024luasovideo "02:13" "those templates... and it also has some")
% (find-2024luasovideo "02:16" "demos in test blocks...")

% (find-2024luasovideo "02:19" "but it's better to start by this")
% (find-2024luasovideo "02:22" "other way here - the way 1, in which")
% (find-2024luasovideo "02:24" "everything is very explicit.")

% (find-2024luasovideo "02:25" "Suppose that I want to")
% (find-2024luasovideo "02:28" "create this file here... no, let")
% (find-2024luasovideo "02:32" "me start from the point in which the")
% (find-2024luasovideo "02:35" "the file is already created. let me open")
% (find-2024luasovideo "02:37" "this file here...")

% (find-2024luasovideo "02:39" "this is its code in C, this is the")
% (find-2024luasovideo "02:44" "body - these three lines here -")
% (find-2024luasovideo "02:46" "and somehow I created the rest of")
% (find-2024luasovideo "02:50" "the C code... and this thing here is")
% (find-2024luasovideo "02:53" "a test block - is something that I")
% (find-2024luasovideo "02:56" "can execute with f8s, and that will")
% (find-2024luasovideo "02:59" "compile the the \".c\", the file in")
% (find-2024luasovideo "03:04" "which I am, generate a \".so\", and test this")
% (find-2024luasovideo "03:08" "\".so\".")

% (find-2024luasovideo "03:10" "Let's run it here...  note that")
% (find-2024luasovideo "03:13" "here we have two different blocks that")
% (find-2024luasovideo "03:15" "define environment variables, this one")
% (find-2024luasovideo "03:18" "and this one... if we execute them in order")
% (find-2024luasovideo "03:22" "then the second block will override the")
% (find-2024luasovideo "03:24" "definitions from the first one. I'm on a")
% (find-2024luasovideo "03:27" "Debian system, so that's what I want... but I")
% (find-2024luasovideo "03:29" "have a friend who is testing this on Mac,")
% (find-2024luasovideo "03:32" "and what he has to do is to run these three")
% (find-2024luasovideo "03:35" "three lines here and skip these other lines...")

% (find-2024luasovideo "03:38" "anyway, I want to run these")
% (find-2024luasovideo "03:41" "lines here,")
% (find-2024luasovideo "03:43" "then this thing here...")
% (find-2024luasovideo "03:45" "now I have my file \".c\", my file")
% (find-2024luasovideo "03:49" "\".so\", and now I can run Lua and ask Lua")
% (find-2024luasovideo "03:54" "to load the \".so\" and to run this")
% (find-2024luasovideo "03:59" "function here here")
% (find-2024luasovideo "04:00" "to install")
% (find-2024luasovideo "04:03" "the Lua functions that are defined")
% (find-2024luasovideo "04:06" "in C in that file...")

% (find-2024luasovideo "04:08" "and now the function minusdiv is")
% (find-2024luasovideo "04:11" "available, and I can run it.")

% (find-2024luasovideo "04:13" "Note that this thing")
% (find-2024luasovideo "04:17" "loads... this thing tells loadlib to")
% (find-2024luasovideo "04:21" "run a function with this name, and the")
% (find-2024luasovideo "04:24" "function with this name is")
% (find-2024luasovideo "04:28" "defined here...")
% (find-2024luasovideo "04:33" "and that function")
% (find-2024luasovideo "04:39" "runs this line to install all the")
% (find-2024luasovideo "04:43" "libraries listed in this table here, and")
% (find-2024luasovideo "04:46" "one of these lines")
% (find-2024luasovideo "04:49" "is an entry for a Lua function")
% (find-2024luasovideo "04:52" "called minusdiv... the C function")
% (find-2024luasovideo "04:56" "that corresponds to it is")
% (find-2024luasovideo "04:59" "this one, and it is defined here.")

% (find-2024luasovideo "05:02" "So it's a bit boring to write a C")
% (find-2024luasovideo "05:05" "file like this one - unless you do that")
% (find-2024luasovideo "05:08" "all the time and you remember all the")
% (find-2024luasovideo "05:09" "details. I don't... I don't use these")
% (find-2024luasovideo "05:12" "things often, so for me it was much")
% (find-2024luasovideo "05:14" "better to create some functions based")
% (find-2024luasovideo "05:17" "on templates that would generate")
% (find-2024luasovideo "05:20" "the files for me.")

% (find-2024luasovideo "05:22" "Let me show how these functions work.")

% (find-2024luasovideo "05:26" "If I run this function here")
% (find-2024luasovideo "05:29" "it creates a temporary buffer that will")
% (find-2024luasovideo "05:33" "generate a file with this name here,")
% (find-2024luasovideo "05:36" "that defines a function like this...")
% (find-2024luasovideo "05:39" "in the first moment the function will")
% (find-2024luasovideo "05:41" "be just a stub... we will have to replace")
% (find-2024luasovideo "05:43" "its body by something else.")

% (find-2024luasovideo "05:46" "Let me start by running this. This is my")
% (find-2024luasovideo "05:50" "temporary buffer, if I run this line")
% (find-2024luasovideo "05:53" "Emacs switches to C mode, so everything is")
% (find-2024luasovideo "05:57" "much easier to understand because")
% (find-2024luasovideo "06:00" "of colors...")

% (find-2024luasovideo "06:03" "and this line here will copy the rest")
% (find-2024luasovideo "06:06" "of the file to the kill ring")
% (find-2024luasovideo "06:08" "and will open this file here.")

% (find-2024luasovideo "06:13" "Usually this file here is empty...")
% (find-2024luasovideo "06:16" "let me delete this file...")
% (find-2024luasovideo "06:21" "so now I'm in the in the typical")
% (find-2024luasovideo "06:24" "situation, in which this file is empty...")

% (find-2024luasovideo "06:28" "and if I run this thing here")
% (find-2024luasovideo "06:31" "then this function, ee-copy-rest, copies")
% (find-2024luasovideo "06:34" "the rest of this file to the kill ring")
% (find-2024luasovideo "06:37" "and now I can go to this buffer here")
% (find-2024luasovideo "06:39" "type C-y, and I get a copy of this thing.")

% (find-2024luasovideo "06:43" "Now I need to")
% (find-2024luasovideo "06:47" "replace this body here by something else...")
% (find-2024luasovideo "06:51" "let me delete it, first let me go back...")
% (find-2024luasovideo "06:54" "I'm going to use a copy of these lines...")

% (find-2024luasovideo "07:03" "and I also want to adjust my test...")
% (find-2024luasovideo "07:07" "the test is this one, the test will be")
% (find-2024luasovideo "07:15" "this one... and now let's test this thing.")

% (find-2024luasovideo "07:20" "I need to execute this thing to compile")
% (find-2024luasovideo "07:23" "the C file and to generate a \".so\"...")
% (find-2024luasovideo "07:27" "here it is, everything works...")

% (find-2024luasovideo "07:29" "and now I can run this Lua block")
% (find-2024luasovideo "07:33" "here... it loads the \".so\" and tests this")
% (find-2024luasovideo "07:38" "function... so that's it.")

% (find-2024luasovideo "07:42" "Let me go back to the \"very fast way\".")

% (find-2024luasovideo "07:45" "All these things are")
% (find-2024luasovideo "07:48" "explained in one of the...")
% (find-2024luasovideo "07:52" "well, sorry... most of the")
% (find-2024luasovideo "07:55" "documentation of eev is in sandboxed")
% (find-2024luasovideo "07:59" "tutorials... the main one is this one here,")
% (find-2024luasovideo "08:02" "and note that you can write")
% (find-2024luasovideo "08:06" "anything here, and do tests here...")

% (find-2024luasovideo "08:09" "and this thing is in a")
% (find-2024luasovideo "08:14" "temporary buffer - it's not saved in any")
% (find-2024luasovideo "08:16" "file, so you can do any mess that you")
% (find-2024luasovideo "08:18" "want here... and we have an intro")
% (find-2024luasovideo "08:22" "called lua-tutorial. It's in a very")
% (find-2024luasovideo "08:25" "preliminary stage, and at this moment it")
% (find-2024luasovideo "08:28" "has... most of its sections are")
% (find-2024luasovideo "08:32" "about creating \".so\" files...")

% (find-2024luasovideo "08:36" "and it has one section for using CLua1.lua")
% (find-2024luasovideo "08:40" "\"from the inside\", in the sense that...")
% (find-2024luasovideo "08:49" "in a sense that... oh, I'm without")
% (find-2024luasovideo "08:52" "internet here, so I can't run that demo")
% (find-2024luasovideo "08:56" "now... but the idea is that we")
% (find-2024luasovideo "08:59" "download three files in a subdirectory")
% (find-2024luasovideo "09:01" "of /tmp, and we adjust two environment")
% (find-2024luasovideo "09:05" "variables - one that tells Lua")
% (find-2024luasovideo "09:09" "which file to use as an init file, and")
% (find-2024luasovideo "09:13" "another one that says to Lua to add")
% (find-2024luasovideo "09:16" "that directory to the PATH...")

% (find-2024luasovideo "09:18" "and then the instructions will")
% (find-2024luasovideo "09:25" "explain how to use this thing here from")
% (find-2024luasovideo "09:27" "its test blocks...")

% (find-2024luasovideo "09:29" "for example, this block here")
% (find-2024luasovideo "09:31" "defines my main class, CLua, and if we")
% (find-2024luasovideo "09:35" "run this test block here...")

% (find-2024luasovideo "09:40" "I will need this smaller font")
% (find-2024luasovideo "09:42" "for a few minutes...")

% (find-2024luasovideo "09:44" "it loads the current file...")

% (find-2024luasovideo "09:47" "in this block here I have to choose")
% (find-2024luasovideo "09:51" "if I will compile on a Mac or on Debian...")
% (find-2024luasovideo "09:54" "I will choose Debian...")

% (find-2024luasovideo "09:58" "and now we have several tests that")
% (find-2024luasovideo "10:01" "explain... that show how the data")
% (find-2024luasovideo "10:04" "structures work, how the things work in")
% (find-2024luasovideo "10:08" "either in the lower-level functions")
% (find-2024luasovideo "10:10" "or in the higher-level functions...")

% (find-2024luasovideo "10:13" "and here we have some basic tests...")
% (find-2024luasovideo "10:19" "and here we have a higher-level function")
% (find-2024luasovideo "10:25" "that uses fewer arguments, and that")
% (find-2024luasovideo "10:32" "defines another way of creating a C file...")
% (find-2024luasovideo "10:35" "and now we can run this...")

% (find-2024luasovideo "10:38" "and in this block here we can check that")
% (find-2024luasovideo "10:41" "we can run buildandload twice")
% (find-2024luasovideo "10:44" "to define the function foo twice,")

% (find-2024luasovideo "10:46" "and in the first time the function foo")
% (find-2024luasovideo "10:47" "will have this definition,")
% (find-2024luasovideo "10:49" "in which it returns this string, \"orig\",")
% (find-2024luasovideo "10:51" "and in the second time we will redefine")
% (find-2024luasovideo "10:55" "that function...")

% (find-2024luasovideo "11:00" "so the function foo will be redefined")
% (find-2024luasovideo "11:03" "to be another function defined in C,")
% (find-2024luasovideo "11:06" "whose body is this, and that returns")
% (find-2024luasovideo "11:09" "the string \"redefined\"...")

% (find-2024luasovideo "11:11" "So we can use these blocks to test")
% (find-2024luasovideo "11:14" "several definitions of a Lua function")
% (find-2024luasovideo "11:19" "defined in C, and we can have a sequence")
% (find-2024luasovideo "11:22" "of blocks like that one...")

% (find-2024luasovideo "11:25" "and it's very easy to compare the")
% (find-2024luasovideo "11:27" "results of running, for example, this,")
% (find-2024luasovideo "11:32" "and running this...")

% (find-2024luasovideo "11:36" "and these lines here at the end just show")
% (find-2024luasovideo "11:38" "the templates corresponding to")
% (find-2024luasovideo "11:43" "the last execution of buildandload,")
% (find-2024luasovideo "11:45" "so we can see")
% (find-2024luasovideo "11:46" "what is the command for loadlib,")
% (find-2024luasovideo "11:51" "what would be the commands for require,")
% (find-2024luasovideo "11:53" "that I'm not not using now at")
% (find-2024luasovideo "11:56" "this moment, I'm using the lower-level")
% (find-2024luasovideo "11:59" "way of loading a C function...")

% (find-2024luasovideo "12:03" "and what are the commands for")
% (find-2024luasovideo "12:06" "compiling the \".c\" into a \".so"...")
% (find-2024luasovideo "12:10" "and what is the code in C, that")
% (find-2024luasovideo "12:14" "is just this...")

% (find-2024luasovideo "12:18" "so, let me go back... this section of the")
% (find-2024luasovideo "12:22" "tutorial explains how to use CLua1.lua...")
% (find-2024luasovideo "12:26" "I mean, it explains how to")
% (find-2024luasovideo "12:31" "download CLua1 in a subdirectory of")
% (find-2024luasovideo "12:35" "/tmp/, and how to run the tests in CLua1...")

% (find-2024luasovideo "12:40" "and this other block here")
% (find-2024luasovideo "12:44" "explains how to use")
% (find-2024luasovideo "12:46" "the faster way \"from anywhere\".")

% (find-2024luasovideo "12:51" "Once we have CLua1 installed in /tmp/ -")
% (find-2024luasovideo "12:54" "I'm putting things in /tmp/ because")
% (find-2024luasovideo "12:57" "I think that most people are just")
% (find-2024luasovideo "12:59" "going to try this for 5 minutes, very few")
% (find-2024luasovideo "13:02" "people will make this more permanent, so")
% (find-2024luasovideo "13:05" "it's better to put everything in /tmp/...")

% (find-2024luasovideo "13:08" "and this second block here can be run")
% (find-2024luasovideo "13:13" "from anywhere... I'm not in /tmp now,")
% (find-2024luasovideo "13:19" "and I can run this and")
% (find-2024luasovideo "13:25" "create two definitions of the")
% (find-2024luasovideo "13:28" "function minusdiv - the first one with")
% (find-2024luasovideo "13:31" "this C body here, and the second one with")
% (find-2024luasovideo "13:35" "this C body here, and each one has")
% (find-2024luasovideo "13:39" "some tests...")

% (find-2024luasovideo "13:44" "and that's it. I didn't explain")
% (find-2024luasovideo "13:48" "everything in a lot of detail here")
% (find-2024luasovideo "13:50" "because I guess that most people are")
% (find-2024luasovideo "13:52" "going to prefer to read")
% (find-2024luasovideo "13:53" "the textual instructions in")
% (find-2024luasovideo "13:57" "this page...")
% (find-2024luasovideo "14:00" "and I'm going to to start working on")
% (find-2024luasovideo "14:04" "that now. So this video is an")
% (find-2024luasovideo "14:07" "introduction... and the precise")
% (find-2024luasovideo "14:09" "instructions will be here.")
% (find-2024luasovideo "14:12" "So, that's it!")
% (find-2024luasovideo "14:15" "Thanks! =)")

(find-2024luasovideo "14:16" " ")
]==]

unrevised_bigstr = [==[
(find-2024luasovideo "00:00" " ")

]==]

-- Local Variables:
-- coding:  utf-8-unix
-- End: