Latest Headlines

Planet Derby – Valentines

As mentioned previously we were working on a Valentines version of Planet Derby. Well it was ready for valentines day and you can have a go at Planet Derby : Valentines

It’s much better if you’ve got a webcam

Delete autocorrect entry from iPhone dictionary

So everyone has got words in the iPhone dictionary that get autocorrected to something you use more regularly. Mine has now started replacing “in” with “i’n” which is annoying because firstly I don’t know how that got in there and secondly, I use the word in quite a lot.

Yeah, I can click the cross and change it back to in but I’d prefer to get rid of the entry. You can go into Settings > General > Reset > Reset Keyboard Dictionary and get rid of all your personal additions but that’s a bit extreme.

The correct way of doing it is start a text, type the word in and when the cross comes up, press it. Do this about five times and it will be removed from the dictionary.

Simples.

Planet Derby

Check it out! We’ve been creating Planet Derby for the University of Derby.

So far we’ve done Planet Derby and Planet Derby Chirstmas.

Currently working on Valentines edition which will be followed by Easter version.

Update – 11/4/2001
We’ve now added a Valentines version and a Mother’s Day version but I don’t know if there’s going to be an Easter version or not.

PHP content not showing in TinyMCE

I’m developing a simple news CMS for a client and decided to try TinyMCE since it looked good and I hadn’t tried it before. I downloaded it, uploaded it the server and put the code into the CMS. I tested it by adding a news item and it worked great!

The problem was when I did the edit script – the same form put with PHP echoing the news contents in to the textarea. When TinyMCE loaded there was no content there – I could briefly see the code in the textarea before it got transformed into the WYSIWYG window.

I turns out that it was the Firefox plugin Firebug causing it to disappear – I uninstalled this and it worked fine!

jQuery and Innerfade on mouseover and mouseout

So the website I’m working on at the moment has four boxes across the bottom. One of the designers suggested that when you move your mouse over them, the fade between a series of images. You can see what I mean on the Richmond Retreats website.

My first thought was to use Innerfade with mouseover to fade in the div and start the fading. Turns out it wasn’t as simple as I thought it would be and there’s not much in the way of help on the net either. What I ended up doing was having four static images and then four hidden divs with all the images to to run using innerfade. This means I can use the hover call to fadeOut the static div, fadeIn the other div and then start innerfade. I just then fadeOut one and fadeIn the other when the mouse is moved away again. The main bit of code you’ll want is:


$(document).ready(function()
{
$("#box-a").hover(function()
{
$("#box-a-h").fadeIn('fast');
$("#box-a-h").innerfade({
speed: 2000,
timeout: 3000,
});
},function()
{
$("#box-a-h").fadeOut("slow");
});
});

Hope someone finds this useful.

Joining two text field in Excel

OK, so I got given an Excel workbook with contact details for an email campaign I’m doing for a client with four fields: title, first name, last name, email. The email software I use is set up for using one name only so I thought I’d join it up into two fields, name and email and import that into the software.

Since I’m a programmer I typed this into the formula bar of Excel thinking It’d be similar to JS:

=A1+” “+B1+” “+C1+” “

Unfortunately this just threw up an error. Turns out the correct version is:

=A1&” “&B1&” “&C1&” “

Simples

Using custom fonts with CSS

Since starting at my new place the design team have been developing website designs for me to implement. In the past the designers I have worked with have been web designers and so have accepted that you can only use a few fonts, verdana, arial, times, etc. However the new team are graphic designers and as such love using custom fonts in the layouts.

Previously I would have just picked the closest web safe font and used that but being new and wanting to create a good impression, I thought I’d do some research and find out if it was possible. Turns out it is. The first thing you need to do is get your font in the correct format. Depending on what format your font is in you should be able to convert it to the two types you need, TTF (True Type Font) and EOF (Embedded Open Type) using the excellent Online Font Converter website. Once done all you need is to use some CSS in your stylesheet.

@font-face
{
font-family: "font_name";
src: url('font_name.eot');
src: local(font_name), url('font_name.ttf') format('opentype');
}

All you then need to do is declare it for the various CSS definitions:

body,p
{
font-family: font_name, Verdana, Arial, Helvetica, sans-serif;
}

And there you go. I’ve tested this on my Mac using Firefox and Safari, Windows using IE8 and my iPhone. It didn’t work on the iPhone but using the above example, defaulted back to Verdana which is close to the test font I was using, Myriad-Pro. As long as you choose a similar looking font to specify after your custom font in the font-family you should be OK.

Using COUNT in the WHERE clause of MySQL statements

I’ve got a huge report for the Medicology MTI that has been running extremely slow due to the amount of data and queries. I’ve been trying to speed it up to make accessing and analysing the results easier.

The users have to answer 56 questions to complete the survey. This means that most for the calculations there’s currently an “if” statement to check they completed all 56 questions and then skip the row of the mysql result set if they haven’t.

I haven’t checked if it will make it quicker but surely checking the amount of answers completed in the SQL query will result in less data and a speed increase. The problem is that the COUNT(*) I’m using to get the number of answers is in the SELECT part of the statement which is executed after the WHERE clause, which is where it needs to be:

SELECT id, COUNT(id) AS cnt FROM answers WHERE cnt>=56 GROUP BY id

The above returns an error. What you need to do is modify the query as follows:

SELECT id, COUNT(id) AS cnt FROM answers WHERE cnt>=56 GROUP BY id HAVING cnt>=56

That will return the required result set.

Hibernate a Mac Book Pro

As mentioned previously I’ve started working for a new company which exclusively uses Macs and I’ve got to say, they are superior to PCs in every way I’ve found so far.

I’ve had to get used to bits but on the whole I’m never ever going to back to a PC or laptop. Today’s challenge for the Mac was how to get my MacBook Pro to hibernate. I used to it on my Windows laptop all the time – it was invaluable. Being able to press the power button and wait for it to turn off then press the power button again and have all your documents and applications still running was an invaluable time saver.

So I wondered if the same was possible on the Mac and did some Googling. It turns out something similar is possible – it’s called Safe Sleep. With any Mac Book Pro made in the last 5 years or so all you have to do is close the lid and it puts it into Safe Sleep. Then you just open the lid again later, press any key and it restores to the state it was in. Perfect.

Since I’ve got a background in electronic engineering it’s obvious that this would require some power consumption and therefore had a limited time span to work. I asked my boss, Phil, if he’d done it and he said he’d unplugged his, closed the lid and taken it home for a three day weekend and when he came back in on Tuesday it still had about 50% power left. Perfect.

It’s only been two weeks but let’s see if there’s anything that the Mac doesn’t do better. Well worth the extra costs.

Random Slideshow on iPhoto or iDVD

I was asked by Phil to create a DVD slideshow from a load of photos he had to show at his wedding. Thing is because there was a 1000 of them we wanted them in a random order and didn’t want to rename them all or change the order by hand.

Before anyone starts commenting saying “You can’t have a random slideshow on a DVD. Once it’s burned it’s fixed”. I know. What we wanted was to not have them in the order they were taken in but rename the file names so they play in the DVD the same every time but in a apparently random sequence.

After A LOT of Googling I eventually gave in that I wouldn’t be able to do it using either iDVD or iPhoto as for one reason or another, they wouldn’t do it in the current versions. Luckily this forum has a solution using terminal if you’re not squeamish. Since I’m from a programming background it was no problem and works like a charm. Just follow the steps exactly and you’ll be fine.