May 26th, 2009
On one of my websites I use a feed that has a limited bandwith quota, normally the quota limit is not a problem, but occasionally the website gets hammered by various intenet spiders, bots, and screen scrapers, so whenever I get near to the quota I implement a simple throttle that says no to bad bots.
Well, that was the theory, unfortunately one of the ip numbers that I banned was that of a googlebot and as a result I ended up number one on google for the search term ” “Sorry site not available – database ip-throttle in effect – please try again later….”.
Sometimes number 1 on google is not all it is cracked up to be!
Tags: Google, Google Search, Googlebot, Ip Numbers, Number 1, Number Search, Quota Limit, Screen Scrapers, Spiders
Posted in Main Content | No Comments »
May 15th, 2009
Have been playing about with gallery and drupal this last month as my daughter is about to graduate and join the real world and wanted a gallery website to display her ceramic art, so please have a look at her Ceramic Art Gallery Website.
I also found a great bit of code at www.flashyourweb.com to create a slideshow from the pictures in your gallery, I have included an example in this page:
Tags: Acme, Ceramic Art Gallery, Lt, Rator, Real World, Slideshow, Target, Target Blank
Posted in Main Content | 1 Comment »
April 8th, 2009
Just did some cross browser testing – all works OK in firefox and safari and seamonkey and google chrome, but internet explorer croaks. The customer (not totally unreasonably) objected to dates being displayed as YYYY-MM-DD and wanted them displayed in the UK format of dd/month/yy. Unfortunately somewhere in the dates manipulation I used the Javascript Dates.parse function. this worked OK in Firefox and processed UK dates OK ie Date.parse(”1/Aug/2009″) gave the correct result of 1249081200000,
but in IE I got NaN.
Try it yourself in different browsers by putting UK style dates at www.w3schools.com/jsref/jsref_parse.asp
Tags: Correct Result, Croaks, Cross Browser, Firefox, Google, Internet Explorer, Javascript Function, Madness, Manipulation, Nan, Safari, Seamonkey, Style Dates, Uk Style, W3schools, Yyyy
Posted in Main Content | No Comments »
April 3rd, 2009
Just been working on a booking system for holiday lets and stumbled on the next millennium time bomb – I was using php mktime to add days to a date and discovered that if you add 1 day to Jan 1st 2037 the result is correct, but if you add 1 day to April 1st 2038 you get a date back in 1968 (a good year – but not the right answer!).
If you want to check it out yourself the PHP code is included below:
Function FindDate($sDate,$iDirection,$sTarget) {
// $sDate format YYYY-MM-DD from MySQL table
// $idirection to go forward or back in time
// $sTarget day of week we want to find
list($yyyy,$mm,$dd)=preg_split('/\W/',$sDate);
$i=0;
do {
$timestamp=mktime(0, 0, 0, $mm, $dd+$i, $yyyy);
$i=$i+$iDirection;
$w=date('D',$timestamp); // gives Mon - Sun
echo ($i." ".$sDate." ".$w);
echo (date('Y-m-d',$timestamp)."\n");
} while ($w!=$sTarget && abs($i<7));
$r= date('Y-m-d',$timestamp);
echo ($r."\n");
return $r;
}
Tags: Abs, April 1st, Booking System, Echo, Good Year, Millennium Time Bomb, Mktime, Php Code, Preg, Sdate, Starget, Sun, Yyyy
Posted in Main Content | No Comments »
March 18th, 2009
I like the idea!
Similar in someways to the concept of sending the next tax demand back with a note along the lines of ‘Thank you for your offer but just at the moment , due to other financial commitments, we regret that we must decline your request“.
I was clearing out my spam folder and noticed a message with the above header, sometimes even spam can be interesting! The contents were less so; it was some sort of scheme to make lots of money returning phone calls….
Tags: Depression, Financial Commitments, Lots Of Money, Phone Calls, Spam Folder
Posted in Main Content | No Comments »