Wednesday, January 19, 2005

Dead

This website is now dead. I have my own server and I will at some point soon remove this totally. My new stuff will be at think.textdriven.com until I get a domain. I don't think anyone really read this anyway :) but I thoiught I'd post just incase.

Thursday, September 16, 2004

Gmail Invites and the time!

I only just realised what time it is. I should go home and Salsa! Anyway I was only going to post to offer gmail invites in case anyone wants em. I didn't even notice I had them until just now :)

Saturday, September 11, 2004

Ooh I feel all special

I didnt' realise people have actually been reading my blog (I guess I knew that kinda but still) Anyway I know it's been almost a month since they commented but you never know

Starting off with Creating a Web Page with HTML : Visual QuickProject Guide (Visual Quickproject Series). I apologise for the comments they were direct from my mum. She got the impression from amazon but I shall see what she went for an post soon.

The seond comment I'm guessing is from my dear old friend (who I don't keep in touch with nearly enough), Maddy. There are a few other people who it could be but there's something in the language. So am I right? (Oh and thanks about the hair I think although I've just had it changed, it's a bit franz ferdinand gets cool imho)

Anyway get in touch, It's my name with a dot between adam and ..... at gmail.com

Never been a regular

Well I'v e nev er been very good at anything regfular so updates have been very sparse. Since I last updated I have

  • Went to a club launch in manchester

  • Been to pride in manchester

  • Met a girl

  • Organised a treasure hunt experience for some friends (hat tip to Siobhan's Place)



My two times in manchester have rocked beyond belief. Only the Mr Scruff thing at the beginnming of next week left for the hat trick. Ill write up pride and the bizarre night later, but both rocked. As for the girl it's none of your business :P and the treasure hunt was great again more detail when I have some time.

Oh and I *quit* smoking, well it's not going too bad anyway.

Thursday, August 19, 2004

Amazon.com: Creating a Web Page with HTML : Visual QuickProject Guide (Visual Quickproject Series)

I suggested to my mum she should have a look at Amazon.com: Creating a Web Page with HTML : Visual QuickProject Guide (Visual Quickproject Series) as suggested by Zeldman and she came back with this:

I ordered what looks like the next one up...has sections on style sheets....it seems idiot guides etc don't expect mums to be fiddling about with style sheets....I looked at one link from the last site you recommended and was informed that obviously, since I was reading this page, I wasn't going to be a mum, I was going to be selling something :)
But then most mums don't seem to have sons who know what their mums ought to be doing.

Even my mum is doing proper xhtml/css. All we need is to convice my dad of the benefits of standards in thatching(?) and we'll be the most standard compliant family in the world.

Wednesday, August 11, 2004

101 Recipes

I've actually been very remiss about updates. Totally ignoring a very random weekend in manchester, a tragic friday rthat went totally wrong and well a wednesday not that dissimiliar (oh and a friday again bu t that makes the update) but I have two recent things I feel like sharing.

One: I have started doing 101 recipes with Laura from the good food magazine book. All veggie but actually pretty good.

Two: I think I have a datae tonight! I'm not sure it may just be one of those friends things but well she seems like an interesting person and I'm not bothered whatever happens, fate always deals me a good hand in the long run.

Saturday, July 10, 2004

Positive from Average

I just watched Bruce almighty. Wasn't bad wasn't thaqt great. Light entertainment and Carrey was quite funny in his wacky way. However it had two great little bits.

The first was when Bruce says to god
Can I ask you about free will?
to which God replies
Yes you can, that's the beauty of it
. Brilliant and when Morgan Freeman says it I can almost give it credibility.

The second was a message about changing things yourself. Everyone having the power to do miracles, and by miracles I don't mean magic. Bruce learnt he could make a difference without the powers and later on Anthony spotted some chavs letting down tyres across the road, so I did something.

Nothing big or special, just went over and as I crossed the road they did in the other direction so I followed back and confronted them.
Are you two letting down tyres?

No

Are you sure?

Yes honest.

Are you sure?

Yes, We weren't I promise!

Right


And I left... and they walked off but didn't do it again. Liek I said nothing big but it felt good. Neighbourhood watch here I come :) It's easy not to do things like that and I think I've realised I don't do things I should. That's gonna change.

Thursday, July 01, 2004

Converting ShortStats to PostgreSQL

Shaun Inmans rather spiffy shortstats has always looked nice to me but until lately I coudln't run it as I don't use MySQL. So I hacked it and with Shaun's permission here is a guide how.

configuration.php


One small change ass $SI_db['con'] = 0; to the database section to provide a connection resource for all your PostgreSQL actions.

_install.php



  1. Change the checking line to use $SI_db['con'] and pg_query so the code reads
    if (@ pg_query($SI_db['con'],"SELECT * FROM $SI_tables[stats]") && @ pg_query($SI_db['con'],"SELECT * FROM $SI_tables[searchterms]"))

  2. Change the two queries that add the database to the following

    $query = "CREATE TABLE ".$SI_tables['stats']." (
    id SERIAL,
    remote_ip varchar(15) NOT NULL,
    country varchar(50) NOT NULL,
    domain varchar(255) NOT NULL,
    referer varchar(255) NOT NULL,
    resource varchar(255) NOT NULL,
    user_agent varchar(255) NOT NULL,
    platform varchar(50) NOT NULL,
    browser varchar(50) NOT NULL,
    version varchar(15) NOT NULL,
    dt int4 NOT NULL default '0',
    PRIMARY KEY (\"id\")
    )";
    $query_search = "CREATE TABLE $SI_tables[searchterms] (
    id SERIAL,
    searchterms varchar(255) NOT NULL,
    count int4 NOT NULL default '0',
    PRIMARY KEY (id)
    )";



  3. Take the query execution out of the if statment at the end as so:

    $r1 = @ pg_query($SI_db['con'],$query);
    $r2 = @ pg_query($SI_db['con'],$query_search);

    if ($r1 && $r2)



inc.stats.php


One small change, the query at the end should be pg_query($SI_db['con'],$query); using our database connection and PostgreSQL.

functions.php


Again three changes here

  1. The connection function SI_pconnect() needs a PostreSQL connection string like
    $SI_db['con'] =@ pg_connect("host=".$SI_db['server']." user=".$SI_db['username']." password=".$SI_db['password']." dbname=".$SI_db['database']); and you can replace the logic after with if ($SI_db['con'] = 0) die($horribly);

  2. Every single function needs to be scoured for mysql_query($query); calls and have them replaced with pg_query($SI_db['con'],$query); as well as adding global $SI_db; at the start of every single function.

  3. last but not least a to get referers working we need a small change to the SQL in SI_getDomains()

    SELECT
    domain,
    referer,
    COUNT(*) AS total,
    MAX(dt) as last_access
    FROM
    $SI_tables[stats]
    WHERE
    domain !='".
    SI_trimReferer($_SERVER['SERVER_NAME'])."'
    AND
    domain!=''
    GROUP BY
    domain,referer
    ORDER BY
    total DESC,
    last_access DESC



And then your done


Follow the README provided and everything should work fine. If not feel free to email me and if I have time I'll offer help or even send a copy of my working abeit old version of shortstats

-
adamdidthis design