Helen and Olly - Answer Me This!

September 10th, 2008
I'm an avid listener of the "Answer me this podcast" http://answermethispodcast.com, they've recently had a challenge for listeners to post a video and ask them a question, here's mine...



Love you!

Women Drivers - a rant

September 10th, 2008
--- Start Rant ---

Ok ok, this might not JUST be with women drivers but I've only ever experienced it with women ;-) and by all means don't think that this is the only gripe I have with women drivers, just hear me out on this point...

Take the diagram to the left, I'm in car 1, she is in car 2, I'm stationary, giving way, she's driving down the road, and can easily get past me, there's no cars behind me and no reason not to go straight through, but..

She pulls in to the space (number 3) and flashes me to go through! What the fuck?? Then when I went past she drove off, why would you do that?

Why? why? why?

--- End Rant ---

"Pushing" the web

September 6th, 2008
So Recently I've been delving into the marvelous world of Pushing data to web browsers.

Ok, before I get flamed, what I mean by pushing (for now) is the browser requesting data and the server sending new events periodically as they happen. Other technologies in this area are things like Comet and Orbited. Many people are already using various methods to implement this, services such as Mibbit, GMail/GDocs, Facebook, Highrise and others.

While this isn't a discussion about why I didn't use the existing approaches, I will say some of them are because the servers are based on Java or Twisted (python), which is bulky and I felt it could be simplified.

For now the general thought process is that the clients web browser requests data from the server via AJAX or JSONP, Flash or an IFrame, and when the server has some data to send, it plops it out, the web browser reads it and everyone is happy...

Limitations of these methods...

365 (Re)Launch

August 26th, 2008
"Aaaargh"

It's 5 to midnight and I'm still yet to take an interesting photo of the day for my 365 gallery, when I say an interesting photo, I mean it in the sense of somebody who has lived in a box for any length of time and has been oblivious to the invention of the internet, tv or any other form of mainstream entertainment would find it interesting.
You'll then see me quickly run around the house trying to find something vaguely worth taking a photo of, normally a picture of my room or an attempt to get the kids to do something random.

Luckily this doesn't happen all that often, although more often than I'd like. Back when I started my 365 Gallery in 2006 I never really expected it to last too long but over the last 18 or so months It has changed my life significantly.

So getting to the point, if there ever was a point, I'm now proud to say that the website has been relaunched and rebranded into my current website as there seems no hope of me stopping it in the forseeable future.

"Yay" I hear you all cry! but wait, there's more..

You can now add comments! Exciting stuff eh, not to mention bigger pictures, faster downloads and 24/7 access, even when I've got half a dozen torrents on the go ;-)

So please go take a look over at http://scrivna.com/365/ and while you're at it subscribe to the RSS Feed

Love you all!

Jade (dog-face) Goody

August 19th, 2008



--- Start Rant ---

This woman is just such a bitch, I mean who is she? she's a nobody! and she's BBC front page news today. I have to say her agent is a fuckin miracle worker, but my god.

I think it just sums up what this nation is like, everyone is sooo interested in this nobody's life.

So she goes on a national T.V program is racist and offends 90% of the country, possibly the world, then she does this blatant publicity stunt to go on Indian T.V to say how anti-racist and great she is.

So by now the British population is back in love with her.. then oh wait, here comes the big one.. she conveniently gets cancer and now we are all meant to feel sorry for the racist greedy slag.

I wouldn't put it past her that in a few weeks we'll all hear that she's fine and it as really just a cheap and nasty trick to get herself out of the house before she says some other dipshit comment and gets herself lynched.

Anyone in this country who cares what this bint is doing should be shot!

--- End Rant ---

PHP File Diff

August 9th, 2008
So for anybody that has ever used Trac to look at your SVN repo's you'll know that there is a cool diff tool they use that shows the differences between change sets.

The tool shows the additions / deletions of the code highlighted in different colours with line numbers and some clever shizzle.

So anyway, I thought that was pretty cool so decided to have a go at it in PHP. You can see my attempt over here and the code for that page is available here.

It's a pretty simple class which compares and highlights all the differences between 2 files or strings located on your server. I was going to do loads of cool stuff with this but never got round to it. Hopefully his will be a helpful start to someone else.

Status Update

July 29th, 2008
Hey All!

So it would seem that I've finally got so annoyed with wordpress that I've written my own blogging software. It's taken a few weeks off and on and I've just finished writing the back-end so I can post entries, w00p!

The software is still a work in progress, I cant even add tags yet!

Hopefully there aren't too many bugs, hope you enjoy the new look!

Love you!

365... so far

June 21st, 2008
So thought i'd put together a compilation of my 365 project so far.. and here it is!

New Homepage!

June 15th, 2008
W00p!

So i've finally had the opportunity to re-vamp my personal site, it's reminded me how hard designing and trying to be creative actually is.

Anyway, you can find it over here... http://scrivna.com

x x x

PHP Force Download

April 22nd, 2008
So today I needed to force a file to download in a web browser where the browser would normally just output the file. It will also work in IE6 over a secure (HTTPS) connection.. which was a bit like hard work.

function forceDownload($file,$name=false,$contenttype="application/octet-stream",$delete=false){
	if (!$name) $name = $file;
	
	header("Cache-Control: public, must-revalidate");
	header("Pragma: hack");
	header("Content-Type: " . $contenttype);
	header("Content-Length: " .(string)(filesize($file)) );
	header('Content-Disposition: attachment; filename="'.basename($name).'"');
	header("Content-Transfer-Encoding: binary\n");
					  
	$fp = fopen($file, 'rb');
	$buffer = fread($fp, filesize($file));
	fclose ($fp);
	echo $buffer;
	if ($delete){
		unlink($file);
	}
}

Example Usage:
So I wanted to create a temporary file, write some contents to it then force the file to be outputted via the browser and deleted on completion of download.
$data = 'what a load of content';    // data to write to a file

$filename = 'cache/tmpfile.txt';     // the file to write the data too, must be writable
file_put_contents($filename,$data);  // write the data to the file

// force the download and delete the file afterwards
forceDownload($filename,'whateverfilenameyoulike.txt','text/plain',true);

.
© Ross Scrivener 2008 | Contact