Posts in the “technology” category

Radio Pi (formerly “Al Radio”)

I’ll write more about this as time goes on, but I’ve finished the first round of software (and hardware) development on my “Radio Pi” project (which, thanks to a friend, I now refer to as my “RadioPi” system). This project lets me play local FM radio stations, online radio streams, recorded radio streams, and podcasts, all from a little Raspberry Pi (RPI) computing system.

Video

First, here’s a short video of my RPI Radio in action:

[toc hidden:1]

A large collection of Gnuplot examples

I needed to use Gnuplot a little bit over the last few days, mostly to create 2D line charts, and these are my brief notes on how to get started with Gnuplot. If you haven’t used it before, it’s a pretty amazing tool.

Jumping right in ...

Installing gnuplot

Use MacPorts or Homebrew to install Gnuplot on Mac OS X systems:

port install gnuplot
brew install gnuplot

Sample data files

My examples use the following 2-column and 4-column data files:

[toc hidden:1]

ImageMagick: How to create a photo montage

Recently, I was looking for an easy way to create a montage of photos (or collage), and after a little research and testing I found that this ImageMagick montage works:

$ montage 1.jpg 2.jpg 3.jpg 4.jpg -geometry '400x400+2+2' -background '#333333' output_file.jpg

For more help on those montage command options, see this link or this link.

How to put multiple lines in a Markdown table cell (multiline table)

To create an HTML table in Markdown where a cell in the table has multiple lines (a multiline cell), use the HTML <br> tag to make the line into multiple lines, like this:

| Format   | Tag example |
| -------- | ----------- |
| Headings | =heading1=<br>==heading2==<br>===heading3=== |
| New paragraph | A blank line starts a new paragraph |
| Source code block |  // all on one line<br> {{{ if (foo) bar else   baz }}} |

I made the <br> tags in that Markdown text bold so they’re easy to see.

That Markdown text produces this HTML table output:

Format Tag example
Headings =heading1=
==heading2==
===heading3===
New paragraph A blank line starts a new paragraph
Source code block // all on one line
{{{ if (foo) bar else baz }}}

In summary, if you need to have a table cell span multiple lines when writing Markdown, use the HTML <br> tag, as shown.

How to convert Docbook to AsciiDoc

If you ever need to convert Docbook to AsciiDoc, this Pandoc command seems to work well:

pandoc --wrap=none -f docbook -t asciidoc \
       DocbookFile.xml > AsciiDocFile.adoc

As I have found out in the long run, if you want to edit the resulting LaTeX file, the wrap option is very helpful.

Facebook deleted the “Lists (of friends)” link

When I use Facebook, I like to use lists to group people that I know, friends, relatives, people from different states, etc. But on Thanksgiving of 2019, or maybe the day before, Facebook deleted the “Lists” link from their web app. It used to be with this group of links. I don’t use their app on my phone, so it’s pretty crazy that they removed this.

So, dear friends, if I don’t see and like your stuff, it’s not my fault. I’m sure not going to type in the name of each friend to see if they posted anything.

Update: You can find the Facebook “friends list/groups” URL here: facebook.com/friends/friendlist

Notes on how to transfer large music and movie files to an Amazon Kindle Fire HD 10 microSD card

These are some very brief notes on what I just did to get a 500GB microSD card to work with an Amazon Kindle Fire 10, so that I can store some very large files on that microSD card inside the Kindle Fire 10. The notes are cryptic, but hopefully they’ll make sense to me in the future, and may make sense to you as well.

How to delete individual pages from your Firefox browser history

This website used to be based on Drupal, and as a result I have a bunch of URLs like this in my Firefox browser history:

  • alvinalexander.com/node/add/blog
  • alvinalexander.com/node/add/photo
  • alvinalexander.com/node/add/misc

Since this blog is no longer based on Drupal, having those pages in my history is annoying, so I wanted to delete those individual URLs from my Firefox history.

Deleting individual URLs from my Firefox history

The steps to delete individual pages from your Firefox history aren’t obvious, but they aren’t too hard either:

Bazel docs style guide “Defining Principles”

These are the “Defining Principles” for the Bazel documentation, from the Bazel docs style guide:

  • Concise. Use as few words as possible.
  • Clear. Use plain language. Write without jargon for a fifth-grade reading level.
  • Consistent. Use the same words or phrases for repeated concepts throughout the docs.
  • Correct. Write in a way where the content stays correct for as long as possible by avoiding time-based information and promises for the future.

As technical writing goes, those are some smart ideas. Some time after I created this website I learned, “Anything I write here I have to maintain,” and it turns out that’s a lot of work.

Getting started converting documents with Pandoc

I’m looking into producing my Scala/FP book as a PDF, and as part of that I have been looking into Pandoc. With the exception of converting HTML tables into other formats such as Markdown or LaTeX, Pandoc has been working well so far.

Here are a couple of Pandoc commands to show you how easy this is:

# create a pdf from a markdown doc
pandoc test1.md -s -o test1.pdf

# create an html doc from a markdown doc, long form
pandoc test1.md -f markdown -t html -s -o test1.html

# convert markdown to latex
pandoc test1.md -s -o test1.tex
pandoc test1.md -f markdown -t latex -s -o test1.tex

# read a markdown doc and print html to stdout
pandoc -s table.md --to html

# convert a latex document to html
pandoc -s test.tex -o html

As a “note to self,” I confirmed that LaTeX to HTML approach in October, 2019. It creates a large, single-page HTML document. It’s not perfect, but it worked surprisingly well on a large LaTeX project.

As another note to self, this command helps a little bit with the Pandoc HTML to Markdown table conversion problem:

pandoc table.html --to=markdown_github -o table.md

As a better note, both of these commands work when converting tables in ODT and DOCX files to Markdown:

pandoc Test.odt -t markdown-simple_tables-multiline_tables-grid_tables -o ODT.md

pandoc Test.docx -t markdown-simple_tables-multiline_tables-grid_tables -o DOCX.md

I can confirm that those commands create pipe-delimited Markdown tables from ODT and DOCX input files.

For more information on Pandoc, see their getting started doc and user’s manual.

AsciiDoc FAQ: What is the AsciiDoc image syntax?

AsciiDoc FAQ: What is the AsciiDoc image syntax?

The AsciiDoc image syntax looks like this:

image:images/hello.png["Put the HTML ALT text here"]

This example assumes that you have a file named hello.png in a subdirectory named images. Here’s a more complete example that also shows an AsciiDoc image with a title/caption and HTML image “ALT” text:

[[unique_image_id]]
.Put the title/caption text here
image::images/hello.png["Put the ALT text here"]

I suspect that how the caption and ALT text is rendered will depend on your tools/toolchain, but this is the way I use it.

VisiCalc was written in assembly language

If you think programming now is difficult, VisiCalc was written in assembly language for an Apple II. Here are a few words from this web page that describe this code:

“Each line represents no more than one CPU instruction. The poll_keyboard subroutine call was important. As Bob Frankston describes it: ‘There were no interrupts nor a clock [on the Apple II]. If the user typed a character before the keyboard input buffer was emptied it would be lost ... To avoid [losing characters when the user typed fast during a CPU-intensive operation] I polled the keyboard in the middle of potentially long loops — keyboard checks were strewn throughout the code.”

The code was written at night while dialed into a time-sharing system with only a keyboard and printer.

It’s almost all on your cellphone

Almost every product on this 1991 Radio Shack ad is now on your cellphone (sans the scanner and radar detector).

How to use a non-default table column separator in Asciidoc

As a brief note, if you ever need to use a different column separator when creating a table in Asciidoc, you can do so by specific the separator field in the table preamble.

For example, in the following Asciidoc table I can’t use the default pipe character | to separate the table columns, because I need to use that character in the content inside the table, so I set the separator character to be : instead:

<<methods_to_combine_cmds>> lists the ...

.Methods to combine external commands
[[methods_to_combine_cmds]]
[cols=",",options="header",separator=:,]
|===============================
:Methods :Description
:`cmd1 #| cmd2`  :The output of the first ...
:`cmd1 ### cmd2` :`cmd1` and `cmd2` will be ...
:`cmd1 #> cmd2`  :Normally used to write to ...
:`cmd1 #&& cmd2` :Run `cmd2` if `cmd1` runs ...
:`cmd1 #|| cmd2` :Run `cmd2` if `cmd1` ...
:`cmd1 #&& cmd2 #|| cmd3` :Run `cmd2` is ...
|===============================

I shortened that content so you don’t have to read through all the non-essential text, but the image shows the actual resulting Asciidoc table.

For more information, this asciidoctor.org URL was the most helpful resource for me. This other page shows how you can specify format="csv" to create a table from a CSV-style syntax.

In summary, if you needed to see how to create an Asciidoc table with a non-default table column separator, I hope this example is helpful.