Articles in the Computers Category
PHP, Regular Expressions »
Problem
I have a ton of date strings in the stupid US style dd/mm/yy format. i.e. 12/24/09 being 24th September 2009. I need to convert them to the UK style dd/mm/yy.
Solution 1
As a string in PHP is really just an array of characters, the simplest fix was to address the individual number characters by their positions within the sting, and rearrange them into the format I wanted:
$d = “12/24/09″;
$d = $d[3].$d[4].”/”.$d[0].$d[1].”/”.$d[6].$d[7];
echo $d; // displays “24/12/19″.
Solution 2
I posted my solution on twitter (@hutchings) and asked for comments and @londonhackspace organiser Jonty came …
Flash »
Problem
I’m doing some freelance Flash development, and it’s been a while. I have just created a dynamic text field that I wanted to fill via actionscript, then fade in via an alpha tween. This wasn’t working, even if I set _alpha = 0 on the movieclip containing the text field.
Solution
You can only set _alpha on a Dynamic Text field if the font has been embeded (with the embed button).
Works now! wohoo! Simple stuff that I’ve known in the past, but forgot.
Networking »
Problem
We’re building a website in Business Catalyst and need to provide the client with a test site during the design, build and testing phases. This test site needs to be accessible on a sub-domain of the client’s main domain. At the same time we want to retain DNS control of the parent domain, and stick a small holding site there.
For example:
‘mydomain.com’ has a small holding site on it, and mail services etc work as usual for that domain.
‘test.mydomain.com’ needs to be delegated to the Business Catalyst nameservers.
Solution
Turns out this is …
Joomla!, Windows »
Problem
When trying to add a Plugin, Component or Module in Joomla’s Extension Manager, you might get the following error:
JFolder::create: Could not create directory
Warning! Failed to move file.
Shown here:
This is likely – but not definitely – to be after the site has been moved from location to another, a change of directory, or server.
Solution
When a Component, Plugin or Module is added, the Joomla system attempts to copy the installable zip to a temporary directory, called ‘tmp‘. From there, PHP extracts the files and installs them. The error above usually occurs for …
Day to Day, Google Chrome, Mozilla FireFox »
Problem
I need to send a mate a link to an item on eBay after breaking his strimmer. The nice people at eBay have reworked their URL structure recently to improve SEO, so a link to a single item now looks something like this:
http://cgi.ebay.co.uk/Medium-duty-bump-head-for-Kawasaki-brushcutter-strimmer_W0QQitemZ190302614007QQcmdZViewItemQQptZUK_Home_Garden_GardenPowerTools_CA?hash=item2c4eeb71f7&_trksid=p3286.c0.m14&_trkparms=65:12|66:2|39:1|72:1686|293:1|294:50
..which is not exactly Twitter, Live Messenger or email friendly. Long URLs break often in email and instant messengers when they ‘wrap’ at the end of a line (like the above is doing).
Solution
Here’s the old style linking system that still works: http://cgi.ebay.co.uk/ws/eBayISAPI.dll?ViewItem&item=190302614007
So you can use that structure for a …
Add to My Yahoo!