Tuesday, May 31, 2022

planner pages : LaTeX geeky joy

There are geeky things that I just love love love.  Not surprisingly, one of the disappointments of being a happy nerd is that it's hard to describe my math pursuits in a way that other people can understand, so it's hard to celebrate nifty news.  Anyone want to jump up and down about the time that I discovered a geometric quantification of anamorphic distortion?  No?  (It's so cool, I swear . . . ).  

Earlier this spring, I did a geeky thing that just delighted me; and I still think it's so much fun that I want to try to describe it, with some of the weird technical stuff embedded, but to explain to non-Texperts why this was such a cool adventure for me.  

Here's what I did: I designed monthly calendar pages for my planner, using a mathematical typesetting language called LaTeX.

When I first learned LaTeX, back in grad school, I thought its main (only?) use was to allow us to write those symbols that are part of every cartoon about math:  fractions, weird Greek letters, integral signs, arrows, and such.  It wasn't until a few decades later (of constant LaTeX use) that I discovered that there's a language-within-a-language, something called "PGF/TikZ", that lets people draw lines and other things positioned in highly precise locations.  I discovered this through playing with a fabulous graphing application called "GeoGebra", and it thrilled me so much that I'd often tell other mathematicians about it when we were schmoozing at conferences.  

Nerd-aside:
In GeoGebra Classic 5, if you "File:-->"Export" --> "Export as PFG/TikZ",
you go straight from the picture you created to a string of TikZ code.  

By having GeoGebra do the coding for me, I picked up knowledge myself along the way.  I learned, for example, that the command

\draw (10, 15) -- (18.8, 15);

draws a little line segment, 8.8 centimeters long, at a height of 15 centimeters.  Why is this cool?  For me, it was like discovering that mayonnaise jars have the same necks as regular canning jars, or that the fuel gauge on car dash has a little indication of which side the gas tank is on.  It's such a neat new aspect about something I already thought I knew so well!

So, knowing that I can put lines exactly where I want them, I knew I could create the outline of the calendar, and also (on the reverse side of the page) create lined pages for an index of notes and also a place for my monthly to-do lists  (the place to scribble things like, "wash windows", or "pick cherries",  for when I don't yet know which day in the month I'll want to do it).  


One side of my pages

But I don't want to have a line of code for each line in that page.  Shorter code is better, because it allows for easier changes down the road.  To make it easier to tweak all the lines at once (change color, change thickness), I googled "Latex for loops", and came up with the code to do this:

\foreach \n in {1,...,15} { 
\draw [dotted, line width = 0.75, color=browncolor]  (6.6, \n)  -- (8.8, \n);
\draw [dotted]  (6.6, \n.5)  -- (8.8, \n.5);
}

Figuring out this "for loop" snippet of code was like, I dunno, googling "how to fix my dishwasher" or "how to fold an origami frog" -- you know it's possible; it's just a question of learning from an expert.


The next step was to put in the words and numbers. LaTeX/TikZ can do that, too, with commands that look like this:

\draw (11.1, 16.2) node {\tiny Sunday};

This, too, was fairly easy to automate with the 12 month names. LaTeX has a date counter that you can advance, and so for each month, I used the code that extracted the name of the month, putting it first in just the right place for a tab (so cute!) and then at the top of the left and right pages, as such:   
\draw (18.8-\the\month*2/3, 17.5) node {\small \monthname};  % top tab

\draw (4.4, 16.6) node {\monthname\ \the\year};

\draw (14.4, 16.6) node {\monthname\ \the\year};


Months and tabs
It's actually that tab at the top that tickles me the most.   In the past, when I made pages, I'd have to tape on hand-written labels for tabs after the pages were printed, but I realized mid-project I could have the tab be part of the paper and just cut carefully.  Do you ever wonder why math teachers keep asking those annoying questions about when Train A meets Train B?  It's so that you can figure out questions like, "where do the tabs at the top of the page go, and how do you make sure the word "July" is printed in the same place on the front AND the back of the paper?"   Totally geek happiness, adding these tabs that slide along the top!  

Taped-on tabs from previous excel-formatted pages.

Okay, but HERE comes the part that was REALLY fun to figure out: where to put the numbers of the days (and -- especially -- where NOT to put them)?  This part was fun in a crossword-puzzle kind of way, or Sudoko, or some-such.  The reason this is tricky is that, on any good calendar page, there are days that are empty.  There are usually a bunch of blank blocks before "1" and again after the last day of the month. The fact that each month has a different number of days makes this even more fun to play with: the rhym "30 days hath September, April, June, and November" is helpful for memorizing, but not for coding.  So the puzzle is this: how do I tell my program when to write the days, and when not to?

The solution?  Learn the Ninja art of of "If-Then-Else".   For each box in the calendar grid, I built a command that checked whether the month of the counter ("\the\month") matched the month of the current calendar page (which for technical reasons is designated in my code as "#2"), and then drew the day (or not, depending) and then moved over into the next square:

\ifthenelse{\the\month=#2}  {\draw(17.7, #1) node  {\the\day};} { } \AdvanceDate[1]


Lovely, right? That line says if \the\month = #2, then draw stuff, otherwise do nothing (denoted "{}").  

But to add extra degrees of difficulties, every once in a while there's a month that spreads across six, not just five, calendar weeks.  April 2023 is one such month:  April 1 is on a Saturday, then there are four full weeks, and then April 30 is on the next Sunday. Where do I stick April 30?  I don't have space in my usual grid to add the 30th below the 23rd, so I decided to stick it at the top.  

April 30 (Sunday) and April 1 (Saturday) are both in the top row.

How to do this?  [Fast forward past many scratching-my-head hours, and many don't-quite-work attempts].  I finally hit upon a very workable solution: in the first two blocks of each page, time-travel forward 5 weeks to see if it's one of those "special" days, print that date if it is and don't print it if it isn't, and then travel back in time to the normal date to resume normal printing.  This is what time travel looks like in my LaTeX code:

\def\SpecialMonday{\AdvanceDate[35]\ifthenelse{\the\day>29} 

        {\draw(13.3, 15.7) node {\the\day}; }{ } \AdvanceDate[-35] }

I totally feel so clever.  

In fact, I was on such a roll that I decided to see if I could ALSO get people's birthdays automatically added on the right days.  And, what the heck, why not also see if I could add their current age?  More puzzling-challenge-searching, and I finally decided to use lists, together with a command that subtracts the birth year of the person from the current year.  So, for example, a list of events in January might have

 . . . 
, % 25
Lisa \BORN{1991} , % 26
 , % 27
. . . 

and then the command

\draw(11.1, 15.7-2.5) node {\small \em\textcolor{orangecolor}{\DTLlistelement{\Events}{\the\day}}};


would put Lisa's birthday and age on the bottom of the block for the 26th, whatever day (and age) it happens to be that year, while writing nothing on nearby days.
Birthday and age, generated automatically. 
Whoop!

So . . . here's the upshot of all this.  Excel versions come and go, but my LaTeX code is stable enough to last me a lifetime.  From here on in, I can change one line -- just updating what day is the first Sunday on  a new year (2023 begins on Sunday, January 1, 2023; 2024 "begins" on Sunday, December 31, 2023, etc), then hit "compile", and I'll have beautiful planner pages, with birthdays and etcetera all in exactly the right places.  

It'll be super easy to make new pages . . . but, ironically and pleasantly, it was a lot more fun having difficulty writing the code in the first place.  


Sunday, May 29, 2022

Family update: inside and out

Life continues to be rich and full here in Enoughsville.  This is a week of inside and out, the most dramatic instance of which involved a sewer drain outside our basement door overflowing . . . into the basement.  (Yuckers).  A plumber managed to fix the problem [cross fingers!!!] by sending cameras into various pipes and giving a gentle nudge in just the right place.  We may end up splurging on a fancy new sewer trap, thereby becoming the envy of all our neighbors.  Don't be too jealous, yourself!

Prewash likewise got checked out inside and out, and it looks like her insides are more mysterious than our sewer pipes, since she's going to go for a follow-up ultrasound next week.  She acts like she's in perfect health, but her lab tests (heh -- she's not really a lab!) apparently merit a follow up.  More on that next week.

I, too, got to go visit my doc for the annual Celebration of Health, and all the tick-boxes on the check-up were deemed boringly but pleasantly copacetic.   OfSnough didn't get a full-body inside/out check-up, but he did contribute to the overall health theme by getting re-boosted.  It made him a little sore and achy early in the week, but by the end he was back to packing boxes of medical supplies to ship to Ukraine.

With all of that going on, I am very happy to be enjoying a few of the small pleasures that come with May.  Our vegetable box came with garlic scapes (yay!!!!!!).  I've made a pint of garlic scape pesto, and I'm just giddy about it. 

We're also enjoying the front porch, with our new neighbors, who we've now identified as mourning doves (thanks, Rozy!).   Mourning doves look a lot like, and are often confused with, turtle doves, and that's what Y thought these birds were.  But it's not the second day of Christmas, so . . . well, any way, I was delighted that Y shared this beautiful song with me, adding

One of my friends from college wrote a lovely song with this bird as the title that I’d also like to share. He was a Chem major and now works for BMS in NJ (which is where my mom worked as a chemist until retirement last year)…


And another thing that May brings, every couple of years, is college reunions.   I was "elected" (roped into being) the fund raising chair: a title I immediately changed to "Fun Raising Chair".  I'm writing this from the dining hall of my campus, after having spent a weekend re-connecting with people I knew for a very short -- but very meaningful -- time in my life, and it's such a joy to be back here. 

A small piece of a campus that feels like "mine",
even though I was only here a few years, really.

And that's the news from our family, which continues to be wealthy in our adventures.  May you and yours be similarly prosperous.  

Thursday, May 26, 2022

Re, the recycling bin.

Our recycling bin disappeared last month.  We'd put it out with our recycling, as we do about once a month or so, and when we came out in the morning, it was gone. (So was the recycling).  

What on earth happened?  Multiple theories abound:

  1. A giant wind blew it away. (Contradictory evidence: there was no wind, and all of the other recycling bins up and down the street were still present and accounted for.) 
  2. Someone stole it. (Contradictory evidence: it's very easy to get recycling bins for free, and this recycling bin in particular was beaten up and starting to fall apart, so probably not high on people's wish lists.)
  3. The recycling people took it, because it was so beaten up, it was easier to toss in the truck as-is than to empty and replace. (This is our pet theory.)
My neighbors pointed out that we could get a replacement from the county waste management system, but since I don't like bringing new plastic into my life when I can find more eco-friendly alternatives, of course I opted for Plan B: make my own.  

I haven't done a painting project in foreffer, and even though it would be perfectly fine to have a regular old cardboard box as a recycling bin, I decided to make a recycling bin that would be beautiful. Well, at least, beautiful to me.

I began with a large box rescued from work. I think it had been used to ship masks to our campus. Prewash and I brought it home one hot and muggy day, and I set to work on transforming it.

A handle!!! It's very . . . handy.

Heat guns help to remove stickers. 
(Probably not necessary, since I painted the box, but fun).

Not shown:  cutting recycling stencils out of newspaper.

Newspaper stencil in three pieces, 
stuck on with (magic) water!!

Paint the box green, over the stencil.  

Remove the newspaper stencil.  ooh!  looks good!

Adding cow spots, so that the recycling bin matches the house.
Very important to be "matchy matchy".  

Add a ferocious guard dog to protect the recycling bin.
(Anyone who comes close gets covered in dog hair.)


Now we're ready to put out recycling again, when we eventually need to.  Phew!

Sunday, May 22, 2022

Wheels on chairs, chairs on wheels

I grew up in a time when we carried suitcases in our hands, lugging those giant rectangular boxes by their small handles, getting intense physical workouts just from the act of walking through an airport. Wheels on luggage hadn't been invented.

When wheels did start appearing on suitcases, the effect was almost electrifying. They spread like wildfire. How could anybody not have thought of this before? Luggage had been invented; wheels had been invented; how could we not have put them together?

Segue to my dining room chairs.  We have lovely wooden floors, and we're trying to protect them a bit from the feet of my dining room chairs. I've bought little felt pads (a.k.a., "dog hair magnets"), plastic gliders (which last about seven months before breaking and exposing the nail with which they'd been attached), and I've even sewed cute little socks out of old sweaters. My sister uses tennis balls, which I love, but I haven't attempted myself.

Naked chair legs, and legs with socks.

In the classrooms across my campus, we're seeing a transition from traditional classroom chairs to chairs with wheels. Oh, my goodness, but we all love the chairs on wheels. How did we not think of this before?!?

How indeed? Probably in the same way that I'd never thought of wheels for my dining room chairs, despite putting wheels on all sorts of pirate chests and army chests around the house. Because of those projects, I happened to have been gifted (fabulous coincidence) four sets of four wheels, just waiting to be put to use.

In case you're curious about how a professional attaches chairs to wheels, you'll have to just go look somewhere else.  I googled the heck out of it, and didn't find anything that seemed to have good step-by-step instructions.  Since one of the first steps I could think of myself involves "taking a saw to the chair legs", I really wanted to see if there were pitfalls I should avoid, or successes I should emulate.  Having found neither, I plunged in anyway.  

In case you're curious about how this particular amateur attaches chairs to wheels, feast your eyes.  

Step 1:  Measure the heights of the wheels.  I used this T-square.  Wait, it's not actually called a "T-square", and I can't figure out the name of this kind of ruler.  Well, anyway, I used this thingy to measure the wheels. 

Step 2: Turn the chair upside down, and draw lines on the legs at the heights of the wheels.  

Step 3 (the really scary Point-of-No-Return step):  Saw off those ends of the legs.  This not only makes the legs shorter, but --- in the case of my particular chair legs, which are quite tapered at the bottom --- gives me a thicker portion of the leg to drill into.

Step 4:  Drill holes in the legs.  For each leg, I used the drill about four times, starting with a tiny drill bit and then widening the same hole with slightly larger drill bits.  I did this for two reasons:  the first is that it's much easier to put the hole exactly where I want it with a teensy little bit.  The second is that I feared that using a large bit right at the beginning might split the leg.  This technique seemed to work well for me. 


A bit of painter's tape on the drill bit helps
to make sure I'm drilling to the right depth.

Step 5:  Plop the wheels into the holes.   The first time I did this, the holes were a bit on the big side, so I used a dab from a glue gun to keep the wheels from falling back out.  For the rest of the chairs, I stuck with a smaller drill bit on the final round, and gently tapped the wheels in with a rubber mallet.  (Gently!  I didn't want to use so much force that I split the legs. )
See the circular saw behind the chair? 
That's what I trimmed the legs down with.

Step 6:  Sit on the chairs.  I attempted this with just one of our four chairs at first, because if this was going to ruin things, I didn't want to completely ruin them!  But the first chair worked great -- so great, that sliding the other chairs around quickly became onerous by comparison.  (We'd never thought, "whoa! This chair is hard to move!  But when one of the chairs glided along on wheels, the other chairs all started to feel like they were glued to the floor.)  So, I added the rest of the wheels on.  
The view that Prewash the Dog has of our dining room table now.  

I should add that we actually have two sets of wooden chairs.  The ones I added wheels to are the really old set, and they're not as fancy as some Amish-made chairs that we have around our other table.  We like the wheels so much that we might actually go add them to the fancy chairs, too.  Since I don't have another set of freebie wheels, and since I hate purchasing plastic, and since those chairs are much more formal, I'd probably try for metal wheels instead.

At any rate, I added the wheels to keep from scratching up the floors.   The wheels seem to be successful at that, but they also just make the chairs a lot easier to use.  Super duper! 

Chair toes, post amputation.


Saturday, May 21, 2022

List-style updates

Life has been more-than-enough of rich and full these past two weeks, here in Enoughsville.  Here, in whirlwind-style list form, are some of the highlights:
  • My running buddy's daughter tested positive for Covid, so we've stayed apart so I could keep myself healthy for the show I've been working on all year.
  • I did a Fitness Blender workout one Wednesday morning, since I couldn't run with my buddy, and I got so wiped in the middle of it I was nearly nauseous.  
  • Then I remembered that two days before, on Monday, I'd given blood.  Oh, yeah, maybe not the best idea to do a hard workout two days later.  (I'm fine now.)
  • But that positive test from my daughter's running buddy: that's part of a larger trend.  People all over my campus are testing positive . . . I'm getting updates daily from people who are needing to isolate.  Oh, sheesh. Fortunately, the worst health effect they're experiencing (these vacc-ed, boosted people) is really bad headaches.  But I'm back to masking in public, for sure.
  • Including at Commencement at my college.
  • Including when we went indoors to use the restrooms at Commencement for Kinderling (yay, Kinderling!!!!!!!). 
Congrats, Kinderling!!!
  • Speaking of being outdoors a bunch, summer has rolled in for real.  I've pulled the heavy blankets off the bed, and switched winter clothes for summer clothes.  Screens go on the doors tomorrow!!
  • OfSnough celebrated the two-year anniversary of the resolution to walk 40 miles per week, and he's still doing it: going strong.  
  • Inkling got to see a bunch of cool shows in NYC.  She took her socks, of course.  
  • Sizzling got to visit my sister-in-law, and they have photographic proof of being together.
  • Jason got a puppy named "Indi".   Awwww!
  • Nelson has a friend named Brendon, and they hosted a lemonade stand that raised $62.
  • Birds moved into the pillars on our porch.  Anyone know what kind of birds these are?


But the really big thing for me . . . the REALLY BIG THING . . . is that we put on our show.  I've been writing lyrics and dialog, recruiting people, figuring out stage stuff and tech stuff, making props, commissioning posters, holding rehearsals,  etc -- this has been something like 8 hours a week for me for the past semester, on top of my other work.  It has been so much fun doing rehearsals with so many people across campus . . . and then Wednesday, WE DID IT!  We put the show on for an AUDIENCE.  And it was fabulous.  We had a great audience, and so much laughter and cheering (before, during, and after).  

 
And so now, now that the show is over, now I feel like summer has actually begun.

And that's a bunch of the news from our family, which continues to be wealthy in our adventures.  May you and yours be similarly prosperous.

Saturday, May 7, 2022

May showers

Life continues to be rich and full and Enoughsville.  Here's what we're full of lately:  rain.  April showers brought May showers (and May flowers, too, but, oh, those showers).

View from my window: flowers and showers, simultaneously.

One of my running buddies and I did a 10k today, in the 50° rain.  Once we got going, it was actually kind of nice running weather, but dang, neither of us would have showed up if she hadn't offered to drive me there, and if I hadn't enthusiastically accepted.  

Instant triathlon:  just add water!  

Speaking of going distances, I got to celebrate Inkling's birthday by giving a talk in Panama.  (It was a zoom talk from the comfort of my Command Center, but it was hosted by folks in Panama, so THAT was very cool.)  

Also for Inkling's birthday, a colleague gave me a bunch of her shoes, and apologized that maybe I wouldn't like them: I didn't have to keep them; I could give them away or donate them if they weren't my style (etc etc).  I'm not sure why people apologize for giving me really nice things, because I love being part of the keeping-things-out-of-the-landfill cycle.  This colleague happens to have (a) really fancy taste in clothes, as in she know the names of her clothes, and (b) exactly the same sized feet as me.  This is a double windfall for me, since I happen to have a yard-sale body but do not have yard-sale-sized feet.   I was starting to wear out all my decent walk-around shoes, seeing as the last bunch I got several years before the pandemic.  And now, I'm set with a bunch of nice new shoes, which is a great birthday present -- even if it was my daughter's birthday and not mine. 

Inkling turned 10000 [base 2] this year!  (Base 2 always makes people sound really old.  In base 7, she's only 44, if that makes you feel better).  She's out of sock madness, as predicted/planned, and also happily sad that the director of her community chorus got a wonderful job that will take him away from the chorus.  Good for him, but sad for the chorus.  

My guy managed to clear the rain clouds earlier this week for his own birthday, which he celebrated by riding one kilometer for each year of his life so far, which means he rode . . . a long, long way!  He didn't ride all the way to Panama, but it was a good workout nonetheless.  

Nelson tells me he's getting over a cold, and is generally happy.  He very much appreciates all that his sister Sizzling is doing to keep him finding new opportunities in Minnesota.  I think I need to figure out how to go visit him and see for myself.  

And that's the news from our family, which continues to be wealthy in our adventures and who has enough rain thank you very much.  May you and yours be similarly prosperous.