Archive for the ‘Personal’ category

CakePHP Full Text Search

June 20th, 2010

CakePHP’s database abstraction is just one of the reasons to use this powerful framework for agile web development. However, it is not always obvious how to build complex queries. I recently had to implement a MySQL full text search against a music database that searched on titles, descriptions and tags. Full text search is a quick, and not too dirty way to make a pretty decent search, although it does come with a caveat, as described in the MySQL documentation:

Full-text indexes can be used only with MyISAM tables, and can be created only for CHARVARCHAR, or TEXTcolumns.

It did take a little bit of experimentation to get the syntax for the query correct in CakePHP as the query is a little different from the regular “SELECT field FROM table WHERE somevalue = somevalue“.

So, for this example I will use a MyISAM table called pages and search against the title, content and tags fields for the term” jquery web development”. You should substitute that term with your dynamically passed value in the code below.

Firstly I built the conditions for my query into a “params” array.

$params['conditions'] = array(
‘MATCH(Track.title,Track.description,Track.tags)
AGAINST(”‘ . $kw_list . ‘” IN BOOLEAN MODE)’
);

$params= array(’conditions’ => array(
‘MATCH(Page.title,Page.description,Page.tags)
AGAINST(”jquery web development” )’ ));

Finally a call to CakePHP’s native find method will perform the search:

$this->Page->find(’all’,$params);

One last note: MySQL full text search can be powerful when used correctly and a potential bottleneck when poorly implemented. I suggest reading the documentation for further information and more advanced usage.

A health insurance example of how SEO is dead, long live Online Marketing.

June 7th, 2010

At Zumo Internet, when we started a new campaign for health insurance company, WPA one of the things we have noticed over the last year is that whilst SEO is not entirely dead, there are so many more avenues to explore when trying to boost traffic to websites.

For instance, we had to research the private health insurance industry to see exactly what services were offered and what users were likely to search for when they were trying to find private medical insurance. In doing so, we realised that there are a great number of concepts in the health insurance industry that were not understood to the leyman. Even the costs or the ability to use private medical insurance to fast track in the NHS were concepts new to us. So we were researchers in the medical insurance industry.

Then we found ourselves having to compose press-releases, articles and surveys connected to the health insurance industry in order to help people better understand once they hit the site as well as change site copy to make a balance between discovery by search engines and human readability. So we were copywriters.

Finally we had to get all this information into a well-presented and readable report showing what people were searching for when they were looking for medical insurance and what the effects of our works was. So were statisticians.

SEO seems such a misnomer for the work that goes into driving relevant traffic to sites. So we now opt for the label Online Marketing.


How to fix the OSX Leopard Set up Assistant Loop Bug.

January 19th, 2010

Today, my G5 (Leopard) started displaying the Set Up Assistant everytime it booted. Even after completing setup it was impossible to access the GUI. It was held in a continuous.

If you get caught in the Leopard Setup Assistant Loop Bug, here is the way to get your Mac booting again with no loss of data.

  1. Boot into Safe Mode by holding down the shift key just after you hear the first boot sound. This takes an eternity so be patient.
  2. Don’t log in to any account. Instead press the back arrow key once (this will highlight an account).
  3. Then click the restart button.
  4. Now just wait while your Mac performs some updates and then reboots as normal again.

Even Macs break occasionally / rarely.

Select and Unselect All Checkboxes with jQuery

January 15th, 2010

I’ve been working with jQuery to spice up my interfaces for over 12 months now and figured it’s time to share some of the little techniques I’ve developed on the way.

The first is something I use quite alot when I am giving users the ability to administer lists of items in bulk. That including a checkbox that when checked sets the state of all the checkboxes beside a list of items to “checked”. Naturally unchecking it will uncheck all checkboxes. I’m sure you get the picture here’s the code based on two scenarios depending on your preference. But firstly you need to include the jQuery library in the head of your document (I grab mine straight from Google’s repository to save my bandwidth):

» Read more: Select and Unselect All Checkboxes with jQuery

Keep linux scripts running after you have closed a remote shell.

October 14th, 2009

I stumbled across this whilst importing 1.1TB of data from a server to Amazon S3 (more on that another day). What I wanted to achieve was to be able to ssh into my remote server, issue a command to push over 200,000 mp3’s up to Amazon and to be able to exit the shell and keep the process running.

The answer lies in a command line tool called screen.

Screen allows you to start a process on a virtual screen, then detach that screen and do something else (including log out). You can also reattach your screen after logging out and logging in again.

If you dont have the screen command on your remote linux box, first install it either from source or using your favourite package manager. Then login into your remote box and run your desired command prefixed with “screen”. For example:

screen top

Now to detach the screen use CTRL+a followed by d. This will detach your screen and you can go about any other business, including quitting your remote session.

Reattaching you screen at any time is as simple as running the command:

screen -r

You can detach and reatach your screen as much as you want until your running process is finished or you kill it, at which point your virtual screen is killed too.

British Sign Language Support – New Zumo Internet Launch

September 22nd, 2009

Over at my Web Development Agency in Spain we’ve been busy again and we are pretty chuffed with the results. Once again working with TMax Media we have built and just launched BSL Homework Support a website that offers resources, and assessments for anyone interested in learning sign language.

We cut the XHTML, wrote the CSS and used PHP and MySQL to power the online purchasing and content retrieval system. The site features thousands of video clips that we deliver using jQuery and some elegant third party applications such as Shadowbox and JWPlayer.

If you are looking for something special for your next web project, or you’re a media agency looking for a reliable and talented web development service, please email info@zumointernet.com and we’ll let you know what we can do to you.

CEIP Mariana Pineda, Benalmadena, Arroyo de La Miel

September 10th, 2009

Hopefully this may help someone else find the contact number for this school which is not correctly listed on either the Yellow Pages in Spain or the Junta de Andalucia’s website.

The telephone number is 951 293 997

In case you are wondering why it is so hard to find: the school is fairly new and is listed as a plot of land still on the Junta’s site. I’m guessing the amount of paper work needed to get a website change actioned is far greater than the parent’s need to contact a school.

The official listing is here.

Summer Fields School – New Zumo Internet Launch

September 3rd, 2009

Whoops we did it again. Another Zumo programmed site has left the building, this time in the shiny coat of Summer Fields Prepartory School.

TMax Media designed the site and Zumo Internet cut the code and programmed the CMS and front end from start to finish with a smooth blend of XHTML, CSS, PHP, MySQL and jQuery. More reason to trust us with your web site development.

Working with PHP’s simplexml and nodes with hyphens

July 21st, 2009

Here’s a quick GOTCHA that may save at least one developer some time. Recently whilst working with some XML to import music into an mp3 download site I came across an issue accessing the values of specific nodes through the simplexml object that I created. The value always threw up zero.

The issue lies in node names containing hyphens, thus:

$object->album-title     returns     0

The answer is to wrap the object property (node name) containing the hyphen in curly braces.

$object->{’album-title’}     returns     “London Calling”

Here’s hoping that helps someone.

Thunderbird Software Update Failed. One or more files could not be updated

July 19th, 2009

This is a software update loop that has been annoying me for a while now when Thunderbird tries to update itself on Windows. Well, before you go removing any files or removing Thunderbird and starting from scratch, try this somewhat abstract method. I’ll bet more times than not it works:

  1. Ctr+Alt+Delete and open your Process manager.
  2. End the process “Quickcam.exe”.
  3. Restart Thunderbird, install the update and sleep peacefully.