Growth, experiments, and shifting my preferences

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.

Thinking about problem-solving and sequencing

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!

Tweaking my daily routines for that feeling of progress

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…

Using Emacs Org Mode tables to calculate doses to buy

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

Adding calculations based on time to the Org Agenda clock report

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! =) )

Weekly review: Week ending June 5, 2015

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)