Devolution of the Word “Meme”


By Gene Wilburn

Photo by Peter Lam CH on Unsplash

Sure, you know what a meme is. It’s a picture with words, usually humorous, sometimes acerbic. You see dozens of them each day if you’re on social media. You probably share really funny ones with friends. And, as you’ve seen, there are hundreds of cat memes floating around the Internet.

But did you know that the word meme has strayed from its intended meaning?

Meme is not an old word. It is a word coined by Richard Dawkins in 1975 in his landmark book on biology, The Selfish Gene. It is a foreshortening of the Greek word mimēma ‘that which is imitated.’ It was intended to signify ideas that spread through a population in the manner of a gene, though faster.

Think of ideas that have swept through populations: philosophical or religious beliefs, the idea of a renaissance, the concept of an age of reason, to highlight a few. On the societal side, think of political phrases like “lock her up” and “#metoo” that have spread far and wide.

In an interview with Newsbeat, Dawkins admitted that “I’m not going to use the term internet meme to refer to a picture with writing on it.” For Dawkins, memes are “ideas that spread from brain to brain — a bit like genes, they are replicated many times.”

And so it is that while gaining a popular new word for pictures with captions (now its primary meaning in dictionaries), we’ve mostly lost an intellectually useful word to explain how ideas spread.

One thing linguists always tell us: language is in a continual state of change. Words change meaning, and there’s nothing we can do to stop it. It’s the way language works. We may rue the change in the meaning of meme but it’s now a done deal.

As Kurt Vonnegut, Jr. often wrote, “And so it goes.”


Gene Wilburn is a Canadian writer, photographer, and retired IT specialist.

Dictionaries – A Writer’s Best Friends


by Gene Wilburn

Webster’s New World Dictionary. Photo by the author.

Words are … the most powerful drug used by mankind ― Rudyard Kipling

Words are the core stuff of writing―its quirks, quarks, roots, and branches. To form sentences and paragraphs, we use words. To express ideas, thoughts, plots, characters, dialogue, or scenes, we use carefully crafted combinations of words. The richer our vocabulary, the more precise and elegant we can be, not to impress the reader, but to seek le mot juste, the perfect word or words to describe or express something.

As a self-appointed dictionary evangelist, I believe all writers should love and use dictionaries. They’re the gateway into our language’s word horde, and English has the largest word horde of any language as measured by the number of entries in a dictionary — over a million words and counting.

Dictionaries provide not only the correct spelling of a word (including variant spellings), but also the definitions of words and the nuances of distinction between a word and a word with a similar, but not exact, meaning. Today’s online dictionaries even come with an audible pronunciation guide, to enable you to pronounce the word correctly in speech.

Selecting a Desktop English Dictionary

If you don’t already have a preference in dictionaries, and would like a print dictionary to keep on your desk, any of the so-called college desk dictionaries will provide you with an excellent companion and guide. Top Choices for American English include:

These dictionaries not only provide spelling, pronunciation, and syllabification, they define words, and give a bit of the word’s history, or etymology. These are among the most handy dictionaries available.

Canadian writers might also want to supplement one of the above with a paperback copy of the Oxford Canadian Dictionary of Current English to check on Canadian spelling preferences for Canadian publications, such as colour instead of color and other words with -our spelling, and doubled consonants in words such as counselling.

Some of these dictionaries are also available in ebook format or as an app for phone or tablet. My favorite dictionary app for American English is provided by the august Merriam-Webster company, publisher of the definitive Third International as well as smaller dictionaries. On my iPad, I use the Merriam-Webster Dictionary and Thesaurus app almost daily and consider it the best dictionary app I’ve used. It can be obtained from the app store for your iOS or Android device.

Online Dictionaries

If you simply want to quickly check the spelling of a word, Google (or your search engine of choice) is your friend. A quick check on Google will usually zero in on the spelling you want, even if you don’t spell it totally correctly.

Beyond Google, there are free online dictionaries that might suit your needs as well as a desk dictionary. Here are some that you might want to bookmark:

Urban Dictionary

This site is a terrific aid to writers writing contemporary fiction and who want to include some of the latest in colloquial and slang terms and expressions. It’s kept very up to date on the latest words, some of which are at least semi-vulgar. You know. The way people actually talk. These recent words can add spice or variety to your character’s dialogue. E.g., Cape: “When someone is protecting, covering for or being a ‘hero’ for another person — ‘Lisa always gotta cape for Jay when he gets caught leaving early’.”

Oxford English Dictionary

This is the most authoritative dictionary of the English language. It is famous for its etymologies and its historical citations that give examples, with dates, of how a word has been used in written English, from earliest recorded history of the language. The creation of the dictionary is the stuff of legend. Here’s a primer on the subject.

Bonus for fiction readers: Dictionary of Lost Words, by Pip Williams. A delightful novel about a young girl who grows up to womanhood working in the Scriptorium where the Oxford English Dictionary was created.

The downside of the online OED is that it requires a hefty annual subscription. However, some public library systems and colleges subscribe for the benefit of patrons and you may be able to access the dictionary for free through your library.

Merriam-Webster Online

Simply one of the best. The website offers both dictionary and thesaurus listings from its carefully curated database. It seems on a par with the desk version of Merriam-Webster’s Collegiate. Note that it does display ads when using it for free.

Cambridge Dictionary Online

The Cambridge dictionaries are another of the fine set of professionally created dictionaries available online. You can toggle it to either US or UK English, making it especially handy for Canadian writers. It too contains ads.

Wiktionary

Wiktionary is a popular site for looking up words. It has been created in the same manner as Wikipedia, by volunteers. It presents a less attractive interface than the previous dictionaries but it offers, according to its opening page, over a million words in English. It may be one of the best places to find the definition of technical words and terms. It provides some etymologies as well and it’s totally free, with no ads.

Online Etymology Dictionary

Here’s a site to bookmark by word lovers who are interested in the history of the words we speak and write. As it says on its opening page: “This is a map of the wheel-ruts of modern English. Etymologies are not definitions; they’re explanations of what our words meant and how they sounded 600 or 2,000 years ago.” Sheer fun and delight.

Word of the Day

An excellent way of increasing your awareness of words and their subtleties is to subscribe to the “Word of the Day” offerings from several of the dictionary companies. Each day in your email inbox you will find a word that is examined and explained, including its history of how it evolved into today’s meaning.

The sites that offer this list it on their front web page. I must admit I have a favorite: Merriam-Webster Word of the Day. It even has a companion podcast that is available from Apple Podcasts, Google Podcasts, and Spotify Podcasts. Merrriam-Webster also offers a more general podcast called Word Matters. It describes itself this way: “Word Matters is a show for readers, writers, and anyone who ever loved their English class. Join Merriam-Webster editors as they challenge supposed grammar rules, reveal the surprising origins behind words, tackle common questions, and generally geek out about the beautiful nightmare that is language.”

What could be more fun than geeking out on words? Well, okay, maybe that’s an exaggeration, but as a writer our stock of words and our intimate knowledge of them is one of our best assets.


Gene Wilburn is a Canadian writer, photographer, and retired IT professional. He has a B.A. and M.A. in English with a specialty in the history of the English language.

Goodbye Overdrive, Hello Libby

By Gene Wilburn


For some years now I’ve been using Overdrive Media Player as my ebook reader and audiobook player for books and audiobooks borrowed from the public library. Overdrive is on my iPad, my MacBook, and my wife’s iPad. Between us we must have listened to or read several hundred borrowed library books. We like and enjoy Overdrive and, for our purposes, it’s an ideal library companion.

Recently, though, we learned that Overdrive (the company, based in Cleveland, Ohio) is replacing Overdrive Media Player with a different client app called Libby. In fact, they’re set to pull the plug on Overdrive Media Player by February, 2023. It’s no longer available in the various App Stores. Given that we’re now living on borrowed time, we added Libby to our tablets and laptops to get used to it, preparing ourselves to leave the Overdrive app forever.

It’s a truism in the software world that users don’t generally like changes to their interfaces, or having to switch to a different product. Word users balked at the “ribbon menus” of later versions of Word, and few Word users have switched to Google Docs or LibreOffice Writer. When you’re comfortable with an app, changes are painful. And so it was as we moved to using Libby.

The Overdrive interface is clean, neat, and tidy.

Overdrive Bookshelf Interface

Whereas Libby is expansive, not as neat, and very chatty.

Libby Bookshelf Interface

Of course beauty, being in the eye of the beholder, means that what one user likes, another wouldn’t. You can never please everyone, but on the whole I can move into Libby without overt trauma. Almost.

However, I’ve found two flaws in Libby.

Libby Doesn’t Allow You to Copy Text

I must say I was shocked when I discovered that you can’t copy and paste text from ebooks in Libby. This is something I do a lot in Overdrive, copying passages to my Notes app for research purposes, or quoting an opening line or paragraph when talking about an interesting book on Facebook. This, for me, is a serious deficiency.

Libby Doesn’t Support More Than One User Per Library Account

The reason why this might be a problem is simply this: Sometimes family members share the same Library card. For example, my wife and I live in the city of Mississauga, Ontario, adjacent to the city of Toronto. We each have a Mississauga Public Library borrowing card, but having previously lived in Toronto, we missed the larger selection of resources from the Toronto Public Library system. This we solved by purchasing a single extramural reader’s card for TPL. At a cost of over $100 per year, we didn’t feel we could each could afford one, so we share a single library account.

When we use Overdrive, we can each download books and ebooks from the library and our borrowings don’t get confused. If we’re reading the same book or listening to the same audiobook, our individual Overdrive apps keep our position locations discrete, which is great because we obviously don’t read or listen to the same book at the same pace.

Libby synchronizes its bookshelf automatically across devices, meaning that our separate reading locations get updated to whoever is farther along in the reading or listening. Then if one of us returns to a previous location, it resets it for the other one. Relocating your place, especially in an audiobook, is a painful experience.

Unfortunately, there is no setup mode in Libby that allows you to turn off synchronization, making it work more like Overdrive.

Better Font Sizing in Libby

Aside from those two problems, Libby is pleasant to use and, like Overdrive, allows you to choose your reading font, size it for your eyes, and choose between white, sepia, or black backgrounds. Black is especially good for reading at night. Both offer a timer to switch off your audiobook after a certain number of minutes, say 60 minutes, which is a godsend if you fall asleep while listening. You don’t have as far to backtrack.

One thing that has bugged me for years about Overdrive is its too-coarse adjustments of font size. I frequently hit that condition where the font is ether too small, or too large, with no steps in between. Libby has much finer font size adjustments. I can always seem to find that just-right “Goldilocks” font size when I’m reading on Libby, which gives Libby the edge for me on ebooks.

Looking Ahead

For the most part, I don’t anticipate great difficulty adjusting from Overdrive to Libby. I still prefer the clean, terse Overdrive user interface, but Libby is easy to use and is probably a better interface for new library users.

Overdrive (the company) only needs to fix two deficiencies: The ability to copy text from ebooks, and the option to turn off synchronization. If they can do that, I’ll give Libby full marks. Until then, it’s an app that just misses being great.


Gene Wilburn is a Canadian writer, photographer, and retired IT specialist..

Fedora 36 Linux: First Impressions

By Gene Wilburn


Fedora GNOME Interface

When I started using Linux in the early 1990s, my first distro was Slackware, followed soon after by Red Hat. Eventually I discovered Debian Linux and it quickly became my favourite, especially after Red Hat evolved into an enterprise company.

Along the way I tried Ubuntu Linux and Linux Mint and liked both, partly because they were part of the Debian family of distributions. Over the years I’ve watched them become easier to use and more polished. I run the latest Linux Mint on my desktop machine.

Even so, I enjoy trying out different distributions to see what they offer. Of course, Linux is Linux, no matter which distribution — under the hood they pretty much all do the same things. Where they differ the most is in packaging systems, method of installation and maintenance, and the user interface.

My test computer for experimenting with distributions is a Lenovo Thinkpad E431 i3 laptop, introduced in 2010. It contains 4GB RAM and 500GB of hard disk. Not a speed demon, but it has plenty of memory and storage, and is supported by all the Linux distributions I’ve tried.

Using this laptop, I took a look at the no-nonsense Fedora 36 Workstation. Fedora is sponsored by Red Hat and is characterized as a “bleeding edge” distribution, continuously introducing the newest versions of applications. It is popular and has a large support community.

Installation

After loading the Fedora .iso file onto a stick disk, I booted it up on the Thinkpad and asked it to install to my hard disk. The installation procedure worked but was less explicit about what was going on than, say, an Ubuntu installation.

The only confusion I encountered was in letting it know it could blow away the existing Linux Mint and use the entire hard disk. There is less feedback than I’m accustomed to, and it was unclear to me whether I had set it to delete the existing partitions. It turned out to work fine, but I prefer the feedback I get with an Ubuntu-family install.

First Look

After Fedora booted up for the first time, it displayed the latest GNOME user interface, which left me wondering what to do. There were no docks or panels on the screen. My first hurdle was how to access stuff. I tried clicking at the corners and clicking on the background screen, to no avail. Then I pushed the Windows key, which led me to the dashboard, or “dash” as it seems to be called. From the dash I could launch selected software or invoke a full screen of installed apps, similar to Launchpad on a Mac.

I’ll never understand why most distributions, including Fedora, do not include a Terminal app in the initial dashboard. That’s always the first thing I need to use.

Fedora Workstation is highly integrated with GNOME and is configured to present an uncluttered screen, leaving most of the screen available to applications. I like this approach, especially when working on a restricted screen such as a laptop.

From apt to dnf

Instead of the apt command-line tool of the Debian variants, Fedora uses dnf for command line management of software installations. Fedora packages are .rpm files rather than .deb files and Fedora supports both Snap and Flatpack, which are increasingly used for software distribution. Fedora differs from Debian-based distros in its security mechanism. Ubuntu-family distros use AppArmor while Fedora uses SELinux.

In practice, switching to dnf is straightforward for an experienced Debian user.

In Debian distributions, you might install a software package such as btop by typing

sudo apt install btop

In Fedora you would type this instead

sudo dnf install btop

The two systems are similar enough that transitioning from apt to dnf presents no particular challenge.

btop

Changing the Look & Feel

Although I find the GNOME interface interesting and slick, I couldn’t get comfortable with it, so, in the great Linux tradition, I added my favourite GUI, Cinnamon, as an alternate GUI with the simple command

sudo dnf install cinnamon

and, upon completion, Fedora installed the Cinnamon option. This significantly increased my comfort level.

Cinnamon User Interface with Menu and Task Bar at the Bottom

Bottom Line

I give Fedora 36 highest marks: It’s a great distribution. I suspect, though, that it’s a better Linux for experienced users than beginners. For those new to Linux I think Ubuntu or, particularly, Linux Mint, makes a better choice.

If you want to use a solid, leading edge Linux, and have a bit of Linux experience, Fedora is one of the top choices.


Gene Wilburn is a Canadian writer, photographer, and retired IT professional.

Enough with Subscriptions Already!

By Gene Wilburn


Photo by Samantha Gades on Unsplash

These days it seems as if every vendor of every product has jumped on the “service as subscription” bandwagon. While this might be good for vendors, providing a steadier income stream, it’s reaching a breaking point for customers. Worse, it’s often nothing more than a greedy money grab.

$18/Month to Warm Your Derrière

BMW has recently introduced a monthly subscription fee of $18US a month if you want access to the vehicles’ heated seats. Other car vendors are implementing a monthly subscription fee for remote-start key fobs.

“Earlier this year, Cox Automotive conducted a survey of 217 people who intend to buy a new car over the next two years. Only 25 percent said they’d be willing to pay a monthly or annual fee to unlock a feature in their vehicle. The remaining 75 percent said piss off. [my emphasis]

Well, you might say, luxury car owners can afford subscriptions like seat warmers. Not so fast. GM expects its in-car subscription services on its automotive lines to generate nearly $2-billion this year, which will reach as high as $25-billion by the end of the decade.

Remember, this is beyond the base price you pay for your family automobile, and it’s not just aimed at luxury cars.

How Much Monthly Streaming Services Cost in Canada

The following prices were what I could confirm as Canadian prices. U.S. pricing tends to be slightly lower.

Netflix Canada: $9.99 / $15.49 / 19.99 depending on the plan
Crave: $9.99 for mobile devices, $19.99 for all platform
HBO (ad-free): $19.35
YouTube (ad-free family plan): $17.99
BritBox: $8.99:
Hulu (ad-free): $11.99
Wondrium: $20.00 (lower with quarterly or annual plans)
Spotify: $9.95
Amazon Prime: $9.99
Cable or Fibre Plan: $50 (for basic package)

Depending on how many streaming services you subscribe to, you could be pushing $150 per month. It wasn’t so bad when there was just Netflix, but everyone jumped on the bandwagon, diluting the offerings on each service so that you’d need them all if you are a serious movie and TV buff.

Software Subscriptions

And then there’s software. Adobe has always charged plenty for its software but, in recent years, seems to have found the subscription model more profitable. As a photographer, I purchased its last sales-based package of Photoshop CS6. Unfortunately, CS6 apps no longer run on my current Macs so the only option, if I want to continue to use Photoshop, is to subscribe to it for $9.99/month.

I did for a short while. Photoshop is more polished and better than ever, but is it worth over $100 per year to rent it? I’m not a professional photographer, and, being retired, my budget simply doesn’t stretch that far for a hobby. So I unsubscribed and purchased Affinity Photo outright. It’s a pretty fair substitute, and cost me a one-time $40, on sale.

As a writer, I’ve looked at software such as Ulysses. I use Markdown editors most of the time, and Ulysses is a very nice product, but is it worth $50/year in perpetuity (with probable increases in the subscription price along the way)?

We’re talking Markdown here, an open-source format. Any free Markdown editor does the job nicely, thank you.

Then there’s Microsoft Office. $79.00 per year for the personal edition, and $109.00 per year for one to six people (Canadian pricing). In a misleading sleight of hand, they put a “Buy now” button for the subscription, rather than the more honest “Rent now.”

If you need pure Microsoft, there’s no evading the cost, though the excellent open-source LibreOffice suite is free, as are the Google office modules like Docs and Sheets if you’re a student or a casual user.

It happens at the low end of software too. I’m amazed at the number of iPad utility apps from the App Store that only give you a free trial period, then charge you forever with a monthly subscription fee. Even for a calculator app.

The Bottom Line

No single subscription sounds terribly out of line, but the cumulative cost of subscriptions-as-service is an insidious trend for anyone on a low-to-moderate fixed income.

The bottom line is that many of us simply can’t afford to play this game. Or are unwilling to.

I’m booked solid. I will not rent any more software, streaming services, or automotive services, and I know I’m not alone. We simply can no longer afford it. I’m already deciding which services to drop.

Oh, yeah, what about Medium? I enjoy reading what Medium writers have published so I will probably continue to subscribe. But my loyalty is thin. If the price increases, I’m outa here.


Gene Wilburn is a Canadian writer, photographer, and retired IT specialist.

Math For An Aging Brain

A Personal Essay

By Gene Wilburn

In my 76th year I decided to re-engage in the study of math. It’s important for seniors to keep their brains active, and entire books have been written about the plasticity of the brain and the desirability of keeping it stimulated. Yet one tires of a daily round of crosswords, sudokus, and Solitaire.

Even so, why math? Partly it’s because math fascinates me with its precision, logic, elegance, and beauty. Plus, math is hard. Hard, but not unreasonably hard. It requires effort, which is the point of studying it. Math is also open ended—you can grow with it, taking it as far as your ability allows. This makes math a progressively stimulating brain exercise. There’s always something new to challenge your thinking.

To put my relationship with math in perspective, some background is in order. Before immigrating to Canada and becoming a Canadian citizen, I grew up in the U.S. at the time the former Soviet Union shocked the world by launching Sputnik I, the first man-made orbiting satellite, in 1957. This triggered a call for a new generation of scientists and engineers.

President Ike and the Republican Party (which in those days was pro science) highly encouraged students to study science and engineering —today called S.T.E.M. studies —to catch up with the Russians and to usher in a new scientific and technological era. The transistor had been invented, television was transitioning from black-and-white to colour, rockets were sitting, and sometimes exploding, on launch pads, and exciting things were afoot. I wanted to be part of it.

Being an impressionable teen who, though tall, played basketball rather poorly and baseball even worse, I decided I’d become an engineer rather than pursue my childhood fantasy of becoming a sports star. I wasn’t sure, exactly, what engineers did for a living, but I owned a pair of engineering boots and thought them grand. In my naïveté I imagined that any profession where wearing them was considered de rigeur was the profession for me.

And so I began the math studies of a typical university-bound high schooler of the day: algebra 1, plane geometry, algebra 2, analytic geometry, and a mishmash of precalculus, including trigonometry, functions, slopes of lines, and limits . I was a solid B+ student, decent but plodding.

Off I went to university, slide rule dangling from my belt in a leather holster. I spent my first year flailing away at calculus, chemistry, engineering drawing, and vector analysis  and doing poorly in all of them. The only class I liked, and excelled at, was English Composition.

In a life-changing epiphany, it occurred to me that I could switch majors to English, which I did, and for which I’ve been grateful my entire life. I changed abruptly from S.T.E.M. studies to the Humanities, and I couldn’t have been happier. Literature, philosophy, history, French language, art, and music became my focus. I didn’t miss mathematics at all —then.

But life is strange, taking unexpected turns. In the end, against any reasonable probability, I became a kind of engineer after all. Propelled by a deep fascination with personal computers, I self-studied my way into the field of Information Technology, learning the skills needed to undertake a new profession: programming, database design, networking, web design, and infrastructure management. Over the years I’ve worked in IT, variously, in a cultural agency, a government department, a small business operation, and a large financial organization, all in Toronto. It has been an engaging and satisfying career.

Now, as I enter what are sometimes referred to as the “Twilight Years,” I find myself re-attracted to the study of math, though not with any specific goal in mind other than keeping my brain supple  by challenging myself with problem solving that transcends crosswords and sudokus.

With this goal in mind, I ordered a widely-used university textbook on precalculus. My god, I thought, can a math textbook really cost $170? How do today’s students afford them? The sticker price caused my senior’s fixed income to stutter. At least the graphing calculator app I selected for my iPad was free.

Ever since the book arrived, I have attempted to learn at least one new concept each day, or to work on an existing set of math problems until I get them right. Speed is not an issue. Slow and steady is the path.

Not that math study has so far helped me remember why I’m standing in the pantry, staring at the food shelves, or trying to recall what day of the week it is, but gradually, almost imperceptibly, I sense that my memory is improving. This is anecdotal, to be sure, but when I mentioned to my family doctor that I was reviewing math, he was delighted to hear it and encouraged me to continue, saying that he wished more of his senior patients would engage in a similar pursuit.

I’m aware that the study of math is the last thing in the world most seniors would want to undertake. Too many of them have had unpleasant experiences with it during their school years. Nor is the study of math something you can readily share with family or friends. People are impressed if you tell them you made a hole-in-one playing golf yesterday, or even if you finished under par, but they’re not perceptibly eager to hear that you successfully solved and graphed a dozen polynomial nonlinear inequalities.

Studying math is a solitary pursuit, almost a meditation on the nature of numbers. What distinguishes my study today from my studies as a young student is that there are no deadlines or exams. I can take my time. But I no longer wear engineering boots; they’ve been swapped out for fuzzy house slippers.


Greppy: A Lightweight Perl/PHP Website Search Engine Based on Grep


GNU Grep

My friend and colleague Mark mentioned to me recently that one of his clients was interested in having a search engine on their website and did I have any ideas?

The scenario was this: the site is an informational site, with monthly updates and is hosted in the AWS cloud. It runs in a minimal instance of Linux, with only 1 GB RAM and very tight storage. It’s not an e-commerce site. Was there something small and lean enough to serve?

Mark and I had once worked together on a project for a different client where we installed Apache Solr to build a sophisticated search engine for large amounts of data, but Solr would be massive overkill for the site in question.

GNU Grep to the Rescue

As I thought about a solution for this small site, I immediately thought of grep, the open-source search utility with a long Unix heritage that can absolutely rip through text files to search for words or phrases and show them in context. All it needs are some text files to aim at.

The site in question has a large number of PDF files and HTML files. What, I thought, if copies of these were converted to plain text files and placed in data directory where grep could rapidly search through them? Text files could substitute for the usual inverted index of search engines and, at the same time, have a much smaller footprint on the system. The client wasn’t looking for fancy searches.

Similarly, grep doesn’t need much memory to run in. Furthermore, a lightweight website search engine based on grep could be built with a few day’s programming and testing. After getting the go-ahead to start programming, I invoked vim and began building a simple system.

Building the Text Database, or Index

I knew I’d use Pandoc to convert html files to plain text, but I needed something to convert the PDFs. I discovered the command-line utility pdftotext that is part of xpdf-tools in Linux. (For MacOS, Homebrew installs the utility when you install xpdf.) Between these two, pandoc and pdftotext, I had to tools for building a text database.

To that end, I wrote a batch-processing script in Perl, buildindex.pl that takes the results of a find command that selects all the PDF and HTML files on the site, and processed them through pandoc or pdftotext, putting the resulting text files into a collective data directory called textdata. The script also checks an exclude.txt file that can used to exclude directories that contain private information.

Embedded Filename Metadata

GNU Grep is not a fully-featured search engine, but with a little help from the GNU ls command I was able to prepend the date of last creation or update (mtime format) to the filename so it could later be sorted into most recently updated work to display at the top of a search.

The batch script populates the textdata directory with files that look like this:

1645031851dot0563837700dot_99_news_99_2021_April_Newsletterdotpdf.txt
1645031852dot5724170650dot_99_news_99_2021_August_Newsletterdotpdf.txt 1645031853dot9364470210dot_99_news_99_2021_February_Newsletterdotpdf.txt
1645031855dot7164861080dot_99_news_99_2021_January_Newsletterdotpdf.txt 1645031857dot1805182550dot_99_news_99_2021_July_Newsletterdotpdf.txt
1645031858dot7045517160dot_99_news_99_2021_June_Newsletterdotpdf.txt
1645031860dot2525857010dot_99_news_99_2021_March_Newsletterdotpdf.txt
1645031861dot6606166090dot_99_news_99_2021_May_Newsletterdotpdf.txt
1645031862dot7166397880dot_99_news_99_2021_September_Newsletterdotpdf.txt
1645460076dot2987186510dot_99_shift_99_ShiftHappensdotpdf.txt

Breaking this down, the initial part of the saved text file — 1645460076dot2987186510 — is the date in mtime format.

The word dot indicates an initial dot (.) in the relative pathname, and every _99_ represents a forward slash (/) in the original pathname. The added new file extension is .txt.

This metadata allows the search program to quickly reconstruct the path back to the original document, and to replace .txt with the original extension name.

The Search Module

The client’s website is powered by PHP, so that is the language I used for the search module.

A search form module, searchform.php, prompts for a search term or phrase, which is then passed to the main search program, search.php. The search.php script, in turn, calls on grep to do the search and stores the results in an array that is then reverse sorted. Looping through the array, the search script reconstructs the full path and original extension of the filename, turning it an <a href> HTML link.

To make the results easier to read, search terms found in the results are highlighted in red, to make them stand out in context. Overall appearance is controlled in HTML with an embedded CSS style sheet.

The results, reflecting the song lyrics in my test site, look like this:

Context and Word Boundaries

To refine the search somewhat, the searchform.php file offers two checkboxes. The first allows the searcher to search on whole words and phrases, or do stem searching. In a whole word search, the default setting, the word “train” for example would find instances of “train”, “Train”, or “TRAIN” as a whole word surrounded by spaces or by punctuation. A stem search on “train” would find “train”, “Train”, or “TRAIN” as well, but also things like “trains,” “training,” and “restrain.” This is sometimes useful as an option.

The second checkbox specifies the amount of context surrounding the search term. The default is up to 90 characters on either side of the term. Unchecking the box results in a context of three lines of text: the line before the search term is found, the line it’s in, and the line following.

Batch Processing

To keep the search index, or text data directory, in sync with the information on the site, the buildindex.plscript uses brute force. It deletes everything in textdata/ and rebuilds it from scratch. What this lacks in sophistication it makes up for it in efficiency. It takes no more than five minutes to rebuild the index for the entire site, which can be run manually when needed, or run as a cron job at desired times.

Bottom Line

To our delight, this lightweight, batch-oriented search engine is speedy, and is well suited to the needs of the client. In honour of grep, we named the search system Greppy.

Greppy follows the Unix philosophy of using existing discrete utilities combined together to process text files. There is no need to reinvent the wheel.

To make this engine available to others who might have a use for it, it is available here at Github.


Gene Wilburn is a Canadian IT specialist and technical writer

Are You a Dark Mode or a Light Mode Person?

Are you attracted to the Dark Side?

Recently many apps and desktop backgrounds have sprouted a “dark mode” option or theme, reducing the amount of white light that strikes your eyes. It’s a welcome option in Kindle Reader, Apple Books, and Overdrive Media, giving respite to tired eyes especially in the evening when the greatest eye fatigue sets in and the ambient light is more subdued.

Dark mode is now making its way into writing apps, such as my go-to editor, iA Writer, and I, for one, am delighted (pun intended). For long-haul ebook reading and for writing, I prefer dark mode, finding it causes me less eyestrain than light mode.

Dark mode isn’t something new, though. It was a previous age’s standard.

A Little History

If your memory goes back to the 1980s or earlier, you may remember that computer monitors, and terminals before that, had a black background with white, green, or amber characters. This was in the age of command-line MS-DOS, CP/M, Commodore, TRS-80, and other PCs of the era. When colour computing became an option, screens were often dark blue, with white letters — classic WordPerfect colours. Dark mode has a long history.

Things changed abruptly, in 1984, the original Macintosh computer (and Unix workstations before the Mac was released), introduced a graphical, windowed environment. Soon Microsoft Windows followed, and the new white background with dark letters became de rigeur, proving ideal for desktop publishing and word processing.

We’re now used to seeing our work as a kind of virtual paper with black letters on a white background. This has been the standard for so long that the dark mode had largely been forgotten, other than for command-line users, many of whom adjust their terminal emulation colours to white on black.

The Dark Way

Some changes are the result of fads and it’s become stylish suddenly to sport dark mode backgrounds. Apple has taken this a step further by introducing wallpapers that change mode from light to dark depending on the time of day. Whatever the reasons, dark mode has again become popular, especially among computer geeks.

Gizmo China ran a poll in 2020 asking which do you prefer: Light Mode or Dark Mode? Approximately 78% of the 562 participants preferred dark mode, 11% preferred light, and 11% preferred “scheduled mode” — light mode during the day and dark mode in the evening.

Which is Better?

“Better” is a subjective term, of course, and for many of us “better” is simply what we’re used to. There have been some studies on this and the answer seems to be “it depends.” When ambient light is high, as it often is during the day in a well-lit room, light mode is easier on the eyes because the pupils are contracted and black on white is easier to see. In the evening, though, when the light begins to fade and the ambient light is less strong, our pupils dilate more and white on black is easier to read for many users. “Scheduled mode,” which you can set up in Apple’s Books app, for instance, is an ideal balance.

As far as I know, no one has done an informal study on whether dark mode conserves battery life on a laptop. It should, for the simple reason that black on the screen indicates LCD pixels that are switched off, and a lot of laptop battery power goes into powering the screen. In light mode, most of the pixels are drawing full power.

With these factors in mind, it might be worthwhile for you to “visit” the dark side to see if it works for you. The only right answer to the question of which is better is this: “Your eyes, your call.”

Create Beautiful Self-Published Books With Free Software Tools

By Gene Wilburn

There are many tools that can be used to write a book and prepare it for self publication. Microsoft Word, of course, is commonly used for this purpose, and LibreOffice Writer, a free, open-source alternative to Word, is rock solid.

Word processors, however, are not true typesetting systems, though they do a decent job if “good enough” is your aim. If your aim is a little higher, you need to move up a level.

The next level up from word processors is the tier of publishing systems that do a more nuanced, attractive, and professional-looking job of kerning and leading, especially for print books and PDFs with fully justified lines. Adobe InDesign, Adobe Framemaker, QuarkXPress, and Affinity Publisher are commercial products that offer this kind of quality. The open source world offers Scribus, as well as traditional text-based typesetting systems such as troff and LaTeX, two systems frequently lauded for their ability to produce beautiful typesetting. It’s your choice which typesetting program or system to use, but they all have a non-trivial learning curve.

As a self-published independent author myself, as well as being a retiree on a tight budget for software, I’m going to outline a way to produce great looking books and ebooks using a combination of free tools that work in Windows, MacOS, or Linux. These products and systems are not as widely used as Microsoft Word, and they have a reputation for being “techie,” but I think they’re accessible to anyone who is willing to take on a modest amount of learning.

The tools covered in this article are:

  • Markdown text markup notation
  • Google Docs
  • Pandoc
  • LyX and LaTeX typesetting systems
  • Sigil ebook editor
  • Zotero bibliographic manager

These are the tools I used to produce Shift Happens: Essays on Technology, co-authored with my wife, Marion Turner Wilburn, in 2020, during the first wave of the Covid-19 pandemic. Shift Happens is an overview of many of the technologies of the past century that have shifted our lives, environment, and perceptions. We made it available in ebook, PDF, and printed book formats. Given the subject matter, we wanted to include a “Further Reading” bibliography. We wanted the references in the ebook format to provide hotlinks to the cited sources so that readers could simply tap or click on a link to jump to it. The tools we used made achieving this an easy task.

Markdown Notation

One input, multiple outputs

Markdown is an example of what are called text markup schemes — methods that allow you to add attributes and structure to plain text files, then run them through a document converter that translates the Markdown files into another format, such as HTML. The goal of Markdown is to create one set of master input files, such as chapters of your book, and from those create multiple outputs, whether ebooks, PDF documents, HTML pages, or printed books or reports.

Markdown is simple and easy to learn. For example, surrounding a word or phrase with asterisks, e.g., *italic* produces italic text. Double asterisks around **boldface** produce boldface. Other features follow similar patterns.

Furthermore, there are text editors that are designed specifically to help you with Markdown. Four of the best known are iA Writer, Byword, Ghostwriter, and Typora. They make italicizing a word or phrase as simple as pressing Ctrl-I, as in a word processor. All four have preview modes.

Although Markdown files are usually created in a text editor, you can use Markdown notation in a word processor such as Google Docs, then export your work as a plain-text Markdown file. We used Markdown this way when we wrote our book.

Google Docs

Work from anywhere

Google Docs is a brilliant collaboration tool. As we were writing the content of our book, we had many writing sessions where we both sat in the same room, each with a laptop on our laps, working back and forth through rough passages. We could see in real time the changes the other was making to the text and we would then decide whether to keep it or modify it further.

What made this possible is that Google Docs is a Cloud-based product that you can access from any browser or Google Docs app. The writing and editing of our book was done from a mix of Windows, Mac, Linux, Chromebook, and iPad computers. Having the content in the Cloud also protects it from computer hard disk failure or any other local calamity. There is comfort in knowing that content remains safe on the Web.

Another thing Google Docs is brilliant at is versioning, which it does automatically. We sometimes decided that we preferred an earlier version of what we had written, and we could go into a file’s document history and recover previous passages easily and painlessly.

We used Markdown inside Google Docs as our master documents for the project and any changes to our chapters were done there and nowhere else. Google Docs can export its files as plain text, and we exported them back as plain-text Markdown files once the chapters were finished.

Pandoc

From anywhere to anywhere

Pandoc is an open-source, command-line utility that is an impressive document converter — a Swiss-army knife that can convert a large number of document formats into other formats. We used it to convert plain-text Markdown files to LaTeX files and HTML files in preparation for final book production. It can even be used to convert Markdown files into other formats, such as Microsoft Word. Pandoc is available for Linux, MacOS, and Windows.

In use, Pandoc invoked from the command line, such as

$ pandoc -o chapter1.html chapter1.md

as an example of converting a Markdown file to an HTML file, or

$ pandoc -f markdown -t latex chapter1.md

to convert a Markdown file to a LaTeX file with the same base filename, e.g. chapter1.tex.

Lyx and LaTeX

Pretty printing

LaTeX (pronounced LAY-tek) is a rich typesetting system available for all major operating systems. There are distributions of LaTeX available for easy installation in Windows (MikTeX), MacOS (MacTeX), and Linux (TeX Live). Often used for formal academic books, reports, conference proceedings, and theses, it has hooks for creating footnotes, end notes, bibliographical entries, and mathematical equations. Its output is gorgeous.

To be honest, though, LaTeX can be bewildering to a newcomer, and for this reason I highly recommend using LyX, a front-end word-processing-like editor that uses LaTeX as the back end for final output. LyX is easier to use than straight LaTeX — if you can use Word, you can use LyX, which comes with excellent help file documents. LyX, too, is available for Windows, Mac, and Linux computers. LyX and LaTeX were used to typeset the PDF and on-demand print versions of Shift Happens, and using them proved no more difficult than using a graphical DTP package.

In practice I used Pandoc to convert our Markdown text files to plain .tex files, and imported those into LyX. From inside LyX I adjusted margins, spacing, justification, chapter and section numbering, page size, gutter margin, kerning level, bibliography, and table of contents to create a 6×9″ format trade book. I exported the result as a PDF file, ready to read, and also ready to upload to our on-demand book publisher Blurb. You may choose a different publisher such as Kindle Direct Publishing (KDP).

Sigil

Getting it right

An Epub file can best be described as a zip file containing a miniature website. The contents of the zip container are HTML files, maybe some CSS files and some images in its /img directory, plus a manifest that lists all the files and graphics in the publication, as well as containing Epub metadata. If you want to create an Epub, or modify an existing one, you could scarcely do better than turn to Sigil, a terrific, free Epub editor.

One part of Sigil is an HTML editor displaying HTML code on the left, and live rendered output on the right, for comparison and direct editing. High-level menu options can be used to adjust heading levels, and attributes such as bold and italic. It is easy to create and test Internet links, and to include graphics. Sigil also makes it easy to split or combine chapters and sections. For Shift Happens we simply imported our individual chapter files in the HTML format created from our Markdown files by Pandoc, made a few adjustments where needed, and saved the results to Epub format. For the Amazon Kindle store, we used KDP to upload the finished Epub to convert to Amazon’s proprietary ebook format. The conversion was perfect.

Zotero

By the way …

If you plan to publish a non-fiction book and intend to include a bibliography or “Further Reading” appendix, it’s useful to use some kind of bibliographic software that will store your references and format them according to one of the bibliographic style sheets that are used in the sciences, social sciences, and humanities. Zotero to the rescue.

Zotero describes itself as a “personal research assistant — a free, easy-to-use tool to help you collect, organize, cite, and share research.” It does a great job at this, allowing you to grow your references as you research topics. It has data entry screens, but best of all it can automatically create entries from a website and format them correctly. It is used directly on a computer and the results are syncronized with the Web version. It is also available as an add-on to most major browsers, and it can be integrated with Word, Google Docs and LibreOffice.

Zotero is a professional-grade package, up to the task of organizing and exporting references in accepted academic bibliographic citation styles. If all you need to do is create a simple bibliography and don’t need all of Zotero’s bells and whistles, you can use its simplified Web-based sister product, ZoteroBib.

Your Turn

The devil is in the details

Assembling these tools in Windows, MacOS, and Linux —- downloading them for use on your book project —- is as straightforward as any software installation. Although it may sound complicated to use several packages instead of just one or two, like Word and InDesign, the workflow smooths out as your familiarity with the software grows. Nonetheless, there is a learning curve involved and all the packages require attention to detail. The shift, for many users, is see your book as a logical structure, rather than a visual one. The software is guaranteed to produce visually beautiful output once you get the structure of your book down. The beauty of these products is that they work with anything from a simply structured novel to a complex academic book. Best of all, the products are free.


Gene Wilburn is the author of Northern Journey: A Guide to Canadian Folk Music, Recreational Writing, Markdown for Writers, as well as co-author of Shift Happens. He has also written dozens of articles, essays, and reviews, primarily on computer technology.