drupal

26 Aug

Drupal and Sentiment Analysis on OpenAmplify Blog

in drupal, openamplify, querypath, sentiment

Over at the OpenAmplify blog, SteveS talks about how the CMS world has changed, and how Drupal has "come to his rescue" as he builds a new corporate website. He discusses using OpenAmplify and the Drupal Amplify module to analyze sentiment.

Sentiment analysis is all the rage right now, with the New York Times running a big story on it last Sunday. The Drupal Amplify module provides a foothold into this market already, and I'm excited to be talking about it in my QueryPath session at DrupalCon Paris next week.

02 Jul

Review of "Drupal 6 JavaScript and jQuery"

in drupal, javascript, jquery

Kat Bailey posted a very kind review of my Drupal 6 JavaScript and jQuery book.

From the review:

The book aims to get people with little to no knowledge of Drupal or JavaScript up to speed with creating really awesome functionality, really fast. In fact, its title almost belies the breadth of its scope: although the use of jQuery in Drupal 6 is the one topic that it covers exhaustively, it doesn't skip over any of the basic tools or concepts required to get going with Drupal, and so it would work pretty well as a first Drupal book for any aspiring front-end Drupaler. It covers everything from the ultra-utra-basic ("what is CSS?", "what is a Drupal block?") to Drupal JavaScript Behaviors (and everything else in drupal.js), to JavaScript Theming, to AJAX, to building modules with AJAX functionality, to jQuery syntax, effects, and even writing jQuery plugins!

I've spent the last week or so doing nothing but writing Drupal-centered JavaScript. Every time I reflect back on what JavaScript coding used to be like, I can't help but appreciate the hard work of the jQuery and Drupal JavaScript teams.

17 Jun

Amplify Module and TweetyPants.com on TechCrunchIT

in drupal, openamplify, tweetypants

OpenAmplify launched their new community portal yesterday, and TechCrunchIT picked up the story today. The Drupal Amplify module is highlighted in the story, as is my TweetyPants Twitter tweet-rating website. OpenAmplify provides semantic analysis tools, and the Drupal Amplify module can be used to submit node content and retrieve semantic information about the node.

08 Jun

Presentations from Drupal Camp Wisconsin

in drupal, drupalcampwi, education, javascript, jquery, querypath

DrupalCampWIDrupalCampWILast weekend, I joined a couple hundred other Drupal users at Drupal Camp Wisconsin at the University of Wisconsin, Madison. This well-organized two-day event was fantastic. I met many new people (and can now connect a face with an IRC handle for many more). And the crack team of conference organizers have already put together videos of many conference sessions.

For me, the conference highlights included a handful of sessions on Drupal in education, a pair of sessions on GIS and mapping, and a BOF that I attended on web services, portlets, and the future of distributed web applications. A perennial strong point for Drupal Camps is the coverage of Drupal basics. DrupalCampWI had around half a dozen sessions for beginners. If you are just learning Drupal, a camp like this can really help you find your footing.

The camp's commons area was fantastic, providing ample space for both small and large BOFs as well as impromptu brainstorming sessions. Many conferees stayed at the same hotel, making after-hours ad hoc get togethers easy. And Wisconsin food? I ate my first (and probably last) "bacon bratwurst pretzel burger with cheese."

I gave two sessions. The first was on JavaScript and jQuery in Drupal. The second was on Web Services, mashups and QueryPath in Drupal (a preview version of what I hope to show in Paris this September). Most of the conference sessions are now available in video form.

Update: Added link to QueryPath video

04 Jun

QueryPath 1.3 module released, now has an XML cache

in drupal, php, querypath


The QueryPath module, version 1.3 is now available. This release adds a new submodule called QP Cache.

QP Cache is a cache system optimized for XML storage. It supports keys of arbitrary type and length (objects, strings, arrays) as well as fuzzy expiration dates ("2 weeks"). Cache lookups are very fast. Cache maintenance is left to the implementor. (In other words, Drupal cache clears have no impact on this cache, by design). The main use case, it is anticipated, is to store local copies of documents retrieved from remote web services. While QP Cache can be used without QueryPath, it provides integrated functions that make it trivially easy to work with QueryPath objects.

The Amplify module uses QP Cache to store OpenAmplify data. The code there is a good place to start when developing for QP Cache.

29 May

A Set of Objects in PHP: Arrays vs. SplObjectStorage

in benchmarks, drupal, php, programming, querypath

One of my projects, QueryPath, performs many tasks that require maintaining a set of unique objects. In my quest to optimize QueryPath, I have been looking into various ways of efficiently storing sets of objects in a way that provides expedient containment checks. In other words, I want a data structure that keeps a list of unique objects, and can quickly tell me if some object is present in that list. The ability to loop through the contents of the list is also necessary.

UPDATE Jan 4, 2013: See the updated benchmarks.

Recently I narrowed the list of candidates down to two methods:

  1. Use good old fashioned arrays to emulate a hash set.
  2. Use the SPLObjectStorage system present in PHP 5.2 and up.

Before implementing anything directly in QueryPath, I first set out designing the two methods, and then ran some micro-benchmarks (with Crell's help) on the pair of methods. To say that the results were surprising is an understatement. The benchmarks will likely change the way I structure future code, both inside and outside of Drupal.

19 May

Packt: Creating Our First Module using Drupal 6 (Part2)

in drupal, learning drupal 6 module development, packt, php

Learning Drupal 6 Module DevelopmentLearning Drupal 6 Module Development
Today Packt has published the second part in my series on creating a first Drupal 6 module. In this installment, I walk though the process of implementing hook_block(). Here's Packt's summary:

In the first part of this 2-part article series we had created a basic module that uses hook_block() to add block content and installed this basic module. In this article by Matt Butcher, we are going to extend the module's functionality. We will add a few new functions that retrieve and format data from Goodreads.

As with the previous part, this has been abstracted from Chapter 2 of Learning Drupal 6 Module Development.

If you missed the first part, start here.

15 May

Drupal Quiz 3.0 Alpha 2 released

in drupal, quiz

Drupal Quiz 3.0 Alpha 2 is now released.

The major news for this release is that it has gotten three big new features:

  • A new Matching question type has been added.
  • A new Short answer question type has been added (and it offers fill-in-the-blank-like functionality)
  • QTI (Question & Test Interoperability) XML, version 1.2, can now be imported by Question Import.

Here are some screenshots of the new question types:
MatchingMatchingShort answerShort answer

15 May

Packt: Creating Our First Module using Drupal 6 (Part1)

in drupal, packt, php

Packt has published an article of mine on beginning Drupal 6 module development. In the article, I cover the process of writing a first module (it's based on Chapter 2 of Learning Drupal 6 Module Development). Here's the intro from the article:

Creating Our First Module using Drupal 6 (Part1)

In this two-part article series by Matt Butcher, we will create our first Drupal module. This article assumes basic knowledge of Drupal module development. Our first module will make use of an existing web service to pull in some XML data, format it, and display it as a block in the site's layout.

We will cover the following topics in this article:

  • Creating the .info and .module files
  • Creating a new module
  • Using basic hooks
  • Installing and configuring the module
  • Using important Drupal functions

Read it all: http://www.packtpub.com/article/creating-our-first-module-using-drupal6-...

11 May

The Drupal Lucene API

in drupal, lucene, php, search

At DrupalCon DC, I attended a session on the Drupal Lucene API module. Now, I've been a <http://lucene.apache.org">Lucene Java hacker for many years, and have even written some pretty sophisticated Lucene-based software. I was thrilled when I discovered that Zend had replicated the Lucene API in the Zend Framework. A year or so ago I ported Pilaster over to ZF Lucene.

I am just now getting a chance to read through the Lucene API module for Drupal, and it is very impressive. Aside from being very easy to set up, the actual API is packed with useful goodies that should make building a search implementation easy. Of course, there is already a module for searching Drupal node content, but where Lucene API will shine is in its ability to add on other data sources.

Which leads me to ponder this: OpenOffice.org documents are in XML. QueryPath does XML. I'm thinking that a QueryPath/LuceneAPI tool for indexing OpenOffice documents could be written in about an hour. I hear that MS Office X documents are also XML....