When working on a large project with a number of backend tasks, intranet and public websites, I found that a couple of third party libraries had conflicting names, so when the autoloader ran, it always found the one it hit first. I found myself wondering if it would be possible to Autoload by scope, by registering each registry to the file that had the declaration. That way if a directory was declared in a given file, it will always prefer that, and thus load the right instance. It, unfortunately, does *not* solve your problem if you need to use both instances inside of a single execution.
SplatterPlot in MooTools and Raphael
Recently I’ve been working on some prototypes at work, and we’ve been doing a lot of rapid iteration and one of the ideas called for a splatter plot which was assumed would be fixed, but I had an idea on handling placement purely by linear position, which would then map to some position on a ring (in a series of concentric rings) which, in turn, maps to an X, Y position. I experimentally determined the spacing, number of nodes and radius for the circles and coded up the prototype. The nodes were image based and I’d say maybe 40% of it was dynamic.
Code environment for XeLaTeX
I found myself wanting an environment for outputting code samples and examples, in order to produce some standards documentation. After a couple of iterations I came up with the following:
XeLaTeX watermarking environment macro
I’m totally enjoying my switch from LaTeX to XeLaTeX, with all of the added benefits that entails. Over the years I’ve cobbled together and built a number of helpful macros so this will be my first of many posts to share them. Some may not be XeLaTeX specific, but as that’s the environment I use, many of them will not be fully LaTeX compatible.
Cross Browser SVG Using Moo + Raphael + XML for Script
I’m used to a very easy to implement, callback oriented php SAX parser from working with PHP for so long, and I’ve found a number of instances where I found myself wanting that capability in javascript. In addition, I tend to favor Extending objects to callback passing, as you don’t end up messing with scope issues. So what I really wanted was a simple base class I could extend to build whatever I happened to be working on at the moment. So I went out searching for something like this. The only remotely suitable option I found was XML for Script 3.1 which seemed dubious if only for the amount of time since it was last touched. I did a simple test though, and it seemed to be pretty solid. Relating to my earlier fondness for php’s simple 3 function interface made me want less of what I percieved to be an archaic interface, so I set out to build a MooTools wrapper I could then extend in the way I wanted.