Category Archives: geek

On this page:

Rethinking my time categories: the blurring of business and discretionary activities

I track my time with medium-level categories (not detailed enough that I’m tracking individual tasks, but not so high level that it’s hard to make sense of the data). From time to time, I notice categories drift, or they stop fitting. Consulting is definitely business, but does working on Emacs really belong there? Why is coding classified under business but writing is classified as discretionary time? Most of my categories still make sense a year or two later, but some of them could use more thinking about.

What is business, anyway? I suppose it can include anything related to the earning of money, including support such as paperwork or delegation. Packaging (by which I mean creating e-books and other resources) is part of business, since I earn a small income from that (and pay taxes on it, too!). So is responding to e-mail. Technically, Emacs is related to money, because people have actually booked and paid me for help sessions online (http://sachachua.com/help). I consider programming-related activities to be part of maintaining my technical skills and network. In that sense, coding, web development, system administration, and other geek things are business-related. I distinguish between sketchnoting for client engagements and drawing on my own. Many of my drawings are more along the lines of personal or business planning. Perhaps I should track more under those categories now that I’ve established drawing as a way of thinking, and shift to using “Business – Drawing” when I’m specifically working on illustrations or improving skills.

Discretionary time includes the stuff I do just for fun and the things I learn about just because (Latin and Morse, for example). Probably the only weird thing in here is that I classify writing as discretionary time. It’s fun. Coding is fun too. Coding is more obviously valued, though, so I guess that’s why I consider it business time. And also, if I classify writing as coding time, I’ll tip over way too often into the “working too many hours a week” zone, when I’m not really doing so.

Maybe a better approach is to classify coding, drawing, and other fun things as discretionary time instead, even if they occasionally result in money. Benefit: I get to celebrate having more discretionary time and a lighter workload. (Yeah, it’s all mental anyway…)

Or maybe I need to take a step back and ask myself what kinds of questions I want to be able to answer with my categorical data.

In general, I want to make sure I don’t spend too much time working, because I want to force myself to work on my own projects. That’s why I track the time spent consulting, doing paperwork, and connecting with people (including responding to e-mail). I usually keep a close eye on my Business – Earn subcategory, since that’s the one that can creep up on me unawares. That’s fine with my current categories.

I also want to look for patterns in time use. How does spending more time on one activity (and less time on other activities) influence what I do and how I feel? How bursty am I when it comes to different discretionary projects? As long as I’m tracking at the subcategory level, it doesn’t really matter what the root category is.

Hmm. Since I’m not actually using the distinction between discretionary and business for reports or visualizations that nudge my behaviour, I can probably leave my categories alone if I remind myself that those ones have fuzzy boundaries. It would matter more if I wanted to set goals for investing X hours a week on business things (or, conversely, spending Y hours on discretionary non-business related things, which is oddly harder). Since I don’t care about that at the moment, I’m fine. Also, it’s easy enough to reassign the parent categories, so I still leave the door open for analyses at a later date.

As long as I can keep things clear enough in my head so that I feel confident that I can explain to any auditors that yes, my  business expenses make sense, I should be fine. I feel a little weird about not having a proper business plan for lots of things I’m working on. I mean, I can write them (or draw business model canvasses, more likely), but I prefer this pay-what-you-want model. Oh, hey, there’s an assumption there that I can dig into. People can (and do!) build metrics around freemium or pay-what-you-want models. Maybe I can figure out how to approach this in a business-like-but-still-generous way.

What would a more business-y way look like? I would float an idea to see if it’s useful. Then I would make stuff (and sometimes I’d make it anyway, just because). I might actually track conversions, and try things out, and reach out to people and communities. I’d publish little guides and videos, and maybe add a tip jar for smaller pieces of content so that people can “vote” for things they like more.

All things to do in due course. In the meantime, knowing that the path is there means I can leave all of this stuff still filed under the Business category, because it is. Even if it’s fun. Writing still feels more discretionary than business-y (even posts like this, for example), so I’ll leave that where it is. So no change, but I understand things better.

Do you track your time and have fuzzy boundaries between categories? How do you deal with it?

 

 

Emacs Chat: Tom Marble

Emacs Chat: Tom Marble – Invoicing with Org and LaTeX; Clojure

Guest: Tom Marble

Tom Marble’s doing this pretty nifty thing with Org Mode, time tracking, LaTeX, and invoice generation. Also, Clojure + Emacs, and other good things. Enjoy!

For the event page, you may click here.

Want just the audio? Get it from archive.org: MP3

Check out Emacs Chat for more interviews like this. Got a story to tell about how you learned about or how you use Emacs? Get in touch!

Raspberry Pi LitterBox Cam and quantified cats

We have three cats. One of our cats occasionally poops outside the litter box. We had our suspicions, but we couldn’t pin down who or why. Territorial issues? Finickiness about box hygiene? Sickness? Fear or surprise? What could we do to reduce the frequency of incidents?

We decided that a litter box webcam was an excellent first project for the Raspberry Pi computer that W- just bought. The Pi is a tiny, quiet, inexpensive Linux server. My webcam worked without hassles, and Motion was easy to set up for motion detection. We set it up to capture videos when the computer detected motion. I watched the videos and encoded the data, tracking which cat and which litter box. I figured that exploring this would be a good excuse to work with the Pi and learn a little more about computer vision.

2014-03-24 Litter Box Cam with Raspberry Pi #raspberry #cats

2014-03-24 Litter Box Cam with Raspberry Pi #raspberry #cats

You might think that watching litter box videos would be boring and somewhat icky. It was surprisingly informative. I had no idea that Luke sniffed so many litter boxes before settling on one. Leia usually checked out one or two boxes before doing her thing, but if all the other boxes were used (even if one of them was used only by her), she sniffed everything and then circled around in indecision before finally pooping in the middle of the basement floor. (Watching her try everything made me feel somewhat better.) The two cats cover, but Neko never does. (Territorial dominance marker by the smallest cat?)

We collected a week of baseline data, which showed that box 1 was twice as popular as box 4 and 5. W- hypothesized that it was because box 4 and box 5 were near the furnace, and the strange noises from the furnace might startle the cats occasionally. Leia pooped outside the box twice, both times sniffing all the boxes before going in the middle.

We took to calling Leia our little data-generator.

2014-03-29 Litterbox analysis #quantified

2014-03-29 Litterbox analysis #quantified

Since the cats often left a little bit of extra food in their bowls and the vet had suggested they needed less food or more exercise, we decided to try reducing the amount of food we gave them. That change seems to be going well.

We also moved box 5 closer to box 1. That led to box 5 being much more popular than it used to be, which was a pleasant surprise. If Leia likes box 5 a lot more now that it’s away from the furnace, maybe it’ll be easier for her to find a clean box to poop in.

Preliminary cat litter box results

Preliminary cat litter box results

We set the camera up to capture 2 frames per second in order to save space. Watching it in real-time eventually lost its novelty, so I looked up how to speed up the AVIs.

for FILE in video-*.avi; do
  if [ ! -f "fast-$FILE" ]; then
    ffmpeg -i $FILE -vf "setpts=0.10*PTS" -r 30 fast-$FILE
  fi
done

I also started looking into how to use SimpleCV for computer vision and image processing. I had a hard time getting SimpleCV set up in my Ubuntu virtual machine, but the Windows version worked fine after a lengthy install process on my computer. After much learning, I figured out how to identify changed areas, get the largest share over a certain area threshold, find the centroid of that shape, and plot it back on the image. The real challenge is figuring out some kind of visual output that makes sense to me when I look at it. The image below is a step in the right direction, but it’s still not quite what I need.

summary-113-20140329224621-00

The Raspberry Pi camera module arrived, so we swapped that in and eventually got everything working again after some SD/power-related grumbling.

It would be great if I could get Python to automatically figure out which cat is in the video, distinguishing between multiple cats and flagging it for manual review if the motion detection got confused. Even better if it can track the path that the cats take!

On the other hand, the speeded-up AVIs are now fast enough that the bottleneck isn’t waiting for the video to play, it’s me typing in the description of the path (since I track not only the litter box they use, but any other litter boxes they check along the way). Maybe this is fine.

While watching me encode data, W- said, “Isn’t this something you can have your assistants do?” It’s data entry, sure, but I feel embarrassed about assigning people to watch our cats poop. <laugh> Besides, I’m learning a lot from the encoding process. We’ll probably treat it as a time-limited experiment.

Pretty cool! =) Next steps: Collect more data, try more experimental changes, learn more about image processing…

Anticipated questions/responses:

  • That’s so geeky. You’re weird. Yup.
  • You have too much time on your hands. I like spending my time learning things, and getting better at computer vision and data analysis will come in handy. =) Better than watching TV or reading forgettable things. (See also: Too much time on her hands)
  • Just get a self-cleaning litter box. We got a Litter Robot because that was the best-reviewed of the self-cleaning litter boxes, but only Neko likes using it. We’re not into fancy litter boxes that require cartridges or special litter. It’s hard to tell if Leia will take to a new automated litter box, and returns/refunds for used litter boxes would be a bit weird. We can probably figure out something that works with our current setup, or maybe with an additional regular litter box. We still need to clean daily anyway, so it makes sense to try low-cost approaches first.
  • How about tracking both input and output? Too much work at the moment, and not enough interest in the data. (Weigh the food bowls? Weigh the boxes? Distinguish between cats?)
  • What about rigging up an automated water sprayer / Nerf gun to fire when cats poo outside the litter box? That will just make them poop outside the furnace room. It’s much easier to clean the furnace room than the carpet, so if they’re going to poop outside the litter box, that’s as good a place as any. We don’t want them to get any negative associations.

Emacs Chat: Iannis Zannos – Emacs and SuperCollider

Emacs! Music! Iannis Zannos shares how Emacs can be used for all sorts of awesomeness with Org Mode and SuperCollider.

Check this event page for details and comments =)

Emacs Basics: Customizing Emacs

This entry is part 3 of 3 in the series Emacs Basics

Hello, I’m Sacha Chua, and this is an Emacs Basics video on customizing Emacs. Emacs is incredibly flexible. You can tweak it to do much more than you might expect from a text editor. This week, we’re going to focus on learning how to tweak Emacs with M-x customize and by editing ~/.emacs.d/init.el.


You can download the MP3 from Archive.org

Customize

You can change tons of options through the built-in customization interface. Explore the options by typing M-x customize. Remember, that’s Alt-x if you’re using a PC keyboard and Option-x if you’re on a Mac. So for me, that’s Alt-x customize <Enter>. In the future, I’ll just refer to this as the Meta key, so remember which key is equivalent to Meta on your keyboard. (Review – Emacs Basics: Call commands by name with M-x)

After you run M-x customize, you’ll see different groups of options. Click on the links to explore a group.

For example, people often want to change the backup directory setting. This is the setting that controls where the backup files (the files ending in ~) are created. You’ve probably noticed that they clutter your current directory by default. To change this setting, select the Files > Backup group. Look for the entry that says Backup Directory Alist. Click on the arrow, or move your point to the arrow and press <Enter>. Click on INS, or move your point to INS and press <Enter>. Fill it in as follows:

  • Regexp matching filename: .
  • Backup directory name: ~/.emacs.d/backups

Click on State and choose Save for future sessions. This will save your changes to ~/.emacs.d/init.el. When you’re done, type q to close the screen.

You can also jump straight to customizing a specific variable. For example, if you want to change the way Emacs handles case-sensitive search, you can use M-x customize-variable to set the case-fold-search variable. By default, case fold search is on, which means that searching for a lower-case “hello” will match an upper-case “HELLO” as well. If you would like to change this so that lowercase only matches lowercase and uppercase matches only uppercase, you can toggle this variable. I like leaving case fold search on because it’s more convenient for me. If you make lots of changes, you can use the Apply and Save button to save all the changes on your current screen.

Not sure what to customize? You can learn about options by browsing through M-x customize or reading the manual (Help > Read the Emacs Manual or M-x info-emacs-manual). You can also search for keywords using M-x customize-apropos.

~/.emacs.d/init.el

The Customize interface lets you change lots of options, but not everything can be changed through Customize. That’s where your Emacs configuration file comes in. This used to be a file called ~/.emacs in your home directory, and you’ll still come across lots of pages that refer to a .emacs file (or “dot emacs”). The new standard is to put configuration code in your ~/.emacs.d/init.el file, which you can create if it does not yet exist.

What goes into your ~/.emacs.d/init.el file? If you open it now, you’ll probably find the settings you saved using M-x customize. You can also call functions, set variables, and even override the way Emacs works. As you learn more about Emacs, you’ll probably find Emacs Lisp snippets on web pages and in manuals. For example, the Org manual includes the following lines:

(global-set-key "\C-cl" 'org-store-link)
(global-set-key "\C-cc" 'org-capture)
(global-set-key "\C-ca" 'org-agenda)
(global-set-key "\C-cb" 'org-iswitchb)

This code sets C-c l (that’s Control-c l) to run org-store-link, C-c c to run org-capture, C-c a to run org-agenda, and C-c b to run org-iswitchb. You can add those to the end of your ~/.emacs.d/init.el file. They’ll be loaded the next time you start Emacs. If you want to reload your ~/.emacs.d/init.el without restarting, use M-x eval-buffer.

Emacs Lisp may look strange. Don’t worry, you can get the hang of it even if you don’t think of yourself as a programmer. You can start by copying interesting snippets from other people’s configuration files. Start with small chunks instead of large ones, so you can test if things work the way you want them to. If you need help, StackOverflow and other Q&A resources may be useful.

As you experiment with configuring Emacs, you may run into mistakes or errors. You can find out whether it’s a problem with Emacs or with your configuration by loading Emacs with emacs -Q, which skips your configuration. If Emacs works fine with your configuration, check your ~/.emacs.d/init.el to see which code messed things up. You can comment out regions by selecting them and using M-x comment-region. That way, they won’t be evaluated when you start Emacs. You can uncomment them with M-x uncomment-region.

Emacs gets even awesomer when you tailor it to the way you want to work. Enjoy customizing it!

More Emacs drawings: Dired, moving around

This entry is part 4 of 4 in the series A Visual Guide to Emacs

Dired is the Emacs directory editor. You can get to it with C-x C-f (find-file) if you specify a directory. C-x d (dired) works too. Dired makes it easy to do batch operations on files. One of the niftiest features that you might not even think of looking for, though, is the ability to make a Dired buffer editable using C-x C-q (dired-toggle-read-only). Then you can use replace-regexp, keyboard macros, and all sorts of other ways to change filenames. When you switch back out of editing mode with C-x C-q, the files will be updated.

Here’s a cheat sheet for working with Dired.

2014-02-24 Emacs tips - use Dired to manage files #dired #emacs

2014-02-24 Emacs tips – use Dired to manage files #dired #emacs

Also, bjonnh suggested making a cheat sheet for movement commands. I use the M-b, M-f, C-M-b, and C-M-f shortcuts a lot when working with Emacs Lisp. C-a and C-e are great too.

2014-02-27 Map for getting the hang of Emacs movement #emacs #map #guide

2014-02-27 Map for getting the hang of Emacs movement #emacs #map #guide

If you use evil-mode because you’re used to Vim shortcuts, this cheat sheet won’t be useful to you, but maybe I can make an evil-mode cheat sheet someday.

In other news, I’m slowly becoming the kind of person who can understand SmartParens. I’m getting the hang of slurp and barf, but the rest of it still boggles me. Someday!