Feb 08 2007

Thoughts On Music

Tag: Apple, Computers, Gadgets and MusicAlex @ 7:37 am

Steve Jobs has issued a Hot News article detailing Apple’s stance on DRM and it’s future. I’m going to go so far as to say he has laid down a challenge in full public view to the big 4 Music Distribution Companies. However I can see that his account serves only to appease the public’s wrath due to Apple not licensing it’s FairPlay DRM technology to other companies, I can’t see the big wigs in the music world even reading the article, let alone uttering more than a chuckle.

http://www.apple.com/hotnews/thoughtsonmusic/


Feb 04 2007

Hmm. Upgrades

Tag: LifeAlex @ 11:49 am

This is the obligatory blog entry warning that I have upgraded to Wordpress 2.1 and to ask anyone who finds something that used to be working, now broken, to comment here.

I might make an AJaX Askimet spam counter plugin (if I can’t find one already done) for my sidebar. It’s amazing how much spam attempts to hit my blog. Is there a conspiracy going on. Does askimet make up spam to make it look like it’s stopping a lot more spam than is actually getting submitted?

Statistics time:

  • I installed Askimet on October 11, 2006.
  • Since then it has stopped 7,884 spam comments.
  • That averages to 68 spam comments a day.
  • 925 of those were in the last 15 days.
  • The average over the last 15 days is then 62 spam a day.
  • It is currently letting through less than 1% of that into my moderation queue.
  • Because of my moderation settings, a total of 0 have made it to my blog.

I should really just turn on compulsory registration or try referer checking as well as Askimet but this is fun so I’ll leave like this for a while longer.

EDIT: After watching the access logs (using tail -f access_log | grep wp-comments-post.php) I have found a couple of interesting things. The first is that all the spam that is trying to hit my blog does in fact have a valid referer and a valid User-Agent. The referer is that of various posts in my blog and the User-Agent happens to all be "Opera/9.0 (Windows NT 5.1; U; en)". These requests are either spoofed IP packets or are from a bot-net as the IPs are all over the show.

Just for fun, I’ve done a little .htaccess file hacking which now “403 Access Denied”’s them based on various information I’ve discovered from the access_log, I just want to see if I can stop the spam even getting to Askimet.


Feb 02 2007

Syntax Highlighting

Tag: LifeAlex @ 9:11 am

I just installed a syntax highlighting plugin “igSyntaxHilite” but man it has some things I don’t like. Hard-coded CSS instead of using classes and an external stylesheet, hard-coded Courier New font. Anyway, I’ll be looking around for another syntax highlighter or hacking this one up a lot (must check the license to be honest).


Feb 01 2007

Internet Explorer 6 Performance

Tag: Computers and Web DesignAlex @ 5:18 pm

I spent a huge part of today trying to determine the cause of a major Internet Explorer performance and rendering regression in a Web Application I'm developing. The reason it was such a bitch to find was because so much code had changed since the last time I had done a proper test in IE6. This was in code which I didn't expect to cause rendering issues, performance issues maybe, but those could have been dealt with.

So, I went through carefully ripping apart the project, disabling stylesheets, removing images, removing individual styles to figure out what was going on. About a hour later I hadn't got very far. I had determined that every1 browser was fine except IE6.

In frustration, I turned to Google. Trying to find pages describing huge black areas rendering over the page while using Scriptaculous Sortables got my nowhere so I tried searching for causes of huge black rendering artefacts in IE in general... nothing.

I turn back to trying to make a minimal test case. I ended up removing an image that was inside each Sortable item and suddenly the rendering problem went away and the performance jumped up significantly. Anyway, some dilly-dallying around and it turns out it was the javascript I'd written causing problems at all. It was the IE6 CSS Alpha PNG hack which was causing all the problems (which was working fine without performance issues the last time I tested this site in IE6).

It is indeed common knowledge among web developers that IE6 does not support transparency on 24-bit+Alpha PNG images. The alpha channel is rendered [usually] in a baby blue colour instead of being see-through.

To remedy this I was using the fastest hack around the issue that I have found and it involves pasting 5 lines in the CSS file for a site and bingo. I didn't make this hack but here's how it works. It uses the proprietary filter CSS attribute combined with the DirectX ActiveX control to draw the PNG, to target only PNGs and the also proprietary CSS extension 'expression' which uses JScript to compute values. I haven't had a problem with this hack yet, it doesn't handle CSS background images but I haven't needed it to yet.

CSS:
  1. img {
  2.     height:expression((this.complete&&(String(this.src).substr(String(this.src).length-4,4)==".png"))?"1px":"");
  3.     width:expression((this.complete&&(String(this.src).substr(String(this.src).length-4,4)==".png"))?"1px":"");
  4.     filter:expression((this.complete&&(String(this.src).substr(String(this.src).length-4,4)==".png"))?("progid:DXImageTransform.Microsoft.AlphaImageLoader(src="+this.src+")"):"")
  5. }

This combined with the addition of a PNG on each individual Sortable Item caused the poor DirectX Transform to basically crap itself and render parts of the window black. Very black.

Blah.

What a waste of many hours of my day.

Honestly though, this rendering bug caused a few 'wow' moments from people in my office when they saw what IE was displaying on the screen and how it took roughly 20 seconds and 100% CPU to drag one single item between two lists. I'll have a screen-shot of this up in the next few days.


#1 every means "Safari, Firefox 1.5, Firefox 2.0, IE7, WebKit nightlies and Opera 9"