?

Log in

gmcnaughton

> Recent Entries
> Archive
> Friends
> Profile
> previous 10 entries

February 18th, 2010


02:44 pm - Lynchpin typo
I found a bug last night with such an illustrious history that I need to document it.

SiteBuilder has the concept of resource dependencies: when you publish a page with images, both the page and images need to get uploaded. We have code that analyzes element properties to find these dependencies.

For my new feature I added a new dependency. While reviewing my code later, I realized that it shouldn't work. In fact, the whole system shouldn't work! Both the code and the comments explicitly state that what I did was wrong.

Half an hour of head scratching later, here is what I uncovered:

  • 9/2005 - Coder 1 adds a check that applies to a limited set of circumstances.

    • Unfortunately(?) it contains a typo. Element[@copyrightFooter!=''] should be Element[@copyrightFooterStyle!='']. This causes the change to apply much more broadly than intended (bug 1).

  • 9/2005 - Coder 2 adds code which relies on this typo. It also contains a new bug (bug 2)
  • 9/2006 - Coder 3 adds an entire subsystem relying on the typo.
  • 9/2007 - Intern 1 adds code which relies on the typo and contains a third bug (bug 3).
  • 9/2007 - I fix bug 3, but fail to notice the typo.
  • 9/2008 - I fix bug 2, which was now three years old, by refactoring the code. I fail to notice the typo.
  • 3/2009 - Coder 4 refactors Intern 1's code, but fails to notice the typo.
  • 2/2010 - Five years after the typo was introduced, I stumble across it. Fixing it immediately breaks the entire resource-dependency system.

I know that the right approach is to add tests and refactor. In the interest of time, I will probably just remove the typo and update the comments to pretend that this was intentional all along. :)

(3 comments | Leave a comment)

February 3rd, 2010


01:14 pm - Neologism generator
grep "^ex" /usr/share/dict/words | sed 's/^/s/'

Requires Mac OS X and a juvenile sense of humor.

Edit: once again GWAR is ahead of me, as is the Yale Record.

(Leave a comment)

November 7th, 2009


07:56 pm - Patentable(?) idea day
Patentable ideas for you!  (Or maybe business ideas, or both.)

Computers
  • Lossy zip (aka LLZW: lossy-lempel-ziv-welch).
  • 3rd-party file compression.  Automatic distribution of file chunks via a CDN, using block checksums, ala ZFS de-duplication (this might be what BitTorrent is already doing; this just uses a CDN instead of p2p)
    • the coolest part about 3rd-party file compression is that it could be calculated automatically and common chunks be replicated more broadly or moved to where they are most frequently used.  Actually, I think Freenet does this already.  Akamai should too.
  • Windows OS fractal compression.  File compression via matching blocks in standard Windows install files.  Or in any OS.  Or in the browser itself (requires client to accurately represent browser/version/OS combo).  Ala fractal image compression.
  • Shared strings compression.  Google could publish a dict of most common strings appearing on the web.  The browser would publish its version as an Accept header, and if the client/server dicts matched, the common-strings-compressed version could be delivered.  Similar to 3rd-party auto-CDN compression, but the nearest CDN is actually cached on your local computer.
Arts
  • Flower imprinted images, ala laser etched fruit and Japanese apples.  Flowers would have to be etched after budding.  Longer-lived plants could be imprinted early and allowed to grow (like carving names into bark).


(1 comment | Leave a comment)

November 4th, 2009


11:00 pm - Code snippet of the day

Handling exceptions is tricky. Opinions vary on whether you should catch and report to a central error handler, only catch exceptions you know how to recover from, or fail-fast and allow exceptions to bubble up until the program exits.

Our email management API takes a different tack:

void CEmailManagerExtension::CMDCreateMailbox()
{
    try {
        // ...do some work...
    } catch (...) {
        rCtxt.Redirect("http://www.ebay.com");
    }
}

Obviously if something goes wrong with the create-mailbox API call, the correct response is to send the client to eBay. Maybe they can buy error handling that doesn't suck.

This code has existed since 2002 - no word on whether eBay pays us a revshare for traffic.


(3 comments | Leave a comment)

August 12th, 2009


03:42 pm - HDTR Sculpture
Admittedly I think these are CG renderings rather than physical statues, but I've been wanting someone to do this for a while!

Sculptures in Motion by Peter Jensen


Tags:

(Leave a comment)

August 11th, 2009


05:07 pm - Code snippet of the day
Ran across this in the heppkat codebase today. I believe the comments come from MFranklin.

// This is the best reason not to use this class. What the hell is going on here?
// Nobody knows, as evidenced by the fact that its most prominent use until recently
// was wrapping things that weren't AWT components.
AWTComponentWrapper acw = new AWTComponentWrapper();

...

// This is another good reason not to use this class. This line should instead
// be changed to System.out.println("I give up!"); System.exit(1);
return acw;


In case you're wondering, we don't use this class anymore. I think.

(5 comments | Leave a comment)

July 2nd, 2009


07:45 am - Yellowstone


I know what you're thinking: "Yellowstone has some of the most magnificent scenery ever, up there with the Golden Gate and the Swiss Alps? Isn't that exaggerating a little bit?"

This steam tornado forming over a geothermal hot spring proves otherwise.

Many more pics to come, I'm still working through them all. Some quick words: buffalo, buffalo walking on the road, elk, pronghorn antelope, deer, black bears, moose, bighorn sheep, osprey, golden eagles, herons, marmots, chipmunks; geysers, hot springs, waterfalls, mountains, lakes; snow, hail, rain, wind, sunburn.

(4 comments | Leave a comment)

May 15th, 2009


06:22 pm - Homestead Video Game Throw-Down 'Lympics 2009


My team lost the week-long competition by 1 game. (Not Rock Band though! We won that one.) There will be a next time though. Oh yes, there will be a next time. They will rue the day!

(Leave a comment)

May 11th, 2009


12:52 pm - HDTR Links
Couple links I ran across recently that are HDTR related:

Brian Dettmer: Adaptations - 3d surfaces carved in books, using the pages instead of photos as the dimension.

Khronos Projector - these were the guys who wrote the original SIGGRAF paper back when I stumbled on HDTR (independently, dammit!).

Khronos Projector Demo Applet - play with it!

(Leave a comment)

May 4th, 2009


01:28 pm - Hyperbagging: A New Innovation In Gameplay
I would like to introduce the concept of hyperbagging, a.k.a. fourth-dimensional teabagging.

In first-person shooter games, teabagging is the act of killing another player and then rapidly crouching up/down on top of their corpse, in order to humiliate the target. 4th-dimensional teabagging is the same act performed in a higher dimension. Most game engines do not support higher-dimensional gameplay, but this can be approximated by distributing the teabagging over time.

For example: a player might crouch/uncrouch repeatedly in a certain area, then lie in wait to ambush someone on that point. Later, the player may stop to teabag in spots where they had previously killed opponents.

The full measure of the target's humiliation is hard to visualize, but can be approximated by a time-lapse video or an composite image. These lower-dimensional projections of hyperbagging allow us to grasp facets of the player's shame without requiring visualization of the entire act (a.k.a, tessersack).

The implications of hyperbagging include some surprising outcomes, such as allowing players to be teabagged from all directions simultaneously, including inside themselves.


2D projection of 4D hyperbagging.

(11 comments | Leave a comment)

> previous 10 entries
> Go to Top
LiveJournal.com