Notes about eyeglasses #

These are my barely-organized notes about my need for eyeglasses to correct my nearsightedness. It is likely that I have some of this wrong because I don't fully understand it.


When an optometrist measures your "prescription" they're measuring the 0th and 1st order zernicke polynomials. The 0th order is "sphere" and is a single number, rounded to the closest 0.25. The 1st order is "cylinder" (astigmatism) and has two numbers: a direction axis and an amount. There are higher order aberrations too but the optometrist doesn't measure these. These higher order aberrations can cause halos and other effects; see this example image that shows a "coma" (point smeared out like a comet), "spherical aberration" (starbursts and halos), and "quadrefoil" (point spreads out multiple directions). Laser surgery can often correct these but sometimes the healing process generates new ones.


Emacs mode line simplified #

Back in 2017 I posted that I switched from my own custom Emacs modeline to Spaceline. I liked having a simpler configuration with more features. Unfortunately I eventually realized that those features were slowing down my system. In particular, column number, which-function, and selection-info, and my custom unicode display had to be updated on every keystroke. I went back to the default mode line and used this trick to see when it was recalculated:

(defvar-local mode-line-eval-count 0 "Counting :eval")

;;; put this in mode-line-format
 '(:eval (progn
           (setq mode-line-eval-count (+ 1 mode-line-eval-count))
           (format "%+4d " mode-line-eval-count))))

Every recalculation, the counter increases. By experimenting with the default mode line, I found that having %c in the mode line (column number) causes it to redisplay (almost) every keystroke, and %l (line number) causes it to redisplay when changing lines. I also realized during this experimentation that Emacs felt faster with the default mode line than with Spaceline.

I decided to switch from Spaceline to the default mode line, much closer to my setup before 2017, but simpler, more modular, and matching my tabbar. It feels nice and it looks good. I thought I would miss a few of the fancy features from Spaceline, but I didn't miss them as much as I thought I would. Features I use:

  • Read-only and modified status show a bright color on the left.
  • Project directory and filename are in separate colors.
  • The color theme depends on project (red for work, blue for personal, purple for configuration).
  • Week number ties into my task tracking system.
  • Line number uses Emacs 26's line-numbers-mode instead of the mode line.
Screenshot of Emacs tabbar, line-numbers-mode, and mode-line

I've put a simplified version of the code in a gist.


Fractal islands in the Pacific #

I'm not a big fan of the Pacific Ocean. There. I said it. I like water/land interfaces. Coasts, rivers, lakeshores, beaches, coral reefs, tide pools. The Pacific Ocean has too few of these. So … let's fix it. Here's an idea I had from around 2003 but never blogged about:

Drawing of earth with volcanic islands added
I couldn't find a whiteboard drawing from 2003 but I have this newer one


iTunes Sync Error -256 #

This was a mystery.

I had been messing with my photo sync settings in iTunes, so that I could get more photos onto my iPhone. I started getting this iTunes sync error, -256. I googled for this but naturally Google ignored "256", as it seems to enjoy ignoring the most important words in my queries. I couldn't find an answer, and I had no luck deleting and resyncing photos. I decided I should wipe the phone and restore from backup at some point, but "not today".

A few weeks later (today) I discovered the real culprit. At some point in the past few months I had accidentally deleted podcast files in iTunes. I had restored the iTunes catalog file, and I had restored the files themselves from Trash. Or so I thought. I discovered today that I hadn't gotten them all. Once I fixed that (by deleting in iTunes and telling it to download them again), the photo sync worked again!

Grr1: iTunes does too many things, and it's hard to diagnose errors. Grr2: "error -256" is unhelpful. If it told me what it was doing at the time, it would've helped me realize it was podcasts and not photos that were the problem. Grr3: iTunes catalog and the files on disk can get out of sync; this is fragile.

I'm writing this blog post so that if anyone else has error -256, and convinces Google not to ignore that term, they might find a solution here.


Heat needed to melt ice #

I knew that melting ice takes heat, but didn't have a good sense for how much. I decided to calculate it.

  1. Specific heat tells you how much heat it takes to increase temperature. For water, it's around 4.2 joules per gram of water to raise the temperature by +1°C.
  2. Latent heat (of fusion) tells you how much heat it takes to turn solid into liquid, while not changing temperature. For ice→water, it's 334 joules per gram of water.

So we have two different processes: water to hotter water, and ice to water. How do they compare? Let's divide 334 J/g/°C ÷ 4.2 J/g = 79.5 °C.

That means the same amount of heat can do either:

  1. Melt ice.
  2. Raise water temperature by 79.5°C (143°F).


That's much higher than I expected. Did I do the calculation wrong? I checked specific heat and latent heat again, but I can't see anything wrong with the calculation.

Now imagine what happens with climate change. If you add heat to a system, and there's ice around, it will melt the ice. But if there's no ice around, that same amount of heat will increase the temperature by 79.5°C (143°F). eeek!!

(please tell me I did the calculation wrong, because those numbers are scary)


Emacs Org mode and KaTeX #

Emacs Org mode can handle LaTeX math, and exports it to HTML using MathJax. On my pages I have been using KaTeX instead of MathJax. It loads faster but doesn't support as many features. Org mode doesn't have direct support for KaTeX but for the simple things I do on my pages, I can redirect MathJax to KaTeX using KaTeX autorender:

(setq org-html-mathjax-template
"<link rel=\"stylesheet\" href=\"\" integrity=\"sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y\" crossorigin=\"anonymous\"/>
<script defer=\"defer\" src=\"\" integrity=\"sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx\" crossorigin=\"anonymous\"></script>
<script defer=\"defer\" src=\"\" integrity=\"sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe\" crossorigin=\"anonymous\" onload=\"renderMathInElement(document.body);\"></script>")

(it looks ugly but it's straight from the KaTeX autorender page, but with quotes backslashed)

This seems to work on the small tests I've done so far.

Labels: ,