18 May 2019

Finally Stable Caps to Ctrl Mapping

Over the years, I have tried so many ways on Linux to map Caps Lock to Ctrl:
  • Xorg config (that didn't work on a tty console)
  • Inputrc (really weird rules that depended on initial state)
  • Gnome keyboard config
Finally there is a stable way to remap Caps Lock to Ctrl.  It is relatively simple and it is at the lowest level in Linux.

Thanks to this page for all the details: https://wiki.archlinux.org/index.php/Map_scancodes_to_keycodes but it took a lot of effort to parse out what actually needed to be done.

Here is a distilled version:

0) Make sure Caps Lock is OFF

1) Create the following file:

/etc/udev/hwdb.d/10-caps-modifier.hwdb
---
evdev:atkbd:dmi:*            # built-in keyboard: match all AT keyboards for now
  KEYBOARD_KEY_3a=leftctrl   # bind capslock to leftctrl

2) Run  the following command:

$ systemd-hwdb update

3) Run the following command to make the remapping take immediate effect:

$ udevadm trigger

This was tested on Ubuntu 18.04.2 LTS running Xfce.  The remapping works great in tty consoles, and the X input system.

15 May 2019

Poem for Grandma

I wrote a poem for my Grandma for Mother's Day.

Years

For when along
the road you've come,
you pause,
to see the race,
how it was run.

The mornings when imaginations sang
The afternoons when, interrupting
work and sun, the lightning cracked.
Then came the rain.
The evenings when all work was done.

Some goals were met.
Some riches won.
Some people left.
And not just one.

And then you stood.
Alone.
Dismayed.

But through
this turn and
that meander,
we kept,
we stayed,
we held each other.

17 January 2019

Command The Computer

After hearing hype around machine learning eating up tech jobs, I've wondered if I just have my head in the ground about what kind of work I'm doing.  So far, I haven't seen a straightforward way to apply machine learning to my work goals.

However, today I realized I can start a mind shift toward my work that will be both more healthy for me personally, and will allow me to see opportunities for machine learning that I've been missing.

There are 4 main levels of work I can see:
  1. Initiative
  2. Project
  3. Task
  4. Micro-task
As an individual contributor or team lead, the aspects of the work are scoped down to levels 2-4.  Most of the opportunities I've seen for applying machine learning have been at the Initiative level, where statistical methods can be applied to solve novel problems or automate whole classes of new/existing work.

Now, imagine you already work at levels 2-4.  Imagine you have a computer with infinite intelligence.  Imagine that if you describe a piece of work that needs to be done down to the 80% level of precision, that this intelligent computer could get it done and take care of the details.  This is what I've found impossible to imagine in advance.

The best way I've found to imagine this is as follows:
  • do a Task the way I've always done it (level 3)
  • break the task up into atomic pieces by creating self-standing git commits as I go (one commit per level 4 Micro-task)
  • when I write each git commit, imagine that I had asked a computer to do what I just did
  • write the git commit in imperative form, as if I had commanded the computer to accomplish the work at the 80% level of precision
  • imagine that I had spent the last 30-60min doing something other than solving the problem, and ask myself, "What else would I have been able to do while the computer was spending 15-30min on this?"
This helps me wire up the neurons in my own brain to start thinking about the computer as an intelligent agent that can assist me.  And it helps me to imagine how I can use my attention and energy more effectively, rather than just solving micro-tasks all day.

It appears to me that applying machine learning effectively requires stepping back at least to the Project or Initiative level and delegating more work to an "intelligent" computer.  And if such an agent doesn't exist, perhaps it can be built.

In a weird sort of way, I'm starting to use the Tell, Don't Ask principle in my own thinking to enhance my ability to imagine solutions coming together more quickly.  I know that's taking the Law of Demeter way outside of its traditional scope.  But I'm trying to break out of the box here. ;)

If 2018 was a year I didn't write any blog posts, it was certainly a year of great personal growth.  I look forward to writing here more during 2019.

02 June 2017

Print selection only in Chrome

Maybe you already know about "Print selection only" in Chrome.  But it changed my life today.

I wanted to print only a part of a web page.  Usually, I tweak the pages but then it spans pages and it's confusing to get just the pages I want.  Or if I got desperate, I would copy/paste into a text editor and print that instead (after reformatting all the copy/paste noise away).  Instead of all that nonsense, I found a better way.

Here's how to do it:
  1. Select the text you want to print (in Chrome)
  2. Click Print (or press Ctrl-P or Cmd-P on Mac)
  3. Click "More Settings" in the Chrome print dialog
  4. Select the "Selection only" box
  5. Adjust "Scale" to get it on the right number of pages (1 page usually)
Then print and you can move on with your life.  I love how simple it is.  Hopefully you benefit from this.

30 May 2017

Intractable Problems

Getting into the state of mental flow leads to enjoyment for me.  Whether it's playing a lively game of Monopoly with my kids, or playing/coaching an engaging soccer match, or developing the next feature for FamilySearch -- all of the above activities are more enjoyable when I spend a lot of time in the state of mental flow.

There's a book about this, and I still would like to read it at some point.  But today's post is not primarily about flow.

There are times when I know that a state of mental flow is possible, and desirable, but I can't seem to enter that state.  Maybe I'm meaning to write in my journal but the thing I want to write about is an unresolved problem of some importance to me, and I go into immediate problem solving instead of writing about it.  Maybe I'm trying to get going on a project outside but I'm exhausted from not getting enough sleep the night before.  Maybe I'm attempting to learn something new at work and there is too much new all at once.

Today I realized that when I have problems entering the state of mental flow, it's because I'm stuck trying to solve intractable problems.  See https://en.wikipedia.org/wiki/Computational_complexity_theory

Here are a few "intractable" problems I've faced recently:

  • Which task would be most helpful for me to work on first this morning?
  • What is important to deal with after a trip, and what can be dropped?
  • Who can I get to help set up flags on Memorial Day?
  • How can I get uninterrupted time to spend with my wife?
  • What can I do to increase the likelihood of my son wanting to work with me outside?
The truth is the above problems are only "intractable" when attempted in a certain mental state that treats these decision problems as personal tasks.

Hint: It takes social skill & action to answer all of the above questions effectively.  And while the social skill can be learned, if you approach the above problems by thinking that they are personal tasks to be completed, they will by definition be intractable.

A useful word is "stall".  Some definitions, glosses, examples:

So when you feel yourself get into a stall, think what intractable problem you are trying to solve.  And if it's a problem that needs social skills to solve, reach out for help.  Figure out what skills you need to develop and improve your abilities.

03 May 2017

HELP: Happy, Evolving, Learning, Productive - Journaling template

Sometimes I go to write in my journal after lots has happened, and I find myself at a loss.  Too much has happened, I don't know what's important to record, it's all a jumble.  So I end up staring out the window and attempting a half-baked job of mentally processing things.

Here is a set of headings in an attempt to provide a skeleton for my journaling:
  • H: Happenings
  • E: Evolutions / Progress
  • L: Learnings
  • P: Plans
Or described more fully:
  • H: just neutral reporting on what random stuff has been going on
  • E: progress reports on things that have moved forward in some significant way in the last while
  • L: what you've recently learned that sticks out to you
  • P: what's coming up that has your attention
In an attempt at finding a mnemonic for HELP, I came up with the following:
  • H: Happy
  • E: Evolving
  • L: Learning
  • P: Productive
And here are some more detailed descriptions of the emotional states in the mnemonic:
  • H: just starting to write can keep you happier than not, see this post
  • E: highlighting progress, however small, turns into a sense of gratitude for me
  • L: seeing that I'm still learning is encouraging to me
  • P: putting rough plans on paper has a reassuring effect, and helps me move forward
Those adjectives have enough affinity to the headings that it might help me to remember them, and enough positive energy to help them to stick in my mind.