Archive for January, 2008

Burkean

Sunday, January 27th, 2008

Burkean, named after Edumund Burke: a political incrementalist.

How to respond to events in a custom WindowSWF panel (Actionscript 3)

Wednesday, January 23rd, 2008

One power you have in making custom panels for Flash (or whatever recent Adobe programs that support flash-based panels) that is almost never realized is the ability to respond to events. Does anything like this sound familiar to you: you want to update the panel every time the user changes a document or creates a new one? You want to do something when the document closes? The user moves their mouse (and not directly above the panel)? Fools all over the internet dogmatically claim that it’s impossible. It’s not. Here’s how you do it:

Writing purely in Javascript for Flash (JSFL), you might notice that you can attach events much like you can in actionscript thusly:

someCallback = function () {
    alert('all your bases are belong to us');
    }

fl.addEventListener("documentChanged", someCallback);

To do that in your flash panel, simply enclose that stuff in an MMExecute(); Thusly:

MMExecute("someCallback = function () { alert('all your bases are belong to us'); }");
MMExecute("fl.addEventListener("documentChanged", someCallback);");

And.. it works. Sure enough. But that’s not very interactive. I want FLASH to do something (since javascript just doesn’t do much in the authoring environment), like, say, update the display with new info. Wouldn’t it be cool if I could do this?

MMExecute("fl.addEventListener("documentChanged", SomeAS3Function);");

Alas, not possible. Holy Hell. ExternalInterface can’t even help us out here (right? I’d love to be wrong here…) But here’s what you can do. It’s not terribly pretty, but it does the job and when Adobe comes to their senses and builds AS3 JSFL communication into newer products, it would be very easy to modify the code for a more elegant solution. You can have global variables in the javascript and access them anywhere in the flash document. So, try this:

MMExecute("var updt = false");
MMExecute("updateDoc = function() { updt = true; }");
MMExecute("fl.addEventListener('documentChanged', updateDoc);");

Then, somewhere that is always looping (i.e., where stop() wasn’t called), you’ll want to add an event listener for entering the frame:

this.addEventListener(Event.ENTER_FRAME, updatey);
function updatey(event:Event) {
if(MMExecute("updt") == "true") {
   // whatever you wanna do! Resurrect dinosaurs, make robots feel...
   MMExecute("updt = false;");
   }
}

Note, that MMExecute returns a string so, though it be boolean in javascript, it’s converted to “true” and “false” in actionscript. When dealing with arrays and such, this becomes particularly frustrating, though you must question the design of your program any time you are passing complicated objects around… think about it.

Oh, one final note. It seems the capabilities I wish existed in Flash do exist in Fireworks (?) as detailed here. I looked and looked but could not find any equivalent to IsFwCallbackInstalled for Flash. Given how many things I’ve had to discover that were not anywhere to be found on Adobe’s site and how many undocumented features there are, I can’t help but wondering if a more elegant solution is lurking below.. Do tell me if you find it, mmkay?

English I Don’t Follow

Wednesday, January 16th, 2008

Here are some English rules I willfully ignore. There are more, but here are ones that come to mind. English is full of rules that were invented by Latin-obsessed pedants that don’t make the language clearer or do any of the other things rules were meant for (except annoy the lazy):

  • Dangling participle. Sure, it sounds stupid to say “where are you at?”, but the reason is because the “at” is redundant, not because it’s at the end! Combine subordinate clause, passive voice and this stupid rule and you get the hilarious classic erroneously attributed to Churchill, “This errant pedantry is something that will not with up be put!” Indeed.
  • “They” should work as his/her. Consider the alternative! Wouldn’t you rather just be wrong than unforgivably awkward? This rule achieved a new demonic power to horrify when combined with political correctness since once upon a time, you could at least choose one gender and run with it. Now we have all sorts of strange solutions like randomly varying the genders or just using she, but the masculinists frown upon the latter.
  • Pronoun order. Consider this sentence: “I wanted to go to the store to get some food for me and my girlfriend.” Wrong. Even though “my girlfriend and me” sounds very bad for some reason. This grammar is an artifact from when English was an HONORIFIC language, like other Indo-European languages. German has du resp. Sie, French tu resp. vous, and so on. It wasn’t even that long ago, but we finally dropped the less polite thou/þu. The problem is the logic behind this rule no longer applies. The system has been abolished and we’re stuck with this anachronism. So, English, I’ll strike a deal with you - if you bring back you/thou, I’ll put myself last in lists of people.
  • I don’t always include all the connecting words when drawing analogies and making comparisons. It doesn’t sound incorrect, though it probably is. Example: “The Pet Shop boys are as well-loved in Russia as Jerry Lewis, France”.

How to Discover the true Political Parties

Sunday, January 6th, 2008

When you listen to people talk about their political opinions, one thing that becomes immediately apparent is that they don’t fit neatly with the two major political parties (here in America). That’s to be expected, but is it reasonable to expect that, on average, people’s political values will cluster around these parties? I’m not so sure.

Furthermore, I see the important kernel of political value to be what one sees as important, relative to other things, not so much what one sees as the best solution to these problems. I see people’s jobs as voting in their own best interest. People’s ideas about how best to achieve whatever their value goals are (economic stability, social justice, etc.) are quite often wrong - most people don’t understand economics or sociology or whatever. Furthermore, it’s a good idea to separate ideology from implementation so that political activists don’t get caught up with a pet solution when what really matters is their problem, regardless of solution. This is (in theory!) what politicians are for - to be experts.

So, given that political parties should be based on political values and based on what the political values of the people really are, I propose polling people on a series of questions, allowing them to rank what they see as most important. Then, use mathematical techniques to find loci (not too much unlike those used to distinguish populations, etc.) and let these be the true political parties! This data can be used to discover the right type of voting for our nation and further to justify something other than our current system!

Is anyone aware of someone having tried this before? Anyone who could point me in the right direction for what statistical techniques to use? I’m sure I couldn’t be the first person to have come up with this idea, yet it may well be quite important in determining the future of our country. It may well stem the tide of people voting against their own interests, but then again, in the wise words of ‘tater salad, “you can’t fix stupid.”

Orophily

Saturday, January 5th, 2008

The childish love of standing on top of a mound.

Sexed up Drunk Flies

Thursday, January 3rd, 2008

Drunken flies get hypersexual : Nature News

No time for a real post today (yes, I put a lot of thought into yesterday’s). Enjoy Nature link.

Analogy

Wednesday, January 2nd, 2008

Forest: Shinto Shrine::
Cunt: Panties::