Off Topic

Updated debt clock to show over $10,000,000,000,000 Sunday, October 05, 2008
It was a day I hoped would never happen, but I sat down this weekend and updated my little US national debt clock to display over $10,000,000,000,000. I say it's a sad day because despite what some people say (that the further in debt our country is the more prosperous we are) I find it hard to believe we're better off because of the debt we've just taken on. The whole concept of "money as debt" just seems corrupt. Then again, I'm not an expert on economics. Maybe having our national debt increasing at the rate of $36 per millisecond is a good thing.


The debt clock started when a friend e-mailed me a years ago and asked how to do a counter like a clock that starts at a specific point. He needed it in Flash so I whipped one together and sent it to him and then realized I could maybe do something worthwhile by putting it out there for people to use. I did.. and it hit myspace and facebook.. and I'm currently seeing about 65,000 views of it each month. I encouraged people to download it and install it on their own servers (it's not sucking too much bandwidth, but they shouldn't have to wait on my server for their page to finish loading..) so I'm not sure how many views it's getting that way.. I know it's being used on quite a few political web sites (both Republicans and Democrats running for Congress for example), in articles, and on some personal web sites.

I don't fuss with the accuracy of it since I figure if they can pull a number like $700,000,000,000 out of thin air just because it's "a really large number" then there's no point in trying to be too accurate on anything based on numbers provided by the same folks. I like to think that over the last few years I've helped a tiny bit to raise awareness of our out of control spending.. I can hope it's not too late to sort things out and maybe someday I'll be able to reverse the clock.



Check Layer 1 first Wednesday, July 09, 2008
I was working at about midnight the other night when I heard my little VPN app scream that it'd lost connection.. I noticed that I couldn't get out to my favorite site and checked my DSL modem.... the status light was off. So the next morning I got up and saw it was still off. I called the DSL provider, we went through the standard power off/on stuff and the regular checklist and the guy in India said he'd overnight a new modem (it still hasn't gotten here..). A little while later I remembered something from my CCNA 1 class - check "layer 1" first.

So I swapped out the line between the modem and the wall jack. The lights came back on. I took that phone line and tested it with a phone and it was bad... heh. Always check layer 1 first.

JavaScript minimum window size Friday, July 28, 2006
So I had this need.. to make an HTML popup containing a SWF (scaled to 100% & 100%) that would allow the user to scale the browser window small and large and therefore scale the SWF. The problem was I also needed to make it so that there was a minimum size for the browser window. What I needed was something that would force the browser window to snap back to a minimum size like 600x400 if they resized it down to say 100x100.

It seems so simple in JavaScript.. you know, check the current size of the browser window and if it's too small then resize it back to a larger size. Simple!

But nothing is simple once Microsoft gets ahold of it, and so this is.

Here are the resources I dug up:
force window min size
Maintain Window aspect ration onResize
Manipulating Windows

So it seems simple enough, and within a few minutes I had the code working when I tested in Firefox. I tested in IE6 on my PC and it worked. Cool enough, that was quick.

Then I tried it on my laptop. It didn't work. Here's the Microsoft reason why..
"Windows blocks these functions by using a script when the mouse button is down. If the mouse button is down, Windows considers the operation to be a drag operation and blocks any move or resize functions. "

So essentially what was happening was the user (me) was dragging the browser window in and out and JavaScript was constantly firing an onResize event. IE was interpreting that as some hacker trick or something I guess and so threw an error and walked away. Wee.
Even though my pc is patched up to service pack 2 and I have IE6 all patched up the laptop apparently has something slightly different in the XP. When I check the version for both IE browsers they're the same. The security settings are the same. I was loading via the same server for both systems. But there's something slightly different with the laptop. I didn't have time to dig around and find exactly what is different because it didn't matter. What mattered was I had two computers running XP SP2 and IE6 with the same version and they were treating my JavaScript differently.

So a solution? There's probably a good one out there somewhere, but I didn't find one.. so here's what I did - added a 200ms timeout so that the last reSizeOuterTo() didn't fire until after the mouse button was released. It might be better to use a try/catch and if that error gets thrown then set a short timeout and try again.. or something.. but I just mashed together code I found like so:

function checkSize(){
var width;
var height;
if(document.layers) {
width = window.innerWidth;
height = window.innerHeight;
} else {
width = document.body.clientWidth;
height = document.body.clientHeight;
}
if((width < 600)||(height < 450)){
setTimeout("resizeOuterTo(600,450)",200);
}
}
function resizeOuterTo(w,h) {
if (parseInt(navigator.appVersion)>3) {
if (navigator.appName=="Netscape") {
top.outerWidth=w;
top.outerHeight=h+40;
} else{
top.resizeTo((w+12),(h+30));
}
}
}



It's not elegant, but did the trick for what I needed.. I'm still looking for a permanent solution, so if you have one please feel free to comment.


also.. just to make sure people know this is kind of futile because some dude with a pimped out Firefox might decide to change this setting:
spammers using HyperNews installs Sunday, July 16, 2006

I’m seeing a rise in trackback spam coming from university domains like these posts http://www.csrd.uiuc.edu/HyperNews/get.cgi/PROMIS/10.html at Center of Supercomputing Research and Development at University of Illinois.
It seems that the spammers are just using these HyperNews systems for redirects by adding an old JavaScript trick to their post.  The HyperNews systems that I’ve seen getting hit by this appear to be old, abandoned setups that are not maintained, and don’t filter JavaScript and other nasty tricks out of their posts.

I saw a similar redirect from the HyperNews install at Stanford University last week, reported it, and they’ve removed the redirecting post.  I’ll keep reporting them and adding filters but the spammers have more time than I do.

Page 16 of 25 pages « First  <  14 15 16 17 18 >  Last »