August 5th, 2019

The teachings of Korihor1:

O ye that are bound down under a foolish and a vain hope, why do ye yoke yourselves with such foolish things? Why do ye look for a Christ? No man can know of anything which is to come.

Behold, these things which ye call prophecies, which ye say are handed down by holy prophets, behold, they are foolish traditions of your fathers.

How do ye know of their surety? Behold, ye cannot know of things which ye do not see; therefore ye cannot know that there shall be a Christ.

Ye look forward and say that ye see a remission of your sins. But behold, it is the effect of a frenzied mind; and this derangement of your minds comes because of the traditions of your fathers, which lead you away into a belief of things which are not so.

There can be no atonement made for the sins of men, but every man fares in this life according to the management of the creature; therefore every man prospers according to his genius, and every man conquers according to his strength; and whatsoever a man does is no crime.

When a man is dead, that is the end thereof.

Why do I go about perverting the ways of the Lord? Why do I teach this people that there shall be no Christ, to interrupt their rejoicings? Why do I speak against all the prophecies of the holy prophets? Because I do not teach the foolish traditions of your fathers, and because I do not teach this people to bind themselves down under the foolish ordinances and performances which are laid down by ancient priests, to usurp power and authority over them, to keep them in ignorance, that they may not lift up their heads, but be brought down according to thy words.

Ye say that this people is a free people. Behold, I say they are in bondage. Ye say that those ancient prophecies are true. Behold, I say that ye do not know that they are true.

Ye say that this people is a guilty and a fallen people, because of the transgression of a parent. Behold, I say that a child is not guilty because of its parents.

And ye also say that Christ shall come. But behold, I say that ye do not know that there shall be a Christ.

And ye say also that he shall be slain for the sins of the world — And thus ye lead away this people after the foolish traditions of your fathers, and according to your own desires; and ye keep them down, even as it were in bondage, that ye may glut yourselves with the labors of their hands, that they durst not look up with boldness, and that they durst not enjoy their rights and privileges.

Yea, they durst not make use of that which is their own lest they should offend their priests, who do yoke them according to their desires, and have brought them to believe, by their traditions and their dreams and their whims and their visions and their pretended mysteries, that they should, if they did not do according to their words, offend some unknown being, who they say is God — a being who never has been seen or known, who never was nor ever will be.

  1. The Book of Mormon, Alma, Chapter 30. []

Windows 10: Clear Clipboard

June 24th, 2019

During my workflow I sometimes have to copy a series of images from a remotely accessed computer (running Windows 7) to a file on my main computer (running Windows 10). I have noticed an intermittent problem where I go to copy a second image and when I paste I still get the first image, as if the clipboard was never replaced. This can be quite frustrating if the images are similar enough that I don't notice the problem until later, and I have to go back and re-process data to generate the image that did not copy correctly.

I don't know if this is a problem with Windows 10, or something about trying to get Windows 10 and 7 to work together, or something in the remote desktop access software. The way I have found to get around this is to clear out the clipboard on my host computer, and then copying works again.

To add a shortcut to the Windows 10 desktop that clears the clipboard, use the following procedure:

  1. Right click on the desktop and choose "New > Shortcut".

  2. A pop-up asks for the location of the item, enter the text:
    C:\Windows\System32\cmd.exe /c echo off | clip
    Then click "Next".

  3. Give it a name, like "Clear Clipboard", then click "Finish".
  4. Optional - Change the icon: Right click on the shortcut and select "Properties". Click on the "Change Icon ..." button. Click on "Browse", select an icon file (look in C:\Windows\system32\SHELL32.dll for a large selection).
  5. Optional - Give it a keyboard shortcut: In the "Properties" window, click on the "Shortcut key" box and type a letter, the shortcut will become Control + Alt + the letter.


June 17th, 2019

Being the father of a three-year-old whose name begins with H, I have lately been hearing this version of "The Alphabet Song":

A, B, C, D, B, F, E,
Now my know my A-B-C, next time you sing with me.

She just wants to get to the important letter, and then she is done. And then she will sing it over and over and over again. I wish I had given her a name starting with Z, then she would know the alphabet all the way through.

A Dinner Conversation

June 10th, 2019

For my first year of college I attended a large private university in Utah. For Homecoming, about ten of us went out to dinner together before the dance. We were from a variety of places across the US; I came from Michigan, my companions were from places such as California, Utah, Texas, and North Carolina.

At one point the conversation turned to the types of fast food chains found where each of us lived. There was a Carl's Jr. located across the street from our campus, and I had eaten there for the first time a couple weeks before since there are none in Michigan. We talked about Jack in the Box, and a couple other chains, and then the conversation moved on.

A couple minutes later, Andrea, from Washington, who had been pretty quiet up to this point, innocently said "Do you guys have Dick's? You know, they are like In'N'Out?"

After a few seconds of silence, she realized what she had said and turned bright red.


June 4th, 2019

I was setting a fire in the fireplace, and my 3 yo niece says to me "Be careful Uncle Peter, the fire is spicy."

The rest of these are some of my old favorites:

Q. What is bright orange and sounds like a parrot?
A. A carrot


Q. What happens when the smog lifts in Los Angeles?


My uncle Joe smoked a pack a day and drank a case of beer every night, and when he died he didn't look a day over fifty. He died when he was twenty-nine.


Superman is flying around town when he sees Wonder Woman on a rooftop, naked, lying on her back with her legs spread out and her eyes closed. Glancing around, Superman decides nobody else can see her, so he flies down, unzips his pants, and faster than a speeding bullet gives her a good humping, then zooms away.

Wonder Woman opens her eyes and says "What just happened?"

The Invisible Man says "I don't really know, but my ass hole hurts all of a sudden!"


Joe runs an ice cream truck. Every day he stops at this park, and every day he sees this retarded kid hanging around. The kid always asks for some ice cream, but he doesn't have any money. Joe feels sorry for the kid, so he says "I'll make you a deal: if you can clap your hands three times, then I will give you an ice cream cone."

So the kid says "OK", and gives it a try: WHIFF, one hand goes over the other. And Joe says "Well, maybe you can get it tomorrow."

The next day the kid comes by, and Joe gives him the same deal. The kid smiles really big, spreads his arms out, and CLAP, WHIFF, misses it on the second time.

He tries again the next day: CLAP, CLAP, WHIFF.

The next day the kid comes by and Joe gives him one more try. He concentrates really hard, and slowly moves his arms: CLAP, CLAP, CLAP.

Joe says "Horray, you finally got it, here's your ice cream cone."

The kid takes the ice cream cone and SPLORCH, smashes it into his forehead.1


Eagles may soar, but weasels don't get sucked into jet engines.


Give a man a fish and he will eat for a day.
Teach a man to fish and you will never see him again on Sundays.


After the great flood, Noah gets off the Ark and says to all the animals "Go forth, multiply, and replenish the Earth."

A little while later, he goes around to make sure everybody is doing OK. Everywhere he goes he sees baby animals, cubs, kits, foals, calves, kids, piglets, puppies, and so on, until he comes to a pair of snakes with no baby. He says to them "Why have you not reproduced as your God commanded?" And they say "We would, but we need you to cut down some trees."

Noah is a little confused, but he goes and does it anyway. He cuts down a couple trees and leaves them for the snakes.

A while later he comes back, and to his surprise there are a bunch of baby snakes. So he asks the snakes "Why did you need me to cut down a tree before you had kids?"

And they answered: "We're adders, we need logs to multiply."


Spiderman: So, can you guys give me any advice on, you know, how to last longer with the ladies?

Superman: Don't ask me, they say I'm faster than a speeding bullet.

The Flash: No idea, I'm literally the fastest man on Earth.

Vision: I have no genitals.


Teacher: Please use the word "waffle" in a sentence.

Johnny: "Come on over and my waffle make you something to eat."


At Jack's funeral, somebody asks Judy, his wife of sixty years: "I have heard that you and Jack never had an argument in your whole marriage, how did you do it?"

And she says "That's not completely true. We did have one argument, let me tell you the story:

Back when we were young we got married and we took this horse and carriage out for our honeymoon. We were going along and a fox ran by, startled the horse and made it bolt. Jack wrestled it down to a stop, then he got down, stood in front of the horse, pointed his finger and said "Don't do that. That's your first warning."

So he got back in the carriage next to me and we carried on. We were having such a pleasant ride, when an owl swooped past, startled the horse and made it bolt. Again Jack wrestled it to a stop, got down in front of the horse, pointed his finger and said "Don't do that. That's your second warning."

Well, we hadn't gone another twenty paces when a dog barked nearby, and the horse bolted again. Jack wrestled the horse to a stop, got down off the carriage, pulled out a gun and shot the horse in the head.

It took me by surprise, and I said "Jack, what did you have to shoot the horse for, it wasn't his fault!"

And he looked me in the eye, pointed his finger, and said "Don't argue with me. That's your first warning."

"And we never had another argument after that."


"Doctor, doctor, I woke up this morning and my dick is orange!"

"Hmm, were you doing anything unusual last night?"

"Well, no, I was just eating Cheetos and watching porn ..."


"Doctor, doctor, my sister thinks she's a chicken!"

"Hmm, how long has this been going on?"

"For a couple months now."

"Why haven't you said anything before?"

"We don't have a lot of money, and we could really use the eggs."


"Doctor, doctor, there is something wrong with me! It hurts every time I do this," patient pushes his finger against his head, "Ouch! Or when I do this," patient pushes his finger against his arm, "Ouch! Or when I do this," patient pushes his finger against his knee, "Ouch! What is wrong with me?"

"Hmm, your finger is broken"


John and Jane are a young couple, recently married. Jane wants to make something nice for her husband for Friday night dinner, and she remembers he always says how much he loved his mother's baked chicken dinner. So she looks up a recipe in her hand-me-down cookbook, spends a couple hours prepping, and has the bird on the table just as John walks in the door. After the meal, Jane asks if he liked it, and John says "It was pretty good, but it wasn't as good as my Momma always made it."

Jane is a bit disappointed, but the next week she decides to try again. She scours the internet looking for the best baked chicken recipe, spends all afternoon prepping, and has the bird on the table just as John walks in the door. After the meal, Jane asks if he liked it, and John says "It was pretty good, but it wasn't as good as my Momma always made it."

Jane is a bit worried that she will never live up to her mother-in-law, but she decides to give it one more try the next Friday. She spends the weekend getting tips and tricks from all her older girl friends, and gets a recipe book from the library with the finest cuisine from around the world. She spends all day prepping, and has the bird on the table just as John walks in the door. After the meal, she again asks if he liked it, and John says again "It was pretty good, but it wasn't as good as my Momma always made it."

Now Jane is furious that her husband does not appreciate all her hard work. So about ten minutes before John comes home on Friday she throws a frozen bird into the oven and scorches it. John comes home and she sets the blackened chicken down in front of him and lets he have a taste. After a couple bites, John says "This is amazing, it tastes just like Momma always made it!"

  1. This one is funner to tell face-to-face so you can act out the kid's movements. []

Vpatch for Text Selection Fix

June 3rd, 2019

As I previously noted, I had to make a small change to get the javascript text selection thing to work on this website. The change I made seems to be addressing a symptom, rather than the underlying problem, since when I look at the source code it should work as written. But anyway, I made a vpatch for the MP-WP tree, so if anybody else sees the same problem they can use this fix.

mp-wp_fix-textselectionjs.vpatch (text version)
mp-wp_fix-textselectionjs.vpatch.peterl.sig (text version)

Getting Selection-Magic to Work

May 29th, 2019

Included in this set-up of WP is a javascript thing that allows the selection of regions of the text, which is convenient when you want to reference a certain passage in a blog post. I had noticed that the functionality was not actually working on my web page, so I dug into the problem. I learned a bit about javascript and a bit about Wordpress. Here are the things I had to change to get it to work:

In the single-post file, which is where the javascript thing is active, there were actually two <span>tags with the same ID, so I got rid of one of them. The big problem with the code was that this <span> tag ID must match the ID called for in the selection-magic script, and for some reason the script was not being updated to match the ID on the page. I reasoned that there is no reason that the ID should be unique for each page (it was being assigned a "shash-#" to match the post ID), it just has to be unique within the page. So I switched it to a static ID string, "sm-area", which solved the problem.

In trying to figure out why this was not working, I compared my script to the one on a page with a working version, and noticed that they included the word "selection-" in the generated address, so I added that too. I also did some minor edits to the javascript.

Next Step: I will review the standard files, and if appropriate, make a vpatch to include these changes into the tree as found on Btcbase.org.

Using the .htaccess File to Allow Two Computers Access

May 15th, 2019

In order to control access to parts of a website one can use a .htaccess file to restrict the IP addresses which are allowed to view files in a folder. I have two computers which I generally use to access the admin functions of my website, so I wanted to set up the .htaccess file so that either computer could log into the WP-Admin functionality. After looking through various online suggestions, I figured I should be able to do something like this to allow either IP address:

Order Deny,Allow
Deny from All
Allow from xx.xx.xx.xx
Allow from yy.yy.yy.yy

But when I put this in my .htaccess file, when I tried to load the website I just got an error saying that Apache was misconfigured. If you see anything wrong with the code above, I would love to hear why it does not work, since every site I looked at seemed to suggest this should work for what I am trying to do.

The setting that I have been using, and has been working, is like this:

Require IP xx.xx.xx.xx

But when I use this, each time I switch computers I have to ssh into the host and manually alter three different .htaccess files to use the correct IP address before I can log into WP-Admin, which is annoyingly tedious. So I did some more digging and came up with some more technical documentation, where I found the option to use this form:

Require IP xx.xx.xx.xx
Require IP yy.yy.yy.yy

Which lets either computer access the folder.

Hello from a Linux Computer

May 13th, 2019

Back in 2007 I got my first Macbook. I have been using Macs ever since, except for at work where I generally have been issued a Windows machine, the exception being the computer running the NMR, which has been a Linux system everywhere I have been.

Recently I decided that it would be better to have a Linux computer. I have heard good things about Gentoo, so I thought I would try to start there. I happen to have an old macbook pro sitting around that nobody is using, so I decided to try installing a new operating system there. Apparently macs can be finicky about the particular settings used. I spent the last week trying to follow the Gentoo installation guide, but the system never booted up.

Being rather frustrated at this point, I thought I would start with something easier. So I created a Ubuntu minimal installation disk. After fighting with the Gentoo install for the past week, the Ubuntu install was a breeze. There were just a couple simple questions to answer, and the install program did the rest. Now I have a working Linux system.

I imagine that it will take me some time to get all the settings just the way I want them, but I at least have something to work with. Right away I noticed there is no Curl, so I had to install that.

New Class of Polymers which Allow Efficient Recycling

May 10th, 2019

In the news I saw a reference to this paper on recyclable polymers1. The basic idea described is that these researchers have developed a class of polymers which allow efficient recycling. By combining the monomers of a bis-triketone and a di-amine a polymer is formed. This polymer can be broken back down to the monomers simply by soaking in acid.

The important advancement here is that once the starting monomers are regenerated they can be purified from any additives, and cleaned from impurities from the use of the polymer, and then used as starting materials for the generation of new polymer. This allows the recycled product to be just as high quality as the original product.

Figure 1. A triketone

Figure 1. A triketone

Let's take a look at the chemical reactions going on here. First, when they say they are using a triketone it is specifically a molecule with a carbon surrounded by three carbonyl moieties, an example is shown in Figure 1. A triketone is more appropriate than a normal ketone for this sort of reaction because it has a fairly acidic proton on that central carbon, the acidity is caused by stabilization of the resulting anion by the surrounding carbonyl groups, which can be represented using resonance structures as shown in Figure 2.

Figure 2. Resonance structure of a triketone anion.

Figure 2. Resonance structure of a triketone anion.

The reaction creating the polymer is the reaction of a triketone with an amine, which forms a diketoimine and releases a molecule of water, as shown in Figure 3.

Figure 3. Formation of a diketoimine.

Figure 3. Formation of a diketoimine.

This reaction can be reversed by hydrolysis under acidic conditions to regenerate the original triketone and amine, as shown in Figure 4.

Figure 4. Hydrolysis of diketoimine.

Figure 4. Hydrolysis of diketoimine.

The formation of a polymer would use a diamine and a bis-triketone as starting materials. When mixed, they form a polymer, as shown in Figure 5. Here I have shown the reaction using 1,2-diethylamine and the bis-triketone derived from adipic acid.

Figure 5. Polymerization

Figure 5. Polymerization

Figure 6. A triamine.

Figure 6. A triamine.

The reaction shown above would result in in linear polymer. A branching or networked polymer can be created using a triamine, such as the one shown in Figure 6.

Figure 7. A bis-triketone derived from terephthalic acid.

Figure 7. A bis-triketone derived from terephthalic acid.

The physical properties of the resulting polymer can be controlled by the choice of monomers. A mixture of diamine and triamine monomers could be used to tailor the polymer for a specific use. Instead of using the aliphatic bis-triketone derived from adipic acid, one could start with the aromatic bis-triketone derived from terephthalic acid, which is shown in Figure 7. This would give more rigidity to the resulting polymer. Alternately, one could form a polymer with less rigidity by using a bis-triketone derived from a longer chained di-acid, such as dodecanedioic acid.

The real advantage this polymer presents is that additives such as colorants, platicizers, or inorganic fibers for strength can be added without reducing the recylability of the polymer. Once the polymer is broken down by acid, the monomers can be purified using regular solution purification techniques.

I also wanted to call out at the formation of the bis-triketone, because I think the chemistry here, while not new in itself, is interesting as an example of organic synthesis. They start with two equivalents of dimedone2 and one equvalent of adipic acid3. These were dissolved in methylene chloride with three equivalents of DMAP4, which will deprotonate both the adipic acid and the dimedone. They then added a solution of DCC5 in methylene chloride, which accepts the oxygen from the adipic acid, forming N,N'-dicyclohexylurea and allowing the coupling of the adipic acid and dimedone. The N,N'-dicyclohexylurea precipitates and was removed by filtration, and then the DMAP was removed by washing with hydrochloric acid. This scheme is shown below in Figure 86.

Figure 8. Reaction to form a bis-triketone.

Figure 8. Reaction to form a bis-triketone.

  1. Peter R. Christensen, Angelique M. Scheuermann, Kathryn E. Loeffler, Brett A. Helms, Closed-loop recycling of plastics enabled by dynamic covalent diketoenamine bonds, Nature Chemistry, volume 11, pages 442–448 (2019). []
  2. 5,5-Dimethyl-1,3-cyclohexanedione []
  3. Hexanedioic acid. You need 2 eq. of dimedone because the reaction adds one dimedone to each end of the adipic acid. []
  4. Dimethylaminopyridine, a base. You might think this would require four equivalents, but the DCC acts as a base as well so you don't need so much []
  5. Dicyclohexylcarbodiimine []
  6. I admit that I am being lazy about arrow pushing electrons here, but I think this shows the important part of the reaction. []