Just a quick blog to say that I have upgraded to the latest version of wordpress.
Oh.. and this is for all those people who are confused at my title.. A screensaver is not a wallpaper. They are different. I don’t know how many times I need to tell people this!
Final cut pro studio 2 has arrived today and I’m very impressed.
So far.. it seems to have alot of new features and alot of the erks that I was having with it have been fixed. Here are some of the features I’ve noticed…
Motion 3D support is impressive
Compressor now exports mpeg program streams.
Sound Track Pro exports mp3… no more jumping into itunes just to convert a file
I will update this as I find out more…
Ok, so the wedding is over.. that means I don’t have to do anymore wedding preperations.
CS3 has been released and We got the web studio for my work laptop. Here are my thoughts:
- Photoshop CS3 - Fantastic.. well worth it
- Illustrator CS3 - Dito
- Flash CS3 - Dito..
- Dreamweaver - Hardly worth it, Haven’t noticed much speed difference or features at all.. This would be the biggest disapointment for me. Hopefully next version gets the new interface the others got.
- Fireworks - Installed it.. haven’t used it.
- Contribute - Didn’t bother.
- Flash video encoder - Better.. multipass encoding would of been nice.
Dan McKee posted a comment on this site asking if I could modify my byte calculator widget to allow decimal places. I managed to get it done fairly easily but in the end I kind of re-wrote so its better. This new version has the following new features:
- No need for a select box/input box - just type in the unit you want to convert from and the other fields will automatically convert.
- easily copy the converted value to the clipboard by focusing on the field (mouse click or tab)
- Decimal points allowed (only one) and a better mothod of number input validation is used.

Click on the screenshot to download.
I’m a bit excited about CS3 coming later this month. I’m so excited that I’ve scribbled down some of the features I’m dreaming of:
Dreamweaver:
- Faster, better FTP - no timeouts would be ideal!
- The ability to view ftp passwords or have an option so that passwords arn’t encrypted at all. I don’t know how many times I’ve lost my password for a site and my only copy in dreamweaver. The way firefox handles passwords would be ideal - one password that handles them all.
- Universal Version
- validate php/php debugger with breakpoints
- CVS support
- A Linux version
Flash:
- Some sort of bone system so that characters could be easily animated and distorted.
- A Universal version
- A Linux version
Sometimes when I'm developing a website I might have a string of id values that are comma delimited and want to extract related data from a database. What I could do is explode the string into an array and then run multiple queries by looping through the array. While this works find, its not ideal to query the database so many times. What you can do is loop through the array and create a single query. What I normally do is use the implode function to create the single query.
So anyway, here is some code:
CODE:
-
$ids = "1,2,3,4,5";
-
$idarray = explode(",",$ids);
-
$sql = "SELECT * FROM users WHERE id='".implode("' OR id='",$idarray)."'";
So thats fairly simple, saves having a 'while' loop or a 'for' loop and concatenating a string. Its also helpful if you have multiple queries that have an additional condition. For example you might want to test if each user is active. You example...
CODE:
-
$ids = "1,2,3,4,5";
-
$idarray = explode(",",$ids);
-
$sql = "SELECT * FROM users WHERE active='y' AND id='".implode("' OR active='y' AND id='",$idarray)."'";
After using my previous Password Generator widget for a few days I soon realised that the passwords wern't actually random. Aparently it is a known bug that using the Math.random() javascript function in dashboard doesn't generate random values. I finally got around to re-writing my password generator widget. Version 2 has a simplified interface and automatically copies the generated password to the clipboard. Click the screenshot to download.

Occasionally I need an array of countries for webforms at work.
For a recent job I did I converted a list of countries from static html to php so that I could control the results a bit better. Hopefully this array will save someone some time.
PHP:
-
$countries =
array("Afghanistan",
"Albania",
"Algeria",
"American Samoa",
"Andorra",
"Angola",
"Anguilla",
"Antarctica",
"Antigua and Barbuda",
"Argentina",
"Armenia",
"Aruba",
"Australia",
"Austria",
"Azerbaijan",
"Bahamas",
"Bahrain",
"Bangladesh",
"Barbados",
"Belarus",
"Belgium",
"Belize",
"Benin",
"Bermuda",
"Bhutan",
"Bolivia",
"Bosnia and Herzegovina",
"Botswana",
"Bouvet Island",
"Brazil",
"British Indian Ocean Territory",
"Brunei Darussalam",
"Bulgaria",
"Burkina Faso",
"Burundi",
"Cambodia",
"Cameroon",
"Canada",
"Cape Verde",
"Cayman Islands",
"Central African Republic",
"Chad",
"Chile",
"China",
"Christmas Island",
"Cocos Islands",
"Colombia",
"Comoros",
"Congo",
"Congo, Democratic Republic of the",
"Cook Islands",
"Costa Rica",
"Cote d'Ivoire",
"Croatia",
"Cuba",
"Cyprus",
"Czech Republic",
"Denmark",
"Djibouti",
"Dominica",
"Dominican Republic",
"Ecuador",
"Egypt",
"El Salvador",
"Equatorial Guinea",
"Eritrea",
"Estonia",
"Ethiopia",
"Falkland Islands",
"Faroe Islands",
"Fiji",
"Finland",
"France",
"French Guiana",
"French Polynesia",
"Gabon",
"Gambia",
"Georgia",
"Germany",
"Ghana",
"Gibraltar",
"Greece",
"Greenland",
"Grenada",
"Guadeloupe",
"Guam",
"Guatemala",
"Guinea",
"Guinea-Bissau",
"Guyana",
"Haiti",
"Heard Island and McDonald Islands",
"Honduras",
"Hong Kong",
"Hungary",
"Iceland",
"India",
"Indonesia",
"Iran",
"Iraq",
"Ireland",
"Israel",
"Italy",
"Jamaica",
"Japan",
"Jordan",
"Kazakhstan",
"Kenya",
"Kiribati",
"Kuwait",
"Kyrgyzstan",
"Laos",
"Latvia",
"Lebanon",
"Lesotho",
"Liberia",
"Libya",
"Liechtenstein",
"Lithuania",
"Luxembourg",
"Macao",
"Macedonia",
"Madagascar",
"Malawi",
"Malaysia",
"Maldives",
"Mali",
"Malta",
"Marshall Islands",
"Martinique",
"Mauritania",
"Mauritius",
"Mayotte",
"Mexico",
"Micronesia",
"Moldova",
"Monaco",
"Mongolia",
"Montserrat",
"Morocco",
"Mozambique",
"Myanmar",
"Namibia",
"Nauru",
"Nepal",
"Netherlands",
"Netherlands Antilles",
"New Caledonia",
"New Zealand",
"Nicaragua",
"Niger",
"Nigeria",
"Norfolk Island",
"North Korea",
"Norway",
"Oman",
"Pakistan",
"Palau",
"Palestinian Territory",
"Panama",
"Papua New Guinea",
"Paraguay",
"Peru",
"Philippines",
"Pitcairn",
"Poland",
"Portugal",
"Puerto Rico",
"Qatar",
"Romania",
"Russian Federation",
"Rwanda",
"Saint Helena",
"Saint Kitts and Nevis",
"Saint Lucia",
"Saint Pierre and Miquelon",
"Saint Vincent and the Grenadines",
"Samoa",
"San Marino",
"Sao Tome and Principe",
"Saudi Arabia",
"Senegal",
"Serbia and Montenegro",
"Seychelles",
"Sierra Leone",
"Singapore",
"Slovakia",
"Slovenia",
"Solomon Islands",
"Somalia",
"South Africa",
"South Georgia",
"South Korea",
"Spain",
"Sri Lanka",
"Sudan",
"Suriname",
"Svalbard and Jan Mayen",
"Swaziland",
"Sweden",
"Switzerland",
"Syrian Arab Republic",
"Taiwan",
"Tajikistan",
"Tanzania",
"Thailand",
"Timor-Leste",
"Togo",
"Tokelau",
"Tonga",
"Trinidad and Tobago",
"Tunisia",
"Turkey",
"Turkmenistan",
"Tuvalu",
"Uganda",
"Ukraine",
"United Arab Emirates",
"United Kingdom",
"United States",
"United States Minor Outlying Islands",
"Uruguay",
"Uzbekistan",
"Vanuatu",
"Vatican City",
"Venezuela",
"Vietnam",
"Virgin Islands, British",
"Virgin Islands, U.S.",
"Wallis and Futuna",
"Western Sahara",
"Yemen",
"Zambia",
"Zimbabwe");
-
$select = "Australia";
-
for($i=0;$i<$loop;$i++) {
-
if($select == $countries[$i]) {
-
echo '<option selected="selected">';
-
} else {
-
-
}
-
echo $countries[$i].
'</option>';
-
}