Articles in essays
August 18, 2008 at 09:24 PM · Posted under essays, television
The best kid’s television series ever ended a couple of weeks ago and not nearly enough people watched it. The show? Avatar: The Last Airbender. And since you probably didn’t watch it I’m going to extol its virtues in the time honored tradition of the comparative list. Since you are practically guaranteed to have read it, the otherwise relatively excellent Harry Potter series serves as our lens to the world of Avatar.
A world-spanning adventure
In Avatar the adventure literally spans the globe from pole to pole. Our heroes travel from the frigid arctic to sweltering swamps to dry deserts to lush tropical paradises and everywhere between.
In Harry Potter we spend 90% of our time with our heroes in a castle in England. Sure, we hear some small snippets about the wider world, but even that wider world doesn’t extend beyond Europe. Really? No magical people from, say, China are interested in stopping the ultimate evil?
A celebration of world cultures
Harry Potter is just as limited culturally as it is geographically. It barely hints at cultures beyond British, and still doesn’t get past Europe and doesn’t really care to. We must either conclude that the rest of the world is simply irrelevant, or that Voldemort was just a serial killer/cult leader stalking around the UK.
In Avatar, the world spanning conflict spans the world culturally as much as it does geographically. Bits of practically every world culture are found in the many disparate peoples of the series. Although the series does have a focus on Asian cultures it is by no means fixed. Bits of Western, Inuit, Tibetan, Chinese, Japanese, Korean, Arabic, and many more cultures make the world of Avatar a rich and compelling place. The global conflict really feels global, and not like some power play for a small European island.
Complex characters and motives
In Harry Potter, with the notable exception of one or two characters, the evil people really are the evil people. The Malfoys are evil from the start. House Slytherin really is the house of evil fighting against the three houses of good that we all thought it was. The Ministry of Magic really is as slow-moving and incompetent as we suspect.
In Avatar, the four nations are truly balanced, with good and bad in each: even the ‘evil’ Fire Nation. At the start of the series the Fire Nation is the faceless horde, bent on world domination. As the series progresses we learn of internal conflicts within the nation, and eventually a face is put to their people and culture and we learn that this isn’t the work of an evil nation but that of an evil person who happens to be a powerful and charismatic leader. Avatar doesn’t really treat people as good or bad, they just follow their logical motivations.
Breaking that down a little more:
In Harry Potter Voldemort wants to kill everyone. Why? Because he’s evil.
In Avatar Fire Lord Ozai wants to dominate the world because he desires power, yes, but also because he believes that his domination will lead to a better world. As we learn about the Fire Nation we find that under his rule the people in the Fire Nation are insulated from the war and actually enjoy a very prosperous lifestyle, albeit with some restriction on individual liberties.
Avatar presents a simplistic but very effective starting point for a discussion of both the lure and peril of imperialism. Harry Potter starts a discussion about why we shouldn’t like evil Wizards and bureaucracy.
Further, Harry never questions what he will do when he finally, inevitably, duels Voldemort. In Avatar Aang seriously soul searches for a solution that will allow him to face Fire Lord Ozai and restore balance to the world without taking a life.
Bending is martial arts based and has set rules and limits
Magic is great for a writer because you always have an out, because it’s magic. Harry Potter can introduce entirely new concepts and abilities as needed by the plot (see Horcruxes and every other plot device that requires Hermione to do something obscure she happened to have read in a book).
Avatar sets down the ground rules for bending and then never breaks them or introduces new plot devices. Instead, it demonstrates how cleverness and real honest to goodness hard work and training (shocking!) can be used to make great things happen within those limits.
Also, each style of bending being based on branches of actual martial arts means that bending is a million times more awesome than magic. Just about every fight scene in Avatar contains some of the best martial arts action I’ve ever seen, and that’s saying something.
The adults aren’t all blindingly stupid (but aren’t always right, either)
It would be difficult to find adult characters more utterly, staggeringly idiotic and blind than those in Harry Potter. Look at the Quiddich Referee as a microcosm. Harry is the subject of openly obvious cheating and unusual events, yet the game goes on without a foul or whistle? Hmm, that bludger is continuously making hideously powerful attacks on that one player, even chasing him around and off the court…I’m going to allow this. His broom is clearly being immobilized by an enchantment…I’m going to allow this.
In Avatar, the story is about the children, yes. And they are also unusually gifted children. But the adults of the series are actually clever and competent as well.
You don’t have to be “magical” to be relevant
My biggest gripe with Harry Potter is that the lesson is: only magical characters matter.
In Avatar, many characters, including one of the main characters, has no bending (i.e. magic) ability and still contributes in a major way. We learn that if you work hard you can do whatever you set your mind to. That’s a lesson worth learning.
Comments (3)
March 20, 2008 at 12:58 PM · Posted under essays, science
So a black fungus has evolved inside the Chernobyl reactor last year. A fungus that feeds on gamma radiation. Keep that in mind for a moment.
Someday I believe that we are going to find out that our little oblate spheroid of earth has more in common with deep sea hydrothermal vents than most people realize. Deep sea vents have collections of life growing around them. Bacteria process the chemical energy pouring out of the vent into an edible food supply that allows a diverse collection of animals to thrive. It is the same for Earth: solar energy pouring out of the sun is processed by plant life which converts it into an an edible food supply that allows a diverse collection of animals to thrive.
The deep sea vents are almost entirely isolated from our solar energy cycle. If, somehow, the sun were to stop producing energy (say we encase it in a Dyson sphere within Earth’s orbit) the deep sea vent communities would go on living and thriving as long as Earth’s molten core keeps on chugging out energy. I only say they are almost entirely isolated because the collection of life around them must have collected from the general collection of life on the planet. In other words, they are self-sustaining now, but at some point the essential components for life must have filtered down and evolved into lifeforms that were capable of feeding on the chemical energy. Life probably didn’t originate at these vents, just as I believe that life didn’t originate on Earth.
The more places we look for life, or even just look as in Chernobyl, the more places we find it. Down at the bottom of the ocean so deep that the lack of solar energy means that life surely can’t possibly exist? Thriving, teeming communities of all sorts of life. In the heart of a massively irradiated reactor where life couldn’t possibly survive? A new form of life that is eating the radiation. Inside the boiling pools of Yellowstone National Park where the extreme temperature must preclude the existence of life? Microscopic organisms that could live nowhere else. Wherever we look, if there is some kind of energy source life is already there. Rather than the exception, it seems to me that we are just a deep sea vent, irradiated reactor, or boiling lake in the solar system. We have an abundant source of energy, so we are just teeming with life. If I put a piece of bread and some rocks on a table, should I be surprised when mold soon starts to grow on the available food source?
The problem with the theory is that we have, as yet, no real proof. Yes we have found organic compounds in metorites…maybe. Until we find somewhere else with a similar abundance of energy (Venus?) and find or not find life, there is nothing to compare. Maybe life is everywhere on Earth because we are the one lucky planet in the galaxy.
But let’s get back to that fungus. It literally eats gamma radiation in an environment such high levels that it simply shoudn’t be able to survive. It doesn’t need anything else, no oxygen or even an atmosphere. It is entirely possible that this fungus could survive a trip through space, and that’s all it would take. A planet with some kind of energy, being hit by microscopic life imported from space dust, comets, and meteors, would eventually find itself just as covered as a deep sea vent.
Look at it this way. Assume our planet is truly the only source of life in the galaxy (or universe!). As already described our planet is literally covered in the stuff to such a degree that even in a very short human timeframe, the right kind of life to feed on a new environment (Chernobyl Reactors) is able to form. Our planet is regularly spewing off ejecta from volcanos, minor meteor impacts, and major impacts (the last being about 65 million years ago). Much of that material eventually falls back to us, or trails along behind us like a streamer of matter. But some of that matter escapes our orbit. If we continue this scenario forward millions and millions (and millions) of years then some of the elements of life developed on Earth will reach other planets in our galaxy.
The biggest problem I have with this theory, Panspermia is that it doesn’t answer the question of where life came from or how it originated, but only moves the source and seemingly makes research into the origins of life on Earth a pointless gesture (of course it isn’t). But I still find it very compelling.
Comment
January 25, 2008 at 02:30 AM · Posted under essays, learning, programming, techtips
MVC stands for “model-view-controller”, a programming paradigm where the application is split into three interconnected yet disparate parts (as interpreted by Django):
- the model: the data of the application
- the view: the presentation and selection of data to present to the user
- the controller: the brains of the application that connects the user to the correct view
Note, the MVC paradigm is interpreted differently by the popular “Rails” framework (used for this very blog!). In Rails there are multiple controllers that decide what data to present to the user, and the view is left to simply display the data. In this interpretation Django’s views would be seen as controllers, and Django’s templates would be views.
To best describe how MVC helps us do our jobs as web programmers better, lets look at a simple PHP webpage application written as a script:
<?php
$page_title = "Ten most recent blog entries";
include_once($include_path.'/header.php');
// setup $db
include_once($include_path.'/db_connection_for_this_application.php');
$recent_blog_posts = mysql_query("SELECT
posts.post_date,
posts.post_title,
posts.post_content
FROM
posts
WHERE
posts.post_status='publish'
ORDER BY posts.post_date DESC LIMIT 10, $db);
echo '<h1>Recent Posts</h1>';
while($posts_data = mysql_fetch_array($recent_blog_posts)) {
echo '<div class="post">';
echo '<div class="blog_date">' . $posts_data['post_date'] . "</div>\n";
echo '<div class="blog_entry_title">' . $posts_data['post_title'] . "</div>\n";
echo '<div class="blog_entry">' . $posts_data['post_content'] . "</div>\n";
echo '</div>';
}
include_once($include_path.'/footer.php');
?>
Simple enough. That’s actually the big advantage of writing web applications as scripts. They are (almost) entirely self-contained and easy to understand. You start reading at the top and finish at the bottom, with no file jumping or object modeling required.
Unfortunately, this simpliciy is also very limiting:
- The content and the programming are combined. This means that, aside from CSS, if any web designers want to update the look of the page then they’ll have to modify the same file that contains the application. That’s a great opportunity for things to go wrong.
- The header and footer are fixed. This means altering something like the title of the page forces the application to declare prespecified variables (e.g. the $page_title), that the header file assumes are in place. A bunch of these variables can quickly clutter an application. At a simple level, including headers and footers makes sense, but as pages get more complex they get harder to maintain. What if you have a standard header/footer, but want slightly modified versions for other sections? Using header/footer includes means that you’ll have to create separate include files for each. Without a clear organizational structure things can get confusing pretty quickly.
- Low-level programming is involved. The programmer has to build database queries by hand, which is a great place for bugs to hide.
- No object oriented programming. You can’t wrap up functions and data into logical blocks with specific interfaces (e.g. objects). In a better system, we’d just ask the “Blog” object directly for the ten most recent posts with something like {{ blog.posts | ‘limit’: 10 }}
As you can see, there is room for something better. That something is an MVC framework such as Django or Rails. Let’s look at how one (Django) solves the problems with our PHP script. I’ll show you the code first, then get into the explanation:
### models.py (the *model*) ###
from django.db import models
class Blog(models.Model):
entry_title = models.CharField(maxlength=50)
blog_date = models.DateField()
entry = models.TextField()
### views.py (the *view*) ###
from django.shortcuts import render_to_response
from models import Blog
def recent_posts(request):
post_list = Blog.objects.order_by('-blog_date')[:10]
return render_to_response('recent_posts.html', {'post_list': post_list})
### urls.py (the *controller*) ###
from django.conf.urls.defaults import *
import views
urlpatterns = patterns('',
(r'^recent/$', views.recent_posts),
)
### recent_posts.html (the *template* (part of the view))###
<html><head><title>Recent Blog Posts</title></head>
<body>
<h1>Recent Posts</h1>
{% for post in post_list %}
<div class="post">
<div class="blog_date">{{blog_date}}</div>
<div class="blog_entry_title">{{entry title}}</div>
<div class="blog_entry">{{entry}}</div>
{% endfor %}
</body></html>
Ok! That seems a little confusing compared to the script doesn’t it? Let’s dive in:
recent_posts.html
Take a closer look at the “recent_posts.html”. Think of how lucidly clear that file is to a web designer? There’s hardly any code! While of course no templating language can eliminate programming constructs Django’s system does a great job of only giving the template designers what they need to get the job done. The template “programming” is using its own programming language, not straight Python. There are two big reasons for this: 1) the language is meant to be simple and only provide the features needed to select or present the proper data, 2) the language doesn’t allow templates to do anything that the application should handle (e.g. a template can’t tell the database to delete itself).
Yes, my example doesn’t demonstrate how Django helps with header/footer includes, that’s coming up so be patient!
models.py
This is simply describing to Django how to organize the data object that we’ll be dealing with.
urls.py
This is routing a user’s request for the web address ‘recent/’ (e.g. mysite.com/recent) to the recent_posts function in views.py.
views.py
This is the best part, take a look again:
def recent_posts(request):
post_list = Blog.objects.order_by('-blog_date')[:10]
return render_to_response('recent_posts.html', {'post_list': post_list})
That’s it? That’s it! Our complex SQL query is now a higher level abstraction where we tell Django to tell the blog to give us the latest ten posts. Done!
Now lets look at that last piece: header/footer files.
Django does allow us to build templates that pull in header/footer includes, but it also lets us solve the common data problem with template inheritance. With template inheritance we don’t abstract the pieces of our web pages that are the same, we pull out the pieces that are different. Let me explain with a very simple webpage:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<title>My Website</title>
</head>
<body>
<h1>Page Title</h1>
<p>Customized content!</p>
<hr>
<p>This is my footer</p>
</body>
</html>
Done using header/footer includes:
### header include file ###
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<title>My Website</title>
</head>
<body>
### footer include file ###
<p>This is my footer</p>
</body>
</html>
### custom page ###
include(header_file)
<h1>Page Title</h1>
<p>Customized content!</p>
include(footer_file)
Now done with Django’s template inheritence:
### base.html ###
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html lang="en">
<head>
<title>{% block title %}My Website{% endblock %}</title>
</head>
<body>
<h1>{% block pagetitle %}{% endblock %}</h1>
{% block content %}{% endblock %}
{% block footer %}
<p>This is my footer.</p>
{% endblock %}
</body>
</html>
### page.html ###
{% extends "base.html" %}
{% block title %}Customized Title!{% endblock %}
{% block pagetitle %}Customized page title!{% endblock %}
{% block content %}
<p>Customized content!</p>
{% endblock %}
See what we did there? The parts of the page that will change are pulled out of the base. Django’s template system lets you declare “blocks” that indicate that that part of the page may change. If an extending template declares a block that matches that of the parent template, then the parent’s block is overwritten. If a block isn’t declared by the sub-page, that is in the parent page then the parent page’s block is used. Notice in our “page.html” the footer isn’t discussed at all. Django sees that we are “extending” base.html and that we haven’t specified our own footer block so it defaults to the footer block that was in base.html.
Perfect! We can create base templates that allow for child pages to overwrite any part that we explicitly allow! No more locked headers or footers!
Templates can go through multiple levels of inheritence as well. We could easily have a base template that is then extended into “section” templates that are then extended to specific pages. With a clear and logical chain of command it is easy to see how the webpage templates work together. Much better than a couple dozen header/footer files lying around. We get all the advantages of reusing designs without the headaches!
So there you have it. Sorry for the rambling/unedited nature of this post. It’s 2:30am, I can’t sleep, but I felt like sharing.
Comment
September 11, 2007 at 09:15 PM · Posted under essays
What is art?
If questions were guns, then that one would be a fully loaded shotgun. Ranking up there with politics and religion, the debate on what art is invokes a reaction from all.
Generally people have a vague notion that art is something that everyone agrees is art. That art is cultured, refined, high-brow, sophisticated. That art must be appreciated to be art. Art is that which is hung in museum galleries and fawned over by elite scholars who write detailed analyses describing their value and meaning. People believe these scholars and nod their knowing agreement, sure that they too see the same value that the experts have ascribed.
At the other extreme there are those who say that all that I’ve just described is emphatically not art. That art is the living, breathing, messy, chaotic act of creation. That art in museums is dead works and that true art is that which is happening all around us.
Some say that if something is fun then it isn’t art. That movies and comics and videogames and television and books can never be art because they are made not to express a feeling but to entertain and delight.
Some say art must be beautiful. Some say art must be meaningful. Some say art must be passionate.
I have a serious problem with all of these claims and, in fact, the very debate itself. Every single one of these claims are all predicated on the fact that art must be something. It doesn’t. Art is what it is and what it is is entirely, completely, and utterly subjective. There is no debate here because it all comes down to personal perception. No one can make a genuinely compelling argument about the true definition of art because it is not possible to rationally argue an aesthetic point of view.
For example, I happen to think that industrial architecture is both artistic and aesthetically pleasing. If I talk with someone who disagrees on both of these counts there is no way for me to make a logical case and prove that, yes, an electrical switching station is conclusively beautiful. To be sure, I could make my case. I could try and help this person to see through my eyes via example and description; but this is not proof, merely experience.
Comment