Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
-- This file: -- http://anggtwu.net/SUBTITLES/2022-pict2e-lua.lua.html -- http://anggtwu.net/SUBTITLES/2022-pict2e-lua.lua -- (find-angg "SUBTITLES/2022-pict2e-lua.lua") -- Author: Eduardo Ochs <eduardoochs@gmail.com> -- -- (defun l () (interactive) (find-angg "SUBTITLES/2022-pict2e-lua.lua")) -- (defun b () (interactive) (find-TH "2022-pict2e-lua")) -- (defun p () (interactive) (find-TH "pict2e-lua")) -- (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-editeevsubtitles-links-1 "2022pict2elua") -- (find-efunction 'find-editeevsubtitles-links-1) -- Yttr: (find-yttranscript-links "2022pict2elua" "hiHsUhGVLGM") -- Info: (find-1stclassvideo-links "2022pict2elua") -- Play: (find-2022pict2eluavideo "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 "2022-pict2e-lua.lua" sts = Subtitles.fromsexps(subs_bigstr):addtime("8:13") -- sts.lang = "pt-BR" = sts outfname = "$S/http/anggtwu.net/eev-videos/2022-pict2e-lua.vtt" outfname = "/tmp/2022-pict2e-lua.vtt" out = sts:vtt().."\n\n" ee_writefile(outfname, out) -- (find-fline "/tmp/2022-pict2e-lua.vtt") ** Test the .vtt ** (find-2022pict2eluavideo "0:00") ** Select /tmp/ or ee-eevvideosdir ** (find-eevvideosfile "") ** (find-eevvideosfile "" "2022-pict2e-lua.mp4") ** (find-eevvideossh0 "cp -v 2022-pict2e-lua.mp4 /tmp/") ** (code-video "2022pict2eluavideo" "/tmp/2022-pict2e-lua.mp4") ** (code-video "2022pict2eluavideo" "$S/http/anggtwu.net/eev-videos/2022-pict2e-lua.mp4") ** (find-2022pict2eluavideo "0:00") ** Upload the 2022-pict2e-lua.vtt ** to http://anggtwu.net/eev-videos/ * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) cd /tmp/ Scp-np 2022-pict2e-lua.vtt $TWUP/eev-videos/ Scp-np 2022-pict2e-lua.vtt $TWUS/eev-videos/ ** Upload the subtitles to youtube ** http://www.youtube.com/watch?v=hiHsUhGVLGM ** Check that the "psne subtitles" thing works ** (find-1stclassvideo-links "2022pict2elua") --]] subs_bigstr = [==[ % (find-2022pict2eluavideo "00:01" "Hi! My name is Eduardo Ochs - this person") % (find-2022pict2eluavideo "00:03" "here - and this video is about a library") % (find-2022pict2eluavideo "00:07" "that is being developed using test blocks,") % (find-2022pict2eluavideo "00:09" "and that is very easy to test") % (find-2022pict2eluavideo "00:12" "using test blocks.") % (find-2022pict2eluavideo "00:14" "All the most important information about") % (find-2022pict2eluavideo "00:16" "this package is in this page here...") % (find-2022pict2eluavideo "00:18" "let me show it in a browser...") % (find-2022pict2eluavideo "00:22" "and note that this paragraph says that") % (find-2022pict2eluavideo "00:25" "pict2e-lua is an \"uninteresting") % (find-2022pict2eluavideo "00:28" "library that has been developed in an") % (find-2022pict2eluavideo "00:30" "interesting way - with test blocks\".") % (find-2022pict2eluavideo "00:32" "And this is what we're going to see:") % (find-2022pict2eluavideo "00:34" "how I'm developing it, and") % (find-2022pict2eluavideo "00:37" "how it can be tested very easily.") % (find-2022pict2eluavideo "00:39" "Note that this page has a block that") % (find-2022pict2eluavideo "00:41" "says: Try it!") % (find-2022pict2eluavideo "00:43" "It says that we need to to run these") % (find-2022pict2eluavideo "00:45" "two eepitch blocks here...") % (find-2022pict2eluavideo "00:48" "This page has lots of links, so, for") % (find-2022pict2eluavideo "00:50" "example, if you click here you get the") % (find-2022pict2eluavideo "00:52" "definition of what is an eepitch block...") % (find-2022pict2eluavideo "00:56" "and what we have to do is to copy this") % (find-2022pict2eluavideo "00:58" "thing here to a buffer.") % (find-2022pict2eluavideo "01:01" "I'm going to copy it to a temporary buffer -") % (find-2022pict2eluavideo "01:04" "but i'm going to need a smaller font...") % (find-2022pict2eluavideo "01:07" "so, here...") % (find-2022pict2eluavideo "01:10" "these bullets here are") % (find-2022pict2eluavideo "01:13" "equivalent to the red stars...") % (find-2022pict2eluavideo "01:18" "and, so... let me execute") % (find-2022pict2eluavideo "01:20" "these two eepitch blocks... remember") % (find-2022pict2eluavideo "01:22" "that when I execute a line") % (find-2022pict2eluavideo "01:24" "that starts with a red star with f8") % (find-2022pict2eluavideo "01:28" "the rest of the line after the red star") % (find-2022pict2eluavideo "01:30" "is treated as Lisp, and executed as Lisp.") % (find-2022pict2eluavideo "01:35" "This is usually used to set up something...") % (find-2022pict2eluavideo "01:39" "usually used to set up a target buffer,") % (find-2022pict2eluavideo "01:43" "so these things here set up a target buffer") % (find-2022pict2eluavideo "01:46" "running a shell...") % (find-2022pict2eluavideo "01:49" "these two lines here make sure that I") % (find-2022pict2eluavideo "01:52" "have the debian packages that I need...") % (find-2022pict2eluavideo "01:59" "this setenv does something weird that") % (find-2022pict2eluavideo "02:02" "I'm going to explain later, but all the") % (find-2022pict2eluavideo "02:04" "rest is standard.") % (find-2022pict2eluavideo "02:07" "So... here I'm going to clone") % (find-2022pict2eluavideo "02:13" "this git repository.") % (find-2022pict2eluavideo "02:19" "And then the shell treats all these things") % (find-2022pict2eluavideo "02:22" "as comments, but we can treat them") % (find-2022pict2eluavideo "02:24" "as sexps that can be executed...") % (find-2022pict2eluavideo "02:28" "and this one here shows the contents") % (find-2022pict2eluavideo "02:31" "of the directory /tmp/pict2e-lua ...") % (find-2022pict2eluavideo "02:35" "and we can see that it has some") % (find-2022pict2eluavideo "02:38" "screenshots, READMEs, some .tex files,") % (find-2022pict2eluavideo "02:42" "and so on, and this weird thing here,") % (find-2022pict2eluavideo "02:46" "that is a copy of my init file for lua,") % (find-2022pict2eluavideo "02:50" "that I'm mainly going to use") % (find-2022pict2eluavideo "02:52" "because the library that we're") % (find-2022pict2eluavideo "02:54" "going to test uses some") % (find-2022pict2eluavideo "02:56" "pretty-printing functions") % (find-2022pict2eluavideo "02:58" "that are defined here.") % (find-2022pict2eluavideo "03:01" "So... this (setenv ...)") % (find-2022pict2eluavideo "03:05" "tells lua to read the init file from") % (find-2022pict2eluavideo "03:08" "this temporary directory here.") % (find-2022pict2eluavideo "03:12" "We need this sexp here... it defines") % (find-2022pict2eluavideo "03:15" "lots of functions, including this one") % (find-2022pict2eluavideo "03:18" "here: find-pict2elua ...") % (find-2022pict2eluavideo "03:22" "so now this function is defined, and we") % (find-2022pict2eluavideo "03:24" "can open these .lua files and run the") % (find-2022pict2eluavideo "03:26" "tests in them.") % (find-2022pict2eluavideo "03:30" "Here is one of these files. You can see") % (find-2022pict2eluavideo "03:32" "here a kind of index of the file and you") % (find-2022pict2eluavideo "03:34" "can see that some of these links here") % (find-2022pict2eluavideo "03:36" "point to tests -") % (find-2022pict2eluavideo "03:38" "for example if we follow this link here") % (find-2022pict2eluavideo "03:42" "we go to a test block, and we can execute") % (find-2022pict2eluavideo "03:44" "this test block with") % (find-2022pict2eluavideo "03:46" "a series of f8s.") % (find-2022pict2eluavideo "03:49" "Note that the f8s create a target buffer") % (find-2022pict2eluavideo "03:51" "running Lua, here") % (find-2022pict2eluavideo "03:55" "so they create several data structures") % (find-2022pict2eluavideo "03:58" "and they print these data structures in") % (find-2022pict2eluavideo "04:00" "several ways.") % (find-2022pict2eluavideo "04:02" "There's") % (find-2022pict2eluavideo "04:04" "one thing that is very tricky and this") % (find-2022pict2eluavideo "04:07" "page with details explains it -") % (find-2022pict2eluavideo "04:10" "hopefully explains it") % (find-2022pict2eluavideo "04:13" "well.") % (find-2022pict2eluavideo "04:16" "The thing is that") % (find-2022pict2eluavideo "04:20" "in some of the tests we need to show the") % (find-2022pict2eluavideo "04:22" "pdf file,") % (find-2022pict2eluavideo "04:25" "and we need to run and Emacs command that is") % (find-2022pict2eluavideo "04:27" "going to split the screen in this way,") % (find-2022pict2eluavideo "04:29" "and show the pdf file in this lower") % (find-2022pict2eluavideo "04:31" "right window -") % (find-2022pict2eluavideo "04:33" "and the command that does that is this") % (find-2022pict2eluavideo "04:35" "(etv) here so we have to define it in the") % (find-2022pict2eluavideo "04:39" "right way -") % (find-2022pict2eluavideo "04:40" "and the trick is that this header here") % (find-2022pict2eluavideo "04:42" "contains two blocks of one-liners") % (find-2022pict2eluavideo "04:47" "this is the first one and this is the") % (find-2022pict2eluavideo "04:48" "second one") % (find-2022pict2eluavideo "04:50" "and we need to execute all the sexps in") % (find-2022pict2eluavideo "04:53" "the second one") % (find-2022pict2eluavideo "04:56" "I'm going to execute them with M-7") % (find-2022pict2eluavideo "04:58" "M-e, that is equivalent to") % (find-2022pict2eluavideo "05:00" "M-e .") % (find-2022pict2eluavideo "05:04" "So: all done -") % (find-2022pict2eluavideo "05:06" "so now hopefully this function here is") % (find-2022pict2eluavideo "05:09" "defined in the right way.") % (find-2022pict2eluavideo "05:11" "And let me execute the last test in the") % (find-2022pict2eluavideo "05:14" "this file that that calls this function") % (find-2022pict2eluavideo "05:17" "(etv)") % (find-2022pict2eluavideo "05:20" "so the first part of the test is very") % (find-2022pict2eluavideo "05:22" "easy") % (find-2022pict2eluavideo "05:24" "nothing special - it just sends comments") % (find-2022pict2eluavideo "05:26" "to Lua - but then we have this line here") % (find-2022pict2eluavideo "05:29" "that calls a class called Show,") % (find-2022pict2eluavideo "05:34" "and this class saves") % (find-2022pict2eluavideo "05:36" "some TeX code to a .tex file and run") % (find-2022pict2eluavideo "05:38" "latex to compile that and to generate a") % (find-2022pict2eluavideo "05:40" "pdf") % (find-2022pict2eluavideo "05:42" "and this is a bit tricky - and the") % (find-2022pict2eluavideo "05:44" "important thing is that this") % (find-2022pict2eluavideo "05:46" "takes several seconds to run and we need") % (find-2022pict2eluavideo "05:48" "to wait these several seconds.") % (find-2022pict2eluavideo "05:51" "So: if I send this this line here to the") % (find-2022pict2eluavideo "05:55" "Lua REPL") % (find-2022pict2eluavideo "05:57" "you can see that it takes a few seconds -") % (find-2022pict2eluavideo "05:59" "until it says blah blah Success!!! and now") % (find-2022pict2eluavideo "06:02" "we can run this (etv) here") % (find-2022pict2eluavideo "06:05" "and it shows a drawing here with the") % (find-2022pict2eluavideo "06:09" "with the bounding box in yellow.") % (find-2022pict2eluavideo "06:15" "In this file here the drawings are") % (find-2022pict2eluavideo "06:18" "not very interesting -") % (find-2022pict2eluavideo "06:21" "this is just the core of my library - so") % (find-2022pict2eluavideo "06:24" "let me show how to") % (find-2022pict2eluavideo "06:28" "generate this drawing here that") % (find-2022pict2eluavideo "06:30" "I'm using in the") % (find-2022pict2eluavideo "06:32" "screenshots - this one.") % (find-2022pict2eluavideo "06:40" "This defun here defines the function `a'") % (find-2022pict2eluavideo "06:43" "as a function that opens the first Lua") % (find-2022pict2eluavideo "06:45" "file - with the core definitions - and `b'") % (find-2022pict2eluavideo "06:48" "defines b is the function that opens the") % (find-2022pict2eluavideo "06:50" "second Lua file") % (find-2022pict2eluavideo "06:52" "with some extra classes and some") % (find-2022pict2eluavideo "06:54" "stranger drawings.") % (find-2022pict2eluavideo "06:56" "So") % (find-2022pict2eluavideo "06:58" "let's execute `b'.") % (find-2022pict2eluavideo "07:00" "We are in the second file here") % (find-2022pict2eluavideo "07:03" "and let's execute this test here") % (find-2022pict2eluavideo "07:07" "uh - sorry") % (find-2022pict2eluavideo "07:09" "this one: Plot2D-test2.") % (find-2022pict2eluavideo "07:12" "So here we have") % (find-2022pict2eluavideo "07:14" "a test block -") % (find-2022pict2eluavideo "07:16" "it's quite big - it defines...") % (find-2022pict2eluavideo "07:19" "it changes the preamble,") % (find-2022pict2eluavideo "07:21" "it defines several functions, it uses") % (find-2022pict2eluavideo "07:23" "some") % (find-2022pict2eluavideo "07:24" "classes that are defined in this file,") % (find-2022pict2eluavideo "07:26" "and so on...") % (find-2022pict2eluavideo "07:28" "and then after printing the TeX code") % (find-2022pict2eluavideo "07:32" "it has this line here that contains a") % (find-2022pict2eluavideo "07:34" "show") % (find-2022pict2eluavideo "07:35" "if I execute to this line it takes a few") % (find-2022pict2eluavideo "07:38" "seconds... it says Success!!! and now we can") % (find-2022pict2eluavideo "07:40" "show the .pdf.") % (find-2022pict2eluavideo "07:43" "And: ta-da!") % (find-2022pict2eluavideo "07:44" "this is the figure that I wanted to show.") % (find-2022pict2eluavideo "07:47" "So, that's it.") % (find-2022pict2eluavideo "07:50" "Again:") % (find-2022pict2eluavideo "07:51" "this is a") % (find-2022pict2eluavideo "07:53" "library that is not interesting in") % (find-2022pict2eluavideo "07:55" "itself, but") % (find-2022pict2eluavideo "07:56" "i think that the way in which it can be") % (find-2022pict2eluavideo "07:58" "tested - which is very similar to the way") % (find-2022pict2eluavideo "08:01" "in which I'm developing it") % (find-2022pict2eluavideo "08:03" "is interesting in itself - so") % (find-2022pict2eluavideo "08:05" "if you are interested in test blocks") % (find-2022pict2eluavideo "08:08" "please test this,") % (find-2022pict2eluavideo "08:10" "and send feedback. That's it! bye =)") ]==] unrevised_bigstr = [==[ (find-2022pict2eluavideo "00:00" " ") ]==] -- Local Variables: -- coding: utf-8-unix -- End: