We started producing shows as Today with a Techie on 2005-09-19, 15 years, 10 months, 12 days ago. Our shows are produced by listeners like you and can be on any topic that "are of interest to hobbyists". If you listen to HPR then please consider contributing one show a year. If you record your show now it could be released in 10 days.
Response to HPR 3367 I describe how to specify page numbers in an EPUB eBook.
Hosted by Jon Kulp on 2021-07-22 is flagged as Clean and released under a CC-BY-SA license. Tags:ebooks, epub, scripting, calibre.
Listen in ogg, spx, or mp3 format.
This episode is a response to hpr3367 by Andrew Conway and Dave Morriss. One of the topics they brought up was the thorny issue of page numbers in e-books. Most of the time you don't need to worry about page numbers in ebooks, if you're reading fiction for example. The whole point of an ebook is that the texts can reflow to fit the page no matter what size the screen is or what font-size you've chosen. This is a major accessibility feature of all e-book formats. One reason you might want to specify actual page numbers, though, is if you're dealing with a technical or academic book, and you need to be able to refer to specific passages in the book by page number, as you are expected to do in academic research. Or, as Andrew and Dave were discussing, you might need to create an index in your ebook that would send your readers back to specific pages like in a paper book.
I've thought about this before but never really gotten into the weeds and figured out how to make it happen. In fact, when I was creating the new digital editions of the Counterpoint textbooks like I discussed in hpr1512, I actually took the trouble to put page number anchors through the entire thing, so that at a future date I would be able to enable real page numbers. This was a key part of the source file's infrastructure, which helped me quickly find the passages I was working on in my huge HTML file. Those anchors are not quite in the correct format for EPUB, but they are consistent and I will easily be able to write a script to fix them. I haven't done that yet, but now that I figured out how to do it on some smaller examples, this is on my to-do list.
Anyway while I was listening to Dave and Andrew talk about this, I thought I remembered reading somewhere that in the newest ePub specification, EPUB 3, there was support for publisher's page numbers to deal with precisely this issue. Their discussion prompted me to see if I could make it work. I'm happy to report success, although with some qualifications, which I will get into.
Converting to EPUB 3
The first thing to do is to upgrade your ebook from EPUB2 to EPUB3. There are a couple of ways to do this. The way I did it was to use the ebook editor in a recent version of Calibre. When you open up the EPUB for editing, go to the Tools menu and choose Upgrade book internals. This will create the new navigation file nav.xhtml to replace the old toc.ncx file. You'll need to edit this new file later to enable the page numbers.
Insert page anchors
Next you need to put your page anchors in there. This could be very tedious if you haven't done any preparatory work, such as putting visible page numbers in plain sight in square brackets  the way I did for a couple of ebooks. It wasn't very elegant, but at least it was easy to find where the page breaks were. I have a Blather voice command that triggers a python script to create these things. Here's an example of page number anchor, which goes in the main text of the book wherever you want to insert a page number. This will not be visible to the reader inline. This is for page 57:
Finally you need to put a page list in the new navigation file. This is simply an ordered list with hyperlinks to every page anchor that you put in your ebook. This will not be visible to the reader, but it's critical to making everything work. Here's a minimal example from my first attempt. This only covers Pages 122 to 126. This is the kind of page numbering you might need if you created an ebook from a five-page article from an academic journal that appeared in the middle of the volume.
I'm not sure it matters where you put this navigation block in the nav.xhmtl file, but I put mine between the table of contents and the landmarks blocks.
Scripting the creation of page list
It could be very tedious to create a page list like this, so of course I wrote a script to automate a lot of the heavy lifting. I'm sure Dave can write one that's more elegant than this, but this is what I came up with in about 5 minutes and it did the job, with the exception of putting the right URL for each link. I did a little bit of post-production to search and replace the URLs generated in the script with what I needed for the specific eBook. I think if you added a third command-line argument with a URL, you can solve this problem. The difficulty with larger books will be when you have more than one internal HTML file in the book, you will have to go through very carefully and make sure that the link goes to the correct file. I saved the script as pagelist.sh and put it in my $PATH.
Command to run to generate a page list from pages 42 to 61:
pagelist.sh 42 61
And here's the script:
# grab beginning and ending pages from 1st and 2nd
# CLI arguments, and specify a tmp file to put stuff
# put the top matter for the nav block
echo '<nav epub:type="page-list" hidden="hidden">' > $navfile
echo " <ol>" >> $navfile
# iterate through the page numbers making list item for each one.
# should replace filename with your ebook's actual filename
for i in $(seq $start $end); do
echo " <li><a href=\"filename.html#page$i\">$i</a></li>" >> $navfile
# close out the list and nav block
echo " </ol>" >> $navfile
echo "</nav>" >> $navfile
Then you just need to copy and paste what was generated from the script into your editor and make sure all of the URLs are correct, then stick that navigation block into the nav.xhtml file.
So, once you have the page anchors and the page list in place in your EPUB3 ebook, everything should work. The problem is that so far the only ebook reader I have found that renders the page numbers correctly on the screen is the iBooks app on iOS. I tried it on my Kobo dedicated eReader, on the Marvin ePub reader on iOS and on Overdrive on Android, and none of them displayed my shiny page numbers. iBooks was the only one, but it did so perfectly after choosing "show publisher page numbers" on the table of contents menu. It was pretty magical. A quick internet search confirms that there is very little e-book reader or app support for displaying these page numbers.
However, the embedded page numbers will still be useful if what you want to do is create an index that directs readers back to specific pages. On the one hand, indexes are not as critical as they used to be because you can search through the text of e-books very easily. What you can't do easily is browse an eBook the way you can browse a paper book index to see what topics might catch your eye. This might be something only academics do. It's not uncommon for an academic to pick up a book and flip right to the bibliography and the index!
This episode looks at the popular application Goodreads to see if it can be done better.
Hosted by Ahuka on 2021-07-16 is flagged as Clean and released under a CC-BY-SA license. Tags:social media, alternative, Fediverse, ActivityPub, Goodreads, library.
Listen in ogg, spx, or mp3 format.
Series: Social Media | Comments (0)
Federated social media can open up some wonderful possibilities to reimagine some of the social apps we already use and find ways to do them better. In this episode I want to highlight a talk that aimed at such a reimagining involving an app I already use, Goodreads. My main use of it is to manage my book library, but it also involves a social aspect where you can be friends with people and share book reviews, recommendations, and so on. So seeing how this can be done differently with ActivityPub was very interesting to me.
Part four of the three-part miniseries on deep learning and artificial intelligence
Hosted by monochromec on 2021-07-15 is flagged as Explicit and released under a CC-BY-SA license. Tags:GPT-3, OpenAI, Elon Musk, Microsoft, Bitcoin, meta-programming.
Listen in ogg, spx, or mp3 format.
Series: Linux Inlaws | Comments (0)
In this fourth part of our three-part miniseries on Deep and Machine Learning our two heroes shed some
light on a DL architecture called Generative Pre-Trained Transformer (GPT), a pretty sophistic piece
of software that fools most humans when it comes to authoring text (ideal for budding writers with
a block in place). Other topics of discussion includes OpenAI (the company behind this framework),
Elon Musk, Bitcoin, Microsoft and if the GPT can actually pass the Turing test. All will be revealed -
don't miss this episode!
Starlink is a satellite internet constellation being constructed by SpaceX providing satellite Internet access. The constellation will consist of thousands of mass-produced small satellites in low Earth orbit (LEO), which communicate with designated ground transceivers. The SpaceX satellite development facility in Redmond, Washington houses the Starlink research, development, manufacturing, and orbit control teams. The cost of the decade-long project to design, build, and deploy the constellation was estimated by SpaceX in May 2018 to be at least US$10 billion.
Product development began in 2015. Two prototype test-flight satellites were launched in February 2018. Additional test satellites and 60 operational satellites were deployed in May 2019. SpaceX launches up to 60 satellites at a time, aiming to deploy 1,584 of the 260 kg (570 lb) spacecraft to provide near-global service by late 2021 or 2022. SpaceX started a private beta service in the Northern United States in August 2020 and a public beta in October 2020, service beginning at high latitudes between 44° and 52° North.
On 15 October 2019, the United States Federal Communications Commission (FCC) submitted filings to the International Telecommunication Union (ITU) on SpaceX's behalf to arrange spectrum for 30,000 additional Starlink satellites to supplement the 12,000 Starlink satellites already approved by the FCC.
Astronomers have raised concerns about the constellations’ effect on ground-based astronomy and how the satellites will add to an already jammed orbital environment. In response, SpaceX has implemented several upgrades to Starlink satellites aimed at reducing their brightness during operation. The satellites are equipped with krypton-fueled Hall thrusters which allow them to de-orbit at the end of their life. Additionally, the satellites are designed to autonomously avoid collisions based on uplinked tracking data.
Plain text is turned to Markdown. Otherwise various Markdown flavours are acceptable, or an HTML5 fragment
If images are included the Markdown can refer to them with URLs such as: http://hackerpublicradio.org/eps/hprNNNN/name.jpg
The hprNNNN element is a directory using the number you chose for your show.
In the directory will be the images you sent.
Other assets will go there too so you can refer to these in your notes as well.
If you’re sending plain text, then markers such as >> Picture name.jpg here << will let me make the appropriate Markdown.
The directory also needs an index.html file, but my scripts will generate this if needed.
I intend to document this soon.
How Dave makes HPR shownotes
Uses scripts to manage show note generation
Uses Markdown when writing the notes
Scripts generate note templates and a Makefile
Automation using make
Uses Template Toolkit features inside notes to allow extra features
Notes go through a pre-processor (a script with access to the show metadata)
The end product is Markdown which is processed with Pandoc
Template Toolkit (TT2)
A Perl (and Python) tool kit for making templates
Good for generating HTML, but can generate any text
TT2 macros can be used to display scripts in shows relating to the subject, and to run them and capture the output. This makes it certain that the script on display really generated the output shown!
The 'Falkon' browser (originally called QupZilla) is great for monitoring notes since it updates when the HTML changes.
Dave confused it with Pale Moon (a fork of Firefox/Mozilla) when talking about tab grouping features
Should this (personalised) bundle of software be released to the world?
Probably yes, since the thoughts in it may be useful even if the code is not.
Consolidating show notes into a book
We had discussed the following topic a little in other contexts, and offline, but didn’t really look at it in this show. In brief, and for the record, the plans are:
There was a series on 'sed', the stream editor from the GNU project. It was called “Introduction to sed”, and consisted of 5 parts, which ran through 2016.
Each episode had short and long notes as well as several examples.
Work has begun on consolidating all of the long notes into a single document which will be released on the HPR site, in HTML and PDF formats. Perhaps ePub will be included if feasible.
It’s seen as critical that an index be provided so that topics can be found easily. At the moment this is simplest to achieve with the PDF version, using Andrew’s index generator as discussed in part 1 of this pair of shows.
Digression about experiences in UK Higher Education
Change of funding through the 1980’s to the 2000’s, particularly in IT
Moving from (often very clever) “home-brew” solutions to products from the big players like Microsoft and Oracle.
The change of management style to something more like the industry methods of earlier times, many of which had been discarded.
Perhaps there is scope for more discussion on this subject in another HPR show!
Released: 2021-07-01. Duration: 01:04:29. Flag: Explicit. Series:Linux Inlaws. Tags:Rust, actix, unsafe code, bulleted lists, pubs, OpenSearch.
A show with Steve Klabnik on corroded metal, hipster programming languages and the analogue world
Released: 2021-06-30. Duration: 00:06:57. Flag: Clean. Series:Podcast recommendations. Tags:infosec, podcasts, security, social engineering.
Presenting my favorite information security podcasts which focus on social engineering
Released: 2021-06-23. Duration: 00:05:19. Flag: Clean. Series:Podcast recommendations. Tags:electronics, robots, space exploration, engineering.
I go over the 4 electronics podcasts I am currently listening to.
Released: 2021-06-17. Duration: 00:47:10. Flag: Explicit. Series:Linux Inlaws. Tags:Keras, scitkit-learn, neural networks, Mars, Twix, Limitless, Life.
Part 3 of the miniseries on Deep Learning, politicians and other approaches to intelligence (or not)
Released: 2021-06-01. Duration: 00:15:04. Flag: Clean. Tags:Ethics,renewable,energy,poverty,solar,wind,conservation,green.
I read a paper I wrote about the ethical issues of renewable energy and conservation efforts.
Released: 2021-05-27. Duration: 00:06:06. Flag: Clean. Series:Podcast recommendations. Tags:infosec, podcasts, security.
Presenting my favorite podcasts related to information security careers and growth
Released: 2021-05-20. Duration: 00:57:33. Flag: Explicit. Series:Linux Inlaws. Tags:Policitians, artificial intelligence, deep learning.
Part 2 of the miniseries on Deep Learning, politicians and other approaches to intelligence (or not)