fadedbluesky Can you be a polymath in a world of specialists?

Getting Things Done (or not)

Posted on April 14, 2012

Disclaimer: I haven't actually read the book by the above name. I've read about the book, I've read book summaries and blogs by people who follow it and collected some good ideas, but I'm not a believer. :-) I feel that way about most self-help books. In general I think that most self-help books have valuable ideas in them but I think it is self-destructive to be constantly remaking yourself in the image of the latest guru. This is still very much a work in progress.

Getting Things Done
Even though I've never read the book Getting Things Done I like to use the acronymn as a name for this ongoing project I have. I used to call it PIM (Personal Information Management) so some of my writing on the subject falls under that name. Another work that influenced me is Ordering Your Personal World. In the past I've tried solving this problem by designing and writing massive applications or little scripts. What I'm learning is that the important things are a simple, trusted system, an organized work space, and above all the discipline of keeping it up.

Software is a very alluring solution to the information management problems. It allows you to save it forever, search it, organize it, and rework it as much as you want. For me the big problems of software are the limited portability and the constrained interface. I've written a little todo.py program (in the vein of other todo.txt scripts) that I like but I started thinking of lots of new features that I didn't want to spend the time coding and about the same time I ran across taskwarrior. I am fortunate that my workload is not so high that I can't afford to experiment a little bit. I really tried to get into using Taskwarrior. I really like the interface and the simple features. What killed it for me was 1. I can't take it to meetings, 2. It's not as accessible as paper. I wound up with two lists, one in task warrior, one on paper. And actually a third in Outlook flagged messages. Task Warrior is the one I fell off with.

I've been using my work notebook for this. I've tried using my white board before too. But the problem I've always had is that I end up with offline lists and online lists. I want to reduce the number of lists that I have. My latest idea was to use a single unruled tear off pad. It sits in front of my desk for tasks that come from phone calls and I take it to meetings for tasks there. When I get ready to tear off a page (I NEVER fold a page over, this is a disposable pad) I meant to enter anything important into the computer. But this hasn't happened. What happened was the paper list was so convenient that it's the only one I use.

I will still have my green notebook for more permanent notes that need to be made and my graph paper for design notes. But those things go onto my shelf or into project notebooks. I would like to begin a regime of scanning project notebooks into the computer after a certain age since we have a nice auto feed scanner here at work. But again, hasn't happened yet.

Next time I intend to blog about my filing system.

Focus while on the Computer – Practical

Posted on April 7, 2012

My last post talked about how a computer's interface can affect our ability to focus on work. Of course to answer to this as to many productivity problems is discipline. But my hope was that perhaps these insights could lead to some interface design changes that will make computers more productivity friendly.

This time I'd like to share a few practical things I've found that help me greatly with focus:

1. Nothing on the desktop. When I sit down at the computer I want no information, no options presented to me. No clutter, no distractions. I take that moment of staring at a completely blank (or as blank as I can get it) screen to think in my mind, “What am I going to do? What programs and documents will I need?” I try to open those programs and no others.
2. A clean interface. I like to choose applications, and configure applications so that there are as few as possible distractions. I find information like tool bars and menus handy, but I don’t want them visible all the time. They make me feel distracted and as silly as that sounds feelings are a huge part of getting focused and motivated. So for example, I am currently writing this in a program called FocusWriter. It’s interface is completely hidden but available whenever I move the mouse to the edge of the screen. It’s nice, but it’s only save options are RTF and ODT. So I’m going to look for something similar that will save to TXT or LaTeX or something.
3. Full screen if you can help it.
4. No email notifications. I am 2x more productive when I can turn away from my computer and work on paper on the desk. My computer screen shuts off and I can ignore all those distractions. People might worry about missing important emails, but the reality is that if I schedule 1-3 half hour email sessions a day I can easily keep up with my correspondence. Adjust to fit your own work but realize that email is not real time communication. It’s asynchronous and people usually expect a response within a day. Not within minutes.
5. Same thing goes for compulsive internet checking. The temptation to shut down the brain and just accept input from the internet is very strong. It has an inexhaustible library of entertainment and educational options, but when they are a distraction from your real work you have to resist. Schedule a time for internet browsing and stick to it. Remind yourself, or keep a list even, “I’ll check that on my lunch break.” or something of that nature.

Discipline while working is hard work! What are some tricks you use to help yourself focus on the task at hand?

Computer Interface (Focus)

Posted on March 31, 2012

I got to thinking about kinds of tools the other day. Hand tools tend to be very specific, there is a limited set of things you can do them. A hammer for instance is only useful for a few simple tasks and the manual way you use it lends itself to those tasks. You hold a hammer by the handle, the head facing away from you, it is now naturally positioned to hit things with. Computers are not so. They are general purpose tools and for each of the gazillion things you can do with a computer you interface with them the exact same way. This leads to a certain amount of confusion when sitting down at the computer. You place your hands on the keyboard or mouse and what are you led to do? Your mouse might drift naturally to your most used shortcuts or hands type in your most used URL. You have been trained by habit and use to those things you most often do with a computer. For many of us those things are: check my email, check the latest news website and both of those things are productivity sink holes.

Modern computers are a type of “general purpose computing machine”. Meaning they are not built for a specific purpose. Now computers can be built for specific purposes: running games, video editing, web server, etc. But even these purpose built machines are still highly general. They can all run solitaire and a web browser, or an office suite.

Modern computers are also called “multitasking” machines. The idea being that they can run more than one program at a time. This is a great boon for productivity, supposedly. It certainly works well for computers. You can surf the web, have your email constantly checked and scanned for viruses while your computer performs a myriad of useful things in the background that you never know about like garbage collection, memory management, disk checking, etc, etc. But my personal experience, and repeated studies, show that multitasking is a productivity hit for people. Computers can store a nearly limitless amount of data, recall it instantly and perfectly, and perform the “context switch” required for switching tasks in much less than a second. We human type beings are not so. We forget stuff and take time to switch tracks or directions. Humans also have a gradual productivity increase that comes from focusing on a particular task over time.

What if your computer was designed to be specific in purpose, designed for one specific task and when you sat down at it you interfaced with it in such a way that it was obvious what you were supposed to be doing? What if it was built so that you never had the temptation of Alt-tabbing away from your work and checking Facebook? I wonder if the recent proliferation of smart phones and tablets could open up new kinds of interfaces for computers so that when we sit down at a keyboard we are conditioned to work, but when we sit on the couch with a slate we are ready to browse the internet?

Can you imagine how a computer interface could be changed so that it leads towards a more focused and productive time using it?

Powers of Two

Posted on November 20, 2011

One of the things that I have memorized that helps me with mental arithmetic are the powers of two. The reason it's helpful is often for a multiplying problem or a dividing problem, I can factor the twos out of the operands and treat them separately. The powers of two are fairly easy to memorize if you use computers very much because all kinds of things in computers tend to be powers of two. Screen resolutions, hard disk and memory chip sizes all are (usually) powers of two. If you use the binary number system at all then powers of two are just as important to know as powers of ten are in the decimal system.

Below are a list of powers of two. I recommend learning at least 0-16, 32, and 64. Those the most useful for computers. I've included approximate values for 32 and 64 since the cases where I would need the exact value I can usually look it up easily.

Place Value
0 1
1 2
2 4
3 8
4 16
5 32
6 64
7 128
8 256
9 512
10 1024
11 2048
12 4096
13 8192
14 16384
15 32768
16 65536
17 131072
18 262144
19 524288
20 1048576
32 ~4.3*10^{9}
64 18*10^{18}

I use these numbers a lot in programming. But they also help with many math problems.

Say you want to multiply 64 and 48. First factor the numbers.

64 = 2^6
48 = 2 * 24 = 2^2 * 12 = 2^3 * 6 = 2^4 * 3

To multiply add the exponents on the twos:
  2^6 * 2^4 * 3 = 2^{10} * 3
Because you memorized the powers of two you know that 2^10 is 1024. Multiplying 1024 by 3 is a bit easier than 64*48. I tend to think like this:
  1024*3 = 1000*3 + 24*3 = 3000 + 72 = 3072.

That is a bit of a contrived problem but consider this, you want to know how high a cliff is is. You toss a rock away from you, not up or down, and count the seconds until it hits the bottom. You know from physics that the acceleration, velocity, and position of the rock (on the vertical axis) is:

a = 32 ft/s^2
v = 32 * t ft/s
p = 16 * t^2 ft

See any powers of two in there? Say it takes 7 seconds.
You know the position of the rock after 7 seconds will be:
  p(7) = 16 * 7^2 = 2^4 * 49 = 2^3 * 98 = 2^2 * 196 = 2 * 392 = 784
Knowing the powers of two lets you easily factor even numbers. From there I find it easier to double numbers than other kinds of multiplication. With the above equations and the powers of two you can also calculate how fast the rock will be moving when it hits poor oblivious soul wandering on the trail below.


Posted on November 13, 2011

Often people say they can't memorize. I think the truth is they don't know how or don't want to. It's funny how some things are natural for people to remember, like movie lines or song lyrics. I think that everyone is capable of memorizing. The trick is to find out how your brain works. For some people they make memories best with songs or rhymes. Others need to be moving, if they can make hand motions for ideas and words they can remember them much better. Other people need to write it down. I am definitely an audio learner. I need to hear it and I need to say it to remember it.

There is also association. Your brain needs a framework to hang ideas on. You can't just dump all your ideas on the floor of your brain and expect to be able to find them later. Brains are like closets. You need a system of hangers and shelves to put things on so when you want an idea you can find it. You need to know how ideas connect and why they are relevant so that you can call them up later. My friend used this example: he described a journey where he visited 5 places that I was not familiar with and then asked me to repeat the names of the places he visited and in the same order. I couldn't do it. Then he described a similar journey using names of places I was familiar with. I was easily able to repeat the second journey because I had a mental map in my head that I could draw the journey on. I knew where the places were in relation to each other so the journey made sense to me. I knew he started in the west and went first east and then north. It was because I knew how the places related, I had a framework to put the journey on, that I could remember it.

Your memory is also very strongly associated with emotions. If you can associate a thing with a strong emotion you will remember it for a long time. I haven't tried this one with math myself. But I know the memories I have that are the strongest are times when I was angry or happy or embarrassed.

Mnemonics are another memory trick. For example Oscar had a hold on Arther is supposed to tell me something about the trig functions sine, cosine, and tangent.

Once you figure out how your brain works the only trick left is to practice and this is probably the hardest part for all of us. But there is no way around it. Memorization requires repetition. And not just in one sitting. You need to repeat the memorization process over days, months, and years to really get it down. If you don't use, you lose it. Like physical fitness if we want to retain mental fitness we must exercise.

Mental Arithmetic

Posted on November 6, 2011


When I was in school pocket sized solar calculators were very cheap. I thought I would never have to do math in my head. I could do it on paper. I could use a calculator. why would I ever need to know how to do math in head? Then I grew up. I found that there were cases when I didn't have paper, or a calculator, when I wanted to figure something out. There were the normal commerce things like how much of a discount is 10%? Or is 3 for 5 a better deal than 2 for 4? And also kind of nerdy things like, how high is the cliff? And construction things like, how long do I need to make the rafter if the slope is 3 to 1 and the building is 20' wide? So it turned out there were legitimate cases where I wanted to solve math problems in my head. Nuts.
Then I went to college. I found that there were people, one professor in particular, who could really show me up by solving complicated math problems (not really complicated but I thought they were then) in his head while I shuffled in my bag for my calculator. This annoyed me but I was prepared live as an inferior being who had better things to do than math in my head. That is until I started working. Now I work in a technical field, electrical engineering. And the people in my field who can accurately solve problems in their heads have a serious advantage in any debate. I can't check their numbers without a calculator. I don't even know if they are making it up! So that got under my skin and finally convinced me to knuckle down and learn to do some math in my head.

Since then I have practiced some calculations in my head and found it useful for figuring things out on the spot and in my work. But I have also found another benefit. Math trains your mind to work in different ways. Becoming familiar with mental arithmetic has helped me to think more analytically. I'm naturally a disorganized person and having math in my head has helped me to learn some discipline. And while that sounds dreadfully boring, it has given me more of an edge in life. I think it is part of what makes me successful in my decision making and part of what makes me more productive.


There are lots of tricks to doing math in your head. Many common problems have special algorithms that you can memorize and perform quickly in your head. But there are a few general things I want to cover first.

1. Memorize. Learning to do math in your head requires a good memory and I believe also helps your memory improve.
Basic arithmetic is largely about memorization. Your sums, multiplication tables, squares, special tricks, they all need to be remembered. This takes practice to get and practice to keep it up. I believe that learning to memorize can be dead useful in lots of aspects of life. For one thing you have to learn how your brain works. Does it help to make up a rhyme? a song? hand motions? Should you repeat it out loud or write it down? Once you figure out what works for your brain, you can use that technique all over the place to remember important stuff. One of my goals is to use what I've learned about my brain to remember people's names. Relationships are a huge part of being successful and of just being a good human being. Remembering names is job 1 for building relationships.

2. Ask other people how they do it. Often I have a hard time following someone else's technique. If someone is figuring out a math problem out loud my brain shuts down and I can't think and it's really hard to follow what they doing. But when I try hard to understand and ask questions I often find a new trick to doing a problem that I didn't know how to do before.

3. Practice. I've found doing math in my head to be a relaxing pastime when there is nothing else to do. Waiting in line, on a long drive, or flight, etc. I can usually find some interesting problem to work on like, how fast am I running? I assume the squares in the pavement are 4 feet long and I count how many I cross in 10 seconds. What is that in miles per hour? It's a great way to take your mind off things like how much your lungs hurt or how long the line is or how slow traffic is going.

Hopefully I've convinced you that learning to do math in your head can be a benefit to you in some area of your life. It will help your memory, your critical thinking and decision making and improve your overall mental health. Like exercise for the body, math is for the brain. In the coming weeks I will post about techniques for memorization, tricks for doing calculations in your head, and special kinds of problems that can seem impossible but actually have pretty easy algorithms.

Portable Cygwin part 2

Posted on October 31, 2011

Shortcuts to documents outside of cygwin
On my thumb drive I have several My Documents type folders in the root. The cygwin /home folder is buried down under util/cygwin/home/brian. So I wanted links for those document folders in my home directory when I start cygwin. This would normally be a good case for symbolic links to the /cygdrive/driveletter structure but since it's on a thumb drive I never am quite sure what drive letter I will be assigned when I plug in.

I have this bit of code in my cygwin.bat to figure out the drive letter:

for /F "usebackq" %%i in (`cd`) do SET CYGROOT=%%i
for /F "delims=\:" %%i in ("%CYGROOT%") do SET CYGDRV=%%i

I thought this was the only place I could get at the CYGDRV variable. So I first tried setting mount points in cygwin.bat like this:

mount %CYGDRV%:\\cur /home/brian/cur
mount %CYGDRV%:\\arc /home/brian/arc
mount %CYGDRV%:\\ref /home/brian/ref

The problem was this would only work for the second terminal I opened. I'm not sure why. But the mount points would only appear if I opened a second mintty while the first was still open. There may have been some trick to do with sleeping or backgrounding processes... but I found a more elegant solution. It turns out any variables declared in your cygwin.bat get ported into cygwin! In my .bashrc I added these lines:

mount $CYGDRV:/cur /home/brian/cur
mount $CYGDRV:/arc /home/brian/arc
mount $CYGDRV:/ref /home/brian/ref

And it works like a charm! I created some empty folders called cur, arc, and ref in /home/brian to suppress the warning that mount throws when they don't exist.

This creates some conveinent shortcuts to my documents inside my home directory and it will always work regardless of the drive letter assigned to my thumb drive. You might be wondering why I don't just keep the folders in my cygwin /home folder. The answer is because I don't always work from cygwin. Sometimes I want to access those files from windows explorer and then it's convenient to not have them buried under the cygwin file structure. I supposed I could have put them in /home/brian and then created shortcuts in the thumb drive root... but that wouldn't have really been nerdy enough.

My complete cygwin.bat is a bit messy but here it is:

rem @echo off

echo "Loading the amazing cygwin shell                    ^    /\"
echo "Your linux home away from home                     / \   /\"
echo "give it a minute.  It takes a while to load.   x  //\ \  ||"

rem This is really simple now that I know /usr/bin and /lib and done 
rem automagically based on the location of cygwin1.dll

for /F "usebackq" %%i in (`cd`) do SET CYGROOT=%%i
for /F "delims=\:" %%i in ("%CYGROOT%") do SET CYGDRV=%%i
cd \util\cygwin\bin

rem mount %CYGDRV%:\\cur /home/brian/cur
rem mount %CYGDRV%:\\arc /home/brian/arc
rem mount %CYGDRV%:\\ref /home/brian/ref

rem some different term emulators
rem rxvt -bg black -sl 8192 -fg white -sr -g 150x56 -fn "Fixedsys" -e /bin/bash -i
rem /usr/bin/bash --login -i
rem bash --login -i

start /b mintty -s 120,50 -

Making the console window close
The start /b thing starts mintty in the background allowing the console window to close.

Adding to the cygwin installation
Running setup.exe from my folder on the thumbdrive allows me to update the cygwin installation. I just have to be careful when selecting the install and local temporary folders. And watch out for drive letter changes.

Happy cygwinning!

Tagged as: , 4 Comments

Replace in files recursively

Posted on October 24, 2011

Here is a quick snippet to replace a string in multiple files.

find . -type f -exec sed -i 's/find/replace/g' {} \;

{} is a place holder for the current filename returned from find
the space after it is needed.
use -name "pattern"
or -not -name "pattern"
to filter the files.

find and sed are available on cygwin and most Linux/Unix systems.

Tagged as: , , No Comments

Portable Cygwin

Posted on October 17, 2011

Cygwin is emulates a POSIX/Linux environment on Windows. It has a collection of familiar Linux and Unix programs ported to run with it's DLLs on a Windows system. I use it a lot for things like grep, find, VIM, Python, mercurial, etc.

One of my recent efforts has been to develop a thumb drive with all my usual applications installed on it. The first thing I installed was PortablePython. It comes with the Python version of your choosing, PyScripter, and many useful third party libraries. I was also able to install additional libraries just by copying them into the Portable Python\App\Lib\site-packages folder.

The next thing I tackled was Cygwin. Below are a few links I found while doing research.
I used the cygwin.bat from thissite. The profile script did not work for me. But his suggestions to look at /etc/profile were invaluable as you will see later.
I tried using the package available here. But Setup.exe was way out of date so I couldn't update with new packages after it installed. This provides some help with fixing the PortableCygwin package. But I didn't end up using it.
This discussion and this one on the Portable Apps site provided a little help.
Some thorough instructions, including updating the cygwin terminal are here.

Cygwin is almost totally portable by itself. I was able to copy my installation from the c: drive to my usb and it worked! At least on the computer I started with... I updated the batch file from the above research to look like this:

for /F "usebackq" %%i in (`cd`) do SET CYGROOT=%%i
for /F "delims=\:" %%i in ("%CYGROOT%") do SET CYGDRV=%%i
cd \cygwin\bin

rem some different term emulators
rem rxvt -bg black -sl 8192 -fg white -sr -g 150x56 -fn "Fixedsys" -e 
rem /usr/bin/bash --login -i
rem bash --login -i

mintty -s 120,50 -

The paths for /usr/bin and /lib are set automagically based on the location of cygwin1.dll. So I removed the mount statements that some people recommended.

Cygwin will detect the Windows username and use it as the Cygwin user. This can cause problems because your home directory will change, creating a new one for each new user. Some programs will also be confused by the changing user.

Initially I changed /etc/profile and /etc/zprofile by replacing

USER="$(id -un)"



But my experience suggestes the USER variable doesn't affect the actual user shown by cygwin.

Cygwin comes with a script, mkpasswd, that will create passwd entries for the Windows users, possible all of them in the domain. In passwd replace the username field in the entry for your windows user with the chosen username. A Windows user is identified by it's SID. This is a string of numbers that is unique for different users, machines, and domains.

A very technical description is availabe here: Cygwin Users Guide - Using Windows Security.

On machines where your username is different you should be able to add a line to your passwd that links the SID to your chosen username. You will have multiple lines with the same cygwin username but different SIDs. This will make your username always display the same.

The real issue I was having was that I would always get a different /home folder. The HOME variable solves this problem.

I restored the original USER= line but left HOME=/home/myname I also left my modified passwd line for my Windows user. Then I plugged into a new computer and started cygwin. My user was shown as the new Windows user but the home directory was /home/myname. This has worked on the 3 computers I've tried it on. That should be acceptable so long as none of my programs have a problem with usernames mismatching. As mentioned above I think I could add a /etc/passwd line for the Windows users SID and remap them to myname. But I haven't tried it yet. hg will show my commits as different users but I don't think I mind. VIM and task warrior should work fine. I will update in the future if I make any changes.

Tagged as: , 4 Comments

Intro RS232 Serial

Posted on October 10, 2011

RS232 Serial standard has long been a very common method for communication between computers. It simplicity and reliability has kept it around even when more advanced standards such as USB and Ethernet have become available. The basic idea of RS232 serial is a single twisted pair of wires used for asynchronous data.

Below you will find a table of the common pinouts for RS232 cables.

	DB-25	DB-9	EIA-	Yost
G	7	5	4	4,5
PG	1	-	-	-
TD 	2	3	6	3
RD 	3	2	5	6
DTR 	20	4	3	2
DSR 	6	6	1	7
RTS 	4	7	8	1
CTS 	5	8	7	8
DCD 	8	1	2	7
RI	22	9	1	-

For most cases the important pins are RD, TD and G (ground). Both ends need a connected ground because it's used to give both ends the same reference voltage. Devices are called either a DTE or a DCE. Originally this designation was related to whether the device was a computer or a modem. Now-a-days it is fairly arbitrary. What you need to know is that if both devices are the same (DTE/DCE) you need to roll RD and TD. This is called a null-modem cable. RTS and CTS (Ready to send and Clear to send) are used for hardware handshaking. In a situation where you need a null modem and hardware handshaking you may need to roll RTS/CTS as well. You can also emulate hardware handshaking by connecting RTS and CTS together on each side of the cable.