Work on UVFood - Refactor, Refactor, Refactor

Wednesday, February 13th, 2008

I haven’t done much with UVFood in the last few weeks. Partly because we were traveling for two weeks, but we’ve been back for a while now.

The main reason is that I’ve been doing the dreaded refactoring of the code.

I’ve used Catalyst as the framework for building the web app. Catalyst apps use the Model-View-Controller (MVC) paradigm, and application builders often fall into the trap of having too thin a Model and putting too much of the work into the Controller.

(more…)

Building DBD::mysql under MacOS X

Friday, December 7th, 2007

MySQL Logo

There’s a glitch when you try to build Perl’s DBD::mysql under MacOS X.

When I tried to build it, I got a lot of errors that looked like this:

t/40numrows............install_driver(mysql) failed: Can't load '/Users/admin/src/CPAN/build/DBD-mysql-4.005-C3W6F2/blib/arch/auto/DBD/mysql/mysql.bundle' for module DBD::mysql: dlopen(/Users/admin/src/CPAN/build/DBD-mysql-4.005-C3W6F2/blib/arch/auto/DBD/mysql/mysql.bundle, 2): Library not loaded: /usr/local/mysql/lib/mysql/libmysqlclient.15.dylib
  Referenced from: /Users/admin/src/CPAN/build/DBD-mysql-4.005-C3W6F2/blib/arch/auto/DBD/mysql/mysql.bundle
  Reason: image not found at /System/Library/Perl/5.8.8/darwin-thread-multi-2level/DynaLoader.pm line 230.

It turns out that DBD::mysql was looking for the dynamic library for MySQL in the wrong place. It invokes mysql_config in order to find the location of the libraries, and mysql_config reports /usr/local/mysql/lib/mysql rather than /usr/local/mysql/lib

The easy way to fix it as to do this is to do this command from a Terminal window:

sudo ln -s /usr/local/mysql/lib/ /usr/local/mysql/lib/mysql

The drawback to this solution is that if you install an update to MySQL, you’ll need to remake this link.

You might also either modify mysql_config (it’s just a script, so it’s easy to edit), or to modify DBD::mysql, but the fix I’ve suggested is the simplest.

The real solution is to fix the MySQL distribution for MacOS X to have the correct path in it.
[tags]dbd::mysql, dbi, perl, mysql, macintosh[/tags]
(more…)

MacOS X 10.5 Leopard, From a Developer’s Perspective

Sunday, November 4th, 2007

Apple’s eagerly awaited operating system, MacOS X 10.5, also known as “Leopard”, is now in our hands, and there are quite a few features in it that will be interesting to developers. Amazon is still offering Leopard for $20 off list and Leopard Family Pack (5-user license) for $10 off list.

I do limited development on MacOS X. I don’t write Macintosh applications, but I do write web-based applications that I deploy to non-Macintosh servers. The Mac is a great environment for doing this; I get a real UNIX environment under the hood with Apache, MySQL and Perl, and a nice layer of Macintosh over the surface. After years of struggling with Windows and Cygwin, or living with Windows and Linux, it’s been wonderful moving to a single, reasonable environment for working.

Given that, my emphasis on development under Leopard will be on the kinds of tools a web developer might use, rather than XCode, although I’ll touch on XCode at the end.

(more…)

Welcome to the Blue Forest Research Blog

Thursday, December 28th, 2006

I’ll be using this blog to share information about software development I’m involved in. Most of my work currently involves developing web sites using either Wordpress for blogs or the combination of Perl, MySQL, HTML::Mason and the Catalyst Framework for Perl. Partly this blog is for me; by writing down things I’m using I’ll help myself remember them and have a good resource to fall back on when I forget them. Partly it’s for you; I hope that by sharing some of the things that I find as I work on my projects will be helpful to other people.

Some of what I’ll get into here will be how to structure your web site so that it plays well with others - Google is the obvious target, but Technorati and general search engine optimization are important too, as well as how to use AJAX techniques appropriately. I’ll also talk about security issues (which can be very interesting when you’re utilizing AJAX)

I’ll talk about how to monetize your work, primarily through the use of Google Adsense, the Amazon Associates program, and LinkshareLinkshare, which administers affiliate programs for a very large number of companies including Apple and the iTunes store.

(more…)

Sponsored Links