June 2011

VMWare, Samba, Eclipse, and XDebug: Mixing a virtual Linux environment with a Microsoft Windows development environment

June 1, 2011 - Categories: development, drupal, geek

I’m starting the second phase of a Drupal development project, which means I get to write about all sorts of geeky things again. Hooray! So I’m investing some time into improving my environment set-up, and taking notes along the way.

This time, I’m going to try developing code in Eclipse instead of Emacs, although I’ll dip into Emacs occasionally if I need to do anything involving keyboard macros or custom automation. Setting up a good Eclipse environment will help me use XDebug for line-by-line debugging. var_dump> can only take me so far, and I still haven’t figured out how to properly use XDebug under Emacs. Configuring Eclipse will also help me help my coworkers, who tend to not be big Emacs fans. (Sigh.)

So here’s my current setup:

I like this because it allows me to edit files in Microsoft Windows or in Linux, and I can use step-by-step debugging instead of relying on var_dump.

Setting up Samba

Samba allows you to share folders on the network. Edit your smb.conf (mine’s in /etc/samba/) and uncomment/edit the following lines:

security = user

[homes]
   comment = Home Directories
   browseable = no
   read only = no
   valid users = %S

You may also need to use smbpasswd to set the user’s password.

Xdebug

Install php5-xdebug or whatever the Xdebug package is for PHP on your system. Edit xdebug.ini (mine’s in /etc/php5/conf.d) and add the following lines to the end:

[Xdebug]
xdebug.remote_enable=on
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_autostart=1
xdebug.remote_connect_back=1

Warning: this allows debugging access from any computer that connects to it. Use this only on your development image. If you want to limit debugging access to a specific computer, remove the line that refers to remote_connect_back and replace it with this:

xdebug.remote_host=YOUR.IP.ADDRESS.HERE

Eclipse and PDT

I downloaded the all-in-one PHP Development Toolkit (PDT) from http://www.eclipse.org/pdt/, unpacked it, and imported my project. After struggling with Javascript and HTML validation, I ended up disabling most of those warnings. Then I set up a debug configuration that used Xdebug and the server in the VM image, and voila! Line by line debugging with the ability to look in variables. Hooray!

2011-05-31 Tue 17:37

Hungry hungry compost and other garden updates

June 1, 2011 - Categories: gardening

The compost bin chomps through imageall the organic material we give it. It’s nowhere near the smooth dark brown of finished compost yet, but when I turn it every week, my two full bins have mysteriously become two half-bins of compost. The Internet says it takes a ton of organic material (a literal ton, mind you) to make half a cubic yard of compost. To make two cubic yards of compost, then, you need about one Asian elephant’s weight in organic material. (Yes, I estimate tons in elephants, thanks to hanging out with my dad at the zoo.) So I’ll probably buy lots more cow manure (moo poo, as we call it) to amend the soil next year, instead of hoping that the compost bins will pull through quickly.

Other garden updates:

Casualties: a Thai basil plant, and the curry plant in front

I planted bok choi last weekend, and I planted some edamame today. We’re more likely to take the time and effort to cook the edamame than the string beans I grew the other year. =) I also sprinkled a lot of lettuce and spinach near the borders, where I pulled up the lilies of the valley. All those sprouts are coming up now that I’m home enough to keep the soil moist. (Note: Don’t plant lilies of the valley in your garden unless you mean it. They’re invasive and will take over. Ditto mint, which I keep in a pot.)

Pity it’s no longer dandelion season. We pulled up almost all of ours and ate them as salads. If we have more next year, I may host a party. We do have a berry tree out back that will be fun to harvest. We missed harvesting it last year, but we caught a lot of berries on a tarp the year before that. I think it would be a good combination with pastry cream, tart shells, maybe some powdered sugar on top. By that time, the tea garden should be growing quite well, too. Garden party! J- said her friends are excited about our tomatoes and peas, so we should have them over to harvest too. Mmm…

It’s Bike Month in Toronto!

June 2, 2011 - Categories: Uncategorized

imageWhile we don’t have anything like the awesome biking infrastructure of the Netherlands (oh, and all that flat land – envy!) or the widespread bikes-on-every-bus mixed commutes of Boulder, Toronto is still pretty decent when it comes to biking. June is Bike Month here, so there’ll be plenty of events coming up! It’s a good time to take to the road and explore routes I don’t normally pass. Here’s what I’m thinking of:

Not biking-related, but may still get me out of the house:

Anyone want to come along?

2011-05-31 Tue 17:53

Monthly reviews: April and May 2011

June 3, 2011 - Categories: monthly

Time flies! Travel throws me a little off track when it comes to reviewing, but that’s okay – I’m back on the ground and will probably stay home for at least the next little while.

Based on March’s plans:

Work

Relationships

Life

Mostly there, except for the driving bit! I may just register for classes again, or set up a training schedule with W- and stick with it. But it’s summer and I’d much rather bike than sit in a car. Excuses, excuses… =)

Here’s what went on in April and May:

April: Started learning Latin. Worked on Ruby on Rails project (yay!). Gave a presentation on training. Helped with math study group sessions. Sewed a dress.

May: Celebrated my sister’s wedding in the Netherlands! Wore the red dress I made. =D Started the garden. Deployed a PHP site and conducted training in Colorado. Started with community-supported agriculture. Shifted to eating lots of salad and vegetables. Lots of learning. Some sewing, too.

My favourite posts:

How do I want June to add to my life?

I’m looking forward to lots of gardening, lots of biking, and lots of fruits and vegetables. Some of my friends are getting married – hooray! Work is ramping up, too. Back on the development track, making useful websites… Yay!

Decision review: calendars, development, standing desks, toe shoes, Kindle, bike, CSA, Autodesk Sketchbook, blogging

June 4, 2011 - Categories: decision, kaizen, review

Calendar reminders on my Android: Working so far. I see the calendar reminders on my lock screen and on my home screen, so there are plenty of reminders. I’ve also started adding more events to my calendar, to increase the reward of checking it.

Test cases: Yes, for code’s sake, yes! I’m returning to a Drupal project after several months’ hiatus, and one of the first changes we’re making is extensive: changing a field to a taxonomy, changing lots of logic along the way, making sure all the forms work again… I am so glad I wrote a lot of tests covering the parts I wrote, and I only wish that I got all the other developers to do the same.

Laptop battery replacement: Replacing the battery on my tablet was a good idea. I’ve been getting tons of use out of it, particularly now that I’m back in development. Although W’s new tablet does look pretty tempting, I’m going to hold off buying new gadgets for a while.

Developer setup template: I added “Getting started notes” to our developer guide. Slowly getting there! And I’m glad to see that virtual-machine-based development is much easier now, too.

Standing desks: The kitchen counter is now my default standing desk. It’s well-lit, there are plenty of outlets near by, and I can easily refill my water glass or grab a snack.

Vibram toe shoes: Comfortable as anything, and then some. I prefer to wear these instead of my flats when I’m walking around the neighbourhood. W- still thinks they look funny, but that’s okay, he loves me anyway.

Kindle 3G: Awesome for looking up things on the go, and for occupying myself during subway rides. I’d still rather ride my bicycle than take the subway, but reading classic literature makes up for the fare and the missed opportunity for great exercise.

Folding bike/push scooter: Still haven’t taken the plunge. No local need to do so – I don’t mind saddling up my bike for short trips to the library or supermarket. No travel plans ahead, either.

Community-supported agriculture: We tried a bi-weekly spring share from Plan B Organic Farms, and that’s been working out well. I’ve been having salads I finished the last of the kale and the lettuce

Autodesk Sketchbook Pro: While using Autodesk Sketchbook Pro for presentations doesn’t give me the overview, the infinite canvas, or the clean lines of Inkscape, it’s a smoother workflow, and I rather like it. I’ve been sketching more, too. W- has just gotten his own tablet, and Autodesk Sketchbook Pro (trial version) was one of the first things he installed. I’m looking forward to practising drawing with him.

Writing more about life: I like it. I think of it as writing for my future self.

Blog limits: I sometimes schedule my posts, and I sometimes post more than once a day. Fine with you so far? If you find the e-mail frequency a bit too much, it might be a good idea to check out Google Reader or another feed reader. You can subscribe to my blog using that, too!

Bike ride in the rain

June 4, 2011 - Categories: Uncategorized

I’ve just come back from a bike ride organized by the Toronto Bicycling Network. The ride was supposed to go from High Park to Port Credit, but we stopped at the Tim Hortons near Alexandra Avenue and Lakeshore Road because it was raining so hard. The Tim Hortons we stopped at was just 3.5km from the destination, though, so I’d count that as mostly there. =) In total, I biked 33.7km in about two hours of constant rain, although part of that time was spent rather comfortably sipping hot chocolate inside the cafe.

This is where we ended up:

image

I’d never been that far west on my bicycle, and I haven’t biked in the rain for such a distance or length of item. It’s not that scary after all, although I wish I’d worn my rain pants and my gloves!

Weekly review: Week ending June 3, 2011

June 5, 2011 - Categories: review, weekly

It was very much a salad sort of week. I finished the last of the kale and the spring lettuce from the community-supported agriculture box, discovering along the way that I’m not particular about the kind of oil I use for salad dressing: regular olive oil, fancy-schmancy fruity olive oil, or expensive walnut oil. So run-of-the-mill olive oil it is. I do like tossing nuts into my salad, and the hard-boiled eggs I’ve been keeping in the fridge have been convenient too.

W-‘s new Lenovo X220 arrived, so we’ve both been busy drawing on our tablets. Getting the hang of drawing cubes. =) Baby steps!

Starting a Drupal project at work. It’s great to be back in the world of a gazillion community-contributed modules, although I miss the interactivity of rails console. (drush shell is helpful, but not quite as awesome as that!) Getting back up to speed.

I hope my manager can keep my engagements sane. More demand than supply. It’s a good problem to have, but it’s still pretty crazy. Fortunately, he can sort all of those things out while I focus on code.

Next week: the start of the summer CSA share, more gardening, more writing, more development, more awesomeness… =)

From last week’s plans

  • Work
    • [C] Finish Gen Y/Gen C presentation – no longer needed
    • [X] Get started on project M
    • [/] Wrap up on project C – getting there!
    • Set up Redmine for issue tracking, because of the git integration
  • Relationships
    • [X] Help J- with homework
    • [X] Make cute cat soap holder
  • Life
    • [X] Fix this calendar bug: what can I do to make it easier to remember events and tasks?
    • [X] Draw a presentation-style thing for myself =) – practising drawing cubes, not presentations, but close enough

Plans for next week

  • Work
    • [ ] Get priorities and development responsibilities sorted out for project M
    • [ ] Continue working on development for project M
    • [ ] Bike to work to discuss project M with the information architect
  • Relationships
    • [X] Watch “Thor” with Maira and Scott
    • [X] Prepare some meals in advance
    • [X] Review short-term plans
    • [ ] Prepare lots of salad
    • [ ] Pick up summer share CSA box
    • [ ] Make a list of summer meals
  • Life
    • [X] Go on group bike ride (High Park to Port Credit)
    • [ ] Write about scenarios/planning

Plans for summer: Relationships, work, gardening, biking, drawing and photography, making, and finances

June 6, 2011 - Categories: planning

Cate Huston asks for inspiration: What are you focusing on in June? Work is straightforward: Drupal web development until September, at least, and probably similar work after that. Summer also makes it easy to decide what to do. Biking and gardening, yes. Baking and sewing, not so much. Social events, yes. But it’s a good idea to go beyond these vague categories and figure out what I’d like to explore.

This blog post is not really about focus. It’s more of a list of things I’m thinking about, but at least it’s a shorter, more concrete list than just "stuff". =) Focus comes when I go through the different categories and focus on making one item for each category happen.

Short-term thoughts for summer

Relationships: I should take advantage of summer’s long days and warm weather by meeting up with people. It might be awkward in the beginning, but I’m sure it will get easier. I should nudge my friends to organize things more often. Maybe I just happen to be the most get-folks-together-and-feed-them sort of person in the different groups I’m in. This is okay, although I’m curious about what it might be like to get a regular potluck going. Or a regular cookathon going. Hmm… Possible improvements:

Work: Development is the way to go for me, I think. I like it more than consulting. I like making things happen, and I like the way it continuously sharpens my skills. Yes, it’s a global marketplace, and the work may be tougher than consulting because it’s more easily virtualized. But that’s good, too – less travel. I can keep growing in this by learning more about Drupal and Rails, and improving my front-end skills. I would like to work on a Drupal 7 project and another Ruby on Rails project this year. I want to be the awesome backend developer or technical lead people like working with in order to make websites happen. Possible improvements:

Gardening: I think it’s incredible. You put seeds in soil, you give them some water, and sunlight and nature do the rest. I want to take advantage of the sunlight to learn a little more about growing our own food. I love how the strawberries are starting to bear fruit, and how the peas race up the string-trellis I made. I want to grow more and more fruits and vegetables so that someday, we can grow most of the produce we eat. Possible improvements:

Biking: I enjoy biking. It’s a great way to get to places. I would like to bike more as casual exercise and a way to get myself outdoors. I tend to bike as a way of getting from one place to another, instead of just taking a joyride. One way to bike more would be to just come to work more often, particularly when it’s sunny. Another way to bike more often would be to plan more events that get me outside the house, because I’d rather bike than take public transit if the destination isn’t too far. Hmm… Possible improvements:

Drawing and photography: I’m slowly getting the hang of drawing, and now that W- has a tablet PC, we can make it a relationship-building thing too. Summer is a great time to sketch or shoot the outdoors, use bright colours, and have fun with drawing and photography. Possible improvements:

Making: My wardrobe has settled, so sewing is lower-priority, although I like making gifts and accessories. We might make some shelves for the living room and for upstairs, but that’s also not urgent.

Finances: Nothing special here, just saving up. We’re shifting our grocery patterns (lighter summer meals, organic and local produce), so I’m going to do some more price-checking to see if the community-supported agriculture box is a better deal than, say, shopping at the Sweet Potato (a local health food store) or checking out farmers’ markets. I’ve been thinking about experimenting with dividend-focused stocks after I reach one of my savings milestones, but I’m not completely sold on it yet, and I’m fine just putting money into low-MER index funds for now.

Plenty of good things to grow into.

Made a stuff sack for J-

June 6, 2011 - Categories: life, sewing

imageW- asked me if I could make a stuff sack for J’s sleeping bag, as it turned out she was going camping this week. These bags are handy for compressing loose items such as sleeping bags, jackets, clothes, and so on. You simply stuff as much as you can into the bag, and the bag keeps the items compressed.

I had white ripstop nylon in my fabric stash, left over from the time we were thinking of making a fabric softbox. J- measured the compressed sleeping bag – 25” circumference, about 16” of height – and I started working on a simple tubular stuff sack.

The project came together quickly, even the tricky part of sewing the circular base to the tube. My seams were mostly straight and neat, although I had some bubbling near the bottom. For the drawstring, we reused the free shoelaces that came with J’s new shoes. (Waste not, want not.) The stuff sack ended up just the right size for the sleeping bag. Hooray!

I think I’m getting the hang of going from idea to actual thing, and it’s a lot of fun. All the cat hair that got sewn into the seams along the way probably means I shouldn’t go into commercial production yet, though! Winking smile

Negative optimization

June 7, 2011 - Categories: geek, rails

Checking on one of my projects (a Ruby on Rails survey site), I realized that it was running painfully slowly, taking 30 seconds to render a page.

The first thing I checked was memory. I was on a 256MB slice at Rackspace Cloud. Was the server running out of memory and swapping to disk? I put in the recommended settings for Apache+Passenger+Rails on 256MB:

RailsSpawnMethod smart
PassengerUseGlobalQueue on
PassengerMaxPoolSize 2
PassengerPoolIdleTime 0
PassengerMaxRequests 1000
RailsAppSpawnerIdleTime 0
PassengerStatThrottleRate 5

The website was still crawling. I reviewed the logs and found that ActiveRecord was taking a while. The Internet had a few performance optimization tips, so I checked out the survey controller to see if I could improve performance by preloading information.

As it turned out, I was already preloading information. So I tried turning off preloading by removing the :include directives for my queries.

The system went back to a decent speed.

You see, I’d been working with lots of associations, and eager loading had probably resulted in a gazillion rows in my result set.

Moral lesson: Test your system before and after you put in something to improve the performance, because you just might be making your performance worse. ;)

Oh well. Live and learn!

2011-06-07 Tue 16:19

Thinking about our development practices

June 8, 2011 - Categories: development, geek, kaizen

We’re gearing up for another Drupal project. This one is going to be interesting in terms of workflow. I’m working with the clients, an IBM information architect, a design firm, another IBM developer, and a development firm. Fortunately, the project manager (Lisa Imbleau) has plenty of experience coordinating these inter-company projects.

I feel a little nervous about the project because there are a lot of things to be clarified and there’s a bit of time pressure. I’m sure that once we get into the swing of things, though, it’ll be wonderful.

I’m used to working with other developers within IBM, and I’m glad I picked up a lot of good practices from the people I’ve had the pleasure to work with over the years. I’m looking forward to learning even more from the people I get to work with this time around.

In particular, I’m looking forward to:

It’s also a good opportunity to figure out which of our practices are new to others, and to write about those practices and improve them further. Some things that have turned up as different:

Much learning ahead!

Drush, Simpletest, and continuous integration for Drupal using Jenkins (previously Hudson)

June 9, 2011 - Categories: drupal, geek

One of my development goals is to learn how to set up continuous integration so that I’ll always remember to run my automated tests. I picked up the inspiration to use Hudson from Stuart Robertson, with whom I had the pleasure of working on a Drupal project before he moved to BMO. He had set up continuous integration testing with Hudson and Selenium on another project he’d worked on, and they completed user acceptance testing without any defects. That’s pretty cool. =)

I’m a big fan of automated testing because I hate doing repetitive work. Automated tests also let me turn software development into a game, with clearly defined goalposts and a way to keep score. Automated tests can be a handy way of creating lots of data so that I can manually test a site set up the way I want it to be. I like doing test-driven development: write the test first, then write the code that passes it.

Testing was even better with Rails. I love the Cucumber testing framework because I could define high-level tests in English. The Drupal equivalent (Drucumber?) isn’t quite there yet. I could actually use Cucumber to test my Drupal site, but it would only be able to test the web interface, not the code, and I like to write unit tests in addition to integration tests. Still, some automated testing is better than no testing, and I’m comfortable creating Simpletest classes.

Jenkins (previously known as Hudson) is a continuous integration server that can build and test your application whenever you change the code. I set it up on my local development image by following Jenkins’ installation instructions. I enabled the Git plugin (Manage Jenkins – Manage Plugins – Available).

Then I set up a project with my local git repository. I started with a placeholder build step of Execute shell and pwd, just to see where I was. When I built the project, Hudson checked out my source code and ran the command. I then went into the Hudson workspace directory, configured my Drupal settings.php to use the database and URL I created for the integration site, and configured permissions and Apache with a name-based virtual host so that I could run web tests.

For build steps, I used Execute shell with the following settings:

mysql -u integration integration < sites/default/files/backup_migrate/scheduled/site-backup.mysql
/var/drush/drush test PopulateTestUsersTest
/var/drush/drush test PopulateTestSessionsTest
/var/drush/drush testre MyProjectName --error-on-fail

This loads the backup file created by Backup and Migrate, sets up my test content, and then uses my custom testre command.

Code below (c) 2011 Sacha Chua (sacha@sachachua.com), available under GNU General Public License v2.0 (yes, I should submit this as a patch, but there’s a bit of paperwork for direct contributions, and it’s easier to just get my manager’s OK to blog about something…)

// A Drush command callback.
function drush_simpletest_test_regular_expression($test_re='') {
  global $verbose, $color;
  $verbose = is_null(drush_get_option('detail')) ? FALSE : TRUE;
  $color = is_null(drush_get_option('color')) ? FALSE : TRUE;
  $error_on_fail = is_null(drush_get_option('error-on-fail')) ? FALSE : TRUE;
  if (!preg_match("/^\/.*\//", $test_re)) {
    $test_re = "/$test_re/";
  }
  // call this method rather than simpletest_test_get_all() in order to bypass internal cache
  $all_test_classes = simpletest_test_get_all_classes();

  // Check that the test class parameter has been set.
  if (empty($test_re)) {
    drush_print("\nAvailable test groups & classes");
    drush_print("-------------------------------");
    $current_group = '';
    foreach ($all_test_classes as $class => $details) {
      if (class_exists($class) && method_exists($class, 'getInfo')) {
        $info = call_user_func(array($class, 'getInfo'));
        if ($info['group'] != $current_group) {
          $current_group = $info['group'];
          drush_print('[' . $current_group . ']');
        }
        drush_print("\t" . $class . ' - ' . $info['name']);
      }
    }
    return;
  }

  // Find test classes that match
  foreach ($all_test_classes as $class => $details) {
    if (class_exists($class) && method_exists($class, 'getInfo')) {
      if (preg_match($test_re, $class)) {
        $info = call_user_func(array($class, 'getInfo'));
        $matching_classes[$class] = $info;
      }
    }
  }

  // Sort matching classes by weight
  uasort($matching_classes, '_simpletest_drush_compare_weight');

  foreach ($matching_classes as $class => $info) {
    $main_verbose = $verbose;
    $results[$class] = drush_simpletest_run_single_test($class, $error_on_fail);
    $verbose = $main_verbose;
  }

  $failures = $successes = 0;
  foreach ($results as $class => $status) {
    print $status . "\t" . $class . "\n";
    if ($status == 'fail') {
      $failures++;
    } else {
      $successes++;
    }
  }
  print "Failed: " . $failures . "/" . ($failures + $successes) . "\n";
  print "Succeeded: " . $successes . "/" . ($failures + $successes) . "\n";
  if ($failures > 0) {
    return 1;
  }
}

I didn’t bother hacking Simpletest output to match the Ant/JUnit output so that Jenkins could understand it better. I just wanted a pass/fail status, as I could always look at the results to find out which test failed.

What does it gain me over running the tests from the command-line? I like having the build history and being able to remember the last successful build.

I’m going to keep this as a local build server instead of setting up a remote continuous integration server on our public machine, because it involves installing quite a number of additional packages. Maybe the other developers might be inspired to set up something similar, though!

2011-06-09 Thu 09:51

Sketchnotes from Democamp Toronto 29, June 2011

June 9, 2011 - Categories: democamp, geek, sketches, sketchnotes

UPDATE: 2011-06-10: Made demo notes more visual. =)image

Highlights from Social Leverage talk by Howard Lindzon. Keep an eye on the sentiment for your industry, figure out where there’s momentum, build domain expertise, and get in the game.

image

500px, TitanFile, High Schore House, Vizualize.me, We are TO Tech, Alphaslides. (Click for bigger version.) I liked High Score House’s demo the best. They’d obviously tested a lot and had fun along the way. =)

Sketched with Autodesk Sketchbook Pro on my Lenovo X61T. Sketchbook is my new favourite note-taking program. Even though it doesn’t have Microsoft Onenote’s handwriting recognition and search capabilities, it encourages me to draw more compactly and to use more colours, and it’s more reliable. See other sketchnotes if you want to explore!

(Update: @truejebus says TitanFile is hosted in Canada.)

What did you think about Democamp Toronto? Have you blogged about it? Please share your thoughts and links in comments!

Also check out Tom Purves’ writeup.

Managing configuration changes in Drupal

June 10, 2011 - Categories: development, drupal, geek, work

One of our clients asked if we had any tips for documenting and managing Drupal configuration, modules, versions, settings, and so on. She wrote, “It’s getting difficult to keep track of what we’ve changed, when, for that reason, and what settings are in that need to be moved to production versus what settings are there for testing purposes.” Here’s what works for us.

Version control: A good distributed version control system is key. This allows you to save and log versions of your source code, merge changes from multiple developers, review differences, and roll back to a specified version. I use Git whenever I can because it allows much more flexibility in managing changes. I like the way it makes it easy to branch code, too, so I can start working on something experimental without interfering with the rest of the code.

Issue tracking: Use a structured issue-tracking or trouble-ticketing system to manage your to-dos. That way, you can see the status of different items, refer to specific issues in your version control log entries, and make sure that nothing gets forgotten. Better yet, set up an issue tracker that’s integrated with your version control system, so you can see the changes that are associated with an issue. I’ve started using Redmine, but there are plenty of options. Find one that works well with the way your team works.

Local development environments and an integration server: Developers should be able to experiment and test locally before they share their changes, and they shouldn’t have to deal with interference from other people’s changes. They should also be able to refer to a common integration server that will be used as the basis for production code.

I typically set up a local development environment using a Linux-based virtual machine so that I can isolate all the items for a specific project. When I’m happy with the changes I’ve made to my local environment, I convert them to code (see Features below) and commit the changes to the source code repository. Then I update the integration server with the new code and confrm that my changes work there. I periodically load other developers’ changes and a backup of the integration server database into my local environment, so that I’m sure I’m working with the latest copy.

Database backups: I use Backup and Migrate for automatic trimmed-down backups of the integration server database. These are regularly committed to the version control repository so that we can load the changes in our local development environment or go back to a specific point in time.

Turning configuration into code: You can use the Features module to convert most Drupal configuration changes into code that you can commit to your version control repository.

There are some quirks to watch out for:

You want your integration server to be at the default state for all features. On your local system, make the changes you want, then create or update features to encapsulate those changes. Commit the features to your version control repository. You can check if you’ve captured all the changes by reverting your database to the server copy and verifying your functionality (make a manual backup of your local database first!). When you’re happy with the changes, push the changes to the integration server.

Using Features with your local development environment should minimize the number of changes you need to directly make on the server.

Documenting specific versions or module sources: You can use Drush Make to document the specific versions or sources you use for your Drupal modules.

Testing: In development, there are few things as frustrating as finding you’ve broken something that was working before. Save yourself lots of time and hassle by investing in automated tests. You can use Simpletest to test Drupal sites, and you can also use external testing tools such as Selenium. Tests can help you quickly find and compare working and non-working versions of your code so that you can figure out what went wrong.

What are your practices and tips?

2011-06-09 Thu 12:25

Weekly review: Week ending June 11, 2011

June 11, 2011 - Categories: review, weekly

From last week’s plans

  • Work
    • [X] Get priorities and development responsibilities sorted out for project M
    • [X] Continue working on development for project M
    • [X] Bike to work to discuss project M with the information architect
    • Did some more troubleshooting for project I
    • Shared more Drupal tips
    • Attended Democamp
    • Discussed Idea Labs with ibm.com/communities
    • Hacked together Profiles summary tool for Darrel Rader
    • Set up continuous integration with Jenkins, yay!
  • Relationships
    • [X] Watch “Thor” with Maira and Scott
    • [X] Prepare some meals in advance
    • [X] Review short-term plans
    • [/] Prepare lots of salad
    • [X] Pick up summer share CSA box
    • [/] Make a list of summer meals
    • Sewed stuff sack for J-
    • Worked on Latin homework with W-
    • Hung out with Gabriel Mansour and
    • Experimenting with doing more chores on Friday (laundry, compost, etc.)
  • Life
    • [X] Go on group bike ride (High Park to Port Credit)
    • [/] Write about scenarios/planning
    • Watched X-Men: First Class
    • Posted Democamp sketchnotes, revised sketch
    • Biked a lot, yay!
    • Took pictures of garden

Plans for next week

  • Work
    • [ ] Get started on development with Snake Hill for project M
  • Relationships
    • [ ] Attend Linda and Tim’s wedding
    • [ ] Make pesto
    • [ ] Maybe join Bells on Bloor?
  • Life
    • [ ] Put in drip irrigation system

Getting things ready for the next week: cooking and gardening

June 12, 2011 - Categories: gardening, kaizen

Tired! Did lots of cooking and gardening today. We went into full process-the-community-supported-agriculture-box mode today. I made pesto from the basil in the box (supplementing it with basil from our garden) and another pesto from green garlic. Chopping up the green onions and freezing them means more convenient soups later on. A quick stock made the most of the woody ends from several breakfasts’ worth of asparagus. W- prepared six packs of chicken leg quarters (shake and bake, jerk chicken marinade) and stirfried lots of vegetables. We packed maybe 36 lunches – a few in the fridge, and two neat columns in the chest freezer.

I also put in the drip irrigation system for the backyard. Well, most of the backyard. There has been some attrition among the 1/4″ irrigation fittings, so I set up only the vegetable garden near the house. Home Depot didn’t have the parts I wanted, but Lee Valley has them, so I might pass by one of these days to pick those things up. After I put in the soaker hose, I mulched the strawberries to keep the fruits off the soil. I also put up nets around our blueberries to see if that will improve our chances of actually enjoying them ourselves. We’ll see – there are some serious-looking squirrels around here.

Planted a few more square feet of beans and some lettuce. It’s been cool lately, so maybe the lettuce still has a shot. Saw my first pea flower! The tomatoes aren’t doing too well, though – they’re still scrawny. I’m sure we’ll get plenty of tomatoes in our summer share box.

Tired, but happy. We’ve gone through most of our vegetable box, so I’m less worried about wasting it. We’ve got frozen lunches. We’ve got salad plans. Next week should be a little smoother, and the next week after that even better, and so on.

Decision review: Packing lots of chores into Friday evening worked out. With the laundry finished, I spent Saturday downtown. Might’ve been a good idea to have my massage after the cookathon/gardenthon, though!

And people wonder why I don’t dread Mondays… ;)

2011-06-12 Sun 21:01

This is what my blog looks like on paper

June 13, 2011 - Categories: blogging, life, reflection, writing

I’ve switched to printing out my blog archives monthly instead of yearly, so now I’m all caught up again. It’s surprising how it all adds up. Here’s my blog since just 2007, printed single-space, double-column, double-sided, with monthly indexes:

There’s more beyond that, as I didn’t print out my older posts. Here’s a visual summary from my reflection on 8 years of blogging:

image

I’m surprised that I quite enjoy reading my old posts. I find it difficult to listen to my presentation recordings – I get impatient, I want to move on – but I like reading, particularly when I come across posts I’ve forgotten writing. There’s a lot in here. It’s fun remembering what it was like to look for my first apartment, hanging out with friends, dealing with challenges. I like revisiting my questions, decisions, and plans. There are many things that spark ideas for new posts and sketches.

This print-out is part of playing the long game with writing. I’ve got electronic backups of my blog. A paper backup further increases the chances that I’ll be able to revisit these ideas decades down the line. And it supports serendipity and reflective practice, too. Who knows what I’ll rediscover or review?

Pretty cool. Thanks for sharing the journey so far. Looking forward to what’s ahead!

Decision review: Kitchen counter computing (ad hoc standing desk)

June 13, 2011 - Categories: decision, geek, kaizen, review

imageI switched to using the kitchen counter as my standing desk last month, and it’s working really well. I like working in the kitchen: natural light, plenty of water and healthy snacks, and the occasional cat-cuddling break. The kitchen counter is just the right height for typing. I don’t have an eye-level monitor, but if I keep good posture and take frequent breaks (to cuddle cats, for example), my neck doesn’t hurt.

Standing up also keeps me from the bad habit of crossing my legs at the knees. I fidget more, too – do more stretches, take care of more little chores around the kitchen while thinking about code. Good for circulation.

Not a bad experiment. I think I’ll keep on going.

Now if only we had counters at the right height in the office. There’s a bar-height counter, but it’s a little too high for me to comfortably type on. Maybe two recycling bins upended on a desk…

Cook Or Die Season II: Community-Supported Agriculture

June 14, 2011 - Categories: cooking, cookordie

My “Cook or Die” project started when I moved into an apartment-style dormitory shortly after university. My room was equipped with a small kitchen – really, just a hot plate, a microwave, and a toaster oven. Instead of always eating at the nearby KFC, I resolved to prepare at least one of my meals each day. Hence: Cook or Die. (Well, Cook or Starve.)

I’ve come a long way since I discovered that pita pockets were called pita pockets for a reason. I hardly ever eat out now. I’d much rather eat at home, where meals are frugal, tasty, and just the right size for me. The kitchen is well-stocked. The garden’s full of herbs. I’ve got a decent collection of favourite recipes, and I’m always learning more about cooking.

We’re heading into our second month of community-supported agriculture. W- has signed up for a weekly summer half-share from Plan B Organic Farms. Every Thursday, we pick up a box containing an assortment of vegetables, some of which I’ve never tried before. The box arrives every week, a relentless parade of perishables. (You can postpone for vacations and get a credit, but I think that would be cheating on our experiment.) I’m getting pretty creative about how to get through all of this plus the groceries we buy. The nooks of our freezer are filled with pesto in small Nalgene containers and chopped green onions in Ziploc bags.

I’m also discovering new recipes. I’d never made green garlic pesto before, but the Internet thinks it’s good, so I gave it a try. Today I baked kale chips, although I oversalted my first batch; and yes, they do taste oddly like potato chips. We’ll see if I can get W- and J- to try them. We all like seaweed, and the texture’s not far off.

I turned our ripening avocados into guacamole, mixing in my chopped-up frozen green onions from the vegetable box. I still had lots of guacamole after making myself an omelette. Turns out you can freeze guacamole, but I figured it was more useful to just share it with our neighbours, as they were having a small party. So I rubbed the tortillas with olive oil, cut them into eighths, and baked them for about 8 minutes at about 400’F until they were crisp and light brown. After testing a few, I assembled the chips and the guacamole on a plate and carried it over. Win!

Now we just have to finish the parsnip and the lettuce, and we’ll be ready for Thursday’s box. Cook or Die? More like Cook or Get Overwhelmed By Vegetables…

2011-06-14 Tue 19:27

Kaizen in the little things: The way the door opens

June 14, 2011 - Categories: kaizen, sketches

One of my principles is kaizen: continuous improvement. If you can make your life 1% better every day, you’ll double your life’s awesomeness in less than three months. Even if you improve life by 0.01%, you’ll still do pretty darn well over time. Today was one of those 0.01% days. I don’t know why I didn’t think of this before.

You see, I often ride my bicycle to work. This means maneuvering my long-framed bicycle through the mudroom, out the door, and down the porch stairs. The door has two parts: the actual door, which opens inward, and the screen door, which opens outward. If I roll my bicycle near the door, then open it, the door often gets stuck in front of my bicycle. If I open both the door and the screen door, one of our cats usually slips out and starts exploring the porch. (I’m looking at you, Luke.)

Today I had an epiphany. If I open the house door but not the screen door, then I can get out more easily and I don’t have to worry about the cats slipping past. This is what it looks like:

image

Yes, I know, obvious, but I managed to get through one whole year with this bicycle without having that aha! moment, because I always thought of door-opening as an integral operation: open the house door, then open the screen door. Close the house door, close the screen door. Even though we sometimes leave the house door open and the screen door closed to let in summer breezes, it didn’t click until I stopped and thought about why I was getting stuck in the bike room.

Little things like that are the cruft of un-consciously moving through life, and it’s so much fun to fix them. So many opportunities for improvement everyday!

Make-ahead meals

June 15, 2011 - Categories: cooking

Patricia wanted to know what sort of meals we like preparing in advance. We often make large batches of frozen meals so that we can take them to work or have them as quick, no-fuss dinners. Here are some of our staples:

What are yours?

2011-06-15 Wed 20:33

Personal projects

June 16, 2011 - Categories: decision, kaizen, life, productivity

I rein in work to about 40-44 hours a week so that it doesn’t run away with me. This gives me some time during evenings and weekends to work on personal projects. It’s a good idea to have clear personal projects in mind so that I don’t end up wasting the time mindlessly.

“Do you want to spend your time productively or unproductively?” I asked J-.

“That’s a leading question,” W- said.

“No, I’m serious about it. Unproductive time is good too, as long as you choose it consciously,” I said.

For example, I spend some time here and there playing LEGO Pirates of the Caribbean. I don’t do it just because I can’t think of anything else to do or I don’t feel like doing anything else. I play because I’m curious about how the game designers have constructed puzzles and all those little secrets that dot the LEGO world. That’s definitely not a project, though.

What are the things I’m working on? Spelling them out will make it easier to pick a task that moves me towards them when I find myself with blocks of time.

Latin: W- and I are slowly working our way through Albert Harkness’ “An Easy Method for Beginners in Latin.” We’re on lesson twenty-ish now. Most people are working off the scanned book in Google’s digitized collection, but because the scans are images instead of text, the file is a little slow and unwieldy. I bought the first edition (it’s now the oldest book I have) and we’re working on digitizing it properly, re-typing it in with all the finicky accents and footnotes. We’re less than a fifth of the way through the book, so there’s plenty of work to do on this front. Goal: Digitize the whole book and answer all the questions.

Gardening: I want to get better at planning and growing the fruits and vegetables we like. That means getting more practice at starting seeds and helping them thrive. Gardening is relaxing, too. Goal: Grow, harvest, and measure the yield this year.

Cooking: Our frozen meals get us through most of the week, but I also cook new things based on what we need to finish in the fridge. For example, today I’d like to do something with the asparagus stock so that it doesn’t go to waste. I’m also picking up the community-supported agriculture box today, so that will give me a new set of challenges. This helps me develop the eminently useful skill of preparing healthy meals. Goal: Experiment with and collect summer recipes, then put together other seasonal notes.

Writing: I enjoy writing. I like reading my archive and remembering the steps. I like practising writing every day as a way to share what I’m learning, and it’s a good way to keep learning about content and style. Goal: Review, rewrite, and compile into an e-book.

Drawing: I’d like to get even better at drawing. It’s fun, and I’m learning how to communicate through it. I want to feel more comfortable using colours and drawing shapes. It’s all about practice. Goal: Draw a graphical review each week for a month.

Photography: It’s good, and we’ve got all this equipment already, so I might as well. ;) Besides, I enjoy taking pictures of the garden. Goal: Post at least one photo a week for a month.

What are you working on?

2011-06-16 Thu 08:25

Getting the hang of community-supported agriculture

June 16, 2011 - Categories: cooking, cookordie

I’m starting to get the hang of working with our community-supported agriculture box: a weekly assortment of fruits and vegetables from farms in Ontario. I finished last week’s lettuce today, supplementing it with lettuce from our cut-and-come-again planter (which is actually working as planned!) and topping it with two eggs from last week’s share.

Today we picked up baby greens, two kinds of lettuce, broccoli sprouts, two tomatoes, kale, basil, green onions, and a dozen eggs.

I like processing the vegetables as soon as possible so that I can lock in their freshness and avoid waste. I chopped the green onions and added them to last week’s freezer bag; they’ll see us through many recipes. I made lentil soup with the leftover asparagus stock, the green onion ends, and some carrots we had in the fridge. I ground the Genovese basil into pesto and popped it into the freezer. I baked half of the bunch of kale as chips, making sure to go easy on the oil and salt. The results:

 

The kale chips came out just right.

Kale chips: Preheat oven to 350F (175C). Wash, dry, and tear a bunch of kale into bite-sized pieces, removing the stems. Toss with a tablespoon of olive oil and a teaspoon of salt. Spread kale on a baking sheet covered with parchment. Bake for 8-10 minutes, or however long it takes for the kale to become crispy but not burnt. Munch away guiltlessly.

Summer is short enough as it is. I might as well eat like it. =)

Gardening notes: Cut-and-come-again lettuce

June 17, 2011 - Categories: gardening

One of my gardening goals this year was to have a cut-and-come-again bed for leafy greens. The idea is to grow lettuce and other greens for continuous harvesting instead of waiting until the head has fully formed. We’re using a self-watering planter from Rona perched on the deck rail. I can even harvest barefoot. (Well, in my slippers.)

 

I started these plants from seed, which was another one of my goals. I’ve gotten two salad lunches out of this box already. The lettuce is starting to set seed and the leaves are a little more bitter, but they’re still good to eat. I’ve got bok choi and other plants starting there, too, and I tend to putter around and plant more every week.

I should’ve considered the community-supported agriculture box too, because we’re now swimming in lettuce. Today I changed my salad dressing by using tamari instead of balsamic vinegar, topping it with sliced egg. Bit more of an Asian taste. Next time, I’ll toss in some sesame seeds, too.

Salad greens are actually better in some shade than in the hot sun, so if you’ve been looking for things to grow on a balcony, consider growing your own salad bowl. With the cut-and-come again method, you could get quite a few harvests out of them.

An abundance of cilantro, now freezing in cubes; strawberries and peas

June 18, 2011 - Categories: cooking, gardening

Awesome Garden Lady down the street gave us two large bunches of lettuce and a bag of cilantro, so I made an Asian-inspired salad yesterday: toasted sesame seeds, cilantro, tomatoes, hard-boiled eggs, and the rest of our bag of baby greens, dressed with tamari and olive oil. The cilantro made it feel like eating one of those Vietnamese sandwiches, except without the meat. Yum.

Today I spent the morning chopping up the rest of the cilantro and packing it into our ice-cube tray for freezing. That way, we can easily add cilantro to stir-fries, soups, and other meals.

Many herbs freeze well, which is a good thing because they usually come in large bundles.

In other news, look at what’s in the garden:

The first of many, I hope!

Weekly review: Week ending June 18, 2011

June 18, 2011 - Categories: review, weekly

Tired after lots of biking, cooking, and gardening, but it’s a happy sort of tired. New hack working well: leaving smartphone downstairs to avoid temptation of late-night browsing, then using regular phone as alarm clock set slightly before smartphone.

From last week’s plans

  • Work
    • [X] Get started on development with Snake Hill for project M
    • Helped Darrel Rader with Profiles summarization tool
    • Started thinking about possible presentations on Gen C and banking, Drupal development, career
    • Attended Dries Buytaert’s presentation on Drupal 8
  • Relationships
    • [-] Attend Linda and Tim’s wedding – this Sunday, actually!
    • [X] Make pesto
    • [-] Maybe join Bells on Bloor? – also this weekend
    • Received lettuce and cilantro from Awesome Garden Lady
    • Shared home-made guacamole and baked tortilla chips with neighbor
  • Life
    • [X] Put in drip irrigation system
    • Typed in a few chapters of Latin
    • Had lots of salad

Plans for next week

  • Work
    • [ ] Smooth out session creation form for project M
    • [ ] Work on Generation C and banking presentation
  • Relationships
    • [ ] Attend Linda and Tim’s wedding
    • [ ] Organize get-together
  • Life
    • [X] Join Bells on Bloor
    • [X] Harvest compost
    • [ ] Spread compost in front garden
    • [ ] Type in five chapters of Latin
    • [ ] Have soup and salad every day in order to try to make a dent in the lettuce

Thinking about speaking topics

June 19, 2011 - Categories: braindump

Holly Tse invited me to speak at Lotus Blossoming, an upcoming virtual summit for Asian women. We’re negotiating what my topic might be. I’ve challenged myself to speak mostly about things that pass the following criteria:

I’m picky because I’m not selling anyone stuff. No coaching services, no e-books, no here’s-the-secret-to-happiness. This means I’m not speaking to get exposure or to do marketing. It also means that speeches have to be worth the preparation time I’d take away from other things. Is the speech something I can’t wait to work on, or is it something I’m going to end up procrastinating until the last minute? Is it something that might result in a good blog post and a presentation  I can share? Is it something that can help me grow in terms of content or technique?

I invest time up front before committing to a topic so that I can enjoy the preparation and delivery more, and so that the talk will be more useful for people who invest their time in attending. I know I can be energetic and interesting even when I’m annoyed with the situation or when I have strong doubts about the topic, but I really don’t want to make that habitual.

The great thing is that negotiation teaches me a lot about what I want to write about and explore. For example:

Hmm, there’s an interesting thing there. You see, people often ask me to do social media presentations. I prefer to focus on individual behaviours instead of trends because I want people to be able to do something. I dislike all this emphasis on personal branding and social networking, because it’s so much like scare-mongering. “You MUST be on Facebook/Twitter and your own blog or else you’ll be invisible and irrelevant.” Social networking is fine, but I want to be really clear that it’s not about getting friends/followers/readers/comments.

I’d rather encourage people to take these two approaches: develop their interest in other people and use social tools to make it easier to cultivate those relationships, and start that journey of self-discovery and find something they can share with other people.

The first one is a bit harder if the people you care about aren’t active on social networks, but you can also learn a lot by looking for people who inspire you. When you find people you resonate with, you can learn a lot about them, life, and yourself. For me, blogs tend to be better than Facebook or Twitter for being inspired by other people, because people put more of their thoughts and their personality into their blog. For example, I love the way my mom tells stories and what I learn about her and our family. The way Mel Chua shares her passion for open source and life (we’re not related, but I’d have loved to be) teaches me more about how to let my enthusiasm shine through. I enjoy reading Roger Ebert’s journal and learning about culture and growing old, and I like Penelope Trunk’s vivid stories. People tell me they enjoy reading my blog, too – the way I practise continuous improvement and optimism, the joy I take in life, the things I learn along the way.

As for finding something worth sharing with other people – that’s an excellent place to start, especially for introverts like me. Writing helps you learn a lot more effectively. It gets things out of your brain and into a form you can look at or share.

Come to think of it, I take more of a self-centered approach to social media compared to most of the other presentations or blog posts I’ve come across. It’s not the quick hit of here’s-how-to-make-the-most-of-Facebook-and-Twitter. It’s more about becoming yourself and helping others. Hmm… Will flesh this out some more.

Switching back to Linux as my development host

June 20, 2011 - Categories: development, geek, work

I switched back to using my Ubuntu partition as my primary development environment instead of using Windows 7. I still use a virtual machine to isolate development-related configuration from the rest of my system.

Linux makes better use of my computer memory. I have 4 GB of RAM on this laptop. My 32-bit Windows 7 can only access 3 GB of it, a limit I regularly run into. The resulting swapping slows down my development enough to be noticeable. I could switch to 64-bit Windows, but reinstalling is a disruption I don’t want to deal with right now. On Linux, my processes can access up to 4GB of memory each, which means there’s even room for future expansion. I’m at just the right level now – using 3.9 GB, but not swapping out.

Using Linux also means that it’s easy for me to edit files in my virtual machine. Instead of setting up Samba + Eclipse, I can use ssh -X to connect to my virtual machine and run Emacs graphically. If I want to use Eclipse for step-by-step debugging, I can use sshfs, smbfs, or NFS to mount the files.

The key things I liked about Microsoft Windows 7 were Autodesk Sketchbook Pro and Microsoft Onenote. I can draw a bit using the GIMP or Inkscape, although I really need to figure out my smoothing settings or whatever it is that would make drawing as fun as it is in those other programs. I don’t need those programs when I’m focused on development, though, and it’s easy enough to reboot if I want to switch.

Hibernate doesn’t quite work, but I’ve been suspending the computer or shutting it down, and that works fine. Pretty cool!

(500) days of salad

June 21, 2011 - Categories: cooking

I’m nearly done with the community-supported agriculture box’s haul of lettuce, although I still have Awesome-Garden-Lady’s lettuce to get through. This one is a grape and walnut salad. Next time, I’ll probably slice the grapes to make them easier to spear with my fork.

I’m learning that I like these in salads:

I just have to get through enough salads so that I can get back to writing about other things. I’m getting better at photography, though! =)

Portal 2 and teachable moments in argument

June 22, 2011 - Categories: communication, life, teaching

Portal 2 became an obsession in our household after W- shared with us the Youtube clips of the ending songs, Still Alive and Want You Gone. I downloaded the demo today, and J- flew through it eagerly. The final demo level came all too soon.

Aha. Teachable moment.

“Do you remember the three Greek words we have in the kitchen?”

“Ethos, pathos, and logos.”

“Right.” I wrote them down, with brief descriptions, under the title, “Why should we get Portal 2?” I read the title out: “Why should we get Portal 2?”

“Umm… Because it’s educational?”

“How?”

“Speedy thing goes in, speedy thing comes out, that’s all I have to say.”

I look at her and do the you-can-do-better-than-that smile.

“I’m not good at this stuff.”

“Try writing all of your ideas down. You can make your arguments stronger by editing them afterwards.”

We’re still a bit fuzzy about the categories, but it’s great to see where she’s going. Here’s the list she came up with:

Ethos:

Pathos:

Logos:

“Try thinking of reasons why we might say no, too,” I said. After some thought, she listed:

“Now think of ways you can address those concerns.”

“Maybe I can set a time limit, like 30 minutes…”

“That would take care of the first and second concern. How about the third?”

“It’s like you don’t want to play it too much, but you also don’t want to play it too little…” she said.

“Right. Because if you played only a couple of levels more, it would be a waste. But you played the demo and…”

“… it was amazing…”

“… so the rest of the game…”

“… will probably be ten times as amazing…”

“… and you know you’ll enjoy it. There, see what happens? When you think of why someone would say no and you address those concerns, your argument becomes stronger.”

“Oh, I get it now.”

“Great! Would you like to take this further by organizing your arguments into a proper speech, like this”, and here I sketched out what the speech would be like, with English mixed with fast-forwarded gibberish and hand-gestures so that she could get the sense of it.

She laughed. “Sure!” she said.

Persuasion is a useful skill. Good to find opportunities to help people develop it!

2011-06-22 Wed 21:21

Portal 2

June 23, 2011 - Categories: geek

So we bought Portal 2 for the PS3, because you can unlock a PC version if you link your Playstation Network and Steam accounts. Turns out the PS3 version plays pretty smoothly, too, so J- is playing it now. The game has great spatial puzzles, is excellently designed, and entertainingly scripted and voiced. I’m looking forward to playing it myself.

We don’t play many video games here. There’s so much we can do instead: cook, garden, sketch, write, read books from the library, watch the occasional movie (also borrowed from the library) while folding clothes or eating dinner… But there’s something to be said about the way games help people learn how to solve puzzles and enjoy mastery. A bit of gaming is like salt and pepper on a meal, perhaps; it sharpens the experience, as long as you don’t add too much.

Also, Portal 2 is really cool.

Spatial puzzles. I can do those typical unwrapping puzzles and things-fitting-into-things puzzles that you find in those Mensa-type books. I have a hard time finding my way around a first-person game though, and I find maps really useful when navigating. I am so glad that GPS + maps showed up during my lifetime. Maybe this will help me get the hang of it too!

Must make sure it doesn’t edge out th other things I want to do. =)

Now starting coop split-screen mode with W-… =D

2011-06-23 Thu 20:15

Mindful spending, experiments, and living in line with your values

June 24, 2011 - Categories: analysis, decision, kaizen

A friend was thinking about splurging on an event that included an 8-course dinner for $95. He wrote, “I’d like to go, but that’s more than I’ve ever paid for a single meal. Thoughts?” He said that he had justified past splurges by telling himself, “Well, I’ve spent money on more frivolous things before.” He didn’t need to see me give him The Look to know that this was not the best way to go forward. I gave him plenty of advice, and here are additional reflections.

I think about spending carefully. If I can spend on the right things, minimize spending on the wrong things, and learn as much as I can from getting it right or wrong, I’ll enjoy better quality of life than I would otherwise. 

One of the techniques I use is something I picked up from Your Money or Your Life (Dominguez and Robin, 1999) – there’s an excellent blog post series on The Simple Dollar for people who want to catch up. I calculate the discretionary value of my time and use that to see if things are worth the time it takes to earn the money for them. One way to do this is by taking your income, subtracting taxes, fixed expenses, and work-related expenses, and dividing it by the number of hours you spend working or preparing to work. I like an even stricter measure. I look at the discretionary part of my bi-weekly savings allocations – that’s after taxes, savings, retirement, and other categories. I divide that by 14 days, so that I can easily get an idea of how much of a typical week, month, or year I might be committing to a purchase. This is actually a small number, because I take so much off the top for savings – less than a dollar per hour, which is why I calculate by day instead. ;) Then I can easily get a sense of how large a part of my year something will take up, and whether I think it will be worth it.

I often write down the options I’m considering and the costs, benefits, and consequences of each. For example, when I was thinking about replacing my laptop battery, I listed the options and estimated the value differences of each. I sometimes do this even for small decisions because I learn so much about my preferences and values along the way. I consider intangibles, too, and I use this technique for non-financial decisions as well. Sometimes I’m looking for a clear winner, and sometimes I’m interested in just writing my thoughts down and seeing what I’m leaning towards.

I also review my decisions to see how things turned out and if I need to tweak things further in the future. For example: clothes from Value Village, yes; compost accelerator, no; watching movie in a theatre by myself, maybe (better if I get together with friends). If something turns out to be really worth it (or really not worth it), then I learn a lot. This also helps me avoid analysis paralysis, because even if I’m not certain about a decision, I’m sure I’ll learn something from it. In fact, the more uncertain I am, the more I’ll learn – a tip I picked up from How to Measure Anything (Hubbard, 2007), which defined a measurement as whatever reduces uncertainty. Your Money or Your Life also encourages people to review their monthly budget and expenses to see which categories they want to increase or decrease depending on what contributes to their life. The practice of reviewing decisions is key to making better ones.

I sometimes nudge myself towards action using the First Circus principle, a family favourite. Not only does this tend to lead to interesting experiences, but this also takes advantage of some psychological biases. We’re more likely to regret things we didn’t do more than ones we did, and we’re also more likely to notice the presence of something (in this case, joy or disappointment) than to figure out the subtler effects of deciding not to do something.

Those are decision-making tactics. Strategy, on the other hand, involves getting a better idea of what I value, enjoy, want to become, want to support, and so on. That’s a great learning adventure, too. The more I learn about what I want in life, the easier it becomes to say no to the things I don’t want and to focus on the things that matter to me (and to the people who matter to me).

It’s all about getting better at making decisions – with money, with work, with love, with life, with everything. You’ll make tons of decisions over time, so developing your decision-making skills pays off tremendously. Money is a good way to practise: a finite resource (particularly if you think of it in terms of time) that you can choose to spend in line with your values.

How do you make spending decisions?

Weekly review: Week ending June 25, 2011

June 25, 2011 - Categories: review, weekly

From last week’s presentation

  • Work
    • [X] Smooth out session creation form for project M
    • [-] Work on Generation C and banking presentation
  • Relationships
    • [X] Attend Linda and Tim’s wedding
    • [-] Organize get-together
    • Gave Gabriel advice
    • Helped J- learn more about persuasion
    • Bought Portal 2
  • Life
    • [X] Join Bells on Bloor
    • [X] Harvest compost
    • [X] Spread compost in front garden
    • [-] Type in five chapters of Latin
    • [X] Have soup and salad every day in order to try to make a dent in the lettuce
    • Made strawberry and rhubarb tarts
    • Made lots of salad
    • Reviewed old blog posts
    • Blogged more pictures
    • Returned webcam

Plans for next week

  • Work
    • [ ] Visit client U to help with Drupal
    • [ ] Work on user registration and profile editing for project M
    • [ ] Help team members on board for project M
  • Relationships
    • [ ] Organize get-together?
  • Life
    • [ ] Sleep earlier

Strawberry rhubarb baking

June 25, 2011 - Categories: cooking

Okay, I was wrong. I guess it’s baking season all year round.

The strawberries from the garden are lovely, red and firm. I’ve baked strawberry shortcakes before, so I thought I’d give strawberry rhubarb tarts a try. Rhubarb is available so rarely – all the more reason to experiment. (I think we’ll plant it next spring!)

Recipe from Joy of Baking:

Mix all ingredients. Fill purchased tart shells or home-made pastry circles (see original recipe). Chill assembled tarts for 15-30 minutes in the fridge. Preheat oven to 400F (200C), with the rack in the center of the oven. Bake for 25-30 minutes until crust is golden. Cool on a wire rack before serving. (The original recipe suggests serving with whipped cream or iced cream, ooh.)

Strawberries from the gardenTart with purchased shellsStrawberry and rhubarb homestyle tart

I liked spending my Saturday afternoon baking, trying out new recipes. It’s a little like going to a cooking class, except much cheaper. =) I shared some tarts with neighbours so that we wouldn’t have too much dessert in the house. (Particularly as we’re still planning to bake brownies too…)

Writing your way past “What have I been doing with my life?”

June 26, 2011 - Categories: blogging, kaizen, life, reflection, writing

One of my friends is dealing with a quarter-life crisis of the “what have I been doing with my life?” variety. Comparing himself to other people or to where he had hoped he’d be at this point, he feels like he comes up way short. I shared some advice, and here are some other thoughts that came along the way.

It’s a common feeling, right around birthdays and other yearly milestones. Where did the year go? Why does time fly so quickly? Look at all these people your age – or younger! – doing incredible things. What have you been doing with your life?

Here’s how I deal with it: I write.

That’s because no matter how good your memory is, your brain’s probably going to be bad at remembering the highlights, lowlights, goals and accomplishments of the previous year. You have to deal with a number of limitations. The recency bias means you remember the most recent items better. That leaves lots of fuzzy areas. And because the brain is optimized for associations, not linear access, you’ve got to have the right hooks to get back into some memories.

Photographs are good, but they can only take you so far. There are a lot of important moments you can’t take pictures of: you don’t have a camera handy, you don’t recognize it at the moment, it’s intangible… Writing – even just a quick sketch, a private note – might help you remember.

Write about your thoughts, your goals, your accomplishments, your experiences, your questions, your answers. This doesn’t have to be public. This doesn’t even have to be coherent, although it helps if you can read your writing afterwards. This gives you a record that you can review at the end of the year to see how far you’ve come.

You don’t even have to wait until the end of the year. Use your writing to remember why your goals mattered to you. Use your writing to celebrate the little victories as well as the big ones. Use your writing to make everything in life part of the story you’re becoming – and yes, that includes the tough parts.

Use your writing to slow down life – not all the way, just enough to make it livable. Not too much. Writing about life means standing at a little bit of a distance from it, so that you can turn it over and look at it from different angles. Might not work for everyone. But for the people it works for – maybe you! – it could turn the quicksilver in that hourglass into something you can work with.

Doesn’t matter if you haven’t been doing it before. Now’s as good a time as any to get started. Doesn’t matter if you keep stopping. Even a spotty trail of stones is better than breadcrumbs in the forest of Hansel and Gretel. Doesn’t matter if you feel inarticulate. Start somewhere.

Don’t like writing for yourself? Tell people stories through e-mail or text messages and keep a copy for your notes. After conversations, jot down notes to help you remember. Ask people to help you recall.

What have you been doing with your life? Probably more than you can remember. =) Make the most of each year, and that’ll help you make the most of your life.

Learning from the speeches of grade seven students

June 27, 2011 - Categories: learning, speaking

As part of the grade 8 graduation ceremony, J- and the other grade 7 students spoke about the students who were going on to high school.

J- was initially unsure about her speech. She didn’t know much about her honoree beyond a few short facts and a couple of stories from her interview. Her speech reflected it: generalities like “nice” and “funny”, and two pieces from the interview that were strung together with little transition.

We helped her edit her speech. She found ways to connect the pieces, trim unneeded words, and become more specific. Larger fonts and more space between lines simplified reading. Slashes helped her find places to breathe and remember to make eye contact. It wasn’t perfect, but it had fewer filler phrases, and it flowed more smoothly than her first draft.

She rehearsed with the cat-tree as an ad-hoc podium. She didn’t drill it endlessly, but she practised it enough to get a sense of how the words felt.

When she delivered the speech, she got laughs – and high-fives, fistbumps, and compliments afterwards.

There’s a beginning, perhaps – that feeling of competence, that “hey I can do this”, the way that the music notes of her favourite songs are beginning to melt into melodies and her writing is becoming more about thought instead of mechanics.

One of the key things in helping people learn, I think, is to nudge people over that hump and into that “I rock” experience, so that they get to the point of being able to enjoy it.

I wonder how more people can get over that hump and enjoy exploring and sharing ideas.

Also, it turns out that you can learn a lot about speaking from watching students. A few of the other speeches drew on clear, personal experiences. Others were delivered confidently and capably. Many echoed a common outline – perhaps the suggested questions from the interview: How long has the student attended the school? What are some characteristics you would use to describe the student? What’s a memory you can share about the student? Students were described with generic adjectives: “nice,” “funny,” “athletic.” Stories were left in the air, with little connection to the beginning or end of the speech. But that’s okay, they’re still learning. (Aren’t we all?)

Worth the time.

2011-06-27 Mon 21:36

Drupal notes from helping a client improve her development environment

June 28, 2011 - Categories: drupal, geek

Keeping a to-do list helps you keep sane. If you don’t have a full-scale issue tracker, use a wiki page, text file, or something like that. It’s really useful to be able to get the list of things you’re working on or waiting for out of your head and into a form you can review.

*Drupal Features help you export configuration into code.* This is much better than creating an installation profile because you can update your features with new settings and apply them to existing sites. Invaluable when working with multi-sites that may need to be updated. You may need to clear your Drupal cache before you see changes applied.

Version control is really handy even when you’re working on your own. The ability to go back in time to a working setup (code + database) can help you experiment more freely and avoid late nights spent recovering from mistakes.

*Drush (Drupal shell) is awesome.* It’s a big timesaver. We use it to download and enable modules (dl and en), clear the cache (cc), run database updates (updatedb), launch a SQL console (sqlc), execute PHP (php-eval), run tests, and so on. I use it a lot because I hate clicking around.

Even more powerful with a little bit of xargs magic so that it’s easy to run a drush command against all the sites. Like this:

cat sites.txt | xargs -n 1 -I {} drush -l {} somecommand

Design decisions: Multisite without shared tables; services or syndication for sharing content between sites; central authentication for admin users…

Bash script to create or clone multisites makes tedious things a little bit simpler. Tasks:

2011-06-28 Tue 08:55

Meaning and acknowledgement

June 29, 2011 - Categories: book, education, learning, teaching

J- brought home her report card this week. She did well in so many subjects that it’s hard to pick which strength to build on first. Her mathematics study group sessions and science projects paid off, as did her personal interest in music.

To celebrate her work, W- and I made a colourful card. She likes making greeting cards for us, and it was fun making one for her.

It’s important to acknowledge good work. One time, W- was reviewing J-‘s answers to the math exercises he gave her. “Very good,” he said. He crumpled the finished piece of paper.

I plucked it from his hands and smoothened it out. “Ahem,” I said meaningfully.

“Oops. I tossed the other one already,” confessed W-. I retrieved the previous paper from the recycling bin and uncrumpled it. W- made a point of scoring both papers and adding smileys. J- beamed.

Ah, behavioural psychology at home. You can influence people’s motivation by acknowledging or devaluing their work. In The Upside of Irrationality: The Unexpected Benefits of Defying Logic at Work and at Home (Dan Areily, 2010), I read about experiments that explored how motivated people were if they thought their results were meaningless. As it turns out, people are strongly affected by the immediate perception of the usefulness of their work.

In a task involving assembling Lego figures, participants who completed figures and put them into a box did more and enjoyed the task more than participants whose figures were disassembled right after they finished completing them. Another experiment described in the book involved finding pairs of letters on pages, a small payment scheme that stopped at the 10th sheet, and three scenarios where:

49% of the people who were acknowledged went on to complete ten sheets or more, while only 17% of the people whose work was immediately shredded completed 10 or more. Only 18% of the people whose work was ignored completed ten sheets or more.

Verbal acknowledgment of good work is good, but could it be at odds with the physical message of tossing the paper into the recycling bin? Best to be coherent. So the paper is celebrated, labeled, and put into a folder.

W- reminds me of this principle too, when I forget. On the way home from work one day, I brought up how he spent some time selecting and copying items from the workbook onto a piece of paper for J-‘s exercises. “Should we get a workbook without explanations, so J- can test herself?” I asked W-.

“No, it’s okay. Besides, it shows her that I value this,” W- said. “If I give her a workbook so that I can do something else, it’s not the same.”

We invest learning with meaning and value, and that helps.

Context-switching and a four-project day

June 30, 2011 - Categories: drupal, geek, rails, work

Context-switching among multiple projects can be tough. I’m currently:

I’m doing the Drupal 6 development in a virtual machine on my system, with an integration server set up externally. Consulting for the second project is done on-site or through e-mail. The Rails site is on a virtual server. The dashboard project is now on the company’s servers (IIS6/Microsoft SQL Server), which I can VPN into and use Remote Desktop to access. I’m glad I have two computers and a standing desk (read: kitchen counter) that makes it easy to use both!

Today was one of those days. I helped my new team member set up his system so that he could start working on our project. He’s on Mac OS X. It took us some time to figure out some of the quirky behaviour, such as MySQL sockets not being where PHP expected them to be. Still, we got his system sorted out, so now he can explore the code while I’m on vacation tomorrow.

In between answering his questions, I replied to the consulting client’s questions about Drupal and the virtual image we set up yesterday. That mainly required remembering what we did and how we set it up. Fortunately, that part was fairly recent, so it was easy to answer her questions.

Then I got an instant message from the person I worked with on the fourth project, the call-center dashboard. He asked me to join a conference call. They were having big problems: the dashboard wasn’t refreshing, so users couldn’t mark their calls as completed. It was a little nerve-wracking trying to identify and resolve the problem on the phone. There were two parts to the problem: IIS was unresponsive, and Microsoft SQL Server had stopped replicating. The team told me that there had been some kind of resource-related problem that morning, too, so the lack of system resources might’ve cascaded into this. After some hurried searching and educated guesses about where to nudge the servers, I got the database replication working again, and I set IIS back to using the shared application pool. I hope that did the trick. I can do a lot of things, but I’m not as familiar with Microsoft server administration as I am with the Linux/Apache/MySQL or Linux/Apache/PostgreSQL combinations.

I felt myself starting to stress out, so I deliberately slowed down while I was making the changes, and I took a short nap afterwards to reset myself. (Coding or administering systems while stressed is a great way to give yourself even more work and stress.)

After the nap, I was ready to take on the rest. The client for the Rails project e-mailed me a request to add a column of output to the report. I’d archived my project-related virtual machine already, so I (very carefully) coded it into the site in a not-completely-flexible manner. I found and fixed two bugs along the way, so it was a good thing I checked.

Context-switching between Drupal 6, Drupal 7, and Rails projects is weird. Even Drupal 6 and Drupal 7 differ significantly in terms of API, and Rails is a whole ‘nother kettle of fish. I often look things up, because it’s faster to do that than to rely on my assumptions and debug them when I’m wrong. Clients and team members watching me might think I don’t actually know anything by myself and I’m looking everything up as I go along. Depending on how scrambled my brain is, I’d probably suck in one of those trying-to-be-tough job interviews where you have to write working code without the Internet. But it is what it is, and this helps me build things quickly.

On the bright side, it’s pretty fun working with multiple paradigms. Rails uses one way of thinking, Drupal uses another, and so on. I’ve even mixed in Java before. There were a few weeks I was switching between enterprise Java, Drupal, Rails, and straight PHP. It’s not something I regularly do, but when the company needs it, well… it’s good exercise. Mental gymnastics. (And scheduling gymnastics, too.)

I like having one-project days. Two-project days are kinda okay too. Four-project days – particularly ones that involve solving a problem in an unfamiliar area while people are watching! – are tough, but apparently survivable as long as I remember to breathe. =)

Here are tips that help me deal with all that context-switching. Maybe they’ll help you!

Look things up. It’s okay. I find myself looking up even basic things all the time. For example, did you know that Ruby doesn’t have a straightforward min/max function the way PHP does? The canonical way to do it is to create an array (or other enumerable) and call the min or max member function, like this: [x,y].max. Dealing with little API/language quirks like that is part of the context-switching cost. Likewise, I sometimes find myself wishing I could just use something like rails console in my Drupal sites… =)

Take extensive notes. Even if you’re fully focused on one project and have no problems remembering it now, you might need to go back to something you thought you already finished.

Slow down and take breaks. Don’t let stress drag you into making bad decisions. I felt much more refreshed after a quick nap, and I’m glad I did that instead of trying to force my way through the afternoon. This is one of the benefits of working at home – it’s easy to nap in an ergonomic and non-embarrassing way, while still getting tons of stuff done the rest of the day.

Clear your brain and focus on the top priority. It’s hard to juggle multiple projects. I made sure my new team member had things to work on while I focused on the call center dashboard project so that I wouldn’t be tempted to switch back and forth. Likewise, I wrote the documentation I promised for that project before moving on to the Rails project.

Breathe. No sense in stressing out and getting overwhelmed. Make one good decision at a time. Work step by step, and you’ll find that you’ll get through everything you need to do. Avoid multi-tasking. Single-task and finish as much as you can of your top priority first.

I prefer having one main project, maybe two projects during the transition periods. This isn’t always possible. Programming competitions helped me learn how to deal with multiple chunks of work under time pressure, and I’m getting better at it the more that work throws at me.

What are your tips for dealing with simultaneous projects?

2011-06-30 Thu 16:19