cmurray.org

Observations on technology, business, and other weirdness.

June 5, 2009

Mia Sings Delilah

Filed under: @Home, @Work, Music, Personal — Christopher Murray @ 6:55 am

Last night my oldest daughter, Mia, did what I think took a lot of courage. She got up in front of  about 100 people (parents, kids, grandparents) and sang the song Hey There Delilah. If you know the song, you know there’s lots of words that go by pretty fast and the melody itself requires a fairly wide vocal range. While slightly more timid than usual, she sang with her usual grace and sweetness. She is my favorite singer.

Mia is no stranger to the stage. This summer, she’ll be attending another season of her theater camp and will be performing in her tenth play. Last night was a less formal setting (part of a 70s themed  end-of-the-year celebration at her after school program), but she still brought her game. I’m very, very proud of her. It was such a delight to have parents tell me after the fact how wonderfully she sang and how brave she was to do it.

May 18, 2009

SimpleMind: Mind Mapping For Process and Systems

Filed under: @Work, Technology — Christopher Murray @ 10:02 pm

garland_logo1I’ve recently noticed several posts mentioning mind mapping and other forms of defining process and capturing ideas. I can’t tell you how many tools I have used over the years for this purpose, Visio being my absolute least favorite. (I’ve also run the gambit of note-taking applications, from OneNote to EverNote, my current favorite.) But mind mapping is a simple and cool visual way to illustrate how a process or system might work. This little example below was quickly done on my iPhone using SimpleMind, which I then saved as an image, then imported into this post (using the WordPress iPhone edition). It’s a simplified example but it does show how easy it is to diagram the initial stages of thought for a project. I’m gonna kick this one around for a while, and see if there is a more complete version for the desktop.

There’s not much more to this application. You create related boxes and can move them about the screen. You can change the color scheme and either export it as an image or export it to the paid version ($6.99). For free, this is definitely worth trying out, especially if you’re like me and finding your phone a bigger part of running your business.

April 19, 2009

Running WordPress on Windows IIS

Filed under: @Work, Technology — Christopher Murray @ 8:38 am
Don’t. Just don’t do it. Do not run WordPress on a Windows IIS web server. Simple as that.

We released a major new site rebuild this week and had the unfortunate experience of having the system running on IIS 6.

How do I hate thee, IIS? Let me count the ways …

URL Rewrites. This is the functionality that turns a URL like this: index.php?id=564, into a pretty URL that looks like this: /running-wordpresss-on-iis-sucks/. This second method is preferred not only for search engine exposure, but also because it is easier on the eyes, easier to remember, and is immediately recognizable when sent via an email. This is simple to do when running WP on an Apache web server because you can simply set it in WP (customizing the structure of the link to use dates, titles, etc) and forget it. But IIS has no sense of URL rewriting. You can redirect a file by going into the server settings and configuring it by hand, but that is unacceptable when managing 1,000+ documents/posts/pages.

The lack of rewriting also affects paging (when the server returns multiple pages of search results and the URL needs to support a structure like this: /?search=why-does-windows-suck/page/3).

I spent many days looking for and programming my own solutions. None that I could find solved all the problems created by the missing functionality. I’ll save you the details, but I finally found one that worked:  WordPress URL Rewrite by Binary Fortress. It is a simple ISPAI .dll extension that you point your IIS server to. There is one .ini file where you can identify the root-level directory where you want to start rewritiing, and then a second section where you can list exceptions. The exceptions was critical for this project because we needed to leave in place e-commerce functions that run on IIS).

And then there’s 301 redirects. Windows IIS does not support this either. Why is this important? Because when you rebuild or redeign a site, even though the content in the system remains the same, often the permalinks are going to be different (some of them, anyway). In order to maintain your good standing with the search engines, you need to redirect those old pages to the new ones, or at least to another page that exists on the site. If search results from Google are returning pages on your site that no longer exist, your ranking suffers. Apache allows you to create a .htaccess file, which is a simple text file that the server reads to map those changes (it’s simply a line-by-line list of old pages and news pages). But IIS has nothing this simple. In IIS you need to go to each page in the file structure, right-click on it, go to it’s properties, and then set it to map to another page. Again, for a site with 1,000+ pages, a nightmare.

These may sound like trivial quibles, but this is a fundmental issue when you’re knee-deep in a redesign/rebuild. The alternative, when possible, is to run Apache on the Windows server.

October 7, 2007

The Northborough Group

Filed under: @Work, Strategy, Technology — Christopher Murray @ 10:53 pm

I am proud to introduce my new business venture: The Northborough Group.

The mission of The Northborough Group is to provide services that help businesses manage information better and to use that information in a way that supports defined business goals. The Northborough Group enables:

  • business analysis and functional specifications;
  • design and development of internet and intranet sites;
  • data modeling, mining and migration;
  • open-source systems integration;
  • custom development that provides context for your data.

We also specialize in content management systems (CMS) and the information structures required to build them properly (for example, meta data and taxonomy). In addition, we partner with other experts in the field to better serve your needs.

home
blog
lightbox

Visit our web site at http://www.northboroughgroup.com. Check out our blog, which keeps you current with our projects but also provides insight into industry trends and provides technical how-tos. In addition, click through our portfolio to see the projects and systems we have created. And best of all, click on Contact Us and tell us what ideas you have and how we can help make them reality.

My email is cmurray@northboroughgroup.com. You can always reach me at 508.294.6732.

February 2, 2007

Building Dynamic Database Inserts

Filed under: @Work — Christopher Murray @ 11:24 am

As follow up to yesterday’s post about dynamically assigning variables from database queries, below is some code that takes all incoming values from a PHP form and dynamically maps them to database columns, again, avoiding manually parsing and assigning variables for every query.

The code is simple: form input comes in as HTTP_POST_VARS, which comprise both a key (the variable name) and a value (the information in the form field). We first loop through and break those two elements out of each field and name them $key and $value. Then we create a list of the keys, or field names (which map identically to their counterpart columns in the database), in the format required for the INSERT statement. We do the same for the $values. After looping though and building our lists, we do a little pattern matching and replacement to strip off the trailing commas from each list (preg_replace). From there, we build and execute our elegant little INSERT statement. And like yesterday’s example, this works with any number of fields.

I should note that performance would be better if instead of the preg_replace I used some conditional logic, but I didn’t have time to write that yet.

while(list($key, $value) = each($HTTP_POST_VARS))
{
if($key != “addRequest” && $key != “”)
{
$sqlKeys .= “$key, “;
$sqlValues .= “‘$value’, “;
}
}
$sqlKeys = preg_replace(“!, $!”,”",$sqlKeys);
$sqlValues = preg_replace(“!, $!”,”",$sqlValues);
$sql = “INSERT into vendorApprovals ($sqlKeys) values ($sqlValues)”;
$result = mysql_query($sql);
}

Here also is the code to edit the record we created above:

$sql = “UPDATE vendorApprovals set “;
while(list($key, $value) = each($HTTP_POST_VARS))
{
if($key != “editRequest” && $key != “” && $key != “editID”)
{
$sql .= “$key = ‘$value’, “;
}
}
$sql = preg_replace(“!, $!”,”",$sql);

$sql .= ” where id = ‘$editID’;”;
$result = mysql_query($sql);

February 1, 2007

Variable Variables In PHP

Filed under: @Work — Christopher Murray @ 5:01 pm

This little bit of code here is actually pulling some 24 fields from a database table and assigning them each to individual variables for populating a PHP form (which then can be used to repopulate the database). The trick here was to name the form fields identically to their counterparts in the database. For example, the form field vendorName maps to the database field vendorName.

In many cases, you would run your query, parse out the values, and then assign them manually to variables, like this:

$vendorName = $row[vendorName];

This can be really cumbersome when you have dozens of values coming out of the database. In the case below, we use the PHP function mysql_field_name to grab the database column names. We then use a device called variable variables to assign that value to another variable. The construct is that last line, $$key = ${value}. The double dollar sign makes that variable variable the actual field as variable name rather than its own value. So, rather than seeing vendorName = ‘RedHat’, we see and can use $vendorName = ‘RedHat’. Because of this feature I can dynamically populate all the fields in the form with values right out of the database with only this little bit of code.

$sql = “select * from vendorApprovals where id = ‘1′”;
$result = mysql_query($sql);

while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) {
$i=0;
foreach ($line as $col_value) {
$field=mysql_field_name($result,$i);
$array[$field] = $col_value;
$i++;
}
}
while (list($key, $value) = each($array)) {
$$key = ${value};
}

January 25, 2007

@Home and @Work

Filed under: @Home, @Work — Christopher Murray @ 12:59 pm

I have added two new categories to my blog in order to capture things I discover during my various development projects, both at home and at work (thus the categories @Home and @Work).

I got this idea from my new friend, Sebastien Wains. Sebastien lives in the Belgian countryside, not 50 clicks from my uncle Miguel. Sebastien maintains a fabulous blog of code and systems tricks discovered in his work as a Systems Administrator. While working on a recent project at home (implementation of a secure IMAPS server on my blog host) I found his site invaluable for all sorts of configuration and installation tips and examples.

So, I am going to begin using this blog as a place to capture those things I find while developing that I don’t want to have to rediscover the next time I need them; a sort of development journal. @Home will focus on all things open-source, like Ubuntu, Apache, VMWare, web and database development. @Work will focus on enterprise content management systems, taxonomy, search, and also on particular vendors like Microsoft, Ektron, and Oracle. Hopefully, others will find this as useful as I have found Sebastien’s site.

No fear: I still will post about things like pygmy elephants and nuns with guns.

 

Copyright © 2009 Christopher Murray