Born Geek

Linked Photo Albums

May 12, 2018

I’m trying something new on my photos site. Starting with the NC Arboretum album, photos will now be hosted at Google Photos. This has a number of benefits:

  • Users can comment on photos
  • I can now embed videos in the album
  • Nicer viewing experience on all devices
  • Simplifies the import process for me

New albums will still show up on my photos site, but they will now be links to the external albums. The RSS feed for albums should still work to track what I post.

I’m not yet sure how to handle the “favorites” section of the photos site. I’d like to be able to point to favorite photos as I take them, but how to do that is still to be determined.

Let me know what you think of this new setup. I’m looking forward to giving it a try, and I have a backlog of photo albums to post.

A Subtle Python Bug

February 23, 2018

I recently had a very subtle bug with an OrderedDict in my Python code at work. I constructed the contents of this object from a SQL query that was output in a specific order (can you spot the bug?):

qs = models.MyModel.objects.all().order_by("-order")
data = OrderedDict({x.id: x.name for x in qs})

My expectation was output like the following, which I was seeing on my development system (Python 3.6):

OrderedDict([(4, 'Four'), (3, 'Three'), (2, 'Two'), (1, 'One')])

However, on my official sandbox test system (which we use for internal testing, running Python 3.5), I was seeing output like this:

OrderedDict([(1, 'One'), (2, 'Two'), (3, 'Three'), (4, 'Four')])

There are actually two issues in play here, and it took me a while to figure out what was going on.

  1. First, I’m constructing the OrderedDict element incorrectly. I’m using a dictionary comprehension as the initialization data for the object’s constructor. Dictionaries are (until recently) not guaranteed to preserve insertion order when iterated over. This is where my order was being screwed up.
  2. Second, the above behavior for dictionary order preservation is an implementation detail that changed in Python 3.6. As of 3.6 (in the CPython implementation), dictionaries now preserve the insertion order when iterated over. My development system, running on 3.6, was therefore outputting things as I expected them. The sandbox system, still running 3.5, did not. What an annoyance!

I’ve learned two valuable lessons here: (a) make sure you’re running on the same levels of code in various places, and (b) don’t initialize an OrderedDict with a dictionary comprehension.

Comments Off on A Subtle Python Bug Tags:

High Contrast Mouse Pointer

February 19, 2018

As I age, my vision is getting worse (and it’s already pretty bad). At work, I use a three monitor setup: my laptop is the middle screen, and two external monitors sit to either side. Given the large screen real estate, and given my increasingly bad eyesight, I’ve been having a tough time finding my mouse pointer. Windows has an option to show the location of the mouse pointer when you press the Ctrl key, but that has limited usefulness (though I do use it from time to time).

I recently stumbled upon a neat feature in Windows 10 that has helped me tremendously. There are several mouse-specific features in the Ease of Access section of the Windows settings. The pointer size can be adjusted (which is helpful to a degree), but the most helpful feature is the Pointer Color setting. There’s an option to adjust the pointer color based on whatever color is beneath it. It took a little getting used to, but I can now find the mouse pointer a lot easier than I could before.

ThruNite Archer 2A Flashlight

February 11, 2018

I have always liked a good flashlight. As a kid, I even asked for a 5-cell D Maglite for Christmas (which Santa brought!). This past December, I picked up the ThruNite Archer 2A flashlight from Amazon, based on a review from The Wirecutter. At $30 it’s not cheap, but boy is this thing great.

It uses two AA batteries and puts out an incredible amount of light. There are four brightness settings, ranging from dim (great for when your eyes are adjusted to the dark) to blindingly bright. I also like the fact that it’s compact; you could easily store this in a bag, car console, or junk drawer without taking up much space.

Since I bought it, I’ve put it to use in a number of ways (looking for dropped items in the car, using it on walks at night, and hunting under furniture for lost cat toys). I highly recommend this spectacular flashlight.

Sunset of Firefox Content

January 7, 2018

This post serves as a notice that all Firefox content on this website has been removed. This includes:

  • CoLT
  • Googlebar Lite
  • Firefox Toolbar Tutorial
  • Firefox Profile Tutorial
  • Automatic Extension Updates Tutorial

All links to that content should now redirect to this notice statement. If you’re looking for information on the above, here are a few external references for your use:

Toolbar Tutorial Removed

January 7, 2018

I have removed my Firefox toolbar tutorial from this site, since it is now woefully out of date. If you’re looking for Firefox extension development information, turn to the official documentation.

Comments Off on Toolbar Tutorial Removed Tags:

Hammocks Beach State Park Photos

January 1, 2018

I’ve just posted some photos from a visit to my final North Carolina state park back in October of 2016. This album has been long overdue, but I’m finally getting around to it.

I hope to post more photos in the coming weeks, but I’m debating how best to do that (I have a large backlog of stuff that never made it here). I’ve been using Google Photos as my posting ground in recent times, and I haven’t seen a good way to make those photos public.

Bread Machine Cinnamon Rolls

December 24, 2017

I have a fairly old bread machine (late 90s / early 2000s model) that I use all the time. A few years ago, my dad found a great recipe for bread machine cinnamon rolls that he shared with me. After a minor tweak or two from the original, we’ve hit upon one of the best cinnamon roll recipes I’ve ever tried.

Wet Ingredients

  • 1 cup warm milk
  • 2 eggs
  • 6 Tbsp butter

Dry Ingredients

  • 1 tsp salt
  • 1/3 cup white sugar
  • 4 cups bread flour
  • 1 Tbsp yeast

Put all ingredients in the machine in the typical order (most machines call for wet first, then dry). Use the 2-pound dough setting, and let the machine do its thing. Once the machine is done, dump the dough out onto a flat surface (lightly floured if you like to avoid sticking). Roll the dough into a rectangle about 1/4 inch thick.

Filling

  • 2 Tbsp softened butter for spreading
  • 1/4 cup brown sugar
  • 1/4 cup white sugar
  • 2 Tbsp cinnamon
  • 1/2 cup raisins (optional; golden raisins are particularly good)

Spread the butter on the rolled out rectangle, and then sprinkle the sugar/cinnamon mixture on top of the butter. Also add the raisins (if using them). Roll the rectangle into a tight log (starting with long edge) and keep the seam side down to keep it sealed. Cut the log into the desired pieces (I typically get about 15 or so of these at about 1/2″ or so thick), and place them in greased pans. Let rise in a warm place for 30 minutes to 1 hour. Bake at 350° for 10 to 15 minutes, or until golden brown.

Icing

  • 1 cup powdered sugar
  • 1/4 tsp vanilla
  • Enough milk to make it thick (this is the tricky part)

I typically use about 1 Tbsp of milk, but it’s an art form to guess-timate the right amount. You don’t want the icing too thick, and you don’t want it too runny. I always double the icing recipe above because I love icing (if I can see the bread of the cinnamon roll, I don’t have enough icing on it). Enjoy!

Sunset of Googlebar Lite

April 6, 2017

As of today, I am officially withdrawing my development support for the Googlebar Lite Firefox extension. I’m aware that the extension no longer works well in the latest builds of Firefox, and I have absolutely no desire to fix them. Mozilla’s development environment has gotten pretty irritating as of late, and I just don’t have the cycles (or the drive) to fix the issues that exist.

The future of Firefox add-ons lies in WebExtensions, and toolbar support in that arena is pretty bare-bones (last I looked). The default Firefox search box meets most needs, which has motivated me to drop this extension.

For those that are so-inclined, I will accept pull requests at the official googlebarlite repo. Or, you can fork the project and roll your own.

Lumber River State Park Photos

December 20, 2016

In early October, I visited Lumber River State Park, the penultimate state park in my quest to visit them all. Naturally, I took my camera, and these photos were the result. Sadly, this small park offers lackluster hiking.