doug's blog

What I learned about Scrum

Development methodologies weren't taught at Cornell when I took Computer Science 1982-1986. I first remember hearing about them in the early 1990's. At CivicActions, we've talked about "agile" and "scrum" for some time. But it really took the last couple of projects for me to embrace these methods.

Serialized Objects

in

It sounds pretty obvious. My php warning to you is:

if you serialize a php object, be sure that when you unserialize the object, that the php file which defines the object is loaded in memory.

in complex projects, the ifs-and-whys are often buried deep in the code. The specifics of my saga involve Drupal and panels.

DrupalCon Paris 2009 Video

DrupalCon Paris 2009 is two and a half months away and I'm excited. My wife Marcia is coming with me, we've got our tickets, rented our flat across from Jardin Du Luxembourg, and will be there for two weeks! Vote on youtube DrupalCon for this video, and help John Albin with free admission, at 195-eu, a sweet deal.

hook_form_alter and _node_form, BEWARE!

Caveat Emptor.  This is a Drupal 5.x case, but I think the warning also applies to 6.x.

Drupal Update Handlers with increased memory_limit

I'm doing a lot with update handlers these days. This is where I put almost all of the configuration changes for a release. Putting configuration changes in update handlers has the huge advantage of (a) source controlling these changes, and (b) allowing you to qa them. I strongly recommend this practice.

Most configuration changes are very easy to make in code. Often all you need to do is call variable_set. Sometimes, you have to write some SQL to directly change a table value.

Keyboards

I've been using the Microsoft Ergonomic 4000 keyboard for about a week now, and decided it's not for me. The wrist rest is uncomfortable, and I've discovered that my right hand has been cheating on one particular vi key stroke (it's the "b" to go back a word), and I just can't undo 20 years of muscle memory.

I've spent the better part of a Sunday afternoon now, searching for what to try next, and I can't decide. Here are the options. What do you think?

<?php
  $node
= node_load(1443);

 
$edit = $_POST;
 
$choice = $edit['choice'];
 
$vote = $_POST['vote'];

  if (isset(
$choice) && isset($node->choice[$choice])) {
    if (
$node->allowvotes) {
     
// Record the vote by this user or host.
     
if ($user->uid) {
       
db_query('INSERT INTO {poll_votes} (nid, chorder, uid) VALUES (%d, %d, %d)', $node->nid, $choice, $user->uid);
      }
      else {
       
db_query("INSERT INTO {poll_votes} (nid, chorder, hostname) VALUES (%d, %d, '%s')", $node->nid, $choice, $_SERVER['REMOTE_ADDR']);
      }

     
// Add one to the votes.
     
db_query("UPDATE {poll_choices} SET chvotes = chvotes + 1 WHERE nid = %d AND chorder = %d", $node->nid, $choice);

     
$node->allowvotes = FALSE;
     
$node->choice[$choice]['chvotes']++;
     
cache_clear_all();
     
drupal_set_message(t('Your vote was recorded.'));
    }
    else {
     
drupal_set_message(t("You are not allowed to vote on this poll."), 'error');
    }
  }
  if (
$node->allowvotes) {
    if (
$_POST['op'] == t('Vote')) {
     
poll_vote($node);
    }
    print
preg_replace(
      array(
       
'/ThinkPad UltraNav/',
       
'/Apple Keyboard/',
       
'/Evoluent Ergonomic/',
       
'/Luxeed Dynamic Pixel LED Keyboard/',
       
'/Das Keyboard/',
      ),
      array(
       
'<a href="http://www-307.ibm.com/pc/support/site.wss/MIGR-45868.html">ThinkPad UltraNav</a> - I\'m accustomed to typing on the ThinkPad, but in a desktop, I\'d prefer to NOT have the touchpad',
       
'<a href="http://store.apple.com/us/product/MB110LL/A">Apple</a> - gets lots of rave reviews, but I\'m not a  Mac user',
       
'<a href="http://www.evoluent.com/kb1.html">Evoluent Ergonomic</a> - interesting design that lets righties get to the mouse easier',
       
'<a href="http://www.luxeed.com/product_01.php">Luxeed Dynamic Pixel LED Keyboard</a> - cool, but I\'m not really considering it, just thought I\'d throw it in so others could see it',
       
'<a href="http://daskeyboard.com">Das Keyboard</a> - would have to go with the "Ultimate" for the geek factor.',
      ),
     
drupal_get_form('poll_view_voting', $node, FALSE)
    );
  }
  else {
    print
poll_view_results($node, FALSE, FALSE, FALSE);

    if (isset(
$node->vote) && $node->vote > -1 && user_access('cancel own vote')) {
      print
drupal_get_form('poll_cancel_form', $node->nid);
    }
  }
?>

Voting results

Synchronizing translatable nodes

I just discovered the i18nsync module today. I'll be using this on every i18n site I develop. The only thing I found missing was locations, which was a simple patch.

Upgrade CivicActions Home Site to 6.x

in
We upgraded the home site to 6.x last week. Other than a broken login (phpass on 6.x) for about a day, it's been a smooth upgrade. Kevin helped me get the ball rolling during DrupalCon, but it took up until last week to finish due to competing priorities, and some of the complexities.

Coder review of contrib upgrade to 6.x (for DrupalCon Szeged)

I am co-presenting coder at DrupalCon Szeged with my co-maintainer Stella who has been co-maintaining coder for about a year. See the session write-up This presentation will be similar to the one given in Boston. But Since we have less time, and since we are co-presenting (meaning even less time for me), I'm pre-releasing parts of the presentation in this blog.
Syndicate content