This is an interesting way of speeding up DoEvents, which is useful in a loop. It’s expensive, but necessary in your programme if you want it to respond to user actions. GetInputState() is cheaper, and it’s easy enough to use Windows API calls in Visual Basic code.
If GetInputState <> 0 Then DoEvents
Author: Andy Burns
Connection pooling in MySQL and Java
A bit of an example. I must try and find a package for dealing with this automatically – certainly creating the connection to database is pretty slow. Sharing those connections is well worth it. Need a bit of a play sometime. I’m also wondering if connection pooling with Javascript’s XMLHTTPRequest object might be a good idea.
Finding the offset of a page item
A couple of functions from my friend Jonathan Beckett for finding the x and y offsets of an item on a page. Basically, it works it’s way back up the DOM finding the offset of each parent item. There may be better ways; I haven’t checked that hard.
function get_x(obj){
var xpos = 0;
if (obj.offsetParent){
while (obj.offsetParent){
xpos += obj.offsetLeft;
obj = obj.offsetParent;
}
}
else if (obj.x) xpos += obj.x;
return xpos;
}
function get_y(obj){
var ypos = 0;
if (obj.offsetParent){
while (obj.offsetParent){
ypos += obj.offsetTop;
obj = obj.offsetParent;
}
}
else if (obj.y) ypos += obj.y;
return ypos;
}
A little reminder for myself
The interesting bit is the overflow. There is also overflow-x and overflow-y, although Mozilla and IE render the scrollbars differently – Mozilla outside the DIV and IE inside the DIV.
<div style="height:200; width:200;
z-index:1; overflow:auto; background-color:#fff;
color:#000">
Stopping Installshield
At work, sometimes I get to see some truly bad bits of design – and my current winner is some awful design from Installshield and their ‘Update Engine’. There is, quite simply, no easy way of turning the damn thing off, disabling it, stopping the service, or uninstalling it. What crap!
I did find a solution eventually…
I found the answer here and I’d give Pluck a 10/10 for walking away from an installer program like this. I had installed some software that we were reselling to a customer, to check it worked. Now, I know that the supplier won’t be updating through installshield – it really isn’t that kind of a program. But it still installed this update engine. “Okay”, I thought, “I’ll turn it off”.
So now it’s disabled for all programs, never checks for updates, and it still pops up a window asking to check for updates.
F$%king thing! It positively fails Andy’s test for Software – it doesn’t do exactly what it says on the tin.
Anyway, the solution. Run ‘msconfig’ from the ‘start menu > run…’. Find ‘issch’ and uncheck the checkbox next to it. It is still installed, but it doesn’t run, at least.
And I’d recommend to everyone that they use a different installer. I like Innosetup myself, and use it at work. It does what it says on the tin, and is free, although I’d suggest donating.
Apache Configuration
Getting started with Apache – Article worth reading. Part II Part III
Thoughts on Coding
When writing web applications, ultimately, you probably want to look at performing load testing. This is most easily done by an application, running a script, and pretending to be a number of users.
Of course, if you’re doing something like, say, creating nodes in some sort of a hierarchy (think messages, or files/folders), then you might need to do some stuff before performing other operations – like see if your node was created, get its ID, that sort of thing.
So here’s my thought – make that easy. Put things like ‘New Node ID = ‘ into HTML comments near the top of the page. That way, it should be possible to find and read them with many of these tools.
At the moment, we’re using OpenSTA, which works. That’s about the best that can be said for it. I like the look of Webload but it’s probably too expensive.
Final FireFox plugins (for now)
I guess I should include the other plugins I use:
Adblock – the best think in Firefox bar none.
Cookie Culler – a much better cookie controller.
Web Developer Toolbar – Although this might be standard now – I don’t remember installing it last time…
More Cool FireFox Plugins
Neat Firefox Plugins
Some good Firefox plugins: