Greg.Randall

Saffron update

February 13th 2020

The saffron bloomed in November. All or nearly all 100 bulbs sent up shoots and produced flowers. We got maybe 0.1gr of saffron after drying. Maybe next year we’ll get more.

saffron crocus with saffron picked

Yet another bed

February 13th 2020

murphy bed style bed plans

We’re working on getting a guest bedroom setup. We don’t really want to have a bed setup all the time, so we started looking at Murphy Beds, but quickly discovered that they are super expensive. Even just buying the hardware kit for the Murphy Bed is a couple hundred bucks.

After some looking I found the Lori Wall Bed which is sold as a kit of plywood, which doesn’t require any special hardware. The clever part of the Lori Wall Bed is that it has curved edges that help tilt the bed down from the vertical. Unfortunately it’s still more money than I’d like to spend.

I spent some time designing my own bed plans, borrowing the curved edges. I haven’t built this bed frame yet, but hopefully in the next couple of weeks I can get to it.

The bed takes four sheets of 3/4″ plywood. The idea is that you build a box and a platform. The platform’s bottom has a grid of shelving on it that is used as the bed frame when the bed is being used.


Garden Prep

February 13th 2020

Sarah & I have been hard at work getting the garden started for the spring. We picked up a tiny greenhouse, some plant heating mats, and some grow lights.

The greenhouse seems to be doing pretty well. It doesn’t seem to be constructed especially well, but that shouldn’t matter too much. We’re just going to use it to start plants in the spring and then pack it up when the last frost date passes.

The plants in the little green house have grown really quickly — we had to build a coldframe for more room. We’re experimenting with a heating mat under the coldframe and we also put some of the mylar bubblewrap insulation underneath.

Last year the soil in our beds wasn’t the best so we’ve been working to add home made compost, store bought compost, and other organic materials.

Sarah Digging Animation

Title Case

October 29th 2019

A while back I was working on a WordPress website someone had built where all the titles were all caps, and I needed to fix that.

At first this problem looks pretty simple– just run all the titles through the simple PHP function ucwords. ucwords will take a string like “HELLO WORLD” and convert it to “HELLO WORLD”? Ok so, ucwords only uppercases words not lowercases words? So “HELLO WORLD” apply strtolower which makes “hello world”, then apply ucwords to get “Hello World”. Already this is more complicated than I wanted to get into.

So when you start throwing strings with ‘the’, ‘a’, ‘of’, etc. into the mix things get messier. Our solution of strtolower -> ucwords will make a string like “THE QUICK BROWN FOX JUMPED OVER A LAZY DOG” into “The Quick Brown Fox Jumped Over A Lazy Dog”. Clearly we don’t want “a” capitalized. So we find a list of words that shouldn’t be capitalized:

Alright. Great. Let’s make all of those words not capitalized.

$title = "THE QUICK BROWN FOX JUMPED OVER A LAZY DOG";
$title = strtolower($title);
$title = ucwords($title);
$lowercase_words = array('a ', 'aboard ', 'about ', 'above ', 'across ', 'after ', 'against ', 'along ', 'amid ', 'among ', 'an ', 'and ', 'anti ', 'around ', 'as ', 'at ', 'before ', 'behind ', 'below ', 'beneath ', 'beside ', 'besides ', 'between ', 'beyond ', 'but ', 'by ', 'concerning ', 'considering ', 'despite ', 'down ', 'during ', 'except ', 'excepting ', 'excluding ', 'following ', 'for ', 'from ', 'in ', 'inside ', 'into ', 'like ', 'minus ', 'near ', 'of ', 'off ', 'on ', 'onto ', 'opposite ', 'or ', 'outside ', 'over ', 'past ', 'per ', 'plus ', 'regarding ', 'round ', 'save ', 'since ', 'so ', 'than ', 'the ', 'through ', 'to ', 'toward ', 'towards ', 'under ', 'underneath ', 'unlike ', 'until ', 'up ', 'upon ', 'versus ', 'via ', 'with ', 'within ', 'without ', 'yet');

$title = str_ireplace($lowercase_words, $lowercase_words, $title);

echo $title;

That outputs “the Quick Brown Fox Jumped over a Lazy Dog”. Which is also not what we want. We need the first letter of the first word to be capitalized too. We’ll add in ucfirst to capitalize the first letter.

$title = "THE QUICK BROWN FOX JUMPED OVER A LAZY DOG";
$title = strtolower($title);
$title = ucwords($title);
$lowercase_words = array('a ', 'aboard ', 'about ', 'above ', 'across ', 'after ', 'against ', 'along ', 'amid ', 'among ', 'an ', 'and ', 'anti ', 'around ', 'as ', 'at ', 'before ', 'behind ', 'below ', 'beneath ', 'beside ', 'besides ', 'between ', 'beyond ', 'but ', 'by ', 'concerning ', 'considering ', 'despite ', 'down ', 'during ', 'except ', 'excepting ', 'excluding ', 'following ', 'for ', 'from ', 'in ', 'inside ', 'into ', 'like ', 'minus ', 'near ', 'of ', 'off ', 'on ', 'onto ', 'opposite ', 'or ', 'outside ', 'over ', 'past ', 'per ', 'plus ', 'regarding ', 'round ', 'save ', 'since ', 'so ', 'than ', 'the ', 'through ', 'to ', 'toward ', 'towards ', 'under ', 'underneath ', 'unlike ', 'until ', 'up ', 'upon ', 'versus ', 'via ', 'with ', 'within ', 'without ', 'yet');

$title = str_ireplace($lowercase_words, $lowercase_words, $title);

$title = ucfirst($title);

echo $title;

Finally we get our desired output of “The Quick Brown Fox Jumped over a Lazy Dog”.

We aren’t really catching a whole lot of edge cases here though. What if a title has a hyphenated word in it? The second half of the word won’t be capitalized. What if we have acronyms that should be all uppercase? What happens if the title is in a language that doesn’t follow english rules of capitalization? What if someone’s name is “McDonald”?

I fixed a few more of the edge cases and put the code up on GitHub’s Gist. A quick search of GitHub and Gist reveal many title case functions. It’s a hard problem and I don’t know that mine is the best but it worked on all the titles that I have so far thrown at it.


Single Corn Muffin

October 15th 2019

I took the cornmeal and made a single corn muffin. I only had 32g of cornmeal, so I made a spreadsheet to convert a full cornbread recipe to use all 32g.

I’m pretty pleased with the result — good flavor & good color. Hopefully next year we’ll have enough corn to make more than one muffin.


Next Page
1/5