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.

Alphabet

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,
H!
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.

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:

<RequireAny>
Require IP xx.xx.xx.xx
Require IP yy.yy.yy.yy
</RequireAny>

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. []

BTC price setting auction May 2019

May 9th, 2019

This appeared in the log today:

auctionbot: Buy order # 1047 has ENDED: 500 WFF, WU esta bien SOLD by PeterL for 94mn ecu. Attn: BingoBoingo

This might look cryptic, but it is actually a very important piece of information. What this is saying is that 500 USD1 were sold for 94mn ecu2, which is equivalent3 to 0.094 bitcoin. Or for people who think of things using the USD price, that is an exchange rate of 5319.15 USD/BTC.

This particular monthly auction is important because it is used to set the prices which the Pizarro ISP uses to set the rates they charge customers.

  1. US dollars, aka WFF, which stands for wired filthy fiats []
  2. ecu = euloran copper unit []
  3. Equivalent because the makers of the game Eulora, who issue these ecu, have pegged them to the bitcoin. []

Ideas

May 1st, 2019

Have you ever had a great idea and then later realized that you were not the first one to think of it?

Asphalt paver machine

Asphalt paver machine

When I was about four I invented a machine that would make roads. I even drew a really nice picture in crayons of what I came up with. It had a big hopper in front, and would pour the material down and spread it flat and it had big treads on the side so it could move forward building a road behind it. Some years later I was amazed as my family drove past a highway under construction, and they were using the machine that I had drawn! Something like the picture shown.

When I was in college, after studying a bit of chemistry and physics, I did some thinking about nuclear fusion. Some metals, such as palladium, can absorb large amounts of hydrogen. I reasoned that if one was to make a target of palladium and expose it to deuterium it would hold the deuterium in place. One could then use some high voltage to accelerate more deuterium ions toward it, resulting in nuclear fusion. I was thinking this would be a great way to make a power-producing fusion reactor! Then I found out that this had already been invented some decades prior. The resulting nuclear reactors are not used to generate power, but they are used in the medical field as a source of high energy neutrons.

Also while in college I gave some thought to unusual electric motor configurations. I was fascinated by the homopolar motor. I drew up an idea of a homopolar motor made with multiple windings around two co-axial magnets which were arranged with their north poles pointed in opposite directions. Some years later I found some of my old notes and drawings, and so I did some searching on the internet to try to decide if there was any way they would work. I was surprised to find that a patent had been issued in the intervening years for such a device1, and the drawings in the patent are very similar to what I had drawn some years before.

  1. Although, there being a patent does not necessarily mean that it would actually work. []