Tag Archives: statistics

More Fun Times with Browsers

Unfortunately, the browser share statistics I gave last time were incorrect. Although I did my best to try to remove erroneous hits from web crawlers, site grabbers, and the like (which don’t constitute valid visitor hits), I overlooked a growing trend in hits from (what I suspect are) botnets trying to exploit URL parameters that may be used to pass in filenames to a script that subsequently includes that file (i.e. executes the file). Of course, none of my scripts have that glaring vulnerability in them, but the zombies try it anyways, creating bogus hits. The reason I missed these hits earlier was that their volume per distinct IP was low enough such that I passed over deleting them on initial inspection of the log data. Of course, crawlers like Google will often have thousands of hits per IP, which is simple enough to identify and remove.

However, swarms of zombie computers weren’t the only reason my data was off. Microsoft’s search engine also uses subversive techniques to get in under the radar. From a huge pool of IPs under 65.55., they continually run bogus searches on sites like mine using a User Agent that doesn’t identify itself as a bot but rather looks like a normal (of course Windows) user. I would just block MS’s range altogether, but I suspect that would just anger their search engine. They may have reasonable motives for doing these search checks (e.g. to make sure sites display the same content to the crawler that they do to a visitor), but it’s an annoying system nonetheless.

Anyways, I present to you the revised graphs from the cleaner data below. Thankfully, it looks like users are moving towards IE7 and away from IE6 more than I previously reckoned. Also, Firefox seems to be gaining on both flavors of IE more than expected. Meanwhile, Safari and Opera are not to be counted out. However, Netscape is still finding a new definition of pain and suffering as it is slowly digested over a thousand years.

To be sure this new data was reasonably accurate, I found a neat site that analyzes internet market shares at major websites. Their data does concur with mine; however, due to my enthusiast-orientated content, I do get a lot more Firefox visitors than mainstream sites. This is perfectly acceptable, though. 😉

Actually, the reason I was looking at the log data again to begin with was because I got interested in Operating System shares after reading a revisit on the suckiness of Vista in MaxPC. Thankfully, I’m not the only one that’s holding out on upgrading my OS until something significantly better comes along. Unfortunately, a lot of people are having Vista shoved down their throats just because they want a new computer. …It’s been a while since everything Microsoft did didn’t piss me off.

Even though Internet Explorer 7’s adoption is on the rise, web developers can’t rejoice yet, as IE7 is still a faulty product in its own right. Since I’ve been testing my new layout in IE7, I’ve noticed more and more a strange scrolling bug. It is characterized by an incomplete scrollbar and frequently stuck mouse wheel scrolling. It wasn’t until I tested my new version of the Deus Ex guide (a very long page) that I realized how much of an issue this bug was. Googling around, I could find barely a mention of the bug on all the intertubes. However, one bizarrely made page (#41: Infinite loop related to overflow and position: fixed) did have the problem outlined quite well on a list of IE7 bugs. Unfortunately, there’s no simple fix beyond scraping the whole fixed positioning layout. Reportedly the only way to remedy the situation was to scroll to the bottom of the page, which could take a poor visitor several minutes to do on my DX guide.

However, after I thought about it for a little while, I thought there may be a way to force the page to scroll to the bottom and then back up in JavaScript on page load. I recently used a scrollIntoView function on my new content system overhaul that did just that. It worked brilliantly. And with a little creative use of the DOM, the script can be dropped into any page with a fixed positioned content frame and overcome this bug automatically. Unfortunately, the mouse wheel scrolling issue remains–can’t fix everything with the DOM.

//trigger this function with body onload and onresize events
 function IE7ScrollBarHack() {
     //get the main content frame from id
     var mainFrame = document.getElementById('main');
     var ie7hackanchor;

     //check if our span has already been created
     if ((ie7hackanchor = document.getElementById('hackanchor')) == null) {
         //create a span and append it to the content frame
         ie7hackanchor = document.createElement("span");
         ie7hackanchor.setAttribute("id", "hackanchor");
         mainFrame.appendChild(ie7hackanchor);
     }

     //scroll down to that span and then return
     var prevScroll = mainFrame.scrollTop;
     if (ie7hackanchor != null) {
         ie7hackanchor.scrollIntoView(false);
         mainFrame.scrollTop = prevScroll;
     }
 }

Of course, it’s probably best if you only print this function in IE7 using whatever server scripting language you have. I usually use something like this (in PHP):

$IsIE7 = preg_match('/^Mozilla\/\d+\.0 \(compatible; MSIE 7\.0/i', $HTTP_USER_AGENT);
Posted in Programming, Website | Tagged , | Leave a comment

SnakeByte Studios Endorses Obama-Biden

The election will surely be a landslide for the Democrats with this crucial endorsement!

But seriously, I’ve been behind Obama since the primaries. My decision is based on his keen intellect, technological prowess, and inspirational charisma (and you know, the fact that I’m a Democrat). I often wonder how anyone in my field can even support McCain, who can barely use a computer, versus the young, ambitious, and intellectual spirit of most programmers that is embodied in Barack Obama.

I normally wouldn’t discuss politics on my website and have continually shaken off the urge to do so recently, but the fast yet seemingly endless approach of the presidential election has gotten me so excited that I’ve turned into a political junkie over the past few months. Every morning, I scour the web for hot political news; every evening, I’m fixed to MSNBC’s line-up; and every waking hour, I’m watching for new poll data. It’s gotten so bad, that I’m starting to do programs and spreadsheets with election data.

Friday, I randomly decided to start crunching numbers on the differences in spread between the 2004 election and 2008 election predictions. I grabbed the predictions with a Regex on Pollster.com‘s fine poll trend data and the results from the Federal Election Commission for 2004 and mashed them together in Excel to get the spreads. Then, I got the crazy idea of seeing the data visually. So from there, I made a VB.Net script to take the data and decide what color to make a state (with the typical Blue equals more Democratic and Red equals more Republican) by adjusting hue, saturation, and luminance. Unfortunately, the linear hue equation made the map mostly purple, which didn’t convey the key point that the country is turning Democratic this cycle. So I switched to a logarithmic hue equation that would keep the purples towards the very center. For any interested, here’s the code I used to find the colors. (Where “x” is positive for more Democratic and negative for more Republican.)

Dim MaxDemHue As Integer = 147 'hue when input is MaxShift in the democratic direction
Dim MaxRepHue As Integer = 255 'hue when input is MaxShift in the republican direction
Dim MaxSat As Integer = 255 'saturation when input is MaxShift
Dim MinSat As Integer = 160 'saturation when input is 0
Dim MaxLum As Integer = 92 'luminance when input is MaxShift
Dim MinLum As Integer = 207 'luminance when input is 0
Dim CenterHue As Integer = ((MaxRepHue - MaxDemHue) / 2) + MaxDemHue 'hue when input is 0
Dim MaxShift As Integer = 40 'the max spread in either direction

Dim HueShift As Double = ((MaxShift * 0.262) * Math.Log(Math.Abs(x))) + 3.9138
If HueShift > 0 Then HueShift = 0 'possible that it could go negative with log
hsl.H = CenterHue - (Math.Sign(x) * HueShift)
hsl.S = ((Math.Abs(x) / MaxShift) * (MaxSat - MinSat)) + MinSat
hsl.L = ((Math.Abs(x) / MaxShift) * (MaxLum - MinLum)) + MinLum

Initially, I manually put the state colors into an image. This proved to be a bit time-consuming, so I moved to a vector art format called SVG that, because it’s merely XML, can be changed programmatically. With each state shape having a unique ID, I can just XPath to it in code and Regex change the color. Now the results.

Looking at the map, it seems quite clear that indeed the majority of the country is trending Democratic this year. Most of the states are 5 to 10% more for Obama than they were for Kerry. There are some notable exceptions, though. The northeastern states are surprisingly not much more Democratic (or even more Republican in the case of Massachusetts and Rhode Island); I’m guessing this is because they already turned out very strongly for Kerry last election. Similar to Mass. is Arizona, where McCain has the home-team advantage. That leaves Tennessee and Arkansas as the only other states not trending more Democratic, which may be explained by racial factors and population demographics.

Just for the hell of it, I also plugged the raw prediction data into my script to produce a map with a bit more information than the standard electoral ones you see floating around.

news273I’ve worked on the new version of Cursor Lock recently and a release is eminent (hope I didn’t say that last time I mentioned Cursor Lock). A new installer is already made and all the known bugs are fixed, so there’s just the matter of documentation left. If I can peel myself away from the polls, I’ll hopefully have the new release done before November 4th.

Posted in Programming | Tagged , , , | Leave a comment