Better Inkscape Palettes

Inkscape is a great vector drawing tool, and perhaps my favorite opensource app. One reason being that it is much more polished than most opensource applications (I’m looking at you Gimp and OpenOffice!) But one area that is noticeably lacking is its set of default palettes. In a word, they’re horrid. Of the 18 available, all but one or two are so specialized as to be useless to 99% of users.

I decided to do something about this on my system, so I started by moving the old palettes out of the way so the wouldn’t show up in the palette menu.  On Mac, I did this by typing the following from the command line:

cd /Applications/
mkdir old
mv *.gpl old

With all that old junk out of the way, you can now google for gimp palettes (Inkscape uses the Gimp color palette format) to find custom palettes that suit your taste.  I found Colorzilla to be a good starting point.  Just download your favorite “gpl” files and place them in the ‘palettes’ directory, and then restart Inkscape.

In my installation, I currently have the Visibone2 and Pantone palettes, plus custom palettes that I made for the Best of Kuler [gpl file] and Best of ColourLovers themes [gpl file].

BTW, It’s worth pointing out one of the annoying little characteristics of Inkscape is that it insists on adding a “X” (no color) chit to these palettes, which rotates all the colors by one column from where the palette creator intended them to be.   I’ve accounted for this in my Kuler/ColourLover palettes, but expect other palettes to look a bit off.  (As a workaround, you can edit the palette files to comment out the first color – not ideal, but may be preferable depending on the palette.)

White Sewing Machine Manuals

See that picture?  That’s about what it felt like as I was trying to track down the manual for the White #999 sewing machine I bought at a garage sale last week.  I’ll explain below, but if you happen to find this page while on a similar search let me save you a bunch of time – here’s the magic recipe:

Okay, now for the rest of you loyal readers (Hi, mom!) the reason I’m posting this is because of how insanely difficult it was to figure out these seemingly simple steps.  If the internet has done nothing else, it has made finding information about old products (i.e. manuals and user guides) much, much easier.  Or so I thought.  With rare exception, every time I’ve gone looking for a product manual online, be it for a computer, power drill, or a washing machine – I find a free download in a matter of minutes.  Typically available directly from the manufacturer.

But apparently sewing machines are off in a completely different world.  My attempts at googling for a manual turned up naught;  no manuals on the manufacturer’s site, and nothing but link after link of 3rd parties charging $10, $15, even $20 for what I felt should be a free download.  (Me: “WTF??? I only paid $15 for the darn thing, I’m not gonna drop another $15 on the manual!”)  To understand the frustration involved here, picture a 6’6″ guy with big hands who hasn’t touched a sewing machine in at least 30 years trying to decypher the 15-20 steps needed to properly thread such a device.

It was only after contacting White Co. directly that they pointed me (4 days later) at the Singer site, above.  Nevermind that there is not a single, solitary mention of the term “white” on  And never mind that none of the manual descriptions mention white.  Or that if you search for “white” on the aforementioned manual page you get zero results.  Nope, ignore all that, because this is the official product manual download page for White sewing machine manuals.

Don’t ask me how this came to be.  I’m assuming that somewhere along the line (probably back in the 70’s) Singer acquired the White brand.  And, while they have the legacy manuals in their database, they’ve been doing their best to wipe all other traces from their corporate memory.  Or so sayeth the conspiracy theorist in me.  Regardless, someone over at Singer and White Co’s really need a kick in the pants for this.

To end this rant on a happy note, I’m pleased to say that I eventually did figure out the thread path (w/out the manual, no less!) and for my first project, I stitched up a nice little tool pouch for the screwdriver set I keep in the office.  Look out, Martha, there’s a new domestic goddess a-comin!

JavaScript Inheritance Performance

One area of the Prototype JavaScript library that I have a bit of a love-hate relationship with is its support for mimicing OO inheritance.   The ability to call $super from within a function to refer to a superclass’ implementation is pretty darn cool, but I’ve found myself more and more annoyed at having to navigate what seem like unnecessarily deep and complicated stack traces when trying to debug code.  It was while mired in the bowels of Class.create() and Class#addMethods() that I found myself wondering how much of a performance penalty this stuff was incurring.  To find out, I put together a test to determine how the different strategies for emulating OO inheritance in JavaScript performed.  Here’s what I tested:

  • Ad hoc inheritance – This is a common(?) homebrew technique for allowing prototypes to leverage the code in objects further up the prototype-food chain.  Methods are overridden by keeping a reference to the parent method in a separate property , which can then be invoked as needed.  It’s fast but not very pretty, and it’s arguable whether or not this qualifies as real “OO” inheritance.
  • Prototype-style inheritance – Prototype uses a strategy inspired by Alex Arenell’s Inheritance library. Subclass methods declare a “$super” argument that is set up by Prototype to reference the superclass’ method.
  • Base2-style inheritance – Dean Edwards’ library.  Subclass methods invoke “this.base()” to call their superclass’ implementation.
  • John Resig inheritance – JR, of jquery fame, experimented with a Base2 variant which he published on his blog.  It’s a bit simpler than Base2, but seemed worth testing.
  • [Update] MooTools – For you MooTools fans out there, I believe that library uses the same approach that Dean Edwards came up with for Base2, so performance should be similar.  aNieto2K links to his test in the comments, below, if you’d like to verify this for yourself.  (I’d add this to the test, but Prototype and Moo collide over the use of the ‘Class’ name)

Tests were performed by using  JSLitmus to create a Inheritance Performance testbed. In it, I create a base class and subclass using each of the above approaches.  Each base class has a single method, “foobar” which is overridden, and invoked by, the corresponding subclass. The rate at which objects could be instantiated for each base class and subclass was tested.  The rate at which a method could be invoked on the base classes and subclasses was also tested.   Here are the results (first three are on MacBook – the IE and Chrome tests are on a Dell laptop):

There are pros and cons to each technique.  For sheer balls-out performance you’re best off using the ad-hoc “move aside” approach.  That’s only really important if you’re making 100,000’s 1,000s of calls per second to overridden methods, however.   Both Base2 and Resig’s approach have decent invocation performance, but Base2 can be a bit slow at object creation.

The most interesting result was the utter crap-tastic performance of Prototype.  When calling methods that use $super it’s consistently 20x slower than the other solutions. (Likely a result of the additional closure functions it requires).  Regardless, this is definitely something to watch out for for any application that makes heavy use of subclassing.  Or, rather, of subclassed methods.

Hakkerz say, “Upgradz!”

As you can see, the site has a new look this morning. It’s not entirely voluntary, however. Much to my chagrin I discovered that Google seemed to think my site was a great source of information about Viagra and various other prescription drugs. After a little scrounging around, I discovered my WordPress installation (i.e. this blog) had been hacked recently.

Fixing the problem necessitated changing all my wordpress and database passwords, and upgrading WordPress to the latest version. And, since my old theme was kind of kludged together in the first place I’ve just opted for a nice 3rd party theme for now.