Drawing vector graphics with javascript
By Shawn Bradley | September 30, 2007
In my trolling, I came across this javascript library for drawing graphics. It could be useful in the future…
Topics: Web Development | No Comments »
md4, md5 and sha-1 cryptography in Javascript
By Shawn Bradley | September 15, 2007
Here is a fabulous tutorial on using cryptography in Javascript to create a secure login system.
Topics: Web Development, Software Development | No Comments »
Filtered advertising
By Shawn Bradley | September 15, 2007
There are some great suggestions at this blog for filtering Adsense advertising based on several visitor parameters.
Topics: Blogging | No Comments »
Whitespace in XML - Firefox vs. IE
By Shawn Bradley | September 15, 2007
Today, for a change, I am actually more approving of this particular difference between IE and Firefox. In this case, Firefox is a little TOO rigid in standards adherence, in my opinion. I’m talking about how the two handle whitespace in XML documents.
Adhering to the absolute letter of the standards law, Firefox interprets whitespace as empty text nodes. The end result here is that you cannot format your XML document for readability without introducing a bunch of bogus nodes when the data is processed in Firefox. IE doe things differently - it treats whitespace as most programmers are accustomed to treating whitespace, namely, it ignores it!
Therefore, to get the two browsers to produce the same results, I had to introduce a new function into my AjaxCaller wrapper that would eliminate blank text nodes after receiving the XML from the server. The following code worked very well:
_cleanWhiteSpace: function(node) {
var notWhitespace = /S/;
for (var i=0; i < node.childNodes.length; i++)
{
var childNode = node.childNodes[i];
if ((childNode.nodeType == 3)&&
(!notWhitespace.test(childNode.nodeValue)))
{
// that is, if it's a whitespace text node
node.removeChild(node.childNodes[i]);
i--;
}
if(childNode.nodeType == 1)
{
// elements can have text child nodes of their own
this._cleanWhiteSpace(childNode);
}
}
},
Topics: Web Development, Software Development | No Comments »
Image map coordinates calculated incorrectly by IE7
By Shawn Bradley | September 6, 2007
OK, this one really pissed me off!!! For days now, I have had a problem with a complex image map. As usual, it’s the same old tune - it works fine in Firefox, but barfs in IE. I have an image map that displays several East Texas counties. As the user rolls over the different counties, additional information is displayed in a separate DIV. I got it working fine in Firefox, but when I tested it in IE, the coordinates were incorrect. My DIV would only appear if I rolled over a part of the polygon, but most of the polygon is ignored completely.
I surfed forums and blogs for hours searching for a clue. When I found nothing, I decided to completely re-construct the page from scratch and locate the point where the problem occurs. I went back to Photoshop and exported my image map, checking it in IE immediately. At this point, it worked fine. I then began modifying the resulting code, testing each change along the way. I made a bunch of changes, most of which were formatting, and tried again in IE. Mysteriously, the problem appeared! This was quite puzzling since the changes were only formatting, not functional. I rolled back these changes, and it worked again. Weird…
So my next step was to incrementally re-institute my formatting changes (I tend to be a bit anal about indents and white space), testing each change in IE. Everything worked fine, until I changed the indenting on the block of code that defines the image map. As soon as I indented these lines, the problem returned. When I removed the indenting, aligning the code to the far left, the problem went away. Further experimentation revealed that as long as the <area> tags are left aligned, the map works fine in IE7. Otherwise, the coordinates are calculated incorrectly in the image map.
Topics: Web Development, Software Development | No Comments »
Careful with filenames when deploying to Linux
By Shawn Bradley | September 5, 2007
Today, I lost a substantial amount of time troubleshooting a site deployment. My development platform is Windows, and the site was fully functional on my system. However, when I deployed it to the production server, suddenly files were not able to load. After attempting numerous variations of the path settings, it finally dawned on me that one of the files had a capital letter. In Linux, this matters! As soon as I renamed the file, everything worked fine.
Topics: Uncategorized | No Comments »
Unit testing VBA projects
By Shawn Bradley | August 27, 2007
One of my current projects requires exclusive development in Microsoft Access using VBA. Having put my hand to the plow, so to speak, of extreme programming, I was quite unwilling to return to traditional methods of development. Yet it appeared I was constrained by my inability to drive a VBA app from outside of the Access IDE.
Fortunately, after some poking around on Sourceforge, I was able to locate an NUnit-based project graciously contributed by rharwood. This project is called VBAUnit (naturally) and is available here. The owner of VBAUnit explains that this was a quick and dirty implementation, since VBA development is not a mainstay, but it certainly did the trick for me. I would not have survived this current project with even a modicum of sanity had I not discovered this valuable contribution. If you are doing, or plan to do, any work in VBA, I highly recommend utilizing this resource.
Topics: Software Development | No Comments »
Standards-based CSS web design tool
By Shawn Bradley | August 24, 2007
With the latest buzz about web usability standards, CSS-based layout is gaining prominence over table-based layout for a host of obvious reasons. However, making the transition from a table-based mindset is sometimes a very difficult adjustment. I have been recently endeavoring to make the jump, and have run into many problems, some of which I will chronicle here.
Fortunately, with such broad-based commitment to the ideal of web standards in site design, there are many folks out there who are doing a lot of the heavy lifting for those of us who are not as far along. The good people at csscreator.com have provided some very useful tools for getting started. One such tool is their CSS Layout Generator. Using this simple and intuitive tool, beginners can easily create a variety of CSS-based layout templates. It’s a great time-saver and learning tool. Check it out!
Topics: Web Development | No Comments »
Wrestling with IE
By Shawn Bradley | August 17, 2007
And now for today’s IE vs. Everyone Else showdown!
I typically develop javascript applications using Firefox as my primary browser. (Oh, wait - I use Firefox as my primary browser for everything! Duh!) Anyway - I like developing within Firefox because of the wonderful debugging tools available, such as Firebug. As I progress in the development process, I frequently switch over to IE, just to make sure some IE-specific (mis)behaviour isn’t screwing me. And invariably, I find myself indeed being screwed by IE!
In today’s episode, as usual, the code was working fine in Firefox, but breaking in IE. Running the page in IE resulted in a runtime error indicating that my Balloon object class was not defined. What?! It most certainly is defined - I just ran it in Firefox. As it turns out, the issue had to do with IE’s inability to handle trailing commas within custom javascript objects. But first, a little background…
I am developing a custom popup balloon for a site I am working on. The balloon will be activated in response to the user rolling over an image map with their mouse. Each map slice has an associated balloon containing detailed information about that region of the image map. I am using Beau Scott’s AJAX-enabled tooltip HelpBalloon as an example. Read the rest of this entry »
Topics: Web Development | No Comments »
Introduction
By Shawn Bradley | August 17, 2007
Yes, just what the world needs - another blog! I know, I know … but have a little patience with me. It’s not just that everyone else is doing it - I have been searching for quite some time for a way to catalog my experiences. No, this is not a diary - no one is going to care that I just got a dog, that I went to the lake this weekend, or that I really like pizza. I don’t even particularly care about recording those things. However, in my daily experience as a software developer, web designer, outdoor adventurer, budding martial artist, etc., I learn things that I really believe others can benefit from. If these experiences can help others, then they are worth the time and effort to record and chronicle.
Topics: General | No Comments »
