Fanon And The Hazards of Source Amnesia

a guest post by weebee

Fanon is a rather odd entity. It’s often looked down on entirely, with those who think themselves the ‘best authors’ sneering at any use of it and claiming that you should never resort to such obviously flawed and factually incorrect items. Of course, it does have a purpose and one that, if it’s not noble, at least makes sense.

Some fanon, such as the name “Kimiko”, established for Soun Tendo’s wife in the Ranma 1/2 universe, is simply there because there is absolutely no canon data on the subject, but it’s handy to be able to refer to her by that shorthand and to always have a name to use if you need it.

Other fanon, like the explanation that a Sailor Senshi’s transformation naturally includes a disguise field, helps a person who needs explanations for normally unexplained phenomena, or helps bolster a story if it’s already stretching your suspension of disbelief and doesn’t want you thinking about the why. For example, if Usagi executes a perfectly coordinated wall run and Shingo doesn’t recognize her when she did it while holding him in her arms.

There is a third type of fanon, one that ascribes hitherto vaguely hinted (or not hinted at all) motivations to a character or amplifies (what TVTropes would call flanderizes) established traits such as the insistence on having Minako Aino flub a line every chapter, or having Akane Tendo chase everyone who accidentally sneezes in her direction with a mallet.

These last two types, while occasionally literarily useful, can be somewhat dangerous. For example, there is the habit of an author latching onto one of them as a device that they enjoy using in their work and, through that use, forgetting that it was an author-created device. For example, I often have to remind myself that, in the Anime and Manga, Ranmaverse characters very rarely show any ability to detect the life force of others, and that usually occurs when an aura is being clearly displayed, or a hostile action is being taken against them. It is important to keep track of these devices, as you can find yourself correcting another author on a point of fact that is, in fact, only one of your personal plot devices, or failing to enjoy a story because it violates it.

The strangest effect that modified devices or characters can have on a series is what, for the purposes of this example, I’m calling pervasive fanon, and since it is the thing that brought it to my attention, I will be using Sailor Pluto, and her relationship with the timeline and time gates for the example.

Taking only Sailor Moon, the Anime series as a basis, Sailor Pluto’s limitations and job are rather clearly spelled out. She is to guard the gates of time, ensure that she is standing at them and guarding them at all times (barring earth-shattering emergencies), and not to abuse her powers, most particularly the time stop, the penalty for which is death.

At some point (I have absolutely no idea when or who was responsible), a fanfiction author wished to write a story either revolving around Sailor Pluto, or the act of changing the past. To that end, this author thought that it would be neat if Pluto could open the gates without passing through them, to use them as a sort of temporal viewer rather than a time travel device, explaining that, in his fic, the gates had that function built in to better facilitate her guarding of the timeline.

This plot device was actually quite a good one. It allowed a whole new character interpretation for Pluto. No longer simply the grim guardian of time who stood vigil over one of the most dangerous forces in existence to keep it under control, this Pluto could actually shape events, could enforce her will on the timestream. This is fanfiction, after all, and the possibilities of that are endless, depending on how her character was played.

I’m guessing that the sheer number of possibilities from this plot device, the time gates as a monitoring device, resulted in a wave of fics that used the same premise for various effects and even fics that used it for side or background effects that would help a main story.

This is where things get interesting. The human mind tends to suffer from something called “Source Amnesia.” That is, we sometimes have trouble determining where we heard or learned a piece of information. In a case where we are reading and writing fanfiction about a series that we may not have all of the episodes of, or that we may only be catching once a week, this source amnesia tends to kick in pretty hard, and that’s why things like Pluto’s extra powers over the time gates tend to seep into our knowledge of the series. It’s obvious Pluto can do that, it’s obvious Youma and Dark Generals can absorb large amounts of life force with a single touch, it’s obvious that Sailor Jupiter is actually a dryad… wait, what?

All of these things seem obvious because we’ve seen them so often, as they become popular fanon devices, and we simply cannot go over the canon nearly that much. There are 200 episodes of Sailor Moon, each of them 22 minutes long, and the fifth season is only subbed. Let’s not even talk about the differences caused by the editing done during the dubbing process, and the trick some people (including me), do of assuming that X thing I could have sworn was canon must happen in the subbed version.

All of this seems kind of annoying, but not really that bad, right? Unless someone takes something as fanon that you find really annoying, it shouldn’t bother you. Well, that’s not exactly true. Getting back to Sailor Pluto and the Time Gates. Over the more than a decade that her abilities have been changing in fanon, the generally accepted version of her is capable of monitoring the timeline for change, sometimes remotely, and ensuring that the most likely outcome, right down to decimal point probability, remains crystal Tokyo. If you want to change something, add a major character that shakes things up, many authors will catch themselves wondering, “How would Sailor Pluto let this happen? It would cause X to happen wrong!” and then come up with a long, complex explanation as to how she could tweak things so everything worked out.

But let’s put things back into perspective, here. Recall her original list of abilities? She guards the gate of time, which is a corridor that lets you travel through time. Her only temporally dangerous ability is a timestop that will straight up kill her if she uses it. So you can go ahead and put your new character, scene, or reaction in, because canon Sailor Pluto has no inclination to stop you… unless you’re trying to blow up Usagi or something, anyways. And then she’ll do it by teleporting out of the gates when something or someone else informs her and hitting you upside the head with her staff, not going back to last Tuesday and re-arranging gum wrappers so you never have the idea.

In short, fanon is a useful thing for authors, it lets them do pretty much anything they want with a series and its characters, determined only by the writer’s ability and imagination. But when a stumbling block comes up from what you feel is a well established plot point, don’t be afraid to go back and check the source. If it’s fanon that’s blocking your way, you don’t need it.

Ed.: If you have any ideas as to where in the fandom the expansion of Sailor Pluto’s powers originated, please share them in the comments. Inquiring but overworked minds want to know.

Posted in Otaku Stuff, Writing | 1 Comment

Functional Programming Concepts for the Lay Programmer – Part 2

Update: Part 3 is finally available.

After languishing in the drafts folder for over a year and a half,  Functional Programming Concepts for the Lay Programmer – Part 1 now has a friend.

The Easy Stuff, Continued

Mutable/Immutable
In many languages, there are certain data types where, once an instance created, it cannot be changed. That is, any attempt to change the value produces a new object, leaving the old one unaltered. Such data types are known as “immutable” (unchanging).
Generally, functional languages apply this principle to all data types to limit programming with side-effects to things like disk and network access.
Conversely, data structures which can be altered (eg. Lists/Arrays in pretty much any language which supports imperative programming) are known as “mutable”.
Lambda
Also known as anonymous functions, lambdas are functions which can have their definitions placed anywhere a function name would normally be expected as an argument (See “Higher-order Function” in part 1) and, unlike regular functions, don’t need to be assigned a name. While Python’s lambdas are very limited compared to more functional languages, being more reusable expressions than proper functions, this example should still help to clarify the utility of one-off functions:

myList.sort(key=lambda x: abs(x.delta))

In one line, that lets you perform an in-place sort on the absolute values of the objects’ “delta” member variables. I also ran across a slightly more technical explanation in case you want it. I’m told that the implementations of many Ruby APIs are also an excellent example of the utility of lambda-like constructs thanks to Ruby’s anonymous block construct.

Tuples

In every functional or multi-paradigm language I’ve had personal experience with, lists have certain restrictions. For example, in Haskell, the type signature of every element in a list must be the same while, in Python, lists are mutable which, as a side-effect, means they cannot be used as dict (a.k.a. hash/mapping) keys.

The tuple is a list-like data structure which provides a different set of limitations. In Python, tuples are immutable but can be used as dict keys. In Haskell, you can create a tuple with any combination of elements, but every tuple will have a unique type signature. (If you’re familiar with C-like languages, think of a list as an array and a tuple as a simple struct. The implications for function type signatures are essentially the same.)

In both languages, the most common use I’ve found for tuples is allowing a function to return multiple values of varying types without having to define a new, single-use data type.

Generators

Imagine a function which you can leave and re-enter without losing its internal state. That’s what generators are. They’re most commonly useful anywhere you want to iterate over something without having to generate the entire set of values before you start.

Python implements generators, so this bit of example code should make it a bit clearer:

def find_first(thing):
    for fldr, dirs, files in os.walk('/home/me/stories'):
        for fname in files:
            if thing in fname:
                return os.path.join(fldr, fname)

os.walk is a generator which wraps up a depth-first tree traversal as an iterator so you have the option to abstract away the recursion. Each time it resumes, it traverses one iteration further into the algorithm.

What makes generators so special is how simple they are to use:

def thumbnails(img_paths):
    for path in img_paths:
        base, ext = os.path.splitext(path)
        yield base + '_tn' + ext

for thumbpath in thumbnails(list_of_millions_of_paths):
    # Do something

Think of that yield keyword as “return, but let me resume execution where I left off”. I use them for writing things like for block in parse_png(file_handle):

Coroutines

Coroutines are basically the next generalization up from generators. While generators give you a way to return multiple times from a single function, coroutines give you a way to exit and enter a block of code, receiving and sending data as you go without relying on side-effects (see pure function). Wikipedia has examples of how this is useful.

Python 2.5 and above support coroutines using these extensions to the generator syntax:

def coroutine():
    # ...
    input = (yield output)
    # ...

co = coroutine()
while I_am_looping:
   # ...
   return_value = co.send(new_argument)
   # ...

Continuations

If you take one more step from coroutines, you get to continuations. As a friend put it, “continuations are what system calls do”. The operating system saves everything about your program’s current state and goes off to do something else. Then, when the return value of the system call is ready, it restores that saved state and resumes your program where it left off. When a programming language has good support for continuations, you can arbitrarily choose to save the state of a thread of execution, pass it around, and then come back to it later. As another friend put it, “continuations are what you’d use to, say, implement the ‘yield’ keyword”.

If JavaScript had continuations, for example, you wouldn’t need to write so many callbacks. You’d just write what appears to be a blocking code but works asynchronously under the hood. TameJS (JavaScript continuations for Node.JS using C# syntax) and F# (Example 4: Asynchronous programming) provide good examples of how this looks and works.

Alongside anonymous functions and tail recursion, continuations are one of the few functional-programming features that basic, bog-standard Python doesn’t support… but there is a Python web application framework named Nagare (built on Stackless Python) which uses them to provide a very unique approach to writing Python web applications.

Still to Come…

  • Map/Reduce/Filter
  • Closures
  • Metaclasses

Let’s hope that, this time, it doesn’t take me a year and a half to write it.

Posted in Geek Stuff | 1 Comment

Just a Few Little-Known REAL Mysteries (and other interesting things)

Around the time I wrote “A Few Suggestions/Pleas to Authors of Mystery-oriented Fiction“, I started work on a little post about some of the real mysteries that don’t get much attention. It’s not as long as I’d like, but I don’t think I’ll have time to extend it any time soon.

The Devil’s Kettle
Located in Judge C. R. Magney State Park in Minnesota, U.S.A., this unique waterfall sends half the flow of the Brule river underground. Nobody knows where the water ends up and scientists have no idea how a tunnel capable of carrying that much water could have formed in that kind of rock.
Metro-2
Supposedly, Moscow is home to a secret subway, begun in Stalin’s time and buried deep underground, which interconnects politically important buildings like the Kremlin and the Government Airport and links them to a secret bunker described as an “underground city”. Various current and former members of the government have given various (sometimes conflicting) bits of information but there is nothing reliable on what really does exist and what is exaggeration.

…and since the list is so dissatisfyingly short, I’ll also throw in some…

“Merely” Fascinating Places

Karst Towers
If you’ve ever looked at a traditional Chinese painting (or Super Mario World) and wondered where they got the idea for their exaggerated (sometimes almost phallic) hills, look no further. Essentially nonexistant in North America and Europe, these steep, rocky spires dominate the landscape in various locations in Southeast Asia, most distinctively around the Li River in China, but also in less striking forms in Vietnam.
Hashima, Japan (A.K.A. Gunkanjima)
From 1887 to 1974, this island provided coal for Japan’s industrial needs. At its peak in 1959, it had a hellish population density nearly five times that of Macau, and ten times that of Singapore or Hong Kong. Today, this tiny island is a crumbling concrete ghost town, known mostly to enthusiasts, tourists, and fanfiction authors.
Neft Daşları
Around the end of the 1940s, the Soviet Union was running out of easily-accessible oil, so they decided to drill for it in the Caspian sea… but this was the ’50s and this was the Soviet Union. Rather than build a compact little platform like we do now, they picked a spot with shallow water and Oil, built islets, connected them with causeways, and built a full-blown city on the site. Now part of Azerbaijan, it still produces oil and natural gas.
Unit 731
Everyone knows of the Nazi death camps, but what most people don’t know is that, in World War 2, the Japanese had a branch of the Imperial Army which went even further. Officially known as the Epidemic Prevention and Water Purification Department of the Kwantung Army, Unit 731 was tasked with kidnapping members of the local Chinese population and performing sickeningly cruel experiments on them and on captured prisoners of war to test weapons and to study the progress of various diseases.
Perhaps equally surprising is that we might not have known about this if not for two notable details: First, when the Russian army forced them to abandon their work, participants were ordered to destroy the facilities and commit suicide but it turned out that they’d been constructed too well for the former. Second, while everyone working on the project had been ordered to take the secret to their grave and prohibited from returning to civilian life in Japan, General MacArthur secretly offered immunity to the medical personnel in exchange for granting America exclusive access to their biological weapons research… an offer which they accepted.
Ilha de Queimada Grande (A.K.A. Snake Island)
A small island off the coast of Brazil so densely populated with venomous snakes that, aside from the odd scientist with a waiver, the Brazilian navy forbids civilian visitors. Thanks to Cracked.com for cluing me onto this one.

Got any more real mysteries or little-known fascinating places? Leave a comment and I may amend this list.

Update: As he is wont to do, xkcd did a comic and it’s a chart on the topic of mysterious things.

Posted in Web Wandering & Opinion | Leave a comment

Floating Flattr Buttons in TiddlyWiki

As you’ve no doubt noticed, I’ve started to add Flattr buttons to my various creations. However, given that none of my other attempts to get other people to pay for my hosting have worked, I’ve learned to care more about aesthetics, tact, and tastefulness than about the actual effectiveness of my attempts.

That meant that, when I decided to add a Flattr button to the list of TiddlyWiki plugins I’ve created, I insisted on it looking good and not disturbing the rest of the layout.

My first attempt was to use the standard “dynamic counter” button in the large, rectangular form that Digg originally popularized. It turns out that something about TiddlySpace keeps it from showing and I don’t have time to fool around. On to the static button.

Flattr this

Flattr gave me code that looks like this:

<a href="http://flattr.com/thing/416932/TiddlyWiki-Plugins-by-ssokolow" target="_blank">
<img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a>

Unfortunately, embedding raw HTML in TiddlyWiki using <html> is messy, inelegant, and wraps the HTML in a span with no ID or class to set float: right; on. Therefore, I started translating the markup into TiddlyWiki’s syntax:

[>img[Flattr this|http://api.flattr.com/button/flattr-badge-large.png][http://flattr.com/thing/416932/TiddlyWiki-Plugins-by-ssokolow]]

According to the documentation, that should’ve been enough… but unlike their demo, I was getting align="right" rather than float: right;… so I wrapped the thing in a div using TiddlyWiki’s custom class markup and floated it by adding a line to the StyleSheet tiddler:

{{flattrFloat{
[>img[Flattr this|http://api.flattr.com/button/flattr-badge-large.png][http://flattr.com/thing/416932/TiddlyWiki-Plugins-by-ssokolow]]
}}}
.flattrFloat { float: right; }

That just left one problem: TiddlyWiki was inserting a <br> tag that was throwing off my layout. A quick adjacent sibling rule solved that.

.flattrFloat + br { display: none; }

You can see the result in the wild on my TiddlyWiki Plugins list.

Posted in Geek Stuff | 1 Comment

about:config Tweaks for Firefox 7 (and up)

A couple of days ago, it finally occurred to me to look for a way to turn off the sluggish (on Linux, at least) drag-and-drop previews in Firefox. So, while I’m at it, I thought I’d list a few of the more interesting about:config keys which aren’t exposed by the Firefox 7 GUI.

Performance Tweaks

browser.panorama.animate_zoom Whether to animate when entering/leaving Tab Groups view
browser.sessionstore.max_concurrent_tabs When set to 0, defers restoring tabs from a saved session until you actually click on them.
browser.tabs.animate Whether to animate tab opening/closing
nglayout.enable_drag_images Disable drag-and-drop thumbnails

UI Customizations

browser.backspace_action Set to 2 to stop the Backspace key from navigating back in history when focus lies outside editable fields. (or 1 to make it mean PageUp)
browser.search.context.loadInBackground Set to true in Firefox 13+ to restore the old “open in background” behaviour to the “Search Google for [selected text]” context menu.
browser.urlbar.clickSelectsAll
browser.urlbar.doubleClickSelectsAll
Set both of these to false for Chrome-like selection behavior
browser.urlbar.trimURLs Bring back http:// in your address bar
middlemouse.contentLoadURL Disable for predictable middle-click tab-closing on Linux
keyword.URL Set the search engine Firefox uses by default when you type keywords in the address bar
keyword.enabled Just disable keywords in the address bar altogether
ui.key.contentAccess Controls which modifier key is used for web access keys.I often use web keys and never use browser keys, so I swapped values with ui.key.chromeAccess so web access keys use Alt and browser access keys use Alt+Shift.)
view_source.wrap_long_lines Enable word-wrap in “View Source”

“It’s My Computer”

browser.blink_allowed Set to false to kill blink tags while browsing Geocities-era pages.
browser.history.allowReplaceState For if you’ve got a website which is abusing history.replaceState.
browser.link.open_newwindow Set to 1 to prevent links and JavaScript from opening new windows/tabs.
browser.link.open_newwindow.restriction Set to 0 to force JavaScript to always open new tabs rather than windows.
browser.link.open_newwindow.override.external Lets you specify a different behaviour than open_newwindow for links opened from outside the browser. Set to 3 to open them in tabs.
browser.send_pings Disable <a ping>
browser.send_pings.require_same_host Just limit <a ping>‘s utility for tracking you across multiple sites
browser.sessionstore.privacy_level Set to 2 to keep Session Restore from persisting cookies.
dom.disable_open_click_delay Adjust this to fix some sneaky sites which open a pop-up AND navigate the existing tab when you click
dom.disable_window_open_feature.* A bunch of properties for limiting what JavaScript can control when opening new windows/tabs
dom.popup_allowed_events This controls what the popup blocker counts as “user-triggered”
image.animation_mode Lets you control whether GIF and APNG will animate. Would be better if someone wrote a FlashBlock-like extension for it though.
layout.frames.force_resizability Always show the splitter handles for <frameset>-based pages.
media.autoplay.enabled Ignore autoplay="true" on HTML5 <video> and <audio> tags. (Doesn’t stop sites from calling play())

Let me know if there’s anything I’ve missed.

Posted in Geek Stuff | 3 Comments

Information-richness in a compact zsh Prompt

Note: While this post focuses on zsh, everything I do should be possible to implement in bash too.

When I look at people’s shell prompts, the first thing I always seem to notice is that they’re bulky and eye-grabbing. Seeing a textual version of GNOME Panel get duplicated into my terminal after every command isn’t something that appeals to me, so I thought I’d come up with something just as useful, but a little more compact.

What follows is a step-by-step story, with pseudo-screenshots, of how I went from a bog-standard zsh prompt to a fairly advanced prompt that only looks different when it has something to say, ending in a link to the .zshrc source I use to actually implement it. Feel free to skip ahead.

Because I like the color scheme and because I already have it, I’m starting with the default Gentoo prompt:

ssokolow@monolith ~ %

Obviously, this already has the usual Gentoo prompt’s “you are root” indicators (user ID turns red and % turns into #) and the ability to tell zsh and bash apart at a glance (For those who don’t know, zsh uses % while bash uses $) but I do a lot of programming and I use git for all my code, so the most useful thing I could possibly add is a way to never forget which branch I’m working on. Thankfully, that’s already been done for me:

ssokolow@monolith quicktile [master] %

I’d also wanted a way to see, at a glance, whether there were any jobs running in the background. The %(1j.%%.) ternary expression fixed that one right up:

ssokolow@monolith quicktile [master] % git gui &
ssokolow@monolith quicktile [master] %%

Finally, not all of my programs are clear about when they send a non-zero exit code, so it’d be nice to know that too. Another ternary expression, namely %(0?..%F{yellow}), takes care of that:

ssokolow@monolith quicktile [master] % false
ssokolow@monolith quicktile [master] %

I like how the prompt, by default, only displays the last component of $PWD so I left that unchanged. You’re free to add in other things but I tend to struggle with performance issues when both Firefox and GCC have to fight for “only” 4GiB of RAM so I decided not to hook in any more subprocess calls.

A pruned-down, streamlined version of the code for it is available on GitHub as zshrc.d/gentoo_prompt_setup but you’ll also need this line from my master .zshrc:

typeset -ga precmd_functions
Posted in Geek Stuff | Leave a comment

Installing a new Ttk/Tile theme

By a lucky coincidence, I discovered that PySolFC comes with a Clearlooks pixmap theme nicer than the built-in one I was using. Unfortunately, there seemed to be no documentation on how to install your own Ttk themes beyond forum posts saying “run the build scripts”. Geeking time!

After a little puttering around and a bit of uncertain code-diving (I don’t code TCL.), I figured out that all you have to do is grab your theme’s top-level directory (the one with pkgIndex.tcl) and put it somewhere TCL’s library loader can find it.

Here’s what I used on Gentoo Linux: (Roughly. I actually use zsh.)

mkdir -p ~/.local/share/tkthemes
cp -r /usr/share/games/pysolfc/themes/clearlooks ~/.local/share/tkthemes/
echo "export TCLLIBPATH=~/.local/share/tkthemes" >> ~/.bashrc
vim ~/.Xdefaults

Keep in mind that if you don’t either use startx to launch your X sessions or launch your Tk applications from a terminal, you’ll need to set TCLLIBPATH somewhere like ~/.kde4/env/set_ttk_theme.sh or ~/.xsessionrc instead.

UPDATE: In some Tk applications, you can force the menu bar to match the color of the Clearlooks Ttk theme by setting *background: #efebe7 in your ~/.Xresources file.

Posted in Geek Stuff | 2 Comments