Thursday, July 31, 2025

Communication without complexity

Last Sunday we talked in church (sacrament meeting). Partly to put off preparation, and partly because it was there, I was playing around with a little web page produced by a program that I wrote many years ago. The program's job is to display a random verse from the Book of Mormon.

The message

Most verses are short enough to display nicely on the screen of my iPhone, and I just pull one down — to cause the page to be reloaded — to see the next random pick. As I was doing this, I was galvanized by a verse that appeared (Alma 29:9) because it was precisely what I needed for the topic of my talk.

The more I reflected on this, the more amazed I became. There are over six thousand verses to pick from, and the code that does it is extremely small. It is also very mechanical. So, I choose to believe that seeing this verse at that time was a kind of message from a higher power, because it was precisely what I needed at that time.

It described my message — the one that I ended up delivering — which is that sometimes a person can be at the right place at the right time with just the right tale to have an impact on the world. It was the story of that one time when I was "an instrument in the hands of God to bring [one] soul to repentance;" and that was "my joy."

How the program works

[Victims of mathophobia can skip this section.]

Since it involves a random number, the odds are very low that the program would pick out any particular verse. The one it picked happens to be number 3,332.

#!/bin/bash
echo "Content-type: text/plain; charset=utf-8"
echo
sed -n `echo $((RANDOM%6604+1))`p ../../bofm/eng/all.txt

As indicated by the first line of the code, this script is to be interpreted by the Bash shell (that has been used —in the same way — in many of the earlier posts on this blog).

The next two lines are just sent back to the browser as-is. Line two lets the browser know that what it receives next is just plain text (as opposed to HTML, say). And, line three (a completely empty line) lets the browser know that that's all we have to say about what will be sent.

All of the work is done in line four, repeated below with some extra spaces and underlining to show four distinct sections.

sed  -n  `echo $((RANDOM%6604+1))`p  ../../bofm/eng/all.txt

It runs the sed program, which is a stream editor, which operates on its input line by line. Its input is the file located at the path given in part four, two directories above the one the program resides in and then in a folder named bofm containing a folder named eng containing the file named all.txt (which contains in order all 6604 verses of the Book of Mormon (one and half million characters)).

Normally this program would print out every line as it was read in. The -n flag tells it not to produce any output unless explicitly requested. 

The next bit of code looks really complicated, but it just gets re-written in stages. Those stages are shown below, one at a time.

`echo $((RANDOM%6604+1))`p
`echo $((23143%6604+1))`p
`echo $((3331+1))`p
`echo 3332`p
3332p

That process is called "evaluation" and happens from the inside-out. First a random number is selected from the range 0–32,767 which here we are assuming was 23,143. Then it is divided by 6,604 and the remainder* (if you have a calculator with a "mod" key, you can try this out), 3331, is retained. Then one is added to that, giving 3,332. Finally the back-tick part becomes just the string "3332" which is concatenated to the "p". So, in this case, it is as if the hard-coded command

sed -n 3332p ../../bofm/eng/all.txt

had been used. That simply asks sed to look in turn at every line in the all.txt file and print out line 3,332 ignoring all the other lines. So, the browser only sees that one line, which is verse 9 of Alma chapter 29.

Each time this program runs, a different random number is chosen, and so a different verse gets shown. Everything in the program remains the same, except that RANDOM is replaced by a different number each time the program runs.

Tying in the title

This was a communication to my mind of a particular verse of scripture that I needed to make a cohesive message for a talk and it came very simply, through a device that I myself had created years earlier. The mystery is that that particular random number was chosen at that particular time. For whatever reason it was, this recent event perfectly mirrored the event in my story in that just the right ingredients all came together at the right time.

Notes

Alma 29:9 says "I know that which the Lord hath commanded me, and I glory in it. I do not glory of myself, but I glory in that which the Lord hath commanded me; yea, and this is my glory, that perhaps I may be an instrument in the hands of God to bring some soul to repentance; and this is my joy."

*Because of the Quotient-Remainder Theorem of arithmetic, whenever you divide an integer by 6,604 you will get a unique quotient and remainder. In our example,  if the integer was 23,143 then the quotient is 3 and the remainder is 3,331. The remainder is also called the modulo. That is, 23143 = 3 x 6604 + 3331

"if the integer was 23,143" Other integers that lead to the same verse are 3331, 9935, 16,539, and 29747, so we don't know and can't tell what the actual random number was, just that it was one of these five possibilities.

Perhaps you will take issue with my claim that "it came very simply" in view of the long explanation of how it works. Keep in mind that line four of the program is almost as simple as a program can be.

Thursday, January 11, 2024

Consensus without Coherence

This is about some of the theories of truth, triggered by the previous post, "Concord without Confusion", during the writing of which this author discovered the consensus theory of truth, and marveled greatly.

The consensus theory of truth is defined on Wikipedia as, "the process of taking statements to be true simply because people generally agree upon them."

The author prefers the correspondence theory of truth in which, according to Wikipedia, the truth of a statement "is determined only by how it relates to the world and whether it accurately describes (i.e., corresponds with) that world."

Tuesday, November 21, 2023

Concord without Confusion

A notation supporting a rational basis for peace. The notation itself, based on Popper's three worlds, was introduced in an earlier post, Contrast without Confusion. I'm proposing that this notation could be used by rational people to understand each other, even in the face of conflicting beliefs.

The purpose of the notation is to write down things that are true, and can be accepted as true, by both parties. From there, from that basis of shared truth, a discussion could ensue peacefully and clearly.

By "truth" is meant here agreeing to use the correspondence theory of truth, leaving aside other possibilities such as the coherence, consensus, or pragmatic theories of truth.

Thursday, November 16, 2023

Coexistence without condescension

[1[2author
The difficulty of this post is commensurate with the time it has taken in gestation. My topic, "humility."

Let's start with its opposite, a feeling of superiority. There is a pattern of thought that goes like this: I am superior to another in some way; therefore, I am of more value than than other person. Or, more important than that person. In other words, my superior attribute makes me actually superior.

This is incorrect reasoning in part because we are multi-dimensional beings. Scoring higher on one dimension means little when there are other dimensions where I score lower. In secondary school, I scored higher in academics than others of my peers, yet among the lowest in athletics. This allowed me experience at both ends of the superiority versus inferiority scale.

A brief personal experience to illustrate. Superior performance in my high school was rewarded by the presentation of a school letter, a piece of fabric in the shape of the first letter of the school's name, and in the school's colors. I was granted one of these for my academic performance. When I attended university, I proudly posted the letter in my dorm room. Others would see it and ask, "what was your sport?" The person would inevitably be totally confused when I answered, "academics." Apparently, most schools offer letters only for superior performance in sports. I ended up taking the letter down and putting it in a drawer. I live in a society which worships athletes and tolerates academics, even at a university.

The antidote to this malaise is the challenging attribute of humility.

Returning to this post, after a couple more weeks of gestation and a few servings of humble pie, I notice that the draft began on Armistice Day. This is an important holiday in Canada (where it is called Remembrance Day), where I was born, and is a celebration of coexistence without armed conflict. But that would be another post.

As of today's date, Wikipedia defines humility as "the act or posture of lowering oneself in relation to others, or conversely, having a clear perspective and respect for one's place in context." This is a two-part definition, which leads into my purpose of describing it as seen from the two different belief systems or world views with which readers of this blog are by now familiar: those of secular humanists and Latter-day Saints. See the blog post which introduced these, "Contrast without contempt."

[This post was started in 2014! So "today's date" has a different meaning today November 16, 2023. Publishing this as-is now (11:43 a.m. MST)]

Communication without Conspicuousness

A strange sequence of events happened eight and a half years ago (and today).

A U.S. Supreme court ruling was handed down on a Friday. That same day, The Church of Jesus Christ of Latter-day Saints responded with a press release, and a Facebook friend responded to both with a claim that, "They [the Church] will in time" alter their doctrine to conform to the court's opinion.

The following Sunday, I prepared a response to my friend, but did not post it to Facebook.

Today, I found my reaction as an unpublished draft!

Wednesday, December 14, 2022

Community without conspicuity

Being part of a group of people, a community, without being a conspicuous member of said community.

Last Sunday, it was my privilege to sing in a choir led by my brother-in-law, Ron Harper. Both my wife, Sara, and his wife (our wives are sisters) were also in the choir. Our performance will be on the web for some time, thanks to YouTube and it's community-enabling platform. It was entitled "Symbols of the Nativity - A Musical Celebration" and was a wonderful experience.

Monday, October 3, 2022

Consternation without comprehension

I'm confused about something that I don't understand. At least I'm aware of it; you have to be aware of something before you can understand it, although you might very well be confused about something before becoming aware of what it it.

When I was much younger, in Junior High School, the science class was great. One day we learned that the earth's climate changes over time. Like in this screenshot 


from PBS (taken November 2, 2019), we were taught (did I mention it was in a Science class?) that the earth goes through cycles from warmer to cooler temperatures and back again. Round and round.

In fact, we were told, the earth is currently moving towards its next Ice Age! Furthermore, there was nothing, nothing at all, that we humans could do about it. Colder temperatures were coming in the future, no matter what we wanted or tried to do about it.

After getting a bit alarmed, we were soothed with the information that it wouldn't be for hundreds of years at the soonest.

Nevertheless, this little bit of scientific instruction has stuck with me.

Fifty-five (or so) years later: surprise! Humans can and are doing something about it! We are making the world warmer, through our efforts, and staving off the next Ice Age. Yay!!! Let's celebrate*, right?

No. Apparently, today's science has a different message** for us.

I completely do not comprehend, much to my consternation.

Notes

* I think we should get that classroom of students together for a reunion and build a great big bonfire, to liberate some carbon into the atmosphere, and do our small part to keep the world from getting colder -- doing our small part, since, we can after all do something about it!

** That message is, roughly, "human-caused global warming is an imminent existential threat to humanity, and we must all hunker down, reduce our standard of living, and give up our freedom to the smarter people telling us this, or risk losing our planet!" [to be read with an increasingly shrill and loud voice]

"reduce our standard of living" happens when we are expected to use less energy for cooling our homes in the summer and heating them in the winter, or curtailing our recreational travel, and so on