June 2015

Monthly review: May 2015

June 1, 2015 - Categories: monthly, review

It always surprises me how each tiny step builds up. I remember May to be rather fuzzy, but it turns out that I managed to do a fair bit of sewing, thinking, coding, and planning anyway.

This was the month I realized that I can turn my temporary fuzziness into an advantage. I get to have sneak peeks of what I might deal with in the future, and I can plan and build systems accordingly.

I spent the first half of the month going on long walks every day, and that felt great. It turns out that Hacklab is within walking distance of my house, and quite a few libraries are as well. Whee! I look forward to re-establishing this habit at some point.

W- and I have been spending more time playing video games lately. He’s going through Borderlands, and I’m playing Ni no Kuni. Fun!

2015-06-02b May 2015 -- index card #monthly output

Blog posts

Sketches

Daily: 01 02 03 04 05 06 07 08 09 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Time

Category Last month (%) This month (%) Avg h per week Delta (h/wk)
Business – Build 5.1 10.5 18 9.1
Discretionary – Play 6.1 10.8 18 7.9
Unpaid work 8.0 9.2 15 2.0
Discretionary – Social 1.7 1.6 3 -0.2
Personal 16.4 16.1 27 -0.5
Discretionary – Productive 9.0 8.4 14 -1.0
Discretionary – Family 3.6 3.0 5 -1.0
Business – Earn 5.5 3.9 7 -2.7
Sleep 37.5 35.1 59 -4.0
Business – Connect 7.1 1.3 2 -9.7

Lots more Quantified Awesome coding, drawing, and playing this month. A little more time cooking. Not as much time at Hacklab. Oddly, even less sleep. Or maybe I was fuzzier because I hadn’t been sleeping as much? This was still an average of 8.4 hours a day, though. Biking and long walks put on hold, but maybe I’ll be able to get back to them in the next few weeks.

A deeper dive into absent-mindedness and misplacing things

June 2, 2015 - Categories: analysis

I haven’t misplaced anything today, but I know I will at some point. This week? This month? Definitely this year, and probably more and more as the years go by. It got me thinking about misplacing things, and what I might be able to do about that.

When or why do I misplace things?

  • Active
    • Putting something down in one of many frequent places
    • Putting something down in an infrequent place
    • Getting distracted half-way and putting something down somewhere I don’t remember
    • Putting something down because my hands are full and I need to pick up something else
    • Putting something in a place that’s similar to but not the same as the place it should be, and not catching the mistake
    • Putting something somewhere near it should be instead of where it should be because that place is occupied or inaccessible
    • Putting something away for the long term, then forgetting where it is
    • Putting something away, then forgetting whether I have it or not
    • Putting aside something in progress or waiting for something else, then forgetting where it is or when I need to get back to it (ex: mismatched socks)
    • Shuffling things into similar things (ex: papers)
    • Making a mental note of where I put something, but not remembering it well enough
  • Passive
    • Someone moving or dislodging something from where I expect it to be
    • Forgetting to check for things that have accidentally fallen or been left behind (ex: gloves, scarves, things in pockets)
    • Leaving things in an opaque container for convenience, and then not taking them out and putting them away (ex: gloves)
    • Things falling out of pockets or through linings, un-noticed
    • Familiar tasks in familiar environments lead to automatic thinking and reduced attention
    • Forgetting to prepare or take something
    • Gaps when retracing steps
  • Retrieval
    • Skipping over something because something else is covering it or obstructing my view
    • Looking at something but not recognizing it
    • Limiting my field of view unnecessarily
    • Misremembering things that are similar to things I remember getting rid of, so I don’t look for them
    • Not searching in a systematic manner
    • Having a false memory of putting something away in a different place
      • Confusing with previous memory
      • Confusing plans with reality

What tools and tactics do people use to minimize the hassle of misplacing things?

  • Build automatic habits
    • Have one clearly defined place for each thing, or very few clearly defined places
    • Explicitly encode memories around picking things up or putting things down
      • Looking
      • Mental note
      • Note to self, out loud
      • Text note
      • Audio note, recorded
      • Picture
    • Have a handy holding place for in-between things or miscellaneous things, and review this frequently (ex: bin, belt bag)
  • Reduce retrieval costs
    • Regularly tidy with fresh eyes
    • Make lists of where things are
    • Label containers with their contents (ex: cabinets)
    • Keep things clear and tidy
  • Label
    • Label things so that in case they’re lost, someone might be able to return them to you
    • Offer rewards
  • Reduce the need for the item
    • Replace or supplement often-misplaced identification with always-present information or more frequently used devices (ex: biometrics, keycodes, smartphone)
    • Buy or budget for replacements (ex: pens)
    • Keep extra stock of items in multiple places (ex: pens)
    • Minimize the number of unneeded things you carry, and keep other things in a known place (ex: infrequently-used keys)
    • Eliminate the item entirely
  • Add alerts
    • Track location (ex: smartphones, parking)
    • Add proximity alerts (ex: smartphone-laptop Bluetooth proximity detection, tracking stickers)
  • Fill in gaps
    • Retrace steps
    • Ask someone else who might be able to look with fresh eyes or who might have different memories

When are these tools particularly useful?

From “External and internal memory aids: when and how often do we use them?” (Intons-Peterson and Fournier, 1986):

  • When intervening events may interfere
  • When there’s a long delay between encoding and retrieval
  • When accuracy is important
  • When information is difficult to remember
  • When there’s limited time to remember
  • When you want to avoid the effort of remembering

Based on these thoughts, what can I tweak about my life? Maybe I can pay closer attention to incidents of misplaced things and other action slips over the next few weeks so that I can see where the gaps are….

Thinking about changing interests

June 3, 2015 - Categories: learning, reflection

I’ve gone through quite a lot of interests. Sometimes they combine in useful ways, like the way coding and writing are imbued into practically all the other interests I have. Sometimes they last for years, and sometimes they’re over in months. From other people’s stories, I get the sense that this will likely continue throughout my life. =)

I want to do this better – the cultivation of interests, and the occasional letting go. Why do I want to do it better? I want to minimize the risk of being in the following situations:

  • When I overcommit to an interest:
    • Spending more money, time, or space than an interest needs
    • Making long-term promises (ex: speaking, organizing) that I might feel weird about
  • When I find myself in a lull because I haven’t cultivated my interests enough:
    • Recognizing temporary interest distance and accepting or working around it
    • Accepting the feeling of being a beginner and getting to the point of enjoyment
    • Letting go at the apppropriate point

In addition to those downsides, I want to make better use of the upsides:

  • During the initial period of fascination, I want to take unselfconscious notes
  • As my interest matures, I want to get better at seeking and organizing information, and then coming up with my own thoughts
  • I want to get better at drawing connections between interests and taking advantage of the combinations

So I’d like to learn more about how I think and learn. What kinds of things am I interested in? Why do my interests change? What stages do I go through? How can I make just the right level of commitment, feeding fledgling interests without adding too much weight to them, building on mature interests without stretching them too far, and taking breaks or letting go gracefully without flaking out? Should I focus on developing interest persistence, or get better at going with the flow?

Here’s an example of an interest I’m thinking through: I like Emacs and its community. I seem to get into Emacs cyclically. For a few months each year, I spend a lot of time looking closely at how I use Emacs and learning from what other people do. I hang out in Emacs communities, pay attention to mailing lists, tweak my config, write blog posts, sometimes create resources. (My Emacs geekery really is quite oddly rhythmic. Here’s the data by month since Nov 2011.)

Then other things take my attention, and I drift off. I haven’t tweaked my configuration or written an Emacs-related blog post in a while. I’ll get back to it at some point, I know – the oddest thing will bring me back: some idea or question – but in the meantime, I’m fine with letting it be for now.

But I’ve set up monthly Emacs Hangouts on my calendar and in Google+ events, because precommitting to those means that they happen. And there’s some kind of an Emacs Conference that I think would be an excellent idea, but I haven’t been able to muster the energy to do the kind of social outreach that I think would be needed in order to get the schedule sorted out. And there are the occasional requests for help that come in, even though I don’t feel I can contribute even a fraction of what http://emacs.stackexchange.com/ or the relevant mailing lists could.

I feel like it would be good for me to be closer to that interest, but there are other things on my mind at the moment, so I leave things hanging. I’ll be there for the Emacs Hangouts I’ve set up, but I haven’t felt like doing anything else lately: lining up people for Emacs Chat podcasts, writing or drawing a review of Mastering Emacs, exploring the awesome new packages that are out there…

On the other hand, I know that sometimes all it takes is a little time immersing myself in it: checking out StackExchange questions or IRC conversations, reading source code, going through my long TODO list of Emacs things to learn. Likely that will kickstart my interest.

In the meantime, this lull itself is curious and interesting, because I rarely get to pay attention to feelings like this. It feels odd to be a little bit distant from Emacs and reading books, two of my long-term interests. Writing, drawing, coding, and data analysis continue to be interesting. My sewing is on hold; I think keeping myself to one type of garment a year seems like a good way to avoid burnout. Gardening has been slowed to the pace that nature keeps. I notice a fledgling interest in cognitive research and psychology.

I’m taking it easy, fanning interest when I can and relaxing when I feel like doing that instead. A mix of routine and freedom helps, I think. I like writing and coding in the morning. Sometimes it takes a little effort to get started, especially with writing, but then I get going. In the afternoon, it’s okay to relax.

I don’t think that my values and the things that tickle my brain have changed, so I’ll probably return to my long-term interests once my new interests settle down and get integrated. They’ll be richer for it too, like the way coding got better when I added writing, and writing got better when I added drawing. In the meantime, I’m curious about charting the shifts in my focus and making the most of them.

Hmm, I wonder if this is related to my hesitation around the Quantified Self talk we’re planning for November: I’m not sure if I’ll be able to give the enthusiastic performance that I imagine newcomers would find helpful…

Aha! I think that might explain it. By myself, I’m okay with the shifts in my interests. I just try to take good notes and share them along the way. Social commitments add friction to interest-changing because I don’t want to flake out and I don’t want to fake things, which is why I’m reluctant to make plans even if I miss out on opportunities because I don’t want to do so. However, it would probably be good for me to know how to work with this, because social commitments are a good way to help make things that are bigger than yourself. If I remind myself that (a) at the core, I’m still likely to enjoy the things that drew me to that interest in the first place, and (b) it’s not the end of the world even if I mess up, that might help me reduce the anxiety around essentially making a promise that future me will still have the same passions that people are drawn to in the present. So I’m likely to still avoid making big commitments (say, no convincing people to quit their jobs and start a company with me), but I can practise with the small ones I have.

At the moment, I think I’ll still want someone else to take point on organizing the Emacs Conference speaker schedule, but I can re-evaluate that in two weeks, and we can always move it further out if needed. I should be able to handle the Quantified Self talk – worst-case scenario is I don’t manage to inspire and connect with people, but I don’t expect a small 1-hour talk to change people’s lives that much anyway. So it’s okay even if I don’t feel 100% there in terms of the interests right now. I have enough good memories to know I’ll probably feel that way about those interests again soon, so I can plan accordingly.

It’s a little odd teasing apart temporary factors and long-term factors in my mind, but I’m glad I can sit and write my way through it. In the meantime, I’ll focus on keeping my experiences of those interests pleasant, tickling my brain whenever I can. There’s so much depth to each interest that I don’t really need to add more. But on the other hand, the combinations can be quite interesting, so I’ll explore away. =)

Thinking about simplifying capture on my phone

June 4, 2015 - Categories: android, geek

I’ve been thinking about temporary information: things like where I put down something I was holding, the task I’m working on just in case I get interrupted, thoughts that I want to explore later on.

The seeds of a good system are there, if I learn how to use them more effectively. I usually have my phone handy. Evernote can record audio, pictures, or text, and the creation date is an automatic timestamp. I can export the notes and process them using Emacs. Google Now’s “Note to self” command can create a note in Evernote, or I can tap the Create Note icon.

How can I improve how I use these tools?

If I get used to starting my note lines with a special keyword, then it’ll be easier for me to extract those lines and process them. For example:

DO Actions to add to my to-do list
THINK Thoughts to explore
PLACE Putting things down

If I add custom commands to Google Now, or make Google Now the fallback for another command line, then I can use that for my tracking system as well. AutoShare and AutoVoice might be handy. I should probably learn how to get Tasker working with Javascript, too. Alternatively, I can use Evernote’s e-mail interface, although there might be a slight delay if I’m offline.

If I create a custom single-click interface that can start the note with a specified keyword, that would be even better.

I could also use a more systematic review process. For example:

  • All THINK items can be automatically added to the end of my

questions.org as their own headings.

  • All DO items can be added to my uncategorized tasks.

Okay, let’s start by figuring out Javascript and Tasker, since that will make it easier for me to write actions that take advantage of intents.

First step is to save the JS library template from Tasker. The file is stored in /storage/emulated/0/Tasker/meta/tasker.js. Okay, I’ve created a Tasker scene that has a WebView component that loads the file that I synchronized with Dropsync.

The next step is to simplify development so that I can try things quickly. I want to be able to sync and reload my WebView scene by tapping a button. The Dropsync Tasker action returns immediately, so maybe I’ll just add a wait to it.

Hmm, maybe a good path might be:

  1. Set up easy sync/reload, so I can try things out quickly.
  2. Include JQuery.
  3. Run tasks.
  4. Launch apps.
  5. Send intents.
  6. Convert my current tracking menu to this format.
  7. Add buttons for creating notes (either e-mail-based or intent-based):
    • Do
    • Think
    • Place
  8. Add a command-line. Compare using it vs. using buttons.

On a related note, what kinds of things would I like my phone to be smart enough to do?

  • If I’m at home and I’m calling my cellphone from our home phone, set the ring volume to maximum, since that means I’m trying to find it.
  • If I say that I’m at a social event, ask me who I’m spending time with. Track that. Create a note with the person’s name as the title and “social” as the tag.
  • If I’m going to sleep, track that, then start tracking in Sleep as Android.
  • If I’m going to play a game, track that, then ask me what I’m going to do afterwards and how long I want to play. Load hints for the game (if I want). After the specified time, make a sound and remind me of what I was going to do.
  • If I’m going to read a book, show me the list of my checked-out books and let me pick one of them. Track that, then create a note with the title and author so that I can take notes.
  • NFC opportunities:
    • If I scan at the door, show me a menu: walk, subway, groceries, family, bike.
    • If I scan in at the kitchen table, track it as breakfast / lunch / dinner (as appropriate), then launch MyFitnessPal.
    • If I scan in at the table in front of the TV, show me a menu: relax, nonfiction, fiction, games.
    • If I scan in at my bedside table, treat it as going to sleep.

Mmm… Little things to tweak. =)

Recreating and enhancing my tracking interface by using Tasker and Javascript

June 5, 2015 - Categories: android, geek

I got tired of setting up Tasker scripts by tapping them into my phone, so I looked into how to create Tasker interfaces using Javascript. First, I created a folder in Dropbox, and I used Dropsync to synchronize it with my phone. Then I created a simple test.html in that folder. I created a Tasker scene with a WebView that loaded the file. Then I started digging into how I can perform tasks, load applications, and send intents to Evernote so that I can create notes with pre-filled text. I really liked being able to reorder items and create additional screens using Emacs instead of Tasker’s interface.

Here’s my code at the moment. It relies on other Tasker tasks I’ve already created, so it’s not a standalone example you can use right off the bat. Still, it might be useful for ideas.

tasker-scripts/test.html:

<html>
    <head>
        <title>Sacha's personal tracking interface</title>
        <style type="text/css">
         button { padding: 20px; font-size: large; width: 45%; display: inline-block  }
        </style>
        <script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
    </head>
    <body>
        <div id="feedback"></div>
        <!-- For making it easy to track things -->
        <div class="screen" id="main-screen">
        <button class="note">Do</button>
        <button class="note">Think</button>
        <button class="note">Note</button>
        <button class="note">Journal</button>
        <button class="switch-screen" data-screen="track-screen">Track</button>
        <button class="switch-screen" data-screen="play-screen">Play</button>
        <button class="switch-screen" data-screen="eat-screen">Eat</button>
        <button class="switch-screen" data-screen="energy-screen">Energy</button>
        <button id="reload">Reload</button>
        </div>
        <div class="screen" id="play-screen">
            <button class="play">Persona 3</button>
            <button class="play">Ni No Kuni</button>
            <button class="play">Hobbit</button>
            <button class="switch-screen"
                    data-screen="main-screen">Back</button>
        </div>
        <div class="screen" id="energy-screen">
            <button class="energy">5</button><br />
            <button class="energy">4</button><br />
            <button class="energy">3</button><br />
            <button class="energy">2</button><br />
            <button class="energy">1</button><br />
            <button class="switch-screen"
                    data-screen="main-screen">Back</button>
        </div>
        <div class="screen" id="eat-screen">
            <button class="eat">Breakfast</button>
            <button class="eat">Lunch</button>
            <button class="eat">Dinner</button>
            <button class="switch-screen"
                    data-screen="main-screen">Back</button>
        </div>
        <div class="screen" id="track-screen">
            <button class="update-qa">Routines</button>
            <button class="update-qa">Subway</button>
            <button class="update-qa">Coding</button>
            <button class="update-qa">E1 Gen</button>
            <button class="update-qa">Drawing</button>
            <button class="update-qa">Cook</button>
            <button class="update-qa">Kitchen</button>
            <button class="update-qa">Tidy</button>
            <button class="update-qa">Relax</button>
            <button class="update-qa">Family</button>
            <button class="update-qa">Walk Other</button>
            <button class="update-qa">Nonfiction</button>
            <button class="update-qa">Laundry</button>
            <button class="update-qa">Sleep</button>
            <button id="goToWeb">Web</button>
            <button class="switch-screen" data-screen="main-screen">Back</button>
        </div>
        <script>
         function updateQuantifiedAwesome(category) {
             performTask('Update QA', null, category);
             hideScene('Test');
         }

         function showFeedback(s) {
             $('#feedback').html(s);
         }
         function switchScreen(s) {
             $('.screen').hide();
             $('#' + s).show();
         }

         $('.switch-screen').click(function() {
             switchScreen($(this).attr('data-screen'));
         });
         function createEvernote(title, body) {
             sendIntent('com.evernote.action.CREATE_NEW_NOTE', 'activity',
                        '', '', 'none', '', '',
                        ['android.intent.extra.TITLE:' + (title || ''),
                         'android.intent.extra.TEXT:' + (body || '')]);
         }
         $('.note').click(function() {
             createEvernote($(this).text());
         });
         $('.energy').click(function() {
             createEvernote('Energy', 'Energy ' + $(this).text() + ' ');
             switchScreen('main-screen');
         });
         $('#reload').click(function() {
             performTask('Reload Test');
         });
         $('.update-qa').click(function() {
             updateQuantifiedAwesome($(this).attr('data-cat') || $(this).text());
             hideScene('Test View');
         });
         $('#goToWeb').click(function() {
             browseURL('http://quantifiedawesome.com');
         });
         $('.eat').click(function() {
             updateQuantifiedAwesome($(this).text());
             loadApp('MyFitnessPal');
         });
         $('.play').click(function() {
             performTask('Play', null, $(this).text());
         });

         switchScreen('main-screen');

         </script>
    </body>
</html>

You can find the latest version at https://github.com/sachac/tasker-scripts.

Weekly review: Week ending June 5, 2015

June 7, 2015 - Categories: review, weekly

Another week of taking it easy. My energy was up and down, but manageable. Also, lots of rain this week, including one time I ended up walking home in a downpour. Squish, squish, squish…

I learned how to use Javascript and Tasker together, and I’ve been having fun playing with that. I think I’ll look into developing Android applications next. Tasker+JS will let me quickly prototype ideas, and then I can code those ideas into applications that might be faster or more reliable.

I might be getting the hang of this. =)

2015-06-08a Week ending 2015-06-05 -- index card #journal #weekly

output

Blog posts

Sketches

Link round-up

Focus areas and time review

  • Business (19.5h – 11%)
    • Prepare invoice – State “DONE” from “STARTED” [2015-05-01 Fri 09:23]
    • Earn: E1: 1-2 days of consulting
    • Earn (6.9h – 35% of Business)
    • Build (11.2h – 57% of Business)
      • Drawing (2.9h)
      • Paperwork (1.7h)
    • Connect (1.4h – 7% of Business)
  • Relationships (9.2h – 5%)
  • Discretionary – Productive (8.4h – 4%)
    • Emacs (0.0h – 0% of all)
    • Add to my TFSA
    • File prescription receipts
    • Process Quantified Self Toronto videos
    • Shift my bond allocation
    • Writing (7.0h)
  • Discretionary – Play (36.4h – 21%)
  • Personal routines (25.8h – 15%)
  • Unpaid work (12.9h – 7%)
  • Sleep (55.9h – 33% – average of 8.0 per day)

Adding calculations based on time to the Org Agenda clock report

June 8, 2015 - Categories: emacs, org

Duplicating this answer on my blog in case StackOverflow goes away. =)

Leo asked:

I’m trying to make the Agenda Clockreport show how many pomodoros I’ve invested in a task. A Pomodoro is 25 minutes. For example, 1:15 hours of work is 3 pomodoros.

I’m trying to customize org-agenda-clockreport-paramater-plist, and I would like to extract “Time” and convert it to a pomodoro. I.e., (time in minutes / 25) = pomodoro.

I wrote:

This will create a column in your clocktable report that sums the hours from columns 3 and 4, and then another column that shows you the round number of pomodoros that took up.

(setq org-agenda-clockreport-parameter-plist
      '(:link t :maxlevel 2 :formula "$5=$3+$4;t::$6=ceil($5*60/25);N"))

If you don’t want in-between columns, here’s a totally hackish approach:

(defun my/org-minutes-to-clocksum-string (m)
  "Format number of minutes as a clocksum string.
Shows the number of 25-minute pomodoros."
  (format "%dp" (ceiling (/ m 25))))
(fset 'org-minutes-to-clocksum-string 'my/org-minutes-to-clocksum-string)

Alternatively, you can use :formatter, but the formatting function looks very long and annoying to change.

Leo eventually configured it with:

(setq org-agenda-clockreport-parameter-plist
 '(:fileskip0 t :link t :maxlevel 2 :formula "$5=($3+$4)*(60/25);t"))

(He didn’t mind the decimals, I guess! =) )

Using Emacs Org Mode tables to calculate doses to buy

June 9, 2015 - Categories: emacs, org

I got tired of manually calculating how many I needed to buy based on a daily protocol and how many I had in stock, so I wrote a little bit of Emacs Lisp to figure it out. You can specify the type, daily dose, start and end dates (inclusive; defaults to the last specified date if blank), and how many you have in stock.

First, define a table of this form, and give it a name.

#+NAME: input
| Type         | Per day |      Start |        End | Stock |
|--------------+---------+------------+------------+-------|
| Medication A |       2 | 2015-06-09 | 2015-06-16 |     5 |
| Medication B |       1 |            |            |     0 |
| Medication C |     0.1 | 2015-06-12 | 2015-06-16 |   0.2 |
Type Per day Start End Stock
Medication A 2 2015-06-09 2015-06-16 5
Medication B 1 0
Medication C 0.1 2015-06-12 2015-06-16 0.2

To call the code from the bottom of this post, use something like:

#+CALL: calculate-meds-needed(meds=input) :hlines yes :colnames yes
Type Total In stock Needed
Medication A 16 5 11
Medication B 8 0 8
Medication C 0.5 0.2 1

Here’s the code that processes it:

#+name: calculate-meds-needed :var meds=meds :colnames yes :hlines yes
#+begin_src emacs-lisp
(let (start end)
  (append
   (list (list "Type" "Total" "In stock" "Needed"))
   (list 'hline)
   (sort (delq nil (mapcar
                    (lambda (row)
                      (unless (or (eq row 'hline) (string= (elt row 0) "Type"))
                        (let (total)
                          (setq start (if (string< "" (elt row 3)) (elt row 3) start)
                                end (if (string< "" (elt row 2)) (elt row 2) end)
                                total (* (elt row 1)
                                         (- (calendar-absolute-from-gregorian (org-date-to-gregorian start))
                                            (calendar-absolute-from-gregorian (org-date-to-gregorian end))
                                            -1)))
                          (list
                           (elt row 0)
                           total
                           (elt row 4)
                           (max 0 (ceiling (- total (elt row 4))))))))
                    meds)) (lambda (a b) (string< (car a) (car b))))))
#+end_src

Tweaking my daily routines for that feeling of progress

June 10, 2015 - Categories: experiment, life

I found myself feeling like I hadn’t gotten a lot of things done. My weekly reviews showed me I made progress, but it didn’t feel like it day to day. I thought about what I’d like to feel instead.

2015-05-04c Keeping the end of the day in mind -- index card #life #quality-of-life

2015-05-04c Keeping the end of the day in mind – index card #life #quality-of-life

A little structure helps me do useful things even if my mind is fuzzy.

2015-03-11d How can I structure these types of days -- index card #limbo #routines

2015-03-11d How can I structure these types of days – index card #limbo #routines

I’ve been experimenting with this more now that I’m regularly up around 7 or 8 AM. I seem to have developed a routine that works well for me. I start by having breakfast and reading a book. Then I usually spend an hour or two coding, slowly working my way through my personal project task list. If I want to explore a thought, I spend a little time drawing. Lunch is followed by (or preceded by) playing video games. Then it’s time to draw or write a bit more. Sometimes I nap in the afternoon.

2015-06-09a Designing my mornings -- index card #kaizen #mornings #life

2015-06-09a Designing my mornings – index card #kaizen #mornings #life

If I sit down to read or code, even if I don’t feel like doing so in the beginning, I often find myself getting into it. I know that after I read or code, I’ll have something to add to my daily index card journal, so the rest of the day feels more relaxed. If I keep track of the tiny steps I take – each book, each finished task – I know they’ll add up to a surprising distance during my weekly or monthly reviews.

2015-06-08c What could make this even awesomer -- index card #life #kaizen

2015-06-08c What could make this even awesomer – index card #life #kaizen

I’d been wondering what could give me a good sense of progress in a self-directed life, and this might be the start of an answer. Even if I feel a little lost in other areas, it’s nice to know that I’m a bit further ahead than when I started.

It might be nice to make writing more habitual, since I tend to do it in spurts. It’s easiest for me to write about code, but it might also be useful to write about how I’d like to apply what I’m learning from books or about life. Besides, writing is a good way to organize my thoughts and drawings into larger chunks.

I think I’ll add walking into this routine, too. Maybe in the afternoon, so that I can return the book that I just finished and I can pick up any holds that have come in.

Hmm…

Thinking about problem-solving and sequencing

June 11, 2015 - Categories: development, learning

We’ve been helping J- with her culminating project in Grade 11 programming class, a text-based blackjack game. She was getting stuck because she wasn’t comfortable enough with Java or programming. She didn’t know where to start or what to do. I didn’t write the program for her (and that was never on the table, anyway), but I offered to guide her through the process. More experienced learners can do that kind of planning on their own, but when you’re new to a subject (and especially if you’re under time pressure), it helps to have that kind of scaffolding.

The first thing I did was to properly set up Eclipse on her computer. She had already tried setting it up, but it kept quitting with a cryptic error message. I realized that she didn’t have the Java software development kit installed. Once we added that, Eclipse started working.

Then I set up a sequence of tiny, tiny steps that she could implement with a little guidance. This was not the same sequence of events that would be in the final game: betting, shuffling, dealing, scoring, and so on. Instead, I focused on the steps she could build on bit by bit. It went something like this:

  1. Display a random number.
  2. Initialize the deck array based on the face array and suit array J- had already set up. This would contain strings like “ace of hearts”.
  3. Print the deck array.
  4. Set up a parallel array of card values, and print that as well. This would contain integers such as 1 for ace.
  5. Shuffle the deck by swapping each card with a random card, swapping the same card’s value as well.
  6. Write a function that takes an array of card values and returns the value of the hand.
  7. Modify the function to take aces into account, since aces could be either 1 or 11.
  8. Handle the initial dealing of two cards each by keeping track of the top card and updating a status array.
  9. Display the cards for a specified hand based on the status array.
  10. Update the hand value function to take the status array into account.
  11. Deal cards to the player as requested.
  12. Check if the player has lost.
  13. Follow the rules for dealing additional cards to the dealer.
  14. Check if the dealer has lost.
  15. Figure out who won that round.
  16. Read the bet.
  17. Update the bet after the player has won or lost the round.
  18. Check if the player has doubled their money or lost all their money.
  19. Add more error-checking.
  20. Add more flexibility.

2015-06-11a Blackjack implementation sequence -- index card #sequencing #problem-solving

2015-06-11a Blackjack implementation sequence – index card #sequencing #problem-solving

This sequence meant that she could write and test the less-interactive parts first (preparing the deck, shuffling the cards, calculating the score) before slowing down her compile-run-test cycle with input. It also let her work on the simplest parts first without writing a lot of redundant code and with just a little prompting from me.

Instead of this zigzag path, we could have followed the chronological flow of the program, especially if I introduced her to the practice of stubbing functions until you’re ready to work on them. This shuffled order felt a bit better in terms of demonstrable progress, and she seems to have been able to follow along with the construction process. In retrospect, the chronological flow might have been easier for her to learn and apply to other projects, though, since breaking down and shuffling the order of tasks is a skill that programming newbies probably need a while to develop.

Anyway, helping J- with her project got me thinking about how I work my way through programming challenges on my personal projects and in my consulting. I tend to try to figure things out by myself instead of asking mentors or the Internet. I also tend to write things in a bottom-up instead of top-down order: starting with small things I can write and test quickly, and then gradually building more elaborate processes around them.

2015-06-09e What do I mean by sequencing -- index card #learning #problem-solving #sequencing

2015-06-09e What do I mean by sequencing – index card #learning #problem-solving #sequencing

I think of the process of breaking down tasks and organizing them into a useful order as “sequencing”, which is part of the general domain of problem-solving. There’s probably an official term for it, but until I find it, that’s the term makes sense to me. When I was teaching undergraduate computer science, I noticed that students often struggled with the following aspects:

  • Imagining a good goal, if they were doing a self-directed project (not too big, not too small, etc.)
  • Fleshing out their goal into specifications
  • Identifying possible chunks along the path
  • Breaking those chunks down into smaller chunks as needed
  • Figuring out how to bridge those chunks together
  • Prioritizing chunks
  • Re-evaluating paths, progress, and goals as they learned more
  • Managing motivation
  • Finding resources
  • Translating or adapting those resources to what they needed to do
  • Figuring out what they could start with (what they already knew, or that first hand-hold on a chunk)

2015-06-09h Sequencing challenges -- index card #learning #problem-solving #sequencing #challenges

2015-06-09h Sequencing challenges – index card #learning #problem-solving #sequencing #challenges

I sometimes have a hard time with these aspects too, especially when I’m learning a new toolkit or language. I think I’m getting better at picking ridiculously tiny steps and celebrating that progress instead of getting frustrated by blocks. When I can’t figure tiny steps out, I know that going through tutorials and reading other people’s code will help me build my vocabulary. That way, I can get better at finding resources and planning chunks. I have a better idea of what’s out there, what things are called, and maybe even what’s probably harder and what’s probably easier.

2015-06-09f How do I develop my own sequencing skills -- index card #learning #problem-solving #sequencing

2015-06-09f How do I develop my own sequencing skills – index card #learning #problem-solving #sequencing

Programming gives me plenty of opportunities to develop my sequencing skills. By writing notes with embedded code snippets and TODOs, I can break large chunks down into smaller chunks that fit in my working memory. Sometimes I read programming documentation or source code without any particular project in mind, just collecting ideas and expanding my imagination. If I focus on writing tiny chunks that start off as “just good enough” rather than making them as elaborate as I can, that lets me move on to the rest of the program and get feedback faster. Saving snippets of unused or evolving code (either manually in my notes or automatically via a version contro system) lets me reuse them elsewhere.

I imagine that getting even better at sequencing might involve:

  • Sharing intermediate or neighbouring products to get feedback faster and create more value
  • Figuring out (and remembering!) sequences for getting into various areas such as Angular or D3
  • Becoming fluent with many styles of sequencing, like working top-down instead of just bottom-up
  • Building reliable automated tests along the way, even as my understanding of the project evolves

What about helping other people get better at sequencing?

2015-06-09g How can I help other people develop sequencing skills -- index card #learning #problem-solving #sequencing

2015-06-09g How can I help other people develop sequencing skills – index card #learning #problem-solving #sequencing

  1. If I share a pre-defined sequence, that helps people with less experience follow a possibly more efficient path.
  2. If I customize the sequence for someone I’m helping, that’s even more useful.
  3. Talking about how we’re customizing the sequence exposes sequencing as a skill.
  4. Guiding someone through the breakdown of a small chunk (from a task to pseudocode, for example) can help them get the hang of turning things into specifics.
  5. Guiding someone through the breakdown of a larger chunk into smaller chunks helps them think of larger chunks as doable.
  6. Once someone has identified a few chunks, I can help with prioritizing them based on effort, relationship between chunks, etc.
  7. In preparation for independent learning, it’s good to practice the skill of figuring out those prioritization factors: small experiments, research, and so on.
  8. And at some point (woohoo!), I can help someone reflect on and tweak a plan they developed.

I’m not yet at the point of being able to do even step 1 well, but maybe someday (with lots of practice)!

Since this is a super-useful skill and not everyone’s into programming, it might be interesting to look around for non-programming situations that can help develop sequencing skills.

2015-06-09i Non-programming examples of sequencing -- index card #learning #problem-solving #sequencing

2015-06-09i Non-programming examples of sequencing – index card #learning #problem-solving #sequencing

On the passive side, it’s interesting to learn about how things work or how they’re made. Better yet, you can actively practise sequencing with math problems, video games with quests… Writing is like this too, if you think of key points and use tools such as outlines or index cards. Making things involves imagining what you want and figuring out lots of small steps along the way. Life is filled with little opportunities for everyday problem-solving.

I’d love to learn more about this. Chunk decomposition? Problem-solving order? Problem decomposition? Step-wise refinement? I’m more comfortable with bottom-up problem-solving, but top-down solving has its merits (focus, for one), so maybe I can practice that too. Using both approaches can be helpful. (Ooh, there’s a Wikipedia article on top-down and bottom-up design…) Time to check out research into the psychology of problem-solving!

Growth, experiments, and shifting my preferences

June 12, 2015 - Categories: philosophy, reflection

I’ve been thinking about how to respond to e-mails from former virtual assistants who are looking for additional work. I remember what it was like to feel that the world was a candy store of talent. My experiments with delegation led to interesting experiences. But at the moment, I can’t really think of tasks that I want to specify or how much I would value someone else doing them.

Besides, I tend to get rid of tasks or write programs before I consider paying people to do things, so that tends to get in the way of delegation experiments. I find it more difficult to give instructions to people than to computers.

2015-02-03 Delegation and dreaming small dreams -- index card #delegation

2015-02-03 Delegation and dreaming small dreams – index card #delegation

I tried thinking about ways I want to improve my life at the moment, and how I might want to accelerate those improvements. Compared to my answers from 2013, my current ideas feel closer to where I am, less of a stretch.

2015-06-12a Questions to revisit -- index card #kaizen #experiment #delegation

2015-06-12a Questions to revisit – index card #kaizen #experiment #delegation

Considering various ideas, I catch myself thinking, “Well, that would be nice to experience/be/have and I can imagine being happy with that, but I can also imagine being happy without that.” I wondered whether that detachment came came out of avoidance or peace, and whether I wanted to tweak my balance of detachment and desire – ambition can also be quite a handy thing.

I know that a fuzzy brain dampens my ability to plan and anticipate. This is normal. I also know the fuzziness is temporary, so I’m not too worried about it. Still, I find it interesting to explore.

2015-06-12b Finding my own balance between desire and detachment -- index card #stoicism #philosophy #detachment #desire

2015-06-12b Finding my own balance between desire and detachment – index card #stoicism #philosophy #detachment #desire

2015-06-12c Exploring this distance -- index card #stoicism #philosophy #detachment #desire

2015-06-12c Exploring this distance – index card #stoicism #philosophy #detachment #desire

On reflection, I think it’s less about avoidance / running away from, and maybe more about not preferring something as much as I think I should. Consciously developing your preferences is an idea from Stoicism that I’d like to explore a little more.

2015-06-12d When I don't prefer something as much as I think I should -- index card #stoicism #philosophy #preference

2015-06-12d When I don’t prefer something as much as I think I should – index card #stoicism #philosophy #preference

“Should” is a funny word, anyway. I avoid using that word with other people, but I sometimes still slip up and use that word for myself. So maybe it’s more like I think it might be interesting if I had stronger, clearer preferences for things that were generally acknowledged to be good, but if I don’t, that’s more of an opportunity for learning than a personal failure.

In addition to general fuzziness, I think that gap happens when I have conflicting factors or motivations, and when I underestimate benefits or overestimate costs. I can untangle conflicting factors with reflection and honesty, even if sometimes that leads to uncomfortable realizations about my current self. I tend to overestimate costs more than I underestimate benefits, especially in terms of energy. In any case, my perception of one affects the other. I can work around this by giving things a shot, like the way skills often become more enjoyable the better you get at them.

Even when I have a good idea of the benefits and costs of different choices, sometimes it would be better for me to prefer things that have a lower short-term value than other things I could do.

A tangent: This might be pretty similar to how startups disrupt incumbent companies, actually. An incumbent company initially has lower marginal costs because of its investments. It would be more expensive for that company to shift to a new technology. On the other hand, a start-up doesn’t have those sunk costs, so it’s easier to invest in new technologies. Some startups succeed, getting to the point where they can beat the old technology in terms of return on investment. Other startups fail. But it’s hard to tell which is which until you try, so it makes sense to have a bunch of start-up-like experiments even in larger companies.

2015-06-12e Thinking about disrupting myself -- index card #experiment #disruption

2015-06-12e Thinking about disrupting myself – index card #experiment #disruption

So, what would it be like to use these tools to develop my preferences? There’s the slow evolution of my preferences through reflection and incremental improvement. At the same time, it might be interesting to mentally budget X% of my time for exploring things even if I feel a little meh about them: not just “Hell, yeah” or No, but also things I still feel mediocre at. (‘Cause you don’t get to awesome without being mediocre first!) Doing those small experiments to play with my understanding and preferences might even be easier during fuzzy times than during sharp times, since my opportunity costs are lower.

I might keep my goals and experiments a little close to myself at the moment, focusing on elimination and automation rather than delegation. Maybe I’ll branch out again when I have a little more brainspace to manage and train people, since I don’t want to get to the point where I resent other people because of the consequences of my own mediocrity in delegation. In the meantime, little by little, I’d like to get better at understanding my preferences, and maybe shifting them ever so slightly.

Weekly review: Week ending June 12, 2015

June 14, 2015 - Categories: review, weekly

It was a good week for small steps. I’ve been settling into a new daily routine: a little bit of code, a book, some thinking… In terms of code, I’ve been focusing on adding D3 visualizations and other smarts to my Angular+Node tracker. I’ve been reading about thinking and memory, and thinking about what I can build or practice in order to get better at those things. Overall, though, I continue to be taking it easy – letting go of more of my previous commitments, clearing the way for other experiments.

2015-06-14c Week ending 2015-06-12 -- index card #journal #weekly

output

Blog posts

Sketches

Link round-up

  • 5 reasons not to use your virtual assistant: the Amy scheduling AI looks interesting. It would be neat to check that out when it’s more open. Interesting approach (probably hybrid person+AI) and conversational interface. I wonder what I can build and use along those lines…

Focus areas and time review

  • Business (23.0h – 13%)
    • Earn (6.0h – 25% of Business)
      • Earn: E1: 1-2 days of consulting
      • Earn: E1: 1-2 days of consulting
    • Build (14.2h – 61% of Business)
      • Drawing (9.4h)
      • Paperwork (0.0h)
    • Connect (2.8h – 12% of Business)
  • Relationships (10.6h – 6%)
  • Discretionary – Productive (11.6h – 6%)
    • Emacs (0.7h – 0% of all)
      • Reschedule Emacs Lisp Development Tips episode with jwiegley
      • Announce Emacs Hangout 2015-06-17
      • Host Emacs Hangout
    • Writing (4.5h)
    • Get travis working again for quantified awesome
    • Call with new totals
  • Discretionary – Play (20.9h – 12%)
  • Personal routines (28.3h – 16%)
  • Unpaid work (14.5h – 8%)
  • Sleep (59.2h – 35% – average of 8.5 per day)

Providing values to functions in org-capture-templates

June 15, 2015 - Categories: emacs, org

Over at the Emacs StackExchange, Raam Dev asked how to define functions for org-capture-templates that could take arguments. For example, it would be useful to have a function that creates a Ledger entry for the specified account. Functions used in org-capture-templates can’t take any arguments, but you can use property lists instead. Here’s the answer I posted.

You can specify your own properties in the property list for the template, and then you can access those properties with plist-get and org-capture-plist. Here’s a brief example:

Here’s a brief example:

(defun my/expense-template ()
  (format "Hello world %s" (plist-get org-capture-plist :account)))
(setq org-capture-templates '(("x" "Test entry 1" plain
                               (file "~/tmp/test.txt")
                               (function my/expense-template)
                               :account "Account:Bank")
                              ("y" "Test entry 2" plain
                               (file "~/tmp/test.txt")
                               (function my/expense-template)
                               :account "Account:AnotherBank")))

I hope that helps!

Using your own Emacs Lisp functions in Org Mode table calculations: easier dosage totals

June 16, 2015 - Categories: emacs, org

UPDATE 2015-06-17: In the comments below, Will points out that if you use proper dates ([yyyy-mm-dd] instead of yyyy-mm-dd), Org will do the date arithmetic for you. Neato! Here’s what Will said:

Hi Sacha. Did you know you can do date arithmetic directly on org’s inactive or active timestamps? It can even give you an answer in fractional days if the time of day is different in the two timestamps:

| Start                  | End                    | Interval |
|------------------------+------------------------+----------|
| [2015-06-16 Tue]       | [2015-06-23 Tue]       |        7 |
| <2015-06-13 Sat>       | <2015-06-15 Mon>       |        2 |
| [2015-06-10 Wed 20:00] | [2015-06-17 Wed 08:00] |      6.5 |
#+TBLFM: $3=$2 - $1 

Here’s my previous convoluted way of doing things… =)
—-

I recently wrote about calculating how many doses you need to buy using an Org Mode table. On reflection, it’s easier and more flexible to do that calculation using an Emacs Lisp function instead of writing a function that processes and outputs entire tables.

First, we define a function that calculates the number of days between two dates, including the dates given. I put this in my Emacs config.

(defun my/org-days-between (start end)
  "Number of days between START and END.
This includes START and END."
  (1+ (- (calendar-absolute-from-gregorian (org-date-to-gregorian end))
         (calendar-absolute-from-gregorian (org-date-to-gregorian start)))))

Here’s the revised table. I moved the “Needed” column to the left of the medication type because this makes it much easier to read and confirm.

| Needed | Type         | Per day |      Start |        End | Stock |
|--------+--------------+---------+------------+------------+-------|
|     30 | Medication A |       2 | 2015-06-16 | 2015-06-30 |     0 |
|      2 | Medication B |     0.1 | 2015-06-16 | 2015-06-30 |   0.2 |
#+TBLFM: @[email protected]>$1='(ceiling (- (* (my/org-days-between $4 $5) (string-to-number $3)) (string-to-number $6)))

C-c C-c on the #+TBLFM: line updates the values in column 1.

@[email protected]>$1 means the cells from the second row (@2) to the last row (@>) in the first column ($1).  '  tells Org to evaluate the following expression as Emacs Lisp, substituting the values as specified ($4 is the fourth column’s value, etc.).

The table formula calculates the value of the first column (Needed) based on how many you need per day, the dates given (inclusive), and how much you already have in stock. It rounds numbers up by using the ceiling function.

Because this equation uses the values from each row, the start and end date must be filled in for all rows. To quickly duplicate values downwards, set org-table-copy-increment to nil, then use S-return (shift-return) in the table cell you want to copy. Keep typing S-return to copy more.

This treats the calculation inputs as strings, so I used string-to-number to convert some of them to numbers for multiplication and subtraction. If you were only dealing with numbers, you can convert them automatically by using the ;N flag, like this:

| Needed | Type         | Per day | Days | Stock |
|--------+--------------+---------+------+-------|
|      6 | Medication A |       2 |    3 |     0 |
|      1 | Medication B |     0.1 |    3 |   0.2 |
#+TBLFM: @[email protected]>$1='(ceiling (- (* $3 $4) $5)));N

Working with fragmented thoughts

June 17, 2015 - Categories: drawing, reflection, writing

Some days it’s hard to hold a single thought and dive deeper into it. Sometimes it’s because I get distracted by other shiny thoughts. Sometimes my interest peters out. Sometimes I bump into the limit of what I can think about on my own, without experiments or research.

I’ve come to really like the way index cards let me capture ideas that aren’t quite blog-post-sized. Technically, I haven’t drawn a physical index card since early February, but the digital index cards I draw are calibrated to that scale.

Still, some days it takes me a really long time to draw five index cards. I catch myself wondering if I’ve picked a good question. Sometimes it takes a while to find the next step in the thought. Sometimes it’s easier to let my attention drift to other things.

On the other hand, there are some days when my mind is overflowing with little thoughts. It’s pretty easy for me to switch to another index card, scribble down part of a thought, and then come back to it later.

2015-06-01e Fragmented writing and drawing -- index card #fuzzy #fatigue #writing #drawing #fragmentation

2015-06-01e Fragmented writing and drawing – index card #fuzzy #fatigue #writing #drawing #fragmentation

I’ve been figuring out a better way to work with fragmented thoughts. I tried flipping my habit by writing before drawing. Sometimes that’s a good way to clear my backlog, but sometimes it means I don’t get around to drawing.

Lately I’ve been experimenting with quickly capturing text fragments – a chunk even smaller than index cards. A few taps on my phone bring up a single-line prompt. Whatever I type into that dialog gets saved to a timestamped file named something like yyyy-mm-dd hh.mm timestamp - keyword.txt, and that’s synchronized over Dropbox to my computer. I have some code in Emacs to read those files and add them to a date-based outline, and I’ve included the code at the end of this blog post just in case it’s handy.

I’ve found myself capturing more and more of these snippets these days. When a possibly interesting thought occurs to me while I’m walking around, it’s easy enough to take a moment to unlock my phone and add a note. My Emacs-based workflow fits me a bit better than the Evernote-based one I used to use, but that’s the benefit of customization.

2015-05-24e Working with surface thoughts -- index card #fuzzy #drawing #thinking

2015-05-24e Working with surface thoughts – index card #fuzzy #drawing #thinking

There’s still the challenge of bringing those thoughts together, of course. The text titles and fragment keywords are often enough to remind me of what I was thinking and how the different thoughts might be connected to each other, and I can always open the sketches in a new window if I want to refer to them. I have an ever-growing outline of sketches that haven’t yet been chunked into blog posts, and now I have a chronological tree of these little fragments. I have another bit of Emacs Lisp that lets me quickly get a montage of the sketches listed in part of my outline. Maybe I could use that more often – perhaps even randomly picking an outline node, coming up with a montage, and prompting me to either glue the chunks together into a blog post or draw whatever’s missing.

So this is what the index card workflow looks like as a whole:

2015-05-08b My index card management system -- index card #zettelkasten #workflow #index-cards #drawing

2015-05-08b My index card management system – index card #zettelkasten #workflow #index-cards #drawing

and then the text fragments feed into the beginning of that thinking process.

It’s been almost six months of thinking with index cards. I sometimes feel pretty fragmented, but there are confounding factors so I don’t know whether that’s a side-effect of this way of thinking. But I think it’s unlikely that my past self was that much more coherent and better at concentrating. Remembering what it was like to write my notes before and what it’s like to write my notes now, I think I like this way a lot. I feel like I’m getting better at writing about the small things, not just the big things, and I’m gradually getting better at tying things together.

What might be some interesting next steps for this system?

2015-06-12h 6-month reflection on index cards -- index card #index-cards #drawing #zettelkasten #chunking

2015-06-12h 6-month reflection on index cards – index card #index-cards #drawing #zettelkasten #chunking

It might be cool to visualize how much has been chunked and what’s still isolated, in a way that’s more engaging than my outline. I’m also curious about the time separation of thoughts. For example, this post brings together four cards spread over a little more than a month, a set of connections I probably wouldn’t have been able to follow without these notes.

The fragment code I mentioned:

(defun my/read-phone-entries ()
  "Copy phone data to a summary Org file."
  (interactive)
  (mapc
   (lambda (filename)
     (let ((base (file-name-base filename)) contents timestamp category encoded-time date)
       (when (string-match "^[^ ]+ [^ ]+ \\([^ ]+\\) - \\(.*\\)" base)
         (setq time (seconds-to-time (/ (string-to-number (match-string 1 base)) 1000))
               encoded-time (decode-time time)
               date (list (elt encoded-time 4) (elt encoded-time 3) (elt encoded-time 5))
               category (match-string 2 base))
         (with-temp-buffer
           (insert-file-contents filename)
           (setq contents (s-trim (buffer-string))))
         (with-current-buffer
             (find-file "~/dropbox/tasker/summary.txt")
           (org-datetree-find-date-create date)
           (unless (save-excursion (re-search-forward (regexp-quote base) nil t))
             (goto-char (line-end-position))
             (insert "\n")
             (insert "**** " contents "  :" category ":\n" base "\n")
             (insert (format-time-string "[%Y-%m-%d %a %H:%M]\n" time))

             (if (member category '("Think" "Do"))
                 (save-excursion
                   (org-back-to-heading t)
                   (if (looking-at org-outline-regexp) (goto-char (1- (match-end 0))))
                   (unless (looking-at org-todo-regexp)
                     (org-todo "TODO"))))
             (if (string-match "^Energy \\([0-9]\\)" contents)
                 (org-set-property "ENERGY" (match-string 1 contents)))))
         (delete-file filename))))
   (directory-files "~/dropbox/tasker/data" t "\\.txt$")))

Finding missing dates in PostgreSQL

June 18, 2015 - Categories: geek

My analytics numbers were way off from what I expected them to be. When I did a day-by-day comparison of my numbers and the reference set of numbers, I realized that a few weeks of data were missing from the year of data I was analyzing – a couple of days here, two weeks there, and so on. I manually identified the missing dates so that I could backfill the data. Since this was the second time I ran into that problem, though, I realized I needed a better way to catch this error and identify gaps.

Initially, I verified the number of days in my PostgreSQL database table with a SQL statement along the lines of:

SELECT year, month, COUNT(*) AS num_days FROM
(SELECT date_part('year', day_ts) AS year,
 date_part('month', day_ts) AS month,
 day_ts FROM (SELECT DISTINCT day_ts FROM table_with_data) AS temp) AS temp2
ORDER BY year, month

I checked each row to see if it matched the number of days in the month.

It turns out there’s an even better way to look for missing dates. PostgreSQL has a generate_sequence command, so you can do something like this:

SELECT missing_date
FROM generate_series('2015-01-01'::date, CURRENT_DATE - INTERVAL '1 day') missing_date
WHERE missing_date NOT IN (SELECT DISTINCT day_ts FROM table_with_data)
ORDER BY missing_date

Neat, huh?

Moving past getting things done

June 19, 2015 - Categories: experiment, reflection

2015-06-19a Moving past getting things done -- index card #present #mindset #being

2015-06-19a Moving past getting things done – index card #present #mindset #being

When I have a lot of energy, it’s easy to do good things for my consulting clients or on my personal projects. This energizes me further, and so on. This is a good cycle.

When I’m feeling blah, or when I don’t feel like I’m accomplishing interesting things, I tend to feel even more blah – even if I know that the difficulties are temporary, local, and impersonal.

I realized that my feelings about my days tend to be influenced by whether I made progress. This makes sense; there’s even a book about it.

2015-01-07 Sketched Book - The Progress Principle - Using Small Wins to Ignite Joy, Engagement, and Creativity at Work - Teresa Amabile, Steven Kramer

2015-01-07 Sketched Book – The Progress Principle – Using Small Wins to Ignite Joy, Engagement, and Creativity at Work – Teresa Amabile, Steven Kramer

While it’s useful to be motivated by progress, I wonder if I can tweak my mind to get better at enjoying life even when it feels cyclic and mundane. Instead of noting just the new, non-routine tasks of the day, I could reflect on whether I’m getting better at routine stuff like self-care – to enjoy being, not just doing.

2015-06-19c The gap between who I am and who I wish I was -- index card #gap #mindset

2015-06-19c The gap between who I am and who I wish I was – index card #gap #mindset

I find it a little difficult to relax into this mindset, though. Part of me is pulled towards the satisfaction of making progress, and I find myself wishing I could be better at that. I could improve my skills. I could make things better at home. I could be more energetic. I could cover more ground.

2015-06-19d Maybe the delta is okay -- index card #gap #mindset

2015-06-19d Maybe the delta is okay – index card #gap #mindset

But then again, maybe the outcomes of this hypothetical self and my current self are not that different. Sure, it would be nice to make all the progress a hypothetical me could make. But whatever’s important can be handled by other people, and whatever’s not important isn’t worth stressing out over. Besides, this path can also be interesting.

So, back to this curious thought. What’s beyond getting things done? I’m learning things that are hard to check off a list: how to forget annoyances and frustrations, how to enjoy ripe fruits and sunshine, how to listen to the moment and the silence. How to embrace squirrel-brain, fuzzy-brain, and foggy-brain, and how to gently fan a spark of interest.

It will be worth it, I think, learning how to sit still. “Don’t just do something, sit there!”, as the flipped phrase go.

When the check-things-off part of myself gets antsy, I code or read for an hour or so. Once it’s satisfied, I explore things with payoffs that are less straightforward.

Another thing I used to be antsier about: The thought “Will I ask good-enough questions? Will I think good-enough thoughts?” intrudes less and less these days. I trust that when I sit down to draw, I’ll notice something I want to explore; and if not, it might be a good time for a walk.

2015-05-10d The best thing I can do with my time -- index card #experiment

2015-05-10d The best thing I can do with my time – index card #experiment

It might be interesting to decide, even if it’s temporary and on faith, that this is the best thing I can do with my time.

2015-06-15g Re-evaluating my experiment failure mode -- index card #experiment #failure #equanimity #premortem #narrative

2015-06-15g Re-evaluating my experiment failure mode – index card #experiment #failure #equanimity #premortem #narrative

On a larger scale, I might even become comfortable with this as the general flavour of my experiment. In the beginning, I identified “5 years and nothing to show for it, not even a good story” as one of my potential issues in my experiment pre-mortem. I feel myself starting to let go of the need for a neat story.

Getting things done is good. There are also other things that are good. I wonder what it’s like to live an awesome life, or better yet: live a life awesomely.

Weekly review: Week ending June 19, 2015

June 21, 2015 - Categories: review, weekly

I haven’t edited the Emacs Hangout video yet, but I should get around to that sometime this week. Aside from that, the week has been pretty low-key. W- and I picked up LEGO Jurassic World (PS3 and PS Vita) and have been playing it. Galumphing around as a triceratops or smashing things up as a T-rex is surprisingly satisfying.

2015-06-22a Week ending 2015-06-19 -- index card #journal #weekly output

Blog posts

Sketches

Focus areas and time review

  • Business (25.2h – 14%)
    • Earn (9.1h – 36% of Business)
      • Earn: E1: 1-2 days of consulting
    • Build (16.0h – 63% of Business)
      • Drawing (7.7h)
      • Paperwork (1.3h)
      • Amazon search and replace
    • Connect (0.0h – 0% of Business)
      • Chat with Philip C about Quantified Awesome
  • Relationships (8.9h – 5%)
    • Call with new totals
    • Meet M
  • Discretionary – Productive (7.1h – 4%)
    • Emacs (2.3h – 1% of all)
      • Announce Emacs Hangout 2015-06-17
      • Host Emacs Hangout
      • Edit Emacs Hangout video to blur avy-jump demo
    • Writing (2.7h)
    • Add a summary bar chart of category totals
    • Get grunt working again
    • Add history to refiling
    • Add Jurassic Park to my tracker
    • fix sleep track activity
    • fix categories so that it returns empty ones too
    • Convert icicle chart into a sunburst
    • Switch to hierarchical bar chart
    • Add time filter to date
  • Discretionary – Play (22.3h – 13%)
  • Personal routines (27.2h – 16%)
  • Unpaid work (14.6h – 8%)
  • Sleep (62.7h – 37% – average of 9.0 per day)

Past, present, and future

June 22, 2015 - Categories: reflection

It’s moving more slowly than I might like, but I’m learning how to live in the present. I spend a little more time in the future than I probably should and I’m less comfortable in the past than I’d like to be, but those can wait.

2015-06-15e Past-present-future balance -- index card #balance

2015-06-15e Past-present-future balance – index card #balance

I tend to do a lot of planning and anticipation: rough sketches of just-in-case scenarios, extrapolations of ideas and potential decisions. There’s a lot of waiting for some experiments, too. Can’t rush the seeds growing in the garden, can’t accelerate the learning, can’t jump ahead to see the results.

In a sense, I could, if I let the time in between blur instead of slowing it down even more with experiences and reflections. I get the sense that “passing time” is what leads to people waking up and wonder where their life went, though. Better to kick off more parallel experiments and explore more questions.

I’m making myself keep a list of things that I’m not thinking about yet: things that are too far-off or uncertain, things that are waiting for other things. It’s tempting to spend time thinking about those things – that seems more useful than simply playing games – but it can be counterproductive.

Better to live each moment, then, even if it makes life feel slow, too. It’s good to learn how to be, instead of just distracting myself with juggling as many plans as I can.

What is it like? Napping when I’m sleepy, eating when I’m hungry, cooking for the joy of it, reading for pleasure, even playing games. Stretching out on the deck in the sunlight. Enjoying the seedlings for what they are, instead of wondering if they’ll make it all the way to becoming vegetables in a garden of caterpillars and squirrels. This present will pass, too, so I may as well enjoy it.

Besides, the present might be all I have someday, when the future is short and the past is fuzzy. Might as well learn how to live it!

Notes from helping with physics

June 23, 2015 - Categories: teaching

J-‘s final exams were last week. We’d been helping her review physics, since she was okay with her other subjects. She solved many of the review questions on her own, and then asked us for help with the ones she didn’t know how to do. I was surprised to discover that I remembered enough of kinematics and other topics to be helpful (and to enjoy helping). Yay! =)

We walked her through solving the problems that stumped her. Lots of math and science problem solving is about pattern recognition: seeing how the problem you’re working on is similar to other things you’ve already done (possibly with help), and adapting your experience to the current situation. Having someone sketch out a map and provide quick feedback can make studying a much more productive and less frustrating experience.

Here are some notes on the sub-skills involved:

2015-06-15b Notes from helping with physics -- index card #physics #math #tutoring #j- #family #science #teaching #school

2015-06-15b Notes from helping with physics – index card #physics #math #tutoring #j- #family #science #teaching #school

Algebra’s a big one. I’m not sure how you can develop fluency in that aside from practice and different ways of exploring it. Practising this seems pretty low on the priority list once homework’s finished and even lower priority during vacations. On the other hand, it’s hard to cram understanding when the pressure’s on. I think either John Mighton’s The End of Ignorance or The Myth of Ability had some tips on helping people develop a more intuitive understanding of algebra.

On a related note, there’s also the challenge of translating a word problem into the appropriate math, especially when multiple parts or equations are involved. Maybe we can think out loud more often, modeling the real-world applications of this skill.

There are the usual small mistakes related to doublechecking one’s work or getting the units straight, but she’ll get the hang of that.

J- will be taking more physics, chemistry, and biology next term, so it might be good to do a bit of this review during the summer. In general, I get the impression that she’s doing pretty well, especially compared with the rest of her class.

Summer

June 24, 2015 - Categories: canada, life

It definitely feels like summer here. Not quite the dog days yet – there’s still a touch of coolness in the air – but sunshine and warmth, hello!

2015-06-24a Summer -- index card #summer #seasons

2015-06-24a Summer – index card #summer #seasons

On my walks, I often play with superimposing my memories of other seasons on the present. I look at the leafy trees and remember their stark branches, or the buds, or the colours. I feel the breeze slip through my sandals and think of the clomping of winter boots, the security of wellingtons. And then I think of the colour and the warmth and the sun of the present, and I bring all those things together. It’s an interesting thought exercise that makes things even more vibrant. The practice helps me make winters a little bit better too, when I carry the memories of heat and vibrant colours with me.

2015-06-24b What do I want to tweak this summer -- index card #summer #seasons

2015-06-24b What do I want to tweak this summer – index card #summer #seasons

I’ll have only so many summers, after all, so maybe I can learn how to fully enjoy them. I wonder what I’ll tweak this time around. Maybe I’ll focus on eating more fruits and vegetables. I’ve been treating myself to yummy fruits on sale, and sometimes even when they’re regular-price: strawberries, nectarines, peaches… Soon it’ll be time for corn on the cob, then melons.

More sitting in the sunshine or shade, too, with friends or solo. Last year I said yes to more time hanging out in parks, and that was quite enjoyable. =) I wonder if any of the cats will put up with being in a harness if that means they’ll get to sun themselves on the deck…

Weekly review: Week ending June 26, 2015

June 29, 2015 - Categories: review, weekly

Lots of sleep this week, and few blog posts in the pipeline. On the plus side, I did manage to get a little coding in – learning how to use BlueMix on one hand, and making an edit-in-place grocery receipt interface on the other. Oh, and SketchUp!

2015-07-02b Week ending 2015-06-26 -- index card #journal #weekly

output

2015-07-02b Week ending 2015-06-26 – index card #journal #weekly

Blog posts

Sketches

Focus areas and time review

  • Business (21.7h – 12%)
    • Earn (11.3h – 51% of Business)
      • Earn: E1: 1-2 days of consulting
      • BlueMix training
    • Build (10.4h – 48% of Business)
      • Drawing (4.6h)
      • Paperwork (0.0h)
    • Connect (0.0h – 0% of Business)
  • Relationships (11.1h – 6%)
    • Check on P
  • Discretionary – Productive (4.0h – 2%)
    • Emacs (0.3h – 0% of all)
      • Edit Emacs Hangout video to blur avy-jump demo
    • Organize photos
    • Make better interface for cleaning grocery data
    • Return friendly name in JSON
    • Get data input working again
    • CAD a ramp for the shed
    • Figure out how to run Jasmine tests
    • Get data types management working
    • Writing (1.0h)
  • Discretionary – Play (27.0h – 16%)
  • Personal routines (18.7h – 11%)
  • Unpaid work (11.7h – 6%)
  • Sleep (73.8h – 43% – average of 10.5 per day)

Emacs Hangout June 2015

June 30, 2015 - Categories: emacs

Times may be off by a little bit, sorry!

Boo, I accidentally browsed in the Hangouts window before copying the text chat, so no copy of the text chat this time… =|