This is the home of Will Wade. Its a place of code, general rant, and a lot else besides. I don't intend to write much - only if its worth mentioning.
 

How to make your drupal cron run longer

No, that is not a dodgy innuendo - this is infact a quick hint on how to extend the running time of your cron script for drupal - particularly handy if you keep getting "script execution time exceeded" type errors (i.e."Fatal error: Maximum execution time of 30 seconds exceeded") try the following

1. Edit cron.php - stick the following at the top of the script

$_SERVER["HTTP_HOST"] = 'YOURHOSTNAME';
// ^ e.g. 'sourceymonkey.com' - should be the same name as your config folder in sites
// NB: this is so you can run the script from the command line (and thus remove a browser timeout problem) - if you don't have line command access then there is no need for this
$_SERVER["PHP_SELF"] = '/cron.php';
// may need to change that if your site is in a subdirectory. e.g. 'site/cron.php'

2. Edit includes/common.inc
Open the file up.
search for 'set_time_limit' (in drupal 5.1 its on line 1982)
change the time in the function so:

set_time_limit(24000);

should do the trick (that's quite a while!)

3. Now go the root of your install and type:

php ./cron.php

(If you haven't got line command access just set off the cron script as usual: http://YOURSITE/cron.php)
4. Go and make a cup of tea!
5. Check your logs to see what happened!

Its a nasty hack but one that may help those timeout headaches!
Enjoy!

I HATE INTERNET EXPLORER

Enough Said.
Why is vertical/centre aligning such a god-damn headache in IE. All my sites that have implemented wacky css hacks in the past are once again broken.. arrgh.

Technorati Tags: ,

Virtualhost auto-index script

Thanks to Orange I have no internet at home. It's driving me mad. However some good things do occur when you have no broadband. For example I no longer waste my evenings looking into the massive expanse of my bloglines account and instead build some tools which I have been having plans on for a while. The first is little single script that works with the structure of your local development box set-up by the most excellent Patrick Gibson's virtualhost.sh. Its not great. Infact its quite incorrect at times - particularly if you use the applescript option to calculate folder sizes and modification dates - but its a start.


To install it:

  1. Download the attached index.zip and unzip the index.php file
  2. If you have a standard apple/virtualhost.sh setup your http://localhost/ should point to your ~/Sites folder and currently give you a directory listing. Now just move the index.php file to your ~/Sites/ folder. And now access http://localhost
  3. Have a play!

Some cool features:

  • It produces a RSS feed to add to your bookmarks (its why I wish name-based virtualhosts could work with bonjour)
  • It has a variety of flags that can be passed to it: (from the comments)
    • ?orderby = changes the order of the sites. Has the following Options:

      • modsites (most recently touched virtualhost site folder towards the top)
      • modconf (most recently created/edited virtualhost.conf file towards the top)
      • sitename (order by sitename a-z)
      • sitesize (order by size of site folder) NB: some of these particularly site size & modsites aren't that accurate
    • ?debug=true - set debugging on. May be useful if you ever random questions like "why aren't my sites listed" Not exactly comprehensive. Won't tell you why you can't pay the mortgage this month for example
    • ?rss=true - output a rss feed. Handy for the rss feed bookmarks bar of safari/firefox etc..
    • Note that if the folders of the virtualhost doesn't exist or is perhaps unreadable then you will get a broken image icon.

Creating fancy new stuff

MetaOT stuff has slowed up a bit since I have a new job (Im now a research based OT at Oxford Brookes Uni). However I hope to unveil something pretty special in the coming weeks. I know I have said this before but Im actually pretty close to achieving it this time.

In short its a OT Assessment and Outcome measure database - which I want everyone to add too!
I've added a "create an account" box on the frontpage of metaot to start the ball rolling for folks who "early adopters" - feel free to join the party! Its in a bit of a mess at the moment while I get the format and design right.. But feel free to have a early play at http://metaot.com/ot-assessments-outcome-measures

out of internet

Well damn it. My internet has died - and quite frankly I dont know what to do with myself. Get a life perhaps?? Well its starting to work - its forced me to cycle to uni everyday and finish my poxy research proposal. In short my research proposal is looking at children with visual-motor difficulties and their ability to interact with a mouse and the internet (I intend to write a fuller summary on metaot.com when its all over). It all started because I wrote (it stemmed from an idea devloped by Matt at the Beeb/Fictionlab) some code to do screen-plotting - plotting a mouse movement across a page.

Its far removed from that original idea but I now have some code that does, for what it seems, pretty straightforward things; measures a screen-size, resolution, dpi etc.. what I really want to do though, and this is my question to lazy web, is how the heck do I measure a page-length (note: not page-size - thats useless to me - Im actually intrested in how much scrolling there may be). some problems to make this quest harder: I don't have access to these other web pages and I cant write a firefox plugin - i.e. its either javascript (running in IE) or server-side. I figured some wacky applescripting on the mac but there must be an easier way - mustn't there??!

thanks lazy web

The internet is a truly nice place

To my pleasure I found a rather nice poem underneath my rather desperate picture from new year when I got stuck at Gatwick. I like it.

The Muzak
is putting me
to sleep,

but the people
all around
are
keeping me awake with their insessant, curious, judging looks

and brutal questions.

See Here for the original post and lots more besides Flickr has been an interesting experience for me - getting my name published in the new york times, having some doggy pics published on a doggy magazine site and some disability pics being used for a prospectus (apparently) and now this - smashing.

Im not taking many pictures these days since I have been swamped under by the amount of OT work Im up to - essays, case studys and now a research proposal are all taking up my time but I do intend to get out there a bit more - infact I have to since I have (drunkedly - which sadly does count!) said I would do some pics for a friends wedding in July. Eeek! I don'have a great track record of weddings - my sisters - I ruined the kodak b&w film (trying to be clever I used the wrong dev mix) and for Tom & lotties I, well, got drunk.. (see it can be an excuse when all else fails!)


Technorati Tags: , ,

StrWordCount - Another YubNub command

Just a quick one. I created a quick yubnub command StrWordCount

"StrWordCount. Count the number of words in a string. To count the number of words in a string just enter the words Example: StrWordCount I love Monkeys Gives the answer of 3 Simple! "

Technorati Tags: , ,

Google base isnt what it first seems

I read a lot of reports regarding the interesting idea of google base. It appeared that it was a system that allowed anyone to create lists of stuff. It does do this but the lists are so freeform its only useful if you have your data already in a database as you have to recreate the keys every time.. Here is the mail I just sent the feedback team for google base:

"Just a little usability suggestion.. Google base looks like an interesting idea if you already have your data or if you slowly create entries over time.. However its useless if you need to create rigid tabled data. In other words why do I have to create the keys/attributes each time I make an entry?? Also, on a similar theme why doesnt the dashboard page show you entry types rather than all your entries? Say for example I want to create a database of recipes - they will all follow a similar format, and then a database of say monkeys, I would expect the overview page to show "recipes, monkeys" where clicking on recipes gives you all of your recipes.. I know google is trying to simplify the process by making data so freeform but it actually confuses things. I look forward to some updates - particularly in a backend where some of this issues may be sorted out by third party software"




I was actually hoping it may solve my problems of creating some tables in drupal. Oh well I shall stick to improving the rather cutdown Table Manager instead.

Technorati Tags: , ,

This is the best thing the internet has given me yet..

I have absolutely loved listening to the Stanford lectures since they have been put on the iTunes store for free. Excellent stuff. They have spurred me to do some research into stress, trauma and childhood development which I've started writing a short essay for use on metaot.com
And then I came across something called "OpenCourseWare" - basically tons and tons of course material from MIT. It's awesome. Just a shame Im already at college!! Check out the full list of courses here

Technorati Tags: , , , ,

transport for london yubnub command

Just created a rather tasty yubnub command: tfl

To quote what Ive just written on yubnub:

“Transport for london journey planner.
Transport for London (TfL) has a really nice tool to work out your route (http://journeyplanner.tfl.gov.uk)

To create a new route, just type the postcode of two points
example: tfl -start SW1X7XL -end CR01XX

by default it will use the postcode but can be configured to use address (address), stop/station (stop) or address (address) or place of interest (pov).
e.g.
tfl -start victoria -end belsize park -type stop
or
tfl -start buckingham palace -end london bridge -type pov”

Technorati Tags: , , ,

Page 1>>