Category Archives: Geekstuff

Out with the latin1, in with the utf8mb4

The MySQL database underneath this blog has been using the latin1 encoding since the beginning. However, at some point I started posting with Unicode characters encoded with UTF-8. WordPress dutifully stuffed this UTF-8 data into the latin1 columns without complaint. After all, it’s technically valid, even if it’s nonsense.

This wasn’t a problem until I upgraded to MySQL 8.0. Suddenly, characters in a few of my posts were displaying incorrectly. For example, non-breaking spaces in several posts were no longer invisible, showing up as “Å” in odd places. Characters such as “ö” were obliterated. Worse yet, my posts were a mix of latin1 and UTF-8 encoding.

Thankfully, Nic Jansma developed a solution for this problem some time ago. It’s not completely automated, but it helps. If you do this yourself make sure you run the script against a copy of your database, over and over again, until you’ve resolved all of the problems.

At this point everything has been updated to UTF-8 using the MySQL utf8mb4 encoding. Please drop me a line if you notice anything that looks messed up.

Changing strategies for WordPress performance

Over the years I’ve tried a few different strategies to help with performance: more RAM, faster hardware, and a couple of different caching extensions. The most recent improvements came from a combination of running WordPress in Docker on a diskless RancherOS machine, together with one of the more popular caching extensions.

This was good enough, but I wasn’t happy. The extension was complex both in terms of implementation and configuration. This seemed unnecessary; I set about looking for simpler alternatives, eventually settling on using a redis cache.

Redis has several advantages in a Docker-based environment:

  • It’s trivially easy to add a redis server;
  • It’s easy to configure WordPress to use it, using Redis Object Cache; and
  • It’s fast. Very fast.

I haven’t made any attempt to run benchmarks, but so far it seems to provide a performance boost similar to the old, complex extension – without all the overhead. And that, I think, is a good thing.

macOS vs. VMware vs. scaled Retina resolution

Here’s a quick tech tip; if you have a macOS (or OS X) virtual machine that you can’t seem to set to a reasonably high resolution, it’s probably because scaled Retina resolution is enabled. The telltale sign is that the actual resolution you see, when selecting the Scaled option in Display preferences, is exactly half of what you’re setting with the vmware-resolutionSet utility, followed by “HiDPI”. The other sign is that while you’re able to see an apparently higher resolution in the Scaled resolution list, selecting it has no effect (though you may see the display momentarily go to a higher resolution and then revert).

Disable scaled Retina resolution by opening Terminal.app and running this command:

sudo defaults write /Library/Preferences/com.apple.windowserver.plist DisplayResolutionEnabled -bool false

Reboot, then set your desired resolution with this command (for example):

sudo /Library/Application\ Support/VMware\ Tools/vmware-resolutionSet 1680 1050

If, on the other hand, you’re looking to take advantage of a HiDPI display on your host, simply replace “false” with “true” in the first line and set a resolution of exactly half of the desired resolution (on each axis). Make sure you reboot after changing the DisplayResolutionEnabled property.

Not quite how Apple Pay works

I was reading Kohl’s Apple Pay deal illustrates why mobile wallet is a lot harder than it looks earlier, and some red flags immediately went up. The main issue seems to be the writer’s misunderstanding of how to use Apple Pay. It’s not true that you need to open the Wallet app; simply double-tap the home button (the one with the Touch ID sensor), select the card to use if you don’t want to use the default, then use Touch ID to authenticate and put your phone near the reader/terminal.

There are definitely good points in this article, and the EMV rules have taken some of the shine off of this experience. Even so, it’s a lot easier and faster than checking out at Target with their own store card.

Why I’m not interested in 4K television (yet)

I’ve written about my issues with television technology before, and nothing much has changed, except what the manufacturers are pushing. The technology of the moment seems to be 4K UHD.

Let’s back up a step or two and consider the current state of things.

Traditional broadcast and home video equipment in the United States refreshed the screen about 30 times per second. Films typically used a slightly slower rate of 24 frames per second. Both of these are considered by most people to be good enough. Depending on the conditions, though, some people are sensitive to much higher refresh rates. Once you get to 60 Hz (frames per second) a majority of people won’t detect a difference. If you go above 100Hz virtually nobody can.

For resolution, there’s a similar limit. Your eyes can only resolve the individual dots down to about 300 dots per inch. In a typical living room you’re sitting far enough away from the television that you can’t see the difference between 720p and 1080p with a diagonal size of 40-42 inches.

Did this stop the industry from pumping out sets with 240 Hz refresh rates? How about 24 inch TVs with 1080p resolution? Yeah, it’s possible that you’re putting that 24 inch set on the wall next to the kitchen table, and you might be able to justify that, but let’s be honest; it’s a marketing gimmick. “More is always better,” right?

I’m getting long-winded so I’ll just quickly summarize my remaining point: available broadcast and cable bandwidth just isn’t sufficient for a 1080p 60Hz refresh, the current Full HD standard. You need something better than an average Internet connection or a Blu-Ray player in order to view it.

If you’re not even thinking about a 4K set, you can stop here. I won’t be offended. The same goes if you’ve already spent the money on a 4K set. But, if you’re still thinking about it and the calendar hasn’t hit 2018 yet, you might want to give this a read: The industry wants you to go 4K, but the professionals won’t be joining you

Two hundred posts: Exciting Site Upgrades

And for post number two hundred, something fitting for the occasion. Two delicious upgrades this evening for your viewing pleasure:

1) I’ve removed Zend Optimizer and installed eaccelerator on my server. The site seems to be a fair bit more responsive now. In case you’re interested, the main reason for this change was to cache the compiled code; there’s not much point optimizing the code if you throw away the results each time you do it.

2) The WPtouch plugin has been installed for access from the iPhone/iPod Touch. If you don’t have one of these two charming little gadgets you won’t see a change; sorry about that. It’s very pretty, though, trust me on this.

Now all I need is to generate some content. Wouldn’t that be fantastic? Here’s to another two hundred posts!

Apple TV, take 2

Some pleasant surprises came with the Apple TV 2.0 update, which arrived yesterday…

  1. You can use the Apple TV as an AirTunes device.
  2. 1080p output is supported.
  3. Closed caption support is available (though, sadly, content with CC is currently quite limited).
  4. Though you have 24 hours to finish watching an iTunes rental from the time you start, I was able to successfully start a movie with 45 minutes left on the clock and still watch through to the end – even though this took me nearly 45 minutes over the limit. (Kudos to Apple for allowing this.)
  5. There are (optional) parental controls on all content downloaded from the Internet: movie and TV show previews, podcasts, photos, etc.

My kids and I picked out and started watching a movie within 15 minutes after running the new software. Given the fact that I wanted to keep the cost of our experiment down – in case it didn’t go so well – we chose a standard definition* (SD) movie. While not nearly as good as the network broadcast 720p content we’ve become accustomed to it did compare pretty favorably with a standard DVD. I’d still give the edge to upconverted DVD video; however, there were no glaring deficiencies in the downloaded video.

I’ll be exploring more in the next few weeks. I wonder, what other surprises await?

*Don’t confuse SD with standard (i.e. non-widescreen) picture. The movie was presented in a widescreen format just as in the theater; it just wasn’t encoded as HD.

Content for the Apple TV (and, well… you)

As promised, here’s a selection of what I’ve been watching my Apple TV.

First up, the Hidden Universe HD podcast. Focusing primarily on images from the Spitzer Space Telescope, the Hidden Universe brings some fantastic visuals from the depths of space. With reasonably well-written, 2-6 minute pieces, you can get breathtaking views of objects both (relatively) near and far. The longer, and typically more interesting episodes are hosted by Dr. Robert Hurt. Two versions of this podcast are available, so make sure you get the HD version.

Next on the list is another space telescope podcast: Hubblecast HD. The images are no less breathtaking from Hubble, and the Hubblecast crew has a few video tricks up their sleeve, too. This “vodcast” (or video podcast) is hosted by one Doctor J, aka Dr. Joe Liske, who expertly guides the viewer into the wild and beautiful reaches of deep space. Note: there are three versions of this podcast on iTunes, so be sure to get the HD version, not Full HD. You’ll notice that the first 5 episodes are missing, unfortunately, but you can fetch these from the standard Hubblecast feed or get them online. (The HD version first appeared in episode #6.)

Several television news organizations have at least attempted made an attempt to put together video content. NBC Nightly News is noteworthy as being the first full-length newscast available; FOX for short, generally upbeat clips, updated at least a couple of times each weekday; and CBS Evening News. Unfortunately, none of these are available with enough resolution to look decent on the Apple TV. (Since I started to write this, CNN and ABC have added news-related videocasts as well. I don’t normally watch these networks but you might want to check them out.)

Even if you don’t use an Apple computer, you may find it well worth your while to check out MacBreak in any of the several formats available. Hosted and produced by a variety of folks associated with TWiT, you’ll find a variety interesting short videocasts on topics including image editors, video production, and the cool gadgets. Make sure you get the Apple TV version, not the HD version.

A couple of other videocasts I’m currently subscribed to are Beautiful Places In HD and Finding America HD. They’re not high-end productions but they are certainly enjoyable for what they are. Beautiful Places is currently on hiatus, but hopefully returning this spring; Finding America is updated every week or two.

If you find any of this helpful – even if you don’t have an Apple TV – would you leave a comment or drop me an email and let me know, please?

Misunderstood technology

Now that I’ve had my Apple TV for a few weeks, I decided it was time to write about it a bit.

Since I picked up this little high-def wonder, of course, there’s been a big headline: the Apple TV has made the Yahoo! “worst tech products of 2007” list. The criticisms are all based in reality, so you can’t really blame the writer. Unfortunately, I think that most people don’t actually understand what this device is. As a result it’s more than a little tempting to compare it to what we know. Apple hasn’t helped with their usual radio silence regarding plans for the device, either.

A few notes on what the Apple TV brings to the table, as clearly and succinctly as I can relate them:

First, the device supports progressive (720p, 480p) and interlaced (1080i, 480i) output modes. A widescreen TV does not appear to be required; I haven’t tried on my old 480i JVC standard-def set, but I’m told this works. Both HDMI and component output is available. (For my European readers, you can of course configure a standard 50Hz rate, and 576p/576i instead of the 480-line variants.)

Second, the device is linked directly with one iTunes library on another machine on your network. They tout the wireless connectivity, which is convenient, but you can use a standard Ethernet connection, too. All of the supported media on the linked iTunes library is automatically copied to the Apple TV, including the played/not played status and (if applicable) the point at which you’ve paused playback. This whole process happens seamlessly in the background once you’ve set up the link.

Third, you can you can connect to up to 4 more iTunes libraries using a mechanism similar to pairing Bluetooth devices. Provided the machine is on and running iTunes, you can play content from that library directly on the Apple TV. When you use the device this way you’re actually streaming the content from one machine to another, so make sure you have decent network connectivity if it’s a video. Note that the content is never stored on the device, but is read directly from the other machine via iTunes.

Fourth, a word about content. The only clearly legal way to get content on your Apple TV is to purchase it from the iTunes Store, or to download it via a podcast feed. Nevertheless, you can play most audio and video content supported by stock QuickTime codecs in iTunes. If you believe that it is within your fair use rights as a consumer to transfer copies of media you’ve purchased to your Apple TV, there are several ways to make that happen. (Remember; piracy is a crime. I am not advocating making copies of media you haven’t acquired legally.)

Fifth, and on a decidedly more anecdotal note, I picked up my little guy directly from Apple as a refurbished unit. I know a couple of folks who swear by this; with a factory warranty and a considerably smaller price tag, it’s very tempting. I’ll probably do this again should I be looking for more Apple gear.

In my next entry, I’ll discuss content in more depth. There’s some fantastic stuff available today, whether or not there are any announcements at next week’s Macworld Expo.

Update: While 480i output is available, your television must still support a widescreen signal. My JVC doesn’t.