March 2018

Making books for A-

March 3, 2018 - Categories: drawing, parenting, publishing, writing

A- loves being read to. She picks up new words and ideas from the books we read, requests both favourites and new books again and again, and can identify objects in photographs and drawings. I borrowed a few children’s books from the library in case reading about upcoming changes or challenges helps her understand. The books were okay, but didn’t quite fit the words we use or the way we like to handle things. So this week, I decided to make my own books for A-, especially since there are few books that cover things like microphthalmia.

The first book I made was about night weaning, since we might have to do that in preparation for dental surgery under anaesthesia. I sketched it using ZoomNotes on my iPad, exported the SVG, tinkered with it in Inkscape, exported PNGs, combined the PNGs with ImageMagick, and created a 12-page PDF with 7″x8.5″ pages. That let me print the book out on legal-size paper (8.5″x14″), 2 pages per sheet, duplex printing set to flip on the short side, using this page order:
12, 1, 2, 11, 10, 3, 4, 9, 8, 5, 6, 7. I folded each sheet in half. Instead of hand-sewing the binding, I just taped the pages together. And just like that, I had a book that I could page through properly: “No More Nursing, Time to Sleep.”

I read the new book to A-. She asked me to reread it several times. She pointed to the book and said, “A-!” She pointed to the stick figure for me and said, “Mama!” Success!

The next thing I wanted to try was printing in colour. We recently replaced our printer with an HP M277dw colour laser printer that could print duplex, so I was looking forward to giving that a try. I wanted to make a book about the conformer in A-‘s little eye. This time, I drew the pages of the book using layers in Medibang Paint. I drew on the bus home from Riverdale Farm, working around a sleeping A- snuggled in my carrier. I exported each layer as a PNG, used ImageMagick to convert pairs of pages into what I needed to print (page order: 8, 1, 2, 7, 6, 3, 4, 5), combined those into a PDF. I couldn’t figure out how to get the HP app to properly scale the document and print in duplex, but printing from Linux worked fine. I quickly had another book in my hands: “My Conformer.”

She’s starting to echo phrases from the to books, and it’s been only a few days. Wow!

I’m working on a third book now. Time for something fun: “Let’s Make a Smoothie,” since she enjoys making and drinking them. She already knows all the words, so this is more about enjoyment. This time, I’m going to make a workflow that lets me draw on two-page spreads. I don’t have any wide drawings planned yet, but it could be handy for later. I made an Inkscape template to help me keep margins in mind. I learned how to use Medibang Paint’s folders to organize all the layers, and I’m getting the hang of digitally tracing and painting the photos I took.

I’m looking forward to making even more books and refining my workflow along the way. Here are a few things I want to try:

  • Flat colour
  • Painting
  • Programmatically adding text
  • Printing photos
  • Two-page drawing
  • Parametric templates
  • Smaller format by cutting
  • Programmatically adding photos
  • Heavier-weight paper
  • Board book replacement
  • Printing at Staples or similar
  • Print-on-demand book
  • Handstitching
  • Binding with a cover
  • Smaller format by folding and gluing
  • Mobile workflow
  • Vector drawing

And a few quick ideas for possible next books:

  • Potty Time
  • Brushing Teeth
  • Feelings
  • When I Feel Nervous
  • When I Feel Sad
  • Going to Sleep at the Dentist
  • My Life
  • My Day
  • Going Out
  • At Home
  • I Can…
  • I Can Draw
  • Waiting
  • Try Again
  • Dressing Up
  • Alimango sa Dagat
  • Leron Leron Sinta

Planning a few activities for A-

March 4, 2018 - Categories: parenting

Registration opens this week for City of Toronto recreation programs, so I’ve been thinking about what to experiment with next. For this phase (2-3 years old), A- will probably be focusing on learning about:

  • independence
  • movement
  • language and music
  • emotions
  • socialization
  • the world around us

What have I learned from the classes we’ve taken and the memberships we have?

I was not keen on the Recreation Discovery with Caregiver class that we signed up for during the fall term, since it was hard to wake up A- in the morning and the class didn’t offer much beyond what we could get at drop-in centres.

Between a long trip to the Philippines and a late-waking A-, we missed many sessions of the Smart Start music classes at the Royal Conservatory of Music. Even though she mostly clung to me during the sessions that we did manage to attend, she somehow absorbed plenty from the class. At home, she’s been singing, dancing, galloping, marching, banging rhythm sticks together, playing on the piano and the xylophone, blowing into the recorder, tapping on the table, and even arranging chairs for sitting on – “Just like music class,” she exclaims. I think it’s worth a significant premium over city music classes or the 15-minute circle times at free drop-ins, considering A- gets exposed to well-maintained instruments and a highly skilled music teacher. I’ve picked up more melodic variants of the nursery rhymes I learned elsewhere, learned a few Canadian folk songs, and grown more comfortable with singing. If I can find a summer session in the afternoon, I might consider that.

For spring, I signed A- up for gymnastics classes through the City of Toronto. She’s gotten a lot more active, and I think it might be nice to explore what she can do with more facilities. I hope there’ll be a large padded mat and a few activities for balance and coordination. Even if she ends up being mostly reserved during class, I know she’ll pick up a lot by observing the teacher and the other kids, and I can set up things at home so that she can practice. The age range for the class is pretty big (2 – 5 years old), so I hope there’ll be other toddlers, a small class, and/or a teacher good at managing such a large range.

A- likes swimming too. I think we’ll keep that pretty informal for now, since it’s easy for me to take her to various pools depending on the gaps in our week and when she wakes up. She had fun kicking while wearing a flotation device, and she’s also curious about blowing bubbles. I can probably spend the next few months bringing her to places with shallow toddler pools, and that should take care of swimming without putting too much pressure on our schedule. Besides, this way, I can invite other families along.

The city also had a few science- and engineering-type activities for little kids, but I can probably do those things on my own for now. Likewise, there are private companies that offer cooking classes for toddlers, but I can do that at home.

The High Park Nature Centre also has programs for kids this age. I’ll just start by taking her on the trails often. I’ll step up nature education when A- is about three or so, probably drawing from books like Discovering Nature with Young Children (and the rest of the Young Scientist series) and Small Wonders: Nature Education for Young Children. The nature centre has the advantage of experience and animal encounters, so we’ll look into that when she’s ready for more structure and lots of hiking.

Our Ontario Science Centre membership has definitely paid off. We go almost every week, often meeting up with Jen and E-. A- loves the pretend supermarket, the water table, the music section, and the spinning thing. I renewed that one for another two years.

I sprung for another year of the Curator’s Circle membership level for the Royal Ontario Museum. I made good use of the guest privileges last year by making it my default location for inviting people out, and maybe I’ll get to do more of that this year. A- often requests to go to the museum after music class, since it’s right next door. She’s still not keen on the drop-in centre with toys, but she likes the animal exhibits and can point to many large animals when prompted.

We went to Riverdale Farm a couple of times this year. She’s beginning to be more interested in the animals there, although she’s still wary of the sheep. (“Sheep big! Sheep noisy!”) Worth the occasional trip out even though we haven’t made it to any of the farmer demos, and easy to combine with a short walk to the Children’s Book Bank.

A- liked going to the bouldering gym, too. There’s one near us that has a small kiddie area that has a slide. It’s a three-person affair, since W- needs to hold A- up and I need to climb to the top so that I can lift her over the ledge and slide down with her. I pay for a pass for her, a pass for me, and my shoe rental, and I get to have a short workout climbing too. It’s good for her to see us trying, falling, picking ourselves up, and learning. J- goes to the same gym, so more modeling there too. We’ve gone twice. I’m up for going again when W- and J-‘s schedules permit.

Some playgrounds also have climbing features, and some even use rock-climbing holds. I remember seeing them at Regent Park and at Withrow Park. When the weather warms up, we’ll go on a tour of playgrounds.

What do I need to learn about or prepare in order to support her learning?

  • Music: I can mix in more nursery rhymes and folk songs as she gets the hang of the ones we covered before. She’s also getting interested in instruments, so it’s good to both model having fun playing and let her explore. She’s interested in dancing, so we’ll do more of that pancreas, too.
  • Language: Time to dust off those Ready for Reading recommendations and request award-winning children’s books from the library! A- loves reading, and I absorb more ideas about art and verse as I read things over and over. I’d also like to establish a steady rhythm of making books myself, too. The fridge magnets and the availability of print in everyday life encourage A-‘s interest in identifying letters, and we can continue to let her take the lead.
  • Art: This phase focuses on making marks, exploring materials, and describing actions. I can bring drawing supplies when we visit her grandmother. I can set out large pieces of drawing paper. I can present her drawing and playdough supplies attractively, and I can make them more pleasurable to use. I can model more drawing in front of her. The Trofast drawers we set up in the living room are doing a good job of organizing A-‘s Duplo collection, and A- often plays with Duplo (building towers or playing with the playground). I can review Growing Artists for ideas to take advantage of her new capabilities.
  • Toileting: I think we can redo Oh Crap potty training whenever we’re ready. No rush. A- figured out how to get through a whole diaper-free month without accidents, but our long trip got her used to wearing diapers again. It’s a bit cool, but maybe I can offer her a choice between cloth diapers or going diaperless at home, or I can do more of a conceptual nudge through books. She’s interested in being a big kid at the moment, so it might be a good time.
  • Dressing: She’s working on more fine motor skills. I might be able to get away without fancy dressing frames or toys, since she can practice with my pajamas and my shoelaces. Although if we make it to the EarlyON centre one of these days, there’s a toy with a nice big button that she could use for practice.
  • Physical activity: Lots of walking and going to playgrounds, plus the gymnastics classes I signed up for and the occasional bouldering session too. I can also encourage her to carry heavy things.
  • Independent play: This fits naturally into our household routines. I just need to keep recognizing opportunities for her to go and explore.
  • Cooking and eating: She’s getting more comfortable with a butter knife. She can cut with a serrated knife or even a pointy knife if I carefully guide her hand-over-hand. If I look up cooking class ideas for toddlers, I’ll probably find more things we can do together. It might be time to get colour-coded measuring cups like the ones my sister got for her kids. She’s okay with tongs, too, so I’ll pick up training chopsticks as well.
  • Sleep: Most toddler activities are in the morning. A- and I both seem to be night owls. It’s been nice letting her sleep in, but maybe I should take the hit, deal with a few weeks or months of slight crankiness, and move our schedules earlier. Anyway, we’ll see how things work out as she gets older. If she accepts our nudges to night-wean, that will probably change things too.

So much to learn this year. Fun fun fun! It seems to work out pretty well if I let her take the lead, and even better if I’ve prepared the opportunities and learned more about supporting her learning. This is totally not about turning her into some kind of prodigy. It’s more fun to be a kid, and it’s better for her too. I’m just doing this because I’m having a lot of fun learning with and from her. :) We’ll see what we can learn and share!

2018-03-04 Emacs news

March 4, 2018 - Categories: emacs, emacs-news

Links from reddit.com/r/emacs, /r/orgmode, /r/spacemacs, Hacker News, planet.emacsen.org, YouTube, the changes to the Emacs NEWS file, and emacs-devel.

Week ending 2018-03-02

March 5, 2018 - Categories: review, weekly

We went to Riverdale Farm this week. A- was a little wary of the sheep, but she eventually got more used to the noise. We visited her grandmother. A- ate lots of strawberries and practised fetching things.

A- had lots of fun spinning around and around, whether it was on the platform at the Ontario Science Centre or in the kitchen at home. With a tray, too, for extra challenge points! She enjoyed rock-climbing, and so did I. She walked most of the way to the subway, too, and she walked astride her balance bike from the living room all the way to the kitchen.

She sang all of Humpty Dumpty and Hey Diddle Diddle, and has been dancing and playing instruments “just like music class.”
We played with catching and blowing feathers, too.

A- had a tantrum because she didn’t want me to go to sleep. I think adjusting her sleep schedule will have to be more about waking her up rather than trying to nudge her to sleep earlier. On the plus side, she echoed some of the sentences from the books we’ve been reading: “One step, another, fall down, and then pick myself up and try it again.” “I know it’s hard.”

I figured out how to make books! I drew a 12-page book about night weaning and an 8-page book about A-‘s conformer. I’m looking forward to making more, especially as I collect ideas and fine-tune my workflow. I managed to do Emacs News entirely on my phone, too, which bodes well for traveling without my laptop. I also worked on documenting files to back up.

Next week: new conformer, more books, and setting up some storage!

Using Org Mode, LaTeX, Beamer, and Medibang Paint to make a children’s book

March 8, 2018 - Categories: drawing, emacs, geek, org, publishing

Story

  • It’s time to make a smoothie!
  • I pour blueberries into the blender.
  • Mama adds hemp seeds.
  • I add spinach.
  • Mama blends it all with some water.
  • I peel and add a banana.
  • I add some yogurt.
  • Mama blends it again.
  • Yum yum!

Thumbnails

spread0.png spread1.png spread2.png spread3.png spread4.png spread5.png

Process

  • Prerequisites

    • ImageMagick
    • Texlive (probably)
    • latex-beamer
    • Org Mode and Emacs
  • Set up Org Mode export to Beamer

    (eval-after-load "ox-latex"
      ;; update the list of LaTeX classes and associated header (encoding, etc.)
      ;; and structure
      '(add-to-list 'org-latex-classes
                    `("beamer"
                      ,(concat "\\documentclass[presentation]{beamer}\n"
                               "[DEFAULT-PACKAGES]"
                               "[PACKAGES]"
                               "[EXTRA]\n")
                      ("\\section{%s}" . "\\section*{%s}")
                      ("\\subsection{%s}" . "\\subsection*{%s}")
                      ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
    

  • Set up image directories

    mkdir text-pages blank-spreads drawn drawn-pages
    

    text-pages Will contain one image per page of just the plain text.
    blank-spreads Will contain text spreads ready for drawing
    drawn Export one image per spread (without the text layers) from your drawing program
    drawn-pages Will contain one image per page combining text and drawing
  • Tweak the header.tex

    This file gets included in the LaTeX file for the children’s book. Tweak it to change the appearance. In this example, I use black serif text at the bottom of the page.

    \geometry{paperwidth=7in,paperheight=8.5in,left=0.5in,top=0.5in,right=0.5in,bottom=0.5in}
    \setbeamercolor{normal text}{fg=black,bg=white}
    \setbeamercolor{structure}{fg=black,bg=white}
    \usefonttheme{serif}
    \setbeamertemplate{frametitle}
    {
      \begin{center}
      \vspace{0.7\textheight}                    
      \noindent
      \insertframetitle
      \end{center}
    }
    \usepackage[noframe]{showframe}
    \renewcommand{\maketitle}{}
    

  • Write the story

    I used Org Mode to make it easy to write the story.

    Some considerations:

    • Because we’re printing this as a saddle-stitched booklet, the number of lines should be a multiple of four. Sixteen is probably a good maximum.
    • The first heading is actually for the last page.
    • The second heading is for the cover page.
    • The third heading is for the first inner page, the fourth heading is for the second inner page, and so on.
    #+OPTIONS:   TeX:t LaTeX:t skip:nil d:nil todo:t pri:nil tags:not-in-toc author:nil date:nil
    #+OPTIONS: H:1
    #+startup: beamer
    #+LaTeX_CLASS: beamer
    #+LaTeX_CLASS_OPTIONS: [20pt]
    #+BEAMER_FRAME_LEVEL: 1
    #+LATEX_HEADER: \input{header.tex}
    #+PROPERTY: header-args :var pages=12
    
    * Story
    
    ** 
    ** 
    ** 
    ** It's time to make a smoothie!
    ** I pour blueberries into the blender.
    ** Mama adds hemp seeds.
    ** I add spinach.
    ** Mama blends it all with some water.
    ** I peel and add a banana.
    ** I add some yogurt. 
    ** Mama blends it again.
    ** Yum yum!
    

  • Make the tex, PDF, page PNGs, and spread PNGs

    1. Go to the subtree for the story and use M-x org-export-dispatch (C-c C-e) with the subtree option (C-s) to export it as a Beamer file (option l b).
    2. Use pdflatex to convert the .tex to PDF.

      pdflatex index.tex
      

    3. Create one PNG per text page with:

      convert -density 300 index.pdf -quality 100 text-pages/page%02d.png
      

    4. Create spreads to draw on with:

      montage text-pages/page*.png -tile 2x1 -mode Concatenate blank-spreads/spread%d.png
      

    5. Optionally, create a layered PSD with:

      convert blank-spreads/spread*.png \( -clone 1,0 -background white -flatten -alpha off \) -reverse spreads-for-drawing.psd
      

  • Draw

    I imported the PNG layers into MediBang Paint on a Samsung Note 8 Android phone, and then:

    • imported photos
    • traced them
    • painted and shaded them
    • hid the text layers
    • exported one PNG per spread to QuickPic, renamed them, and uploaded them to Dropbox, because I couldn’t figure out how to export to Dropbox directly

    Layer folders were handy for organizing spread-related images. I couldn’t seem to move all of the layers in a layer folder together on Android, but the iPad was able to do so. If I didn’t have the iPad handy, I combined the layers by exporting a PNG and then importeing it back into MediBang Paint.

    This was a decent setup that allowed me to draw and paint even when I was in bed nursing A- and waiting for her to fall asleep. I held the phone with one hand and rotated the canvas as needed so that it was easier for me to draw lines with my right. Because of the awkward position and the small screen size, the lines are not as smooth as I might like, but the important thing is that they’re there. Whee! =)

    It turns out to be possible to use the free MediBang Pro drawing program under Wine on Linux to import the PSD and save it to the cloud. I was also sometimes able to switch to drawing with iPad Pro with Pencil, but it was harder to find time to do that because that usually made A- want to draw too.

    Anyway, after I drew and exported the PNGs, the next step was to…

  • Convert the drawn spreads back to pages and combine them with the text

    Here’s some code that combines the drawing and the text. Keeping the drawing and the text separate until this stage (instead of exporting the PNGs with the text) makes it easier to change the text later by recreating the text PNGs and running this step.

    (defun my/combine-spread-drawing-and-text (page num-pages)
      (let ((gravity (if (= (% page 2) 1) "West" "East"))
            (spread (/ (% page num-pages) 2)))
        (shell-command
          (format 
           (concat "convert \\( "
                   "drawn/spread%d.png -gravity %s "
                   "-chop 50%%x0 +repage \\) "
                   "text-pages/page%02d.png -compose darken "
                   "-composite drawn-pages/page%02d.png")
           spread gravity page page))))
    
    (cl-loop for i from 0 to (1- pages) do
             (my/combine-spread-drawing-and-text i pages))
    

  • Create print spreads for saddle-stitching

    This code pairs up the drawn pages into a PDF that can be printed duplex. Make sure to choose the option to flip along the short edge. I hard-coded the page orders for 4-, 8-, 12-, and 16-page booklets.

    (let* ((page-order
            '((0 1 2 3)   ; hard-coded page sequences
              (0 1 2 7 6 3 4 5)
              (0 1 2 11 10 3 4 9 8 5 6 7)
              (0 1 2 15 14 3 4 13 12 5 6 11 10 7 8 9)))
           (sequence
            (mapconcat (lambda (d) (format "drawn-pages/page%02d.png" d))
                       (elt page-order (1- (/ pages 4))) " ")))
      (shell-command
       (format
        "montage %s -tile 2x1 -mode Concatenate print-duplex-short-edge-flip.pdf"
        sequence)))
    

  • Print and bind

    After printing and folding the book, I used tape to make the book hold together. Tada!

  • Create on-screen PDF for reading

    A little bit of manipulation so that the last page is in the right place:

    (shell-command
      (format "convert %s onscreen.pdf" 
        (mapconcat 'identity (cl-loop for i from 1 to pages 
          collect (format "drawn-pages/page%02d.png" (% i pages))) " ")))
    

  • Create thumbnails of spreads

    (cl-loop
     for i from 0 to (1- (/ pages 2)) do 
     (shell-command
      (format 
       (concat "convert "
               "\\( blank-spreads/spread%d.png "
               "drawn/spread%d.png "
               "-compose darken "
               "-resize %dx -flatten \\) "
               "\\( +clone -background black -shadow 50x1+%d+%d \\) "
               "+swap -compose src-over -composite "
               "thumbnails/spread%d.png")
       i i width shadow shadow i)))
    

  • Ideas for next steps

    • Better thumbnails for easy previews
    • PDF for online reading
    • More layout possibilities (photos, verses, etc.)
    • Smaller books:

      • crop marks on a full-page print, or
      • the right imposition rules to print more pages on a sheet

February 2018

March 11, 2018 - Categories: monthly, review

In addition to our usual field trips to the Science Centre and the ROM, we went to Riverdale Farm. A- named the animals and enjoyed talking about them, although she found the sheep a little loud. We also started visiting family more often, for both big things like Chinese New Year and A-‘s birthday as well as small things like an afternoon of hanging out.

A- wanted to build a Duplo tower so tall that she had to stand on a chair to add blocks to it. She got pretty good at inserting shapes into her sorter and screwing together the nuts and bolts in her toolkit.

She walked astride her balance bike all the way to the kitchen by herself. She carried empty containers on a tray. She danced a lot and imitated other aspects of music class. She enjoyed bouldering. She wanted to try out a life jacket while swimming, and she kicked her legs too. She picked up diving rings with her foot.

She sang Humpty Dumpty, Baa Baa Black Sheep, and Hey Diddle Diddle practically in full. I could prompt her to show me a sleepy face, a sad face, and so on. She talked about recent events and how she felt, often revisiting moments that were particularly significant to her. She echoed many of the things we often say, such as “Give it a try.” She asked for specific things using “I need…” and often thanked us.

She played more independently, often amusing herself for a number of minutes or toddling off to a different room while telling us to stop. She confidently touched different textures in books. She asked to be pushed faster while in the playground swing, and she wanted to go down the twisty slide.

Her eye exam went well. The pediatrician is working on referrals to Sick Kids for dentistry and endocrinology.

We replaced our printer with an HP M277dw, and I learned how to use it to make short books for A-. I figured out an Emacs News workflow that I can do entirely from my phone, and I set up Syncthing for my files too. We organized A-‘s toys and clothes into IKEA Trofast drawers. I uploaded old photos to Google Photos. Progress!

March: A new conformer, a consultation with the anesthesia dentist, more children’s books, and lots of time with A-. We’ll figure this out!

2018-03-12 Emacs news

March 12, 2018 - Categories: emacs, emacs-news

Links from reddit.com/r/emacs, /r/orgmode, /r/spacemacs, Hacker News, planet.emacsen.org, YouTube, the changes to the Emacs NEWS file, and emacs-devel.

Using exiftool to put date, rating, and title in photo filenames

March 14, 2018 - Categories: geek, organization

Now that we have a Synology backup server, I want to get better at keeping and organizing photos. I’ve got lots of pictures and videos of A- in Google Photos, but I don’t want to rely only on that. When Google eventually decommissions the service (no signs of this now, but you can never tell), I’d like to already have copies of my favourite photos and videos all prioritized and backed up instead of spending days wading through accumulated cruft.

I had previously added significant moments to a “Weekly highlights” album in the Google Photos app. I had also tried to select a number of those for “Level 2 highlights” and “Level 3 highlights” roughly approximating monthly and yearly filters. This was awkward, though, since Google Photos didn’t let me see which photos were already in an album or which timespans weren’t well represented. I wanted a five-star rating system so that I could gradually winnow images I liked, and I wanted tags for more flexibility.

The F-Stop Gallery app on Android seemed to be a quick way to sort through images, rate them, and tag them. I liked how it stored the metadata in the file instead of in a separate database. The bulk management tools were decent, although of course it would be even better to do things with fewer taps.

I downloaded ZIPs of my highlight albums and extracted them to a Samba share so that I could access them from my phone. I rated the level 3 highlights as 5 stars, level 2 as 3 stars, and weekly highlights as 2 stars, leaving the 4-star level for finer distinctions if I need to fiddle with things. Then I used cp -n (no clobber; don’t overwrite existing files) to copy the 5-star photos, then the 3-star photos, and lastly the 2-star photos. That way, even if a photo was in multiple albums, the file would have just the highest rating I assigned.

I can’t always rely on apps to index and search by the metadata in a file, so I like putting that information in the filename. A good filename might look like this:

2016-08-01-20-14-44 ### Relaxing on the deck #family.jpg

It starts with a date and time, since timelines make sense. I add one to the number of stars and convert that to # so that I can easily search for, say, ### to show me all entries that have at least two stars. This also creates a neat ASCII bar chart effect when looking at lists of filenames. I want to include the title if available, and any tags for easy searching as well.

Here’s the Bash script that takes an image file and renames it accordingly:

#!/bin/bash
exiftool -m \
  -"Filename<\${DateTimeOriginal;s/[ :]/-/g} \${Rating;s/([1-5])/'#' x (\$1 + 1)/e} \${Title} \${Subject;s/^/#/;s/, / #/g}.%e" \
  "[email protected]"

This probably has bugs, but it seems to be a decent start.

It was great to find out that I can pass Perl expressions to exiftool to modify the field value. I figured out that I could combine that with the /e flag for executable replacements so that I could generate a string of N+1 characters. While tinkering with the code, I accidentally used \1 instead of \$1 in my Org Mode block. That made a number such as 5 turn up as a scalar with a six-digit value, so I ended up with a really long line of #####... in my Org file. Emacs was definitely not happy. I ended up opening my Org file in vi so that I could delete the offending line. Anyway, I managed to recover from that and figure out what I needed to put in. Yay!

It would be pretty neat to have some kind of inotify thing watching my NAS inbox and processing files accordingly. In the meantime, I don’t mind running another script. We’ll see how this goes!

Week ending 2018-03-10

March 14, 2018 - Categories: review, weekly

A- got a new conformer last week. Progress: she didn’t cry in the waiting room, although she still burst into tears as soon as she saw the ocularist. We’re continuing with the conformer approach instead of switching to a painted shell because A- still rubs the conformer out of her eye from time to time, and it’s easier to replace a conformer. Maybe we’ll switch when she’s closer to school age.

I asked her where she wanted to go for Field Trip Friday. She said, “Riverdale Farm. I miss that. I have fun. Big sheep make big noises.” So we went, and we enjoyed looking at the baby goats. We passed by the Children’s Book Bank, and I was delighted to find that you can take double the number of books on Fridays. I picked up a few more Seuss books.

We’ve been making more of an effort to explore and catalogue places so that we can make the most of Toronto’s resources. We checked out Baird Park, which has a playset with a short tunnel that A- actually worked up the courage to go through. She liked going down the twisty slide on my lap, and then graduated to going down the twisty slide at Lithuania Park with a little push. I posted a few park reviews in Google just in case other people find those notes handy, and I should find some way of organizing my own copy of the notes too.

A- has been having fun with both fine and gross motor skills. She practised using a ladle to pour and a butter knife to spread. She goose-stepped and danced.

A- can talk about more abstract things. She scribbled and said she was drawing “nervous.” One time, W- was carrying her up the stairs to change her diaper, and she was getting a little wriggly and distracted. He said, “Focus.” She said with enthusiasm, “Diaper!”

She likes being involved. When she was at the sink, she said with delight: “Yes! I’m busy!”

One time, she insisted that I carry her up bridal-style in my arms (which she accomplished by flopping in a certain way and protesting if I tried changing things). I was mystified, but it all became clearer once we got upstairs and she wanted me to read Emma to her. The Cozy Classics version has just twelve words, and “carry” is one of them. “Frank Churchill carry. Emma,” she said. Aha!

She often sings nursery rhymes and other songs. She sang part of “Mamma Mia” while dancing, and then obligingly repeated while I suppressed my laughter long enough to record her on video.

Little improvements:

  • W- set up a Synology DS718 network-attached storage server. Wheee! I feel more grown-up with proper backups. I set up borg backups for my server and my laptop. Next: Docker containers for testing the backups…
  • I set up lots of voice shortcuts to help me with groceries and with tracking. For example, I can say, “Okay Google, baby awake” and it will log that in my system. I explored Tasker’s Memento support, too.
  • I figured out how to use Org Mode and LaTeX to typeset drawing templates for children’s books, and I used that to make a book about smoothies. Next: photos, more layouts
  • Lots of tidying up in the basement, too. Whee!
  • I switched to writing in Markor on Android. I briefly enabled Markdown support in WordPress, but it was messing up some of my other posts, so I turned it off again.
  • I set up god-mode in Emacs, which does make phone use a bit easier.

Making an 8-page 7″x4.25″ captioned photo book with Org Mode and LaTeX

March 16, 2018 - Categories: emacs, org, publishing

Here’s another technique that makes a simple photo book. I wanted to
make an 8-page book that could be printed 4 pages to a 8.5″x14″ sheet
(duplex, flip along the short edge), with a final page size of
7″x4.25″.

Sample with my own photos:

out.jpg

Prerequisites

  • ImageMagick
  • Texlive (probably)
  • latex-beamer
  • Org Mode and Emacs

Process

We can define the labels and their captions in a named table like this:

Let’s Go for a Walk  
   
Caption for photo 1 placeholder.png
Caption for photo 2 placeholder.png
Caption for photo 3 placeholder.png
Caption for photo 4 placeholder.png
Caption for photo 5 placeholder.png
   

Note that the first page is row #1 this time, instead of starting with
the last page.

Then we generate the LaTeX code with some Emacs Lisp, like so:

#+begin_src emacs-lisp :var pages=story :results value latex :exports results
(mapconcat (lambda (row) (format "\\graphicframe{%s}{%s}" (cadr row) (org-export-string-as (car row) 'latex t))) pages "\n")
#+end_src

I put that in a subtree for easier exporting with C-c C-e C-s l b (org-export-dispatch, subtree, LaTeX, Beamer).

Story

Process

  • Set up Org Mode export to Beamer
    (eval-after-load "ox-latex"
      ;; update the list of LaTeX classes and associated header (encoding, etc.)
      ;; and structure
      '(add-to-list 'org-latex-classes
                    `("beamer"
                      ,(concat "\\documentclass[presentation]{beamer}\n"
                               "[DEFAULT-PACKAGES]"
                               "[PACKAGES]"
                               "[EXTRA]\n")
                      ("\\section{%s}" . "\\section*{%s}")
                      ("\\subsection{%s}" . "\\subsection*{%s}")
                      ("\\subsubsection{%s}" . "\\subsubsection*{%s}"))))
    
  • Set up the header.tex

    This file gets included in the LaTeX file for the children’s book.
    Tweak it to change the appearance. In this example, I use black serif
    text text on the left side of a picture, both occupying roughly half
    of the page. I also experimented with using a different font this time, which you might need to install (for me, I did apt-get install texlive-fonts-extra).

    \geometry{paperwidth=7in,paperheight=4.25in,left=0.5in,right=0.5in}
    \beamertemplatenavigationsymbolsempty
    \usepackage{etoolbox}
    \usepackage[T1]{fontenc}
    \usepackage{Alegreya}
    \usefonttheme{serif}
    \setbeamercolor{normal text}{fg=black,bg=white}
    \setbeamercolor{structure}{fg=black,bg=white}
    %% \setbeamertemplate{frametitle}
    %% {
    %%   \begin{center}
    %%   \noindent
    %%   \insertframetitle
    %%   \end{center}
    %% }
    \newcommand{\graphicframe}[2] {
       {
       %% \if #1\empty 
       %% \usebackgroundtemplate{}
       %% \fi
       \ifstrempty{#1}{
       \begin{frame}[plain]
         \begin{center}
         \noindent
         \textbf{\huge{#2}}
         \end{center}
       \end{frame}
       }{
       \begin{frame}[plain]
          \begin{columns}
          \begin{column}{0.48\textwidth}
          \huge{#2}
          \end{column}
          \begin{column}{0.48\textwidth}
          \includegraphics[height=\textheight,width=\textwidth,keepaspectratio=true]{#1}
          \end{column}
          \end{columns}
       \end{frame}
       }
       }
    }
    \usepackage[noframe]{showframe}
    \renewcommand{\maketitle}{}
    
  • Create the PDF
    pdflatex index.tex
    
  • Create one PNG per page
    mkdir pages
    convert -density 300 index.pdf -quality 100 pages/page%d.png
    
  • Create the 4-up imposition

    The diagram at https://pressnostress.com/iw/howto/booklets/1.html was helpful.

    montage \( page4.png -rotate 180 \) \( page3.png -rotate 180 \) page7.png page0.png -tile 2x2 -mode Concatenate front.png
    montage \( page2.png -rotate 180 \) \( page5.png -rotate 180 \) page1.png page6.png -tile 2x2 -mode Concatenate back.png
    convert front.png back.png -density 300 ../print.pdf
    

Other notes

Placeholder image from https://en.wikipedia.org/wiki/File:Portrait_placeholder.png – public domain.

Dealing with thought fragmentation, reducing mental waste

March 17, 2018 - Categories: kaizen, parenting

I’ve been figuring out how to deal with the mental fragmentation that can come with being the primary caregiver of a nursing toddler.

It was useful for me to let go of wanting to focus. If I think of childcare as a distraction from what I really want to do, I miss out on what I can get from childcare too. Instead, I’ve been looking for ways to make the most of this stop-and-go life.

Kaizen emphasizes reducing waste. What does mental waste look like when it comes to thinking with a toddler around?

I waste energy if I let my mind fill up with mental clutter. So:

  • Appointments go on my calendar so that I don’t have to worry about forgetting them, and a weekly review helps me remember to check the week ahead.
  • Near-term tasks go into my todo list. Tasks Free lets me quickly reprioritize tasks so that I know what to do the moment A- lets me unlatch and slip away.
  • Blog post ideas go into Markor so that I can write them in Markdown and export them to HTML for my blog.
  • Long-term ideas and notes go into Org Mode. It’s been super helpful to have step-by-step instructions and checklists for things I do infrequently.

Waste happens if I prioritize ineffectively. So:

  • Once A- is asleep, I quickly take care of personal and household tasks, and then work on my laptop. I can do phone tasks while I’m nursing her in bed, but laptop time is very rare. If I focus on improving my systems and making more things doable from my phone, the benefits compound.
  • Small tasks with small benefits tend to beat large tasks with large benefits, because of interruptions. I try to find ways to break large tasks down into small ones with incremental benefits. Many things can wait until next year.

Waste also happens if I repeat myself. So:

  • When I manage to have computer time, I slow down and write notes in an Org Mode file instead of trying to speed ahead and do everything before A- wakes up. This helps me resume my train of thought after the inevitable interruption. It also helps me put together blog posts, which means I can find things in my archive, help people, and maybe even learn from people’s comments.
  • If I’m thinking about a question or idea, I jot down keywords. That makes it easier to remember those thoughts and build on them. I scribble these on paper if I’m around A-, so that she can see me writing and so that she doesn’t get distracted by my phone. If a thought looks promising, I stick it in my pocket in case I want to refer to it during phone time.

Waste happens if I do low-value activities instead of high-value ones. It’s easy to get sucked into reading lots of social media or books on my phone, so I work on getting more value out of phone time. I can:

  • write
  • ssh to my web server or backup server, and code or run scripts – hard with a virtual keyboard and no swiping to type, but doable
  • organize pictures and other files
  • prepare an Emacs News summary
  • read e-books from the library, mainly looking for interesting parenting ideas to try or things to learn about early childhood education

Waste happens when I don’t notice, so it’s good to get enough sleep and to pay attention.

Waste happens when I forget, so it’s good to write, reflect, and organize my notes.

Waste happens when we stay too comfortable and when we push too hard. It’s good to work on finding the sweet spot – the zone of proximal development for A-.

I can reduce waste further by getting more value from my time. For example, being interested in making books for A- lets me get more out of reading books with A-. Writing about stuff lets me remember, and I might even be able to help or learn from other people.

This phase is temporary. Next year, A- will probably be more interested in playing with her peers, and she might be independent enough to participate in activities without me. The year after that, she’ll be old enough for school. I want to make the most of this time instead of rushing ahead. I guess that’s part of why I haven’t prioritized night weaning or finding a babysitter. There’s still plenty of potential to explore even with the setup, and it’s fun working with the constraints.

What could better look like?

  • Sleeping more predictably or more in sync: She seems to adjust her sleep cycle earlier if I go to sleep when she does instead of staying up to do my discretionary things, so maybe I can sacrifice a week or two of discretionary time to see if we can shift to using daytime better
  • Written note workflow: maybe snapping a quick picture and then referring to it when I type; maybe doing small sketchnotes that can be cleaned up by an app and included as images
  • Trying out other ssh apps to see which one I like the most, in case that makes it easier to code
  • Trying more things (new food, etc.), which could take a bit of planning

Lots of things to play with!

2018-03-19 Emacs news

March 19, 2018 - Categories: emacs, emacs-news

Links from reddit.com/r/emacs, /r/orgmode, /r/spacemacs, Hacker News, planet.emacsen.org, YouTube, the changes to the Emacs NEWS file, and emacs-devel.

Week ending 2018-03-16

March 20, 2018 - Categories: review, weekly

It was March Break, so we wanted to avoid indoor crowds. Instead, we went to playgrounds, checked out High Park Zoo, and joined Jen and E- on a visit to the piglets at Riverdale Farm.

The 2-year-old sleep regression seems to have hit us hard. A- and I have been up in the wee hours of the morning. We did manage to have a video chat with Lola one time. A- had a lot of fun singing, dancing, and pretend-cooking for Lola.

We visited W-‘s parents during the weekend, too. While A- played, I filled them in on upcoming medical things and A-‘s development.

A- liked the ducks at High Park, too, so that’s what our songs and crafts have focused on as well. I stocked up on construction paper, felt, pompoms, googly eyes, mini popsicle sticks, and pipe cleaners.

Lots of spinning around with a tray and jumping up and down on the bed. She asked for “bubbles through the air,” and enjoyed catching and stomping them. She laced a belt through my belt loops and helped me buckle it.

A- has started saying things like “Oh my goodness” and “Good idea!” which amuses me. She picked up my She also started explaining herself, as in “I want to nurse in carrier because I tired,” and “I’m nervous about Luke.” We had fun singing her ever-growing repertoire of nursery rhymes.

Her pretend play has been split between reenacting the fun she had at the playground (sandboxes and twisty slides) and reenacting the long flights she took to visit Lolo and Lola. Aside from the occasional “I sit in bassinet a long time,” (which I wish she did – she spent most of the flight in my arms) she seems cheerful enough about the experience, particularly the bits about bringing luggage and asking flight attendants to bring food. She’ll need to travel in her own seat now, so we’ll see how she adjusts to that.

She played hide and seek in the bedroom. Mostly this consists of us hiding together, although sometimes she gets excited about finding me. Slowly practising separation!

Kaizen:

  • I figured out how to make a small, captioned photobook using 4-up imposition.
  • I backed up photo highlights to the NAS and started tagging them with metadata.
  • W- kitted out the playroom with more Trofast drawers. It looks neat.
  • I tried out a paper lesson planner. The month view is good for remembering.
  • I set up scripts for backing up my server to the NAS.
  • We cleared another bookshelf for A-‘s use.

Thinking about the rhythms of my days with A-

March 20, 2018 - Categories: parenting

It helps to look at the balance over a week, I think, instead of focusing on a single day. It also helps to think of rhythms and options, so that I can adapt to whatever A- wants to do.

I usually wake up after seven hours of sleep. It’s hard to go back to sleep afterwards. Sometimes A- wakes up when I do, so then we do our morning routines. Usually she wants another hour or so of nursing in bed, which I can use to write. Sometimes she’ll let me unlatch while she continues sleeping. Then I prioritize coding, since that’s hard to find time for otherwise. She can get a bit anxious if she wakes up without me right there, so I try not to go far.

It’s good to have plenty of outdoor time, especially playground time. If we don’t have anything else planned, I take her to one of the neighborhood playgrounds.

A- has some playtime inside, too. We usually do that after we get back from the playground, late in the evening, or in the wee hours of the morning. I let her take the lead. She likes playdough, Duplo, scissors, singing, bubbles, pretend groceries, tumbling, and pretend playgrounds. She also likes being read to a lot.

I like to meet up with other people once or twice a week, generally in the afternoon. We like going to the Science Centre and Riverdale Farm. Playgrounds are also good for hanging out.

A- has music classes once a week. They’re mostly for my benefit, actually. She doesn’t participate in them much, but they seem to make a good impression on her since she happily imitates them at home. t’s fun learning new songs. I’m not too worried about making it to this one if we need to sleep in or she feels like doing something else. We often pair this with a trip to the museum for a quick look at animals and a leisurely lunch.

I like involving A- in household chores. She likes playing with water and soap when we wash dishes. She can help put away dishes and sweep the floor. She likes preparing food: smoothies, pizza, breadsticks, pasta. She can help load our washing machine and transfer clothes to the dryer. She is interested in shelving books, although her version of sorting them is still randomly shuffling them around and then pulling out more books for me to read.

She usually has an afternoon nap, although sometimes this becomes an early evening nap. I’ve started experimenting with limiting nursing then, so she can get used to dealing with strong emotions at a time when people aren’t trying to sleep.

Evening routines are a bit smoother when W- gets home from work early, but they’re still manageable even when he doesn’t. After dinner, W- and A- catch up with each other while I clean the kitchen and scoop the litter boxes. A- feeds the cats.

More playtime once the chores are done, followed by an evening snack and bathroom routines. Then it’s playtime again. W- usually goes to bed before we do. A- has lots of energy late at night, and loves jumping on the bed and twirling round and round. I keep things fairly quiet and sedate on my part so that I can nudge her towards sleep and conserve my energy.

She occasionally wanders off for a few minutes of independent play. She also sometimes plays nearby while I scribble down thoughts, so I’ve stashed paper and pens all over the house. She can also play independently while I tidy up in the same room, although we tend to balance each other out.

My day feels more satisfying with a little journaling, continuous improvement, self-care, and time with W-. It’s good to mix those in, too.

I’d like to shift our schedule a little earlier. It’s difficult to do so because I feel a little short on sleep myself, even though I’ve deprioritized discretionary time for now. If I wake her up early, she can catch up by napping, but I can’t always nap when she does. Then it’s pretty hard staying up with her at the end of the day. I tell her she can stay up and play a bit more if she likes, but she wants to play with me. Sometimes she accepts that I have to go to bed, and sometimes she’s upset for a little while. Maybe I can experiment with catching a quick nap while W- is home, although sometimes that leads to awkward sleep on my part. Maybe this will be the thing that nudges me to explore getting a babysitter. We’ll figure this out.

It might be interesting to involve A- in more cooking, too. She’s generally interested in watching and participating. If she wanders off, I can continue cooking. If she insists on playing with me, I can try to get the recipe to a good breakpoint, and then try to resume afterwards. She’s usually good at letting me take a break for a few minutes when a timer goes off. Many recipes are forgiving. Many also have inexpensive ingredients, so it’s not much of a waste even if I end up not being able to complete the recipe. I feel a little guilty about leaving a messy kitchen when A- decides to go for a nap, but W- said he’s okay with that, and we can always clean up afterwards. Cooking is good for us long-term anyway.

I’m pretty happy with the overall balance of our days. More sleep and more grown-up time would be nice, although I’m not yet sure I want to invest the money, time, and energy needed for setting up babysitting. Sleep and discretionary time will probably come as we deal with this sleep regression, so no worries. We’re making good use of neighbourhood resources, and we have a few reasons to range further afield. I’m still curious about other things that would be fun for a toddler to explore in Toronto. Those can wait for more predictable days, though. Anyway, I’ve got a few things to try. Tweaking our days…

Decision review: Samsung Note 8

March 20, 2018 - Categories: android, decision, geek, review

It was quite a big jump going from a Moto G (2nd gen, bought in 2015) to a Samsung Note 8 this year, mostly on my dad’s insistence. Here’s how I’ve been working on making the most of my new phone’s capabilities.

  • Camera: Way more pictures of A-, since the camera works decently even in low light. I like how it reminds me to clean the camera lens.
  • Better battery life, quick charge: This is great. I used to keep W-‘s old Moto G handy so that I could swap to it if my phone battery ran low while I wrote in bed. Now I don’t even worry about charging overnight, since I can charge my phone while having breakfast with A-.
  • More storage: It’s nice not having to decide which apps I have space for on my phone. I even used the SD card to copy thousands of archived photos into Google Photos.
  • Pen: Screen-off notes are really quick to scribble down, since all I need to do is take out the pen and start writing. I trust writing more than typing for taking fast notes. I also really like the ability to select part of the screen and extract text, because sometimes apps don’t make it easy to select and copy text. I’ve used the pen to draw and colour illustrations for a book for A-. It’s more awkward than using my tablet PC or the iPad, but it lets me use phone time to get more things done, so it’s worth it.
  • Fingerprint scanner: Surprisingly handy way of reducing the friction of using my phone. I keep my phone locked when the screen is off so that A- doesn’t play with it, and tapping the fingerprint sensor to unlock the phone saves me a bit of fumbling around.
  • Voice and gesture control for pictures: Great for taking pictures, since it’s not easy to hold and shoot with one hand.
  • Speech recognition in general: I’ve been getting the hang of this now that battery life means I’m a little less worried about leaving my phone listening all the time. I have a few shortcuts for tracking activities, and I often set timers and add grocery items by voice too. It’s still not quite reliable, but it’s worth a shot. A- occasionally parrots “Okay Google” and “Command sent,” so I try to model saying “please” when I ask my phone to do things. I haven’t used Bixby as much, since voice wake-up for Bixby interferes with voice control of pictures.
  • Larger screen: This was a little hard to get used to, since the bigger screen makes it hard to put my phone in my pocket or hold in bed. But it does make it a little more manageable to ssh into my server and do things, although working with a virtual keyboard is still annoying. I’ve also used the split screen feature a few times.
  • Edge apps: I’ve used the clipboard and the ruler a few times.
  • Live focus: I’ve used this a few times, but I usually don’t have much time to compose a picture of A-. Maybe when she’s a bit older, or if I think about it more.

I want to explore more of the camera’s features, figure out a good workflow for photos, learn more about what I can do with speech recognition, and get better at workflows for notes (thoughts, images, and e-books).

I wonder if it makes sense to draw more on my phone than on paper even when A- is around. I haven’t been keen on doing so because she usually wants to imitate me, and she gets more out of drawing on paper than on my phone. Maybe I’ll draw on paper and take quick pictures on my phone instead.

I probably won’t upgrade for a while, since it’s likely to be a bit of a hassle selling this phone and upgrading to a new one. I might be tempted by an even better camera in the next phone. After all A- is only this age once. I really like the stylus. That means keeping an eye on the Samsung Note line and figuring out when it makes sense to upgrade. I hope this phone is sturdier than the Samsung Galaxy S3 I experimented with years ago. This one has survived life with a toddler so far, so that’s good. I spend more time on my phone than on my laptop these days, so it’ll be interesting to see how I can make the most of it.

Tickling my brain

March 25, 2018 - Categories: kaizen, learning, parenting

I like tickling my brain. How can I improve the way I invest time into tickling my brain? What’s working and what needs tweaking?

Observing and interacting with A- tickles my brain. She’s awesome. Besides, this way I can collect stories for W-, too. I can tickle my brain more effectively by quickly jotting down some keywords or taking pictures to help me tell stories at dinner. I can also level everything up by engaging playfully and thoughtfully with A-, so that she has fun and so that her world keeps expanding. She uses my attention as a cue for her attention too, so energy pays off.

Learning more about parenting tickles my brain when I try something new with A-, and when something I’ve read helps me see, understand, and extend something A- is doing. I enjoyed picking up tips from Playful Parenting and Happiest Toddler on the Block. Ideas I want to try out tend to be few and far between, though, so maybe I’m not being particular enough about the books I read. I’ve been prioritizing writing time over reading time on my phone, anyway.

In terms of writing, I like exploring a single question with a little background, some things I’ve tried, and some ideas to check out next. It’s hard to keep context in my head with a small screen, lots of interruptions, and no outlining support, so it pays to keep things short and fairly linear. Maybe writing in Orgzly or an outline editor instead of the Markor markdown editor will help me with a bit of structure. I have a list of ideas to write about. It’s disorganized and ever-growing, but that’s probably okay.

Drawing hasn’t fit in my priorities lately. I liked drawing on my Lenovo X220 as a way of exploring thoughts, especially for brainstorming, analyzing, or planning. I enjoyed sketching books to help me remember and share them. I’m not yet familiar enough with the iPad Pro to feel comfortable about getting those sketches into my archive. Besides, A- wants to draw on the iPad if she sees me on it, and if she’s asleep, I tend to write or code instead. I also haven’t replaced my workflows for reviewing, renaming, and writing about my sketches, so that reduces the value I get from them. Hard to combine ideas from multiple sketches on my cellphone screen.

Our upcoming trip might be a good time to dig deeper into this, since I won’t bring my laptop. I can improve by splitting this into doodling time for developing drawing skills and thinking time for sorting out thoughts. I can expand my visual vocabulary by looking at graphic organizers and other people’s sketchnotes, particularly if I can find more people who use them for personal reflection rather than recording other people’s content. Still, writing tickles my brain a little more efficiently, especially since drawings tend to need extra work to make them usable in my archive and shareable with others. Doodles can be ephemeral, though, so that sounds like a good plan: doodle a lot around A-, especially with pen and paper.

Tech tweaking works well in tiny, low-risk doses, with maybe a max of two hours of somewhat sleepy coding time. I can tinker with Android while in bed with A-, or in the tiny pockets of time I get throughout the day. Emacs is almost always fun to play with. I like learning about Linux things that I can share with W-. Troubleshooting is annoying, and exploring packages and features is a lot more fun. For example, I found it hard to sustain enough focus to dig into Docker + WordPress issues. I felt like I was going around in circles even though I was trying to take notes along the way. On the other hand, it was fun playing with exiftool to get it to do what I wanted, because I could make incremental improvements with clear progress and I could stop whenever I was satisfied. I can also use my time away from the computer to think of ideas, while troubleshooting tends to need computer access.

To have more fun with tech, I can pick up inspiration by browsing blogs, documentation, and source code whenever I want to take a break. I’ve come across many useful things by just rereading the Emacs and Org manuals. I can also keep a list of manual things that might be easy to automate, and I can pick something from the list when I have time.

I like picking up new recipes, although I rarely get to do that unless I feel comfortable starting something with A- around. I can probably take more risks in this area, especially if I look at it more from the sensory experience and skill development angles. I can focus on recipes people suggest for cooking with kids and fit that into our weekly routines.

Continuous improvement tickles my brain, and so does keeping an eye out for good ideas. A- is into saying "Good idea!" these days, and maybe I should be too!

Consulting used to tickle my brain a lot (problem-solving and prototyping with external validation!), but because I haven’t been able to focus as much lately, I don’t feel right billing for things that I might not be able to tweak based on feedback or turn over to other developers. Instead, I’ve been using snippets of coding time to improve personal systems, and that will probably pay off quite a bit too.

I could shift time away from A- towards other forms of tickling my brain by sorting out babysitting. Still, I’ve only got so many years of the former, so it seems to make sense to make the most of them. I’m not 100% focused on that, though. I like the way writing helps me remember and coding is fun, so I make time for those. Besides, that also gives A- space to go do her own thing periodically. If I can get better at tickling my brain with five minutes here and there, accumulating the results over time, that might be pretty handy.

Hmm. For the next few weeks, it might be fun to focus on tickling my brain by interacting with A-, keeping an eye out for good ideas, and doodling. I can deemphasize coding (hard to do on my phone anyway) and save writing for when we’re in bed or when she’s off playing independently. Tweak tweak tweak…

Oops report: Moving from i386 to amd64 on my server

March 25, 2018 - Categories: geek, linux

I was trying to install Docker on my Linode virtual private server so that I could experiment with containers. I had a problem with the error “no supported platform found in manifest list.” Eventually, I realized that dpkg --print-architecture showed that my Ubuntu package architecture was i386 even though my server was 64-bit. That was probably due to upgrading in-place through the years, starting with a 32-bit version of Ubuntu 10.

I tried dpkg --add-architecture amd64, which let me install the docker-ce package from the Docker repository. Unfortunately, I didn’t review it carefully enough (the perils of SSHing from my cellphone), and installing that removed a bunch of other i386 packages like sudo, ssh, and screen. Ooops!

Even though we’ve been working on weaning lately, I decided that letting A- nurse a long time in her sleep might give me a little time to try to fix things. I used Linode’s web-based console to try to log in. I forgot the root password, so I used their tool for resetting the root password. After I got that sorted out, though, I found that I couldn’t resolve network resources. I’d broken the system badly enough that I needed to use another rescue tool to mount my drives, chroot to them, and install stuff from there. I was still getting stuck. I needed more focused time.

Fortunately, I’d broken my server during the weekend, so W- was around to take care of A- while I tried to figure things out. I had enough free space to create another root partition and install Ubuntu 16, which was a straightforward process with Linode’s Deploy Image tool.

I spent a few hours trying to figure out if I could set everything up in Docker containers from the start. I got the databases working, but I kept getting stymied by annoying WordPress redirection issues even after setting home and siteurl in the database and defining them in my config file. I tried adding Nginx reverse proxying to the mix, and it got even more tangled.

Eventually, I gave up and went back to running the services directly on my server. Because I did the new install in a separate volume, it was easy to mount the old volume and copy or symlink my configuration files.

Just in case I need to do this again, here are the packages that apt says I installed:

  • General:
    • screen
    • apt-transport-https
    • ca-certificates
    • curl
    • dirmngr
    • gnupg
    • software-properties-common
    • borgbackup
  • For the blog:
    • mysql-server
    • php-fpm
    • php-mysql
    • php-xml
  • For Quantified Awesome:
    • ruby-bundler
    • ruby-dev
  • For experimenting:
    • docker-compose
  • For compiling Emacs:
    • make
    • gcc
    • g++
    • zlib1g-dev
    • libmysqlclient-dev
    • autoconf
    • texinfo
    • gnutls-dev
    • ncurses-dev
  • From external repositories:

I got the list by running:

zgrep 'Commandline: apt' /var/log/apt/history.log /var/log/apt/history.log.*.gz

I saved my selections with dpkg --get-selections so that I can load them with dpkg --set-selections << ...; apt-get dselect-upgrade if I need to do this again.

Symbolic links to old volume:

  • /var/www
  • /usr/local
  • /home/sacha
  • /var/lib/mysql (after installing)

Copied after installing – I’ll probably want to tidy this up:

  • /etc/nginx/sites-available
  • /etc/nginx/sites-enabled

Lessons learned:

  • Actually check the list of packages to remove.
  • Consider fresh installs for major upgrades.

When things settle down, I should probably look into organizing one of the volumes as a proper data volume so that I can cleanly reinstall the root partition whenever I want to.

I also want to explore Docker again – maybe once I’ve wrapped my mind around how Docker, Nginx, WordPress, Passenger, virtual hosts, and subdirectories all fit together. Still, I’m glad I got my site up and running again!

Labeling toy storage bins with photos and text using ImageMagick and org-babel

March 25, 2018 - Categories: emacs, geek, org, organization, parenting, play

I wanted to make labels for A-‘s new toy storage: three low Trofast drawer frames all along the wall.

I liked how early childhood drop-in centres labeled their shelves with both pictures and text. That way, kids can find things before she can read, while still being exposed to print. I took pictures of the bin contents and renamed the files to the labels I wanted to put on them, such as 2x2 blocks.jpg. (We have a lot of Duplo.)

This time, I experimented with creating the labels entirely in Imagemagick instead of using LaTeX. First, I used a table in Org Mode to let me easily play with the dimensions and recalculate pixel sizes.

DPI   300
Columns 3  
Rows 5  
Paper width 14 4200
Paper height 8.5 2550
Minimum margins 0.5 150
Label width 4.3333333 1300
Label length 1.5 450

I passed the width and the height to the following code block by using header arguments. I liked using 400 pixels as the height instead of 450, so that’s what I used. My source image size was 4032×3024 pixels. If I resize them to a height of 400, that gives me a width of 533. Allowing 20 pixels for the text left and right borders gives me (- 1300 533 20 20) = 727 as the text width.

#+begin_src sh :dir ~/code/labels :var width=1300 :var textwidth=727 :var height=400 :var pointsize=72 :results silent
for x in source/*; do
  file=$(basename "$x")
  /usr/local/bin/convert \( \( "source/$file" -resize x${height} \) \
     \( -background white -fill black -font Alegreya-Regular -bordercolor White \
         -gravity West -border 20 -pointsize $pointsize -size ${textwidth}x caption:"${file%.*}" \) \
     +append \) \
     -extent ${width}x${height} \
     \( -fill none -stroke gray -draw "rectangle 0 0 $(echo $width - 1 | bc) $(echo $height - 1 | bc)" \) \
     "out/$file.png"
done
#+end_src

Sample resized label:

I moved the ones I wanted from the out directory to a ready directory and combined the ones I wanted to print into a PDF:

#+begin_src sh :dir ~/code/labels :results silent
montage ready/*.png -tile 3x5 -background none -geometry +0+0 print.png
convert print*.png -density 300 -quality 100 print.pdf
#+end_src

Then I printed the labels in colour on an 8.5×14″ sheet of paper (single-sided, landscape), cut them out, and taped them onto the bins with packing tape.

W- suggested taking macro shots that more clearly show the characteristics of things in the bins instead of just aiming down and taking pictures of the contents. Might be a good excuse to show A- basic product photography when we get back.

W- also recommended making the label text bigger. The first time I did it, I just picked a pointsize based on whatever fit the ones I wanted to print. I decided against letting Imagemagick maximize the font size because I didn’t want labels to have very different text sizes. After a little poking around, I figured out how to use caption: instead of label: to give me text that can neatly wrap within a given space, and that will probably let me use 90-point font instead of 72-point font. That will make the next iteration of labels even easier to read.

It’s nice having all these bins. A- is getting pretty good at heading straight for the bin she wants something from, and she even talks about them: “Horse is in animals bin.” I’m glad we labeled the most frequently used bins. I’ll tweak the labels when we get back from our trip. We’ll probably change some of the bin contents anyway.

Hooray for ImageMagick, and hooray for variables in org-babel blocks!

2018-03-26 Emacs news

March 26, 2018 - Categories: emacs, emacs-news

Travel kaizen

March 28, 2018 - Categories: kaizen, travel

What has changed between our trip last January and this next trip? How can I adapt and make things even better?

  • I’m traveling with A- while W- stays home. This means he can drop us off at the airport. We’ve traveled the same route without him before, so I’m less worried about handling long flights on my own.
  • A- will be too big for a bassinet. Instead, we’re going to try the baby seat provided by Korean Air. According to SeatMaestro, the baby seat is good for 9.1-31.7 kg (20-70 lbs) and a height less than 124.5 cm (49 in), so A- should be okay in it. She’s been focusing on the bassinet in her pretend play, so I hope she doesn’t get too disappointed.
  • I requested grown-up meals for A- instead of child meals. I used to throw out half of the child meals anyway because they were too sugary. We might as well go with the regular meals so that we can try different entrees.
  • A- may want to be carried in my arms instead of the carrier. If I can get away without bringing a rolling carry-on, going with just a backpack might be more convenient.
  • A- often likes walking. If I don’t have to worry about scrambling for overhead bin space, it might make sense to let her run around first instead of boarding the plane early.
  • A- is more talkative. Her pretend play is more elaborate. She can even sometimes be reasoned with. On the flipside, she’s also more particular about what she wants.
  • My dad is no longer alive. No fun stories from him. New family dynamics will take a while to adjust. On the other hand, A- won’t feel nervous about the IV stand or my dad’s coughing. We’ll deal.
  • My sister and her kids will be moving from the Philippines to the Netherlands in the middle of our trip, and my mom will be figuring out her new normal. So things will probably be busy and chaotic, and my mom will probably be sad. I’ll continue to focus on A-, of course.
  • I won’t bring a laptop. I sorted out how to write my journal and Emacs News on my phone, so I think I can probably get away without my personal laptop this time. I was able to turn over my consulting stuff to my client, too, so no work laptop either. This should make getting through airport security a bit easier, although I might still need to take the iPad out.
  • I won’t pack a lot of snacks. There’s plenty of food on the plane and at the airport, and it’s good to spend money to explore new tastes. Still, I might bring some fruit or cheese next time.
  • I’m using more travel organizers. W- has convinced me of the power of organizers. I also bought packing cubes to help me keep my backpack and my suitcase sorted. Having zippered units will probably help me a lot while packing, since otherwise A- tends to unpack my stuff at the same time.
  • I have a phone with a good camera, and a long battery life, and a stylus. This probably means way more pictures and videos, some writing, and maybe even some drawing. It’s bigger, though, so I need to think about stashing the phone securely.
  • I have an iPad with a stylus. I can’t reliably use it for notetaking yet because A- gets distracted by it, but maybe I can figure out a good workflow for drawing and learn more by doodling. W- lent me his Bluetooth keyboard, too.
  • I’m going to keep the ditty bag and toothbrush from the airplane amenities kit. The bag is handy for organizing things, and A- recognizes the toothbrush as “airplane toothbrush.”
  • I’ll buy an electric toothbrush head in the Philippines. I noticed there’s an electric toothbrush body in the bathroom, so I’ll just get my own toothbrush head while I’m there instead of bringing the one from home.
  • I’ll bring our backup nail scissors. I’ll probably leave them in the Philippines, too.
  • I’ll try to leave my Philippine things neatly packed in a bin at my mom’s house. That way, I don’t need to take up drawer and closet space in between trips.
  • We’re landing in Toronto on a Saturday. It was really helpful to have W- around when I recovered from the long trip. Well worth paying extra.
  • We’re paying for our own hotels in Korea both ways. We’re not eligible for the stopover paid by carrier program (STPC) even on the return leg. We used to get it on our previous itineraries, but maybe we can’t this time because we’re flying out on Friday and there’s another flight that leaves later. Maybe they’ve changed their rules. Anyway, since we’ll still have a bit of energy after the 4-hour flight from Manila, I’m going to go check out a different hotel on the way back.
  • I’ll postpone moving off nursing or diapers. I’ll continue talking to A- about it, but I won’t nudge her too much.
  • I’ll organize my everyday carry. A-‘s new bag doesn’t have as many pockets, so I’ll need to stay better organized. I’ll probably need to use a wallet. I wonder if it’s time to try the vest again. I wish I’d gotten it in beige instead of black – no need to be any warmer in the sun. Anyway, I can see if it works for going through the airport and lounging around at home. If I like it, I might consider getting a lightweight khaki one for my next trip.
  • New Crocs. Same as the old Crocs, but not worn down.
  • I can wear scrubs again. No nurses in the house, so I can go back to wearing scrub pants without feeling weird. Pants with pockets for the win.
  • I’m not bringing a backup sling, just my main carrier. If my main carrier needs washing, I’ll just carry A-.
  • I’m packing Giraffe in check-in instead of carry-on. I think A- is comfortable enough to get away with one stuffed toy instead of two during the flights.
  • We’re traveling more frequently. It’s been just two months since our last trip. But I decided to take A- more frequently this year while my mom gets used to life without my dad. Going now means we’ll have a few days with A-‘s cousins too. If we didn’t go now, we would probably wait until June, since A- has a couple of big medical things scheduled for May. Time to take the first circus, as my family would say…

Helping A- level up

March 28, 2018 - Categories: parenting

A- is becoming more opinionated, which is a good thing. I can be more opinionated, too. We can start talking about reasons, and we can work on weathering big emotions. I’ve been erring on the side of permissiveness and allowing self-determination, but maybe I can trust in her resilience and adaptability. Here are some areas I might work on being more firm about:

Weaning: A- asks to nurse for comfort and to help her go back to sleep. Sometimes she stays latched for a long time. The dental surgeon strongly recommended weaning her to reduce the risk of further cavities and repeat dental surgery. I know there are mixed results regarding night nursing and early childhood caries. Still, it’s probably as good a time as any to make the transition.

I’ve been slowly getting A- used to waiting or finding other ways to comfort herself during the day. Sometimes she gets upset for five to ten minutes, but that’s bearable. It’s a bit more challenging at night. I won’t push it too much at night because we have a long trip coming up. When we get back, it might be good to try something like Dr. Gordon’s method.

What could being too soft look like? If I give in to her, she’ll probably stick with nursing on demand for a year or more. We’d probably need to go for another round of dental surgery with its associated risks, costs, and finger-wagging. It’s easier for me in the short term to night nurse instead of wean, but I might be missing out on long-term sleep improvements.

What could being too hard look like? If I push her too fast, she’ll cry a lot and we won’t get much sleep. Lots of people have survived cry-it-out methods, but I’m still hoping to do something a bit gentler. I feel better about her crying if I’m there offering a hug or a backrub. She’s usually so upset that she doesn’t want me to touch her, which I respect, so I just hang out and listen until she settles down. The first time we tried it, she cried for an hour before falling asleep. She seems much better at recovering now.

  • Eating: A- likes playing while we have dinner, and sometimes wants to pull me away. I like sitting down for dinner with W-. I’m getting better at insisting that I will come play with her after I finish my dinner. We keep her dinner on the table until we’re done, since she often wants to sit down for dinner when she realizes we’re enjoying ours.

She tends to eat food every 1.5-2 hours. It might be good to stretch it out a little further.

We plan to move a little away from snacking on the go when we’re out and about. It’s better to sit down and have proper snacks, anyway.

  • Sleep: I can be more firm about waking her up from her afternoon nap so that we don’t end up staying up too late in the evening. I’m also thinking of being more firm about my own bedtime, although she’s welcome to stay up and play a little if she wants.

I think the general plan is to trust in A-‘s resilience and adaptability, and to not be afraid of the hard stuff. We’ll figure this out together. She wants to learn how to be a big kid, and I want to help her. I don’t want things to feel like a power struggle if I can help it. I want it to be more like “Okay, you’re ready for bigger challenges. Let’s try this together.”

As for brushing teeth, we’ll try working on playfulness first. Lots of parents take a firmer approach, but the dentist doesn’t recommend restraining A- for toothbrushing, so we’ll just have to work on making it more fun.

Week ending 2018-03-23

March 30, 2018 - Categories: review, weekly

The big thing this week was the initial consultation with the dentistry department of Sick Kids. They plan to put A- under general anesthesia and fix her top four incisors. They said it looks like totally normal early childhood caries now, so no worries about enamel hypoplasia, and they strongly recommended night weaning as a way of reducing the risk of repeat dental surgery. Since we haven’t been able to be 100% solid on cleaning her teeth before bedtime, night weaning probably makes lots of sense.

Now that we’ve got A-‘s medical things scheduled for May, I decided we could squeeze in a quick trip to the Philippines so that she could spend time with Lola and see her cousins and Tita Kathy before they move to the Netherlands. If A-‘s teeth turn into an emergency situation, I hope travel insurance will help us sort everything out.

We took the ferry to Ward’s Island with Jen and E-. It was lots of fun even though everything was closed. The kids played with the pirate ship playground and had fun tossing leaves. A- favored Aunt Jen quite heavily, even telling me to stop. She also practised climbing up the ladder because she saw E- do it. It was great to see her becoming more independent.

A- was up early one day, so we made it out to Riverdale Farm in time for a farmer Q&A session. I learned a little bit about the sheep and the other animals at the farm. We got to touch the sheep’s nose and wool, which A- liked a lot. We combined that with a trip to Children’s Book Bank and the Regent Park playground, where A- had fun climbing up, sliding down, and digging in the sandbox.

A- was very interested in squeezing glue onto paper and sticking on pompoms, googly eyes, and ripped pieces of paper. She also liked playing with dough while I made breadsticks. Those and spinach pancakes were big hits. For gross motor development, she walked her balance bike up and down the sidewalk.

Lots of fun with language this week. She can use the word “sapatos” to mean shoes, and she can say the first two lines of Cattus Petasatus.

W- told me how she was jumping on the bed and he saved her from falling off head-first. He said she looked a little shocked, and then she said, “Nurse more, nurse more, no more monkeys.”

For my part, I’ve been trying to wean her with the help of timers on my phone. That prompted this hilarious attempt at social engineering: “Phone said it’s okay to nurse, beep beep.”

She really liked the Five Little Ducks song. I changed the lyrics to refer to Papa Duck instead of Mama Duck, and she insisted on changing the song so one little duck always comes back. She was interested in playing the recorder, and she actually listened when I asked her to play it quietly because people were sleeping.

Lots of pretending to be a cat qnd pretending I was Mama cat. She also enjoyed pretending to be Ate G* and pretending I was Tita Kathy.

On our side, W- fixed a leak in the dishwasher drain pipe, and I generated and printed labels for many of the toy bins.

Next up: travel!

Strangers talking to us

March 31, 2018 - Categories: parenting

A- will probably be strongly influenced by how I interact with people, so it’s good to give that some thought. I am a bit reserved, and I’m sometimes reflexively suspicious of strangers who talk to me out of the blue. I’ve been making an effort to smile at people and engage in the usual chitchat about the weather. There are certain things that get the conversation off on the wrong foot and I haven’t quite figured out how I want to handle them. Let me think about what I like and don’t like, and what I want to try next.

Let’s start with positive stuff, so I don’t feel like such a curmudgeon. What I like about the way strangers sometimes interact with A- and me:

  • Observation: “You seem to really like digging!”
  • Offering: “Would you like to play with this?”
  • Joining in: Impromptu dance party
  • Recognition: “You did it!” “That looks like fun!”
  • Inviting A- to make contact: extending a hand for a high five or a fist bump, but not making it awkward or insistent.
  • Empathizing

Things I don’t like:

People just reaching out and touching A-! This makes me want to back off or swat their hand away. I understand that baby skin looks so soft and inviting, and I get that people want kiddos to pay attention to them, but this just creeps me out. I’m tempted to experiment with stroking them right back and seeing how weird that makes them feel, but that just prolongs the interaction. So far, I’m getting better at saying, “Please don’t touch.” Some people really don’t get the hint, though. I may have to practice saying stronger variants.

What’s the harm? Nothing much, I guess, but I want A- to learn about bodily autonomy both ways (her body is her own, and other people’s bodies are theirs), and it creeps me out that other people want to satisfy their curiosity by touching people, and it’s supposed to be okay just because they’re touching a kid. Uh, no.

I am, however, totally okay with people crouching down to her level, saying something like “Would you like a high five?”, extending their hand, and waiting for her to respond.

I also cut little kids some slack, although I’ll still wave them off if I’m in arms’ reach. Just because someone wants to hug or kiss or touch someone doesn’t mean that person has to be hugged or touched or kissed. I’m getting better at intervening with something like “Wait, please. A-, it looks like ____ would like to give you a hug. Would you like to hug or wave hello?”

What’s wrong with her eye? Another one for dealing with other people’s curiosity. There was a Holland-Bloorview ad that resonated with me. It said: “Asking is better than assuming. But do you really need to know?” When I feel relaxed, I say things like, “She was born that way. It doesn’t hurt, though, and she can see fine with her other eye.” I might also practice saying “Why do you ask?” and when people say, “Just curious,” going with “I don’t feel like satisfying your curiosity right now.” Or maybe “Why do you need to know?” said with a smile.

And then there are playful approaches: “She lost it in a hockey fight!” “She’s a pirate in training.” “Aaaaah! Did it fall out again?”

There’s also “Isn’t it amazing how we can adapt to situations? A- can see just fine with her other eye. She can also hear just fine too, so let’s include her in the conversation!”

Or maybe that old standby, “Would you like to ask her? It’s up to her if she wants to answer or not, of course!”

How cute! Or “What a cutie,” or other variants that focus on appearance. I understand that that’s many people’s default compliment for kids (especially girls). People are usually quite genial, so I’ll try to be gracious about it. It might be fun experimenting with playfully asking A- if she wants to be cute today or a more interesting adjective. “Cute” kinda feels a little dismissive, limiting, and more focused on the eye of the beholder, and it tends to have an expiration date… I wonder if “Are you a cute little baby today or an awesome big kid” sets up too much of a contrast. “Cute is out, awesome is in.” might be too conceptual. “Baby sheep are cute. A- isn’t just cute, she’s awesome! Speaking of cute sheep, there’s a new lamb at Riverdale Farm! Have you been?”, maybe? Long thing to say, but redirects the conversation…

I’m okay with A- getting compliments, and I hope she doesn’t get a complex about her appearance. “Cute” is just a bit weird, though, or maybe I’m just a bit weird about it. :)

Boy or girl? I’m guessing people don’t want to make the mistake of assuming gender, but aren’t used to avoiding gendered pronouns. I guess I could jump straight to introducing A- by name and interest, since A- has a gendered name. Then it would feel less like her gender is the first thing people need to know about her.

How old is she? People are probably just calibrating their age guesses and figuring out how impressed they should be with whatever A-‘s doing. Maybe I’ll practice poking them ever so slightly back. “You first! How old are you?” Or maybe directing people to ask her instead (answers optional), so she gets practice in conversations.

Are you from China? Maybe people are trying to calibrate their race guesser? I get this occasionally from non-Asians awkwardly making conversation. Filipinos tend to think I’m Chinese too, but generally don’t mention it until I say something in Tagalog that prompts an “Ah! Akala ko Intsik ka” from them. Maybe I’ll practice the Southern “What a thing to say.” Or maybe “You first! Are you from ___?”

Ooh. This Citylab post has a fun idea for dealing with the “Where are you from?” question: “Mars!” This post gives me a more positive view of why people might ask. Maybe I could distract and redirect with “Isn’t it wonderful how Toronto is such a diverse city and anyone can be a Canadian? Where are you from?” Or maybe “It’s fun to guess where people are from. Are you from ____?”

Ideas to play with!