Articles about computer software development and tools.

Running pocketsphinx Speech Recognition on Ubuntu

 I'm currently researching speech recognition for home automation projects. My primary requirement is that I want an open source package that runs locally in a Linux environment. "Runs locally" means a cloud based solution is not acceptable; I don't want random household chatter shipped off to the cloud.

I thought the pocketsphinx package looked promising. It's available in the Ubuntu repos, so I could try it on my desktop before setting up an embedded testbed.

Here's what I did to get it working.

First, install the following packages:

  • pocketsphinx-utils -- the pocketsphinx runtime
  • pocketsphinx-hmm-en-hub4wsj -- the "acoustic model"
  • pocketsphinx-lm-en-hub4 -- the "language model"

For voice input, I used the microphone in the Logitech Webcam Pro 9000 connected to my system. It's a USB device, and with my Linux sound setup gets routed to /dev/dsp.

To launch the speech recognition engine, run:

wp-spamspan Protects WordPress Blogs Against Spam Harvesters

Nearly two years ago, I published wp-spamspan in my Software Archive. Good things come to those who wait: I finally published it in the public WordPress Plugins Directory:

This plugin allows you to post email addresses (such as chip [at] unicom [dot] com) on your WordPress blog. The plugin filters the display text and automatically munges email addresses to something like:

chip [at] example [dot] com

Then, when loaded into a web browser, a dynamic script scans the page and converts the munged email addresses back to clickable links.

My experience has been that the protection is very good, and the plugin has been reliable.

By the way, I didn't invent spamspan. I just adapted it to WordPress. You can read more about it here:

New Wordpress Plugin Provides Anti-Spam Protection Against Email Address Harvesting

I've just released a Wordpress plugin to protect email addresses that appear in the body of posts against harvesting by spam 'bots.

The plugin is called wp-spamspan. It works by automatically rewriting an email address that spam 'bots encounter into a form like:

chip [at] unicom [dot] com

But for people, the email address appears as a clickable link.

The home page for the plugin is here:

Mar 18 update: Today, I received approval to add this plugin to the official Wordpress directory. Watch for it there (real soon now...).

CakePHP: The Good, The Bad, and The Hurty

As I noted in a previous article, I opted to use the CakePHP framework for the Holidailies 2008 rewrite. It's a PHP framework for web application development. It implements the MVC (model-view-controller) design pattern commonly found in web frameworks (such as Ruby on Rails). I made a very good choice moving Holidailies from complete custom code to a framework. I'm not completely happy, however, with my choice of framework. I'll tell you about some of the things I've found.

What I Liked

The best thing is that it implements magic ORM (object-relational mapping). Manual ORM, such as that implemented by Hibernate, is a major annoyance. You have to create all these useless getter/setter classes, construct an XML index, and go through a lot of work to build the ORM. And heaven help you if you make any schema changes. It's painstaking and fragile.

Developer Cookies

Fortune cookies the software developer received:

The inflection point of knowledge comes when you switch from the user manual to the API reference.

Just because everybody loves unit testing doesn't mean it gets done.

If you say "no" a lot, then there is a problem either with your attitude or your users.

Certification is not a substitute for wisdom.

Any web-based application in which business logic approaches zero may be implemented as a blog.

The corollary to the above is that every "build a web app in 15 minutes" demo will be to construct a blog.

Community of Personality

Software developers have learned that when you need assistance, there are places you can turn online. If you've got a C++ question, maybe you'll visit the comp.lang.c++ newsgroup. For Java questions, the Java Lobby web site is a popular resource.

These are "communities of interest". People with deep interest in the topic (we call them experts) gather there. They can be extraordinarily powerful resources, because you have so many qualified people congregating in one place. Just be sure you follow the guidelines of the community and don't do something stupid (like ask an FAQ), and you may be able to get some quality assistance.

This week, a new web site called Stack Overflow was launched. It is intended to be a resource to help developers with their questions, but it's different from those other resources.

An Example of Ruby Introspection

In my blog post yesterday about Java, I made positive mention of the Ruby programming language. I pointed out that by giving you the power to do some potentially dangerous and confusing things, Ruby also gives you the power to do some very cool stuff. Let me give you an example.

Let's start with a class called Person with a single attribute name:

class Person
    attr :name

Java is the Snubby-Nosed Scissors of Programming Languages

I've had to teach myself Java for my current contract. You may be surprised to find that with all the code I sling, I've not done any Java development up until now. Java is popular for enterprise application development, and I haven't done a lot of work in that space before.

I usually like learning new languages. I'm not enjoying Java at all. It's verbose and wordy, like a pedantic little schoolkid. It's like the snubby-nosed scissors of programming languages.

web-chpass Release

I just released a small update to the web-chpass program. This is a small, secure, robust utility that allows users to change their (Unix/Linux) login password through a web form.

No new features. Just a couple of small tweaks to the nipasswd program. Grab it if you want it.

Movable Type Force-Preview Update

It's been three weeks since I released the Force Preview plug-in for the Movable Type blog system. I blogged about it upon release. Thought I'd give a brief update.

First, the good news: it's been completely effective at stopping comment spam. I've found that the moment the plug-in is enable for a blog, comment spam ceases. My girlfriend reported a single spam, probably hand entered, during the past three-week period. Besides that, nada.

Now the bad news: it's kind of a pain in the butt. You need to modify a minimum of two templates (your individual archive entry template and comment preview template), and more if you use the (now deprecated) comment pop-up. The instructions are pretty explicit, so it shouldn't be difficult if you've only got one blog. It's might annoying, however, if you have several. I had four blogs that needed protection, and only today did I get around to dealing with the last of them.

More bad news: I tried to register the plug-in with Six Apart, the makers of Movable Type, but they won't let me without signing up for Type Key.

My other concern is that trackback spam continues to be a problem, but it's not nearly at the level of the comment spam.

So, I recommend that people with existing Movable Type blogs who are frustrated with comment spam consider trying it.

Syndicate content