Meatware

A Gibsonesque cyber-word, meatware refers, somewhat contemptuously, to those aspects of information processing that are neither software nor hardware.  Programming is a grueling mental activity, and there is a tendency among software programmers to, shall we say, not look after themselves.  There is an old adage that one should never trust a thin cook, and this might be extended to programmers also.  The most consummate technologists spend so much of their time in virtual worlds that their bodies often get neglected.  The state of their bodies becomes, consequently, an ironic badge of their devotion to their craft.

It has been said, mainly by its critics, that Modernism in philosophy since Descartes is distorted by the implicit assumption that object of philosophy is strictly rational, conscious, and intellectual.  This trend was turned back, somewhat, by Heidegger’s discussion of Mood in his masterpiece Being and Time.  Maurice Merleau-Ponty’s Phenomenology of Perception, which at times reads like a rewriting of Being and Time much as Sartre’s Being and Nothingness does, takes this battle further by placing himself within the heart of the intellectual tradition, Husserl’s Phenomenology, and emphasizing the point that all perception, all experience, occurs through the medium of our bodies.  This was, strangely enough, a revolutionary insight at the time.

Eventually Feminism (or at least certain branches of Feminist thought) took up this controversy and used it as a central template for understanding the misunderstandings between men and women.  Men misunderstand humanity as a primarily intellectual (and phallic) being.  Women, on the other hand, implicitly understand the role of the body in the same way that tides understand gravity.   It is an inescapable aspect of a woman’s existence, which the scholars of women’s issues tend to call “embodiment“.

It can’t be said that software programmers really learned anything from the insights of Feminism other than the fact that they would prefer to have very little to do with the body.  If there is such a thing as human nature, software programming tends to distort it and encourage anti-social behaviors such as distractedness, obsessiveness and self-medication.  Exemplary programmers need not be exemplary human beings, and perhaps ought not to be, to Aristotle’s dismay.

Stephen Dubner at Our Daily Bleg suggests an economic explanation for the rise in American obesity.  He suggests that the elimination of outhouses and dramatic improvements in indoor plumbing may have led to the rapid increase in median weight.  Our improved ability to vacate our own waste, he avers, has lowered the inconvenience of indulging in the gastronomic pastime, and so we do.  It depends, I imagine, on whether one seeks answers in the superstructure or in the base. 

Vanity Fair, on the other hand, has a series of articles currently online which may provide a glimpse at what the unhealthy have to look forward to.  Though not himself a programmer, Christopher Hitchens has drunk, smoked and eaten himself to the point that he can be mistaken for one.  At 58, he attempts to turn back the clock of desultory living with a check-in at a spa, and writes about it. 

The articles are accompanied by illustrative photos which highlight this cautionary tale about the importance of maintaining your meatware.

Ten Questions for the Candidates

obama_mccain

We all want our candidates to answer more questions, but it’s hard to figure out what we really want to know from them.  Sometimes it seems like we want to gauge their knowledge of world affairs — and so they are asked social studies questions — “What is the capital of the Republic of Georgia?”  Sometimes we want to know about their experience — and so they are asked what they would do in a certain situation.  Ultimately we want to know if they are smart “like us” or in the least “like us” and so odd questions will be thrown into various debates such as “Who is your favorite philosopher?” and “Which is your favorite book of the Bible?”

These questions typically misfire.  Very few politicians are like Adlai Stevenson.  Whatever it is that makes them good at what they do, which typically involves raising money and cutting backroom deals, we simply don’t have questions for.  Lacking the right questions, on the other hand, may be considered as license to ask any question.  Here are some of mine:

1. How do you celebrate June 16th?

2. What memories do madeleines evoke for you?

3. Do you typically take the road less traveled, or the other one?

4. Would you explain the difference between the ‘ontic’ and the ‘ontological’, and how this distinction affects your daily life?

5. Can Virtue be taught?

6. How many wives of Henry the Eighth can you name?  and which ones bore future rulers of England?

7. Explain the difference between descriptivist and prescriptivist grammar, and apply the difference to something that has nothing to do with grammar.

8. Describe at least five of Martin Luther’s 95 tenets; expand on any you strongly agree or disagree with.

9. Explain the difference between the Ptolemaic and Copernican systems of the world, and why it matters.

10.  Besides beds, what was the chief source of income at Peter Coffin’s Inn?

 

Coincidentally, these ten questions also capture the ten main categories of knowledge that our presidential candidates are expected to exemplify or demonstrate some expertise in, namely:

1. Patriotism 2. Historical knowledge 3. Experience 4. Wonkiness 5. Family values 6. Foreign Affairs 7. Rhetorical skill 8. Faith 9. Science 10. Economics

Eco in Atlanta

umberto-eco

In my basement, lying next to a moldy unused Italian grammar, I have an dusty Italian copy of Umberto Eco’s Name of the Rose, an accusatory symbol of my unfulfilled ambitions.  In October, I’ll have an opportunity to do something with this volume — get it signed by the author.

Umberto Eco will be coming to Emory University at the beginning of October (the 5th through the 7th) to deliver three lectures.   Eco is a fascinating philosopher, literary theorist and author.  I expect the lectures and readings he is planning at Emory to be as entertaining as his writings.  I might even get a chance to ask some questions about authorial intent.  If you are in Atlanta, be sure to save the date.

Reflection

reflection

Like may others, I recently received the fateful email notifying me that Lutz Roeder will be giving up his work on .NET Reflector, the brilliant and essential tool he developed to peer into the internal implementation of .NET assemblies.  Of course the whole idea of reflecting into an assembly is cheating a bit, since one of the principles of OO design is that we don’t care about implementations, only about contracts.  It gets worse, since one of the main reasons for using .NET Reflector is to reverse engineer someone else’s (particularly Microsoft’s) code.  Yet it is the perfect tool when one is good at reading code and simply needs to know how to do something special — something that cannot be explained, but must be seen.

While many terms in computer science are drawn from other scientific fields, reflection appears not to be.  Instead, it is derived from the philosophical “reflective” tradition, and is a synonym for looking inward: introspection.  Reflection and introspection are not exactly the same thing, however.  This is a bit of subjective interpretation, of course, but it seems to me that unlike introspection, which is merely a turning inward, reflection tends to involve a stepping outside of oneself and peering at oneself.  In reflection, there is a moment of stopping and stepping back; the “I” who looks back on oneself is a cold and appraising self, cool and objective as a mirror.

Metaphors pass oddly between the world of philosophy and the world of computer science, often giving rise to peculiar reversals.  When concepts such as memory and CPU’s were being developed, the developers of these concepts drew their metaphors from the workings of the human mind.  The persistent storage of a computer is like the human faculty of memory, and so it was called “memory”.  The CPU works like the processing of the mind, and so we called it the central processing unit, sitting in the shell of the computer like a homunculus viewing a theater across which data is streamed.  Originally it was the mind that was the given, while the computer was modeled upon it.  Within a generation, the flow of metaphors has been reversed, and it is not uncommon find arguments about the computational nature of the brain based on analogies with the workings of computers.  Isn’t it odd that we remember things, just like computers remember things?

The ancient Skeptics had the concept of epoche to describe this peculiar attitude of stepping back from the world, but it wasn’t until Descartes that this philosophical notion became associated with the metaphor of optics.  In a letter to Arnauld from 1648, Descartes writes:

“We make a distinction between direct and reflective thoughts corresponding to the distinction we make between direct and reflective vision, one depending on the first impact of the rays and the other on the second.”

This form of reflective thought, in turn, also turns up in at an essential turning point in Descartes’ discussion of his Method, when he realizes that his moment of self-awareness is logically dependent on something higher:

“In the next place, from reflecting on the circumstance that I doubted, and that consequently my being was not wholly perfect, (for I clearly saw that it was a greater perfection to know than to doubt,) I was led to inquire whence I had learned to think of something more perfect than myself;”

Descartes uses the metaphor in several places in the Discourse on Method.  In each case, it is as if, after doing something, for instance doubting, he is looking out the corner of his eye at a mirror to see what he looks like when he is doing it, like an angler trying to perfect his cast or an orator attempting to improve his hand gestures.  In each case, what one sees is not quite what one expects to see; what one does is not quite what one thought one was doing.  The act of reflection provides a different view of ourselves from what we might observe from introspection alone.  For Descartes, it is always a matter of finding out what one is “really” doing, rather than what one thinks one is doing.

This notion of philosophical “true sight” through reflection is carried forward, on the other side of the channel, by Locke.  In his Essay Concerning Human Understanding, Locke writes:

“This source of ideas every man has wholly in himself; and though it be not sense, as having nothing to do with external objects, yet it is very like it, and might properly enough be called internal sense. But as I call the other Sensation, so I call this REFLECTION, the ideas it affords being such only as the mind gets by reflecting on its own operations within itself. By reflection then, in the following part of this discourse, I would be understood to mean, that notice which the mind takes of its own operations, and the manner of them, by reason whereof there come to be ideas of these operations in the understanding.”

Within a century, reflection becomes so ingrained in philosophical thought, if not identified with it, that Kant is able to talk of “transcendental reflection”:

“Reflection (reflexio) is not occupied about objects themselves, for the purpose of directly obtaining conceptions of them, but is that state of the mind in which we set ourselves to discover the subjective conditions under which we obtain conceptions.

“The act whereby I compare my representations with the faculty of cognition which originates them, and whereby I distinguish whether they are compared with each other as belonging to the pure understanding or to sensuous intuition, I term transcendental reflection.”

In the 20th century, the reflective tradition takes a peculiar turn.  While the phenomenologists continued to use it as the central engine of their philosophizing, Wilfred Sellars began his attack on “the myth of the given” upon which phenomenological reflection depended.  From an epistemological viewpoint, Sellars questions the implicit assumption that we, as thinking individuals, have any privileged access to our own mental states. Instead, Sellars posits that what we actually have is not clear vision of our internal mental states, but rather a culturally mediated “folk psychology” of mind that we use to describe those mental states.  In one fell swoop, Sellars sweeps away the Cartesian tradition of self-understanding that informs the cogito ergo sum.

In a sense, however, this isn’t truly a reversal of the reflective tradition but merely a refinement.  Sellars and his contemporary heirs, such as the Churchlands and Daniel Dennett, certainly provided a devastating blow to the reliability of philosophical introspection.  The Cartesian project, however, was not one of introspection, nor is the later phenomenological project.  The “given” was always assumed to be unreliable in some way, which is why philosophical “reflection” is required to analyze and correct the “given.”  All that Sellars does is to move the venue of philosophical reflection from the armchair to the laboratory, where it no doubt belongs.

A more fundamental attack on the reflective tradition came from Italy approximately 200 hundred years before Sellars.  Giambattista Vico saw the danger of the Cartesian tradition of philosophical reflection as lying in its undermining of the given of cultural institutions.  A professor of oratory and law, Vico believed that common understanding held a society together, and that the dissolution of civilizations occurred not when those institutions no longer held, but rather when we begin to doubt that they even exist.  On the face of it, it sounds like the rather annoying contemporary arguments against “cultural relativism”, but is actually a bit different.  Vico’s argument is rather that we all live in a world of myths and metaphors that help us to regulate our lives, and in fact contribute to what makes us human, and able to communicate with one another.  In the 1730 edition of the New Science, Vico writes:

“Because, unlike in the time of the barbarism of sense, the barbarism of reflection pays attention only to the words and not to the spirit of the laws and regulations; even worse, whatever might have been claimed in these empty sounds of words is believed to be just.  In this way the barbarism of reflection claims to recognize and know the just, what the regulations and laws intend, and endeavors to defraud them through the superstition of words.”

For Vico, the reflective tradition breaks down those civil bonds by presenting man as a rational man who can navigate the world of social institutions as an individual, the solitary cogito who sees clearly, and cooly, the world as it is.

This begets the natural question, does reflection really provide us with true sight, or does it merely dissociate ourselves from our inner lives in such a way that we only see what we want to see?  In computer science of course (not that this should be any guide to philosophy) the latter is the case.  Reflection is accomplished by publishing metadata about a code library which may or may not be true.  It does not allow us to view the code as it really is, but rather provides us a mediated view of the code, which is then associated with the code.  We assume it is reliable, but there is no way of really knowing until something goes wrong.

Styling the Validator Callout Extender

The Validator Callout Extender is one of the controls included in the Ajax Control Toolkit.  It allows one to replace the normal appearance of an asp.net validation control with an attractive cutout.  For instance:

This is a required field.

A common problem concerns how to restyle the callout to give it a custom appearance.  The documentation for this control makes it clear that the default CSS class may be overridden in order to change the appearance of the callout. The Callout Extender has a CssClass property which may be set to a custom style.  Unfortunately, the documentation also includes an apparent error.  According to the documentation for the Validation Callout Extender:

If your CssClass does not provide values for any of those then it falls back to the default value.

This turns out not to be true.  Instead, one must override all the nested classes of the Callout Extender in order to get a reasonably good looking callout.  If any of the nested classes are not overridden, once a value has been assigned to the CssClass property, no style is applied to the nested style.

Consequently, in order to do something as simple as setting the back-color of the callout to Blue, the custom style will end up looking like this:

    <style type="text/css">
        .customCalloutStyle div, .customCalloutStyle td
        {
            border: solid 1px Black;
            background-color: Blue;
        }
        .customCalloutStyle .ajax__validatorcallout_popup_table
        {
            display: none;
            border: none;
            background-color: transparent;
            padding: 0px;
        }
        .customCalloutStyle .ajax__validatorcallout_popup_table_row
        {
            vertical-align: top;
            height: 100%;
            background-color: transparent;
            padding: 0px;
        }
        .customCalloutStyle .ajax__validatorcallout_callout_cell
        {
            width: 20px;
            height: 100%;
            text-align: right;
            vertical-align: top;
            border: none;
            background-color: transparent;
            padding: 0px;
        }
        .customCalloutStyle .ajax__validatorcallout_callout_table
        {
            height: 100%;
            border: none;
            background-color: transparent;
            padding: 0px;
        }
        .customCalloutStyle .ajax__validatorcallout_callout_table_row
        {
            background-color: transparent;
            padding: 0px;
        }
        .customCalloutStyle .ajax__validatorcallout_callout_arrow_cell
        {
            padding: 8px 0px 0px 0px;
            text-align: right;
            vertical-align: top;
            font-size: 1px;
            border: none;
            background-color: transparent;
        }
        .customCalloutStyle .ajax__validatorcallout_callout_arrow_cell .ajax__validatorcallout_innerdiv
        {
            font-size: 1px;
            position: relative;
            left: 1px;
            border-bottom: none;
            border-right: none;
            border-left: none;
            width: 15px;
            background-color: transparent;
            padding: 0px;
        }
        .customCalloutStyle .ajax__validatorcallout_callout_arrow_cell .ajax__validatorcallout_innerdiv div
        {
            height: 1px;
            overflow: hidden;
            border-top: none;
            border-bottom: none;
            border-right: none;
            padding: 0px;
            margin-left: auto;
        }
        .customCalloutStyle .ajax__validatorcallout_error_message_cell
        {
            font-family: Verdana;
            font-size: 10px;
            padding: 5px;
            border-right: none;
            border-left: none;
            width: 100%;
        }
        .customCalloutStyle .ajax__validatorcallout_icon_cell
        {
            width: 20px;
            padding: 5px;
            border-right: none;
        }
        .customCalloutStyle .ajax__validatorcallout_close_button_cell
        {
            vertical-align: top;
            padding: 0px;
            text-align: right;
            border-left: none;
        }
        .customCalloutStyle .ajax__validatorcallout_close_button_cell .ajax__validatorcallout_innerdiv
        {
            border: none;
            text-align: center;
            width: 10px;
            padding: 2px;
            cursor: pointer;
        }
    </style>

This will give you the following change in appearance:

This is a required field.

In order to play with the nested classes in order to customize the look of the callout, it would be useful to know what the HTML for the Validator Callout actually looks like.  Unfortunately, the callout is generated using client script, making it impossible to simply peek at the source in order to figure out what the markup looks like.  After about an hour of reading through the behavior class for the Callout Extender, I was finally able to come up with this:

        <table id="_popupTable" cellpadding="0" cellspacing="0" border="0" class="customCalloutStyle">
            <tbody>
                <tr class="ajax__validatorcallout_popup_table_row">
                    <td class="ajax__validatorcallout_callout_cell">
                        <table width="200px" cellpadding="0" cellspacing="0" border="0" 
                            class="ajax__validatorcallout_callout_table">
                            <tbody>
                                <tr class="ajax__validatorcallout_callout_table_row">
                                    <td class="ajax__validatorcallout_callout_arrow_cell">
                                        <div class="ajax__validatorcallout_innerdiv">
                                            <div style="width: 14px">
                                            </div>
                                            <div style="width: 13px">
                                            </div>
                                            <div style="width: 12px">
                                            </div>
                                            <div style="width: 11px">
                                            </div>
                                            <div style="width: 10px">
                                            </div>
                                            <div style="width: 9px">
                                            </div>
                                            <div style="width: 8px">
                                            </div>
                                            <div style="width: 7px">
                                            </div>
                                            <div style="width: 6px">
                                            </div>
                                            <div style="width: 5px">
                                            </div>
                                            <div style="width: 4px">
                                            </div>
                                            <div style="width: 3px">
                                            </div>
                                            <div style="width: 2px">
                                            </div>
                                            <div style="width: 1px">
                                            </div>
                                        </div>
                                    </td>
                                    <td class="ajax__validatorcallout_icon_cell">
                                        <img alt="" border="0" src="alert-large.gif" />
                                    </td>
                                    <td class="ajax__validatorcallout_error_message_cell">
                                        This is a required field.
                                    </td>
                                    <td class="ajax__validatorcallout_close_button_cell">
                                        <div class="ajax__validatorcallout_innerdiv">
                                            <img alt="" border="0" src="close.gif" />
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </td>
                </tr>
            </tbody>
        </table>
 

This probably isn’t completely correct, but it’s pretty close.  If you want to try to write your own custom style for the Validator Callout Extender, just copy the markup above, as well as the CSS class above that, into your favorite WYSIWYG editor and have at it.  At a minimum, you should be able to customize the colors either to match your site design (the default background color is Chiffon Yellow, after all), or to indicate different sorts of validation errors.

One question I’ve seen on the ASP.NET Forums concerns whether it is possible to switch the arrow that flies off the left side of the callout to the right.  Unfortunately, the arrow is actually coded into the HTML generated by the Validator Callout, and is not controlled by CSS styles.  It would be nice to see this as a feature of future releases of the Ajax Control Toolkit.

CSLA Light Preview Drop

Rocky Lhotka recently announced a pre-release drop for CSLA Light (the less filling version of CSLA 3.6).  Silverlight raises special problems for creating tiered applications.  CSLA Light tries to fill this problem domain by providing a framework for building bindable objects that know how to interact with Silverlight.  This is the sort of solution that will allow us to do more than simply build cool games with Silverlight, since the real promise of Silverlight is the ability to write business applications that are also RIA’s.

One of the few alternatives to CSLA Light that I’ve seen is Shawn Wildermuth’s work integrating Astoria with Silverlight.  I’m keeping an eye on both of these technologies to see how line-of-business Silverlight applications will shape up over the next year.

AJAX Control Toolkit: Script Only

sleestak1-349x267

I previously posted about how to use the Microsoft Ajax Library in order to provide Globalization script functionality without using the ScriptManager control.  Why would you want to do this?

One issue is that Microsoft is currently working on the ASP.NET MVC framework, which will provide a way of doing web applications that is more familiar to PHP and JSP programmers.  In other words, it doesn’t use the WebForms infrastructure that has underpinned Microsoft’s whole approach to web development for the past six years.  The original promise of WebForms was to abstract web development so it looks more like traditional Windows Forms development.  In order to accomplish this, the developers at Microsoft have worked hard to abstract the underlying web technology using windows components that render html and emit client script for the developer.

But now the tide is turning, and with WPF and XAML, Microsoft’s newest technology for building desktop applications, we are seeing a transition to the development metaphors that we have become accustomed to in web development.

ASP.NET AJAX was originally developed following the WebForms paradigm.  While other AJAX frameworks provided script libraries that you needed to manipulate using client script (typically javascript), Microsoft provided their framework wrapped in controls like the ScriptManager and the UpdatePanel.  Even the Ajax Control Toolkit, the Microsoft backed opensource project that extends ASP.NET AJAX with additional controls, follows this model.

But the MVC model doesn’t follow this model.  It follows the model followed by every other vendor of web technology.

So how do ASP.NET MVC and ASP.NET AJAX come together if they follow these radically different models?  Well … the Microsoft AJAX team also provides the underlying scripts for their framework in the Microsoft Ajax Library, which can be used in JSP, PHP, or even your traditional HTML page if you are willing to do the muscle work required to hook into them.  They can also, of course, be used with the MVC framework.

The Ajax Control Toolkit now also exposes its underlying script files for general use, allowing use to get all the great ACT functionality with WebForms or a ScriptManager.  The only problem is that learning to use the library without controls to manage our state and emit our code is difficult, and there is very little online help to get you started.

Stephen Walther is now helping people through this difficulty on his blog, and it is a wonderful thing.  He has already tackled the Popup Calendar and Autocomplete.  Expect to hear more from him in the near future.  I can’t wait to see what he does next.

h/t to Bertrand Leroy’s Tales From the Evil Empire for highlighting this.

ASP.NET AJAX: Script Globalization without the ScriptManager

bigfoot

I just spent about four hours trying to solve a problem I’ll probably never actually encounter in the wild.  Someone posted on the asp.net forums about script globalization using ASP.NET AJAX.  This can be set up pretty easily by simply using the ScriptManager control and setting its EnableScriptGlobalization property to true.  ScriptManager takes care of importing the necessary scripts and handling all the underlying code required to make things work.

What the seeker on the forums wanted to know, however, was whether this could be accomplished without the ScriptManager.  In theory, all the ASP.NET AJAX framework scripts can be downloaded and used in a non-platform dependent manner.

Certain software problems are ubiquitous, and people tend to fall over themselves blogging and posting about them until Microsoft or some other vendor eventually either fixes the problem and it goes away.  On the other hand, there are problems in the software bestiary that are so rare that working on them is the programming equivalent of doing cryptozoology.

This was a juicy problem of that sort.  And I believe I have a solution. It basically involves redoing some of what the ScriptManager does automatically, but what the hey.

To support globalization in ecmascript, the ScriptManager basically sets a variable called __cultureInfo behind the scenes.  This is then used by various ASP.NET AJAX script methods to provide formatting information.  This is actually explained in the Microsoft documentation for the feature.

Behind the scenes, it seems clear, the ScriptManager is querying the CurrentUICulture of the current thread in order to determine the browser’s preferred language, and passing this to the __cultureInfo variable.  The trick, then, is to determine the format of the culture data passed to __cultureInfo.

Here I had to use reflection to discover that there is an internal ClientCultureInfo type in the Sys.Web.Extensions assembly.  It made sense that this was being serialized and passed to the __cultureInfo variable.  With some trial and error, I finally got the serialization correct.

To make this work, you will need to download the Ajax Framework Library, which is a collection of javascript files.  You will need to import the MicrosoftAjax.js file into your web project, and then reference it in your page, like this:

<script src=”MicrosoftAjax.js” type=”text/javascript”></script>

You will also need to create the ClientCultureInfo class for your project, and make sure that it is serializable.  I tried DataContractJsonSerializer class to do my serializing,  but had problem getting the DateTimeFormatInfo type to serialize correctly, so I finally opted to use the now obsolete JavaScriptSerializer.  Here’s what the class looks like:

    public class ClientCultureInfo

    {

 

        public string name;

        public DateTimeFormatInfo dateTimeFormat;

        public NumberFormatInfo numberFormat;

 

        public ClientCultureInfo(CultureInfo cultureInfo)

        {

            this.name = cultureInfo.Name;

            this.numberFormat = cultureInfo.NumberFormat;

            this.dateTimeFormat = cultureInfo.DateTimeFormat;

        }

 

        public static string SerializedCulture(ClientCultureInfo info)

        {

            JavaScriptSerializer js = new JavaScriptSerializer();

            return js.Serialize(info);

 

        }

 

    }

Now that we have the culture info formatted correctly, we need to be able to pass it to the client variable.  We’ll create a public property in the code-behind that is accessible from the client, and set its value in the Page.Load event handler:

 

        protected void Page_Load(object sender, EventArgs e)

        {

            if (!Page.IsPostBack)

            {

                CultureInfo cultureInfo = System.Threading.Thread.CurrentThread.CurrentUICulture;

                ClientCultureInfo o = new ClientCultureInfo(cultureInfo);

                SerializedCulture = ClientCultureInfo.SerializedCulture(o);

            }

 

        }

 

        public string SerializedCulture

        {

            set

            {

                ViewState[“kultur”] = value;

            }

            get

            {

                if (ViewState[“kultur”] == null)

                    return string.Empty;

                else

                    return ViewState[“kultur”].ToString();

            }

        }

Finally, we  need to use this code-behind property to set __cultureInfo.  Just add the following script block to your markup in order to set the current culture:

 

<script type="text/javascript">
    // Get the name field of the CurrentCulture object   
    var __cultureInfo = '<%= this.SerializedCulture %>';
    Sys.CultureInfo.CurrentCulture = Sys.CultureInfo._parse(__cultureInfo);
</script>

 

I added this to the bottom of the page.  To test whether this works, you will need to set the language property of your browser (if you are using IE, like I am).  I set mine to French for testing.  Then append the following script block below the one setting the culture above:

<script type="text/javascript">
    var currentCultureInfoObj = Sys.CultureInfo.CurrentCulture;
    var d = new Date();
    alert("Current culture is " + currentCultureInfoObj.name 
    + " and today is " 
    + d.localeFormat('dddd, dd MMMM yyyy HH:mm:ss'));  
</script> 

 

If you encounter any problems, it is possible that the web.config file is overriding the culture information from the browser.  In that case, make sure the culture is set to “auto” in the config file, like this:

 

    <system.web>

        <globalization uiCulture=auto culture=auto />

    </system.web>

The Imp of the Perverse

nightmare

No college freshman in America is able to escape his courses without encountering Kant’s Categorical Imperative in some form or other.  Drawing on a Medieval moral tradition that held that God has placed in each man’s heart, whether Catholic, pagan, or apostate, the knowledge of right and wrong, Kant held that each person has an inherent rational knowledge of the Moral Law, or the pure form of moral action, which is commonly known as the Golden Rule.  Behind the Golden Rule is, furthermore, an impulse to act according to the Moral Law which Kant dubbed the Categorical Imperative — a concept which Freud later took up and reinterpreted as an irrational force: the Super Ego.

For Kant, however, the Categorical Imperative was always a rational impulse which revealed our transcendent selves.  How, then, to explain the not infrequent impulse to not fulfill one’s duty to the Moral law?  According to Kant:

"We are not, then, to call the depravity of human nature wickedness taking the word in its strict sense as a disposition (the subjective principle of the maxims) to adopt evil as evil into our maxim as our incentives (for that is diabolical); we should rather term it the perversity of the heart, which, then, because of what follows from it, is also called an evil heart. Such a heart may coexist with a will which in general is good: it arises from the frailty of human nature, the lack of sufficient strength to follow out the principles it has chosen for itself…" — Religion Within the Limits of Reason Alone

Edgar Allan Poe made a point of exploring that which Kant would rather leave aside as pointless and empty of content.  In an 1850 short story, he wrote:

"Induction, a posteriori, would have brought phrenology to admit, as an innate and primitive principle of human action, a paradoxical something, which we may call perverseness, for want of a more characteristic term. In the sense I intend, it is, in fact, a mobile without motive, a motive not motivirt. Through its promptings we act without comprehensible object; or, if this shall be understood as a contradiction in terms, we may so far modify the proposition as to say, that through its promptings we act, for the reason that we should not.

"There lives no man who at some period has not been tormented, for example, by an earnest desire to tantalize a listener by circumlocution. The speaker is aware that he displeases; he has every intention to please, he is usually curt, precise, and clear, the most laconic and luminous language is struggling for utterance upon his tongue, it is only with difficulty that he restrains himself from giving it flow; he dreads and deprecates the anger of him whom he addresses; yet, the thought strikes him, that by certain involutions and parentheses this anger may be engendered. That single thought is enough. The impulse increases to a wish, the wish to a desire, the desire to an uncontrollable longing, and the longing (to the deep regret and mortification of the speaker, and in defiance of all consequences) is indulged.

"We have a task before us which must be speedily performed. We know that it will be ruinous to make delay… We glow, we are consumed with eagerness to commence the work, with the anticipation of whose glorious result our whole souls are on fire. It must, it shall be undertaken to-day, and yet we put it off until to-morrow, and why? There is no answer, except that we feel perverse, using the word with no comprehension of the principle." — The Imp of the Perverse

The tendency which Poe calls perversity — the tendency to say the wrong thing, to zig when one should zag, to procrastinate merely to see what will happen next — seems to be more ubiquitous in software programming than in other occupations.  I’ve known programmers who not only say things they shouldn’t, but seem to take a particular joy in doing so.  They do not simply lack an internal censor that would keep them from saying certain things, but seem to actually be possessed by some sort of Socratic daimon who eggs them on.

Yet sometimes I think it is not the programmers who are especially possessed of this imp, but simply they who are not able to mask it behind other, more acceptable, modes of behavior.   We often hear of the disgruntled chef who spits in a difficult customer’s food, or the unhygienic bartender who slips unsanitary items in a customer’s drink.  The same impulse, I think, takes over middle-managers at times.  They, who are forced to do unpleasant tasks by their direct managers, and who in the end are blamed by both the people under them as well as those over them when things go wrong, are always suspected of taking a particular pleasure — dare I say a perverse pleasure — when unpleasant things, such as dressing down an employee or on occasion firing one, must be done.  What is more perverse, after all, than actually taking pleasure in performing unpleasant tasks, and who could blame them if they did?

Similar to Poe’s "mobile without motive," Robert Herrick captured the mood as one of Delight in Disorder (1648):

A SWEET disorder in the dress
Kindles in clothes a wantonness :
A lawn about the shoulders thrown
Into a fine distraction :
An erring lace which here and there
Enthrals the crimson stomacher :
A cuff neglectful, and thereby
Ribbons to flow confusedly :
A winning wave (deserving note)
In the tempestuous petticoat :
A careless shoe-string, in whose tie
I see a wild civility :
Do more bewitch me than when art
Is too precise in every part.

The sexual element that is implicit in Herrick’s understanding of the imp of perversity is remarkably absent from Poe’s, just as the element of danger, pervasive in Poe, is absent in Herrick.  Our contemporary notion of the perverse tends to span both elements, and is generally accessorized with leather where Herrick has petticoats, and piercings where Poe envisions only murder.  Yet even in our own times perversity has started to lose some of its perverse luster.  The Christian Coalition may decry the slipping of moral standards as a slow slouching towards the Rapture, but I see the problem, rather, as one in which we’ve denied ourselves the real pleasures of perversity.  When even leather and piercings have lost their power to outrage as well as titillate, where shall we turn?

I’ve recently been enjoying pulp novels from the 40’s with a certain amount of furtive excitement that those authors are writing things they would never get away with writing today.  For instance, from Mickey Spillane’s 1948 I, The Jury (for those unfamiliar with the series, Mike Hammer is a tough detective, while Velda is his faithful secretary):

"Here’s one you’ll like, chum," Velda grinned at me.  She pulled out a full-length photo of a gorgeous blonde.  My heart jumped when I saw it.  The picture was taken at a beach, and she stood there tall and languid-looking in a white bathing suit.  Long solid legs.  A little heavier than the movie experts consider good form, but the kind that make you drool to look at.  Under the suit I could see the muscles of her stomach.  Incredibly wide shoulders for a woman, framing breasts that jutted out, seeking freedom from the restraining fabric of the suit.  Her hair looked white in the picture, but I could tell that it was a natural blonde.  Lovely, lovely yellow hair.  But her face was what got me.  I thought Velda was a good looker, but this one was even lovelier.  I felt like whistling.

"Who is she?"

"Maybe I shouldn’t tell you.  That leer on your face could get you into trouble…"

And so on and so forth.  I, The Jury was a runaway bestseller and made Mickey Spillane’s career.  This was due in no small part to the racy writing and tight plot, but something should also be said for the cover art.  Here’s the cover of the original 1948 edition:

ITheJury

And here’s the cover redone for a later edition:

ithejury2

Finally, here’s the poster art for a film version:

IJuryMovie

Do you notice a common theme?  A man with a gun pointed at a woman undressing.  Is he holding the pistol in order to force her to undress?  Or is she undressing in order to compel him to drop the pistol?  Thousands of readers in the 40’s and 50’s felt compelled to read the book in order to find out what was behind this juxtaposition of sex and violence, drawn by the imp of the perverse. 

Last of the Great Whistleblowers

Solzhenitsyn

Anne Applebaum has written one of the better obituaries for Alexander Solzhenitsyn in her column for the Washington Post:

"Even Solzhenitsyn’s expulsion from Russia in 1974 only increased his notoriety, as well as the impact of "The Gulag Archipelago." Though it was based on "reports, memoirs and letters by 227 witnesses," the book was not quite a straight history — obviously, Solzhenitsyn did not have access to then-secret archives — but, rather, an interpretation of history. Partly polemical, partly autobiographical, both emotional and judgmental, it aimed to show that, contrary to what many believed, the mass arrests and concentration camps were not an incidental phenomenon but an essential part of the Soviet system — and had been from the very beginning.

"Not all of this was new: Credible witnesses had reported on the growth of the Gulag and the spread of terror since the Russian Revolution. But what Solzhenitsyn produced was simply more thorough, more monumental and more detailed than anything that had preceded it. His account could not be dismissed as a single man’s experience. No one who dealt with the Soviet Union, diplomatically or intellectually, could ignore it. So threatening was the book to certain branches of the European left that Jean-Paul Sartre himself described Solzhenitsyn as a "dangerous element." Its publication certainly contributed to the recognition of "human rights" as a legitimate element of international debate and foreign policy.

"His manuscripts were read and pondered in silence, and the thought he put into them provoked his readers to think, too. In the end, his books mattered not because he was famous or notorious but because millions of Soviet citizens recognized themselves in his work: They read his books because they already knew that they were true."

It is a peculiar meme in Western Culture that, at some level, the evil of Stalin’s Soviet regime cannot be viewed on the same level as, say, Hitler’s Third Reich.  It sometimes takes the form of faint attempts to explain it away, or to see it as an aberration of the Soviet state, and generally ends in a change of subject.  This aura of lingering romanticism about the Soviet State among Westerners is odd and, I think, rather inexplicable.  A meme is probably the best way to describe it.

In Russia itself, the attitude is perhaps easier to understand.  No one likes to be reminded of their own sins, and no one likes bad news that is unlikely to gain them anything.  In her book, Gulag: A History, Applebaum describes the typical reactions of people she encounters in Russia once they discover that she is doing a historical investigation of the Gulag system.

"At first, my presence only added to their general merriment.  It is not every day one meets a real American on a rickety ferry boat in the middle of the White Sea, and the oddity amused them.  They wanted to know why I spoke Russian, what I thought of Russia, how it differs from the United States.  When I told them what I was doing in Russia, however, they grew less cheerful.  An American on a pleausre cruise, visiting the Solovetsky Islands to see the scenery and the beautiful old monastery — that was one thing.  An American visiting the Solovetsky Islands to see the remains of the concentration camp — that was something else.

"One of the men turned hostile.  ‘Why do you foreigners only care about the ugly things in our history?’ he wanted to know. ‘Why write about the Gulag?  Why not write about our achievements?  We were the first country to put a man into space!’  By ‘we’ he meant ‘we Soviets.’

"His wife attacked me as well.  ‘The Gulag isn’t relevant anymore,’ she told me.  ‘We have other troubles here.  We have unemployment, we have crime.  Why don’t you write about our real problems, instead of things that happened a long time ago?’

"In my subsequent travels around Russia, I encountered these four attitudes to my project again and again.  ‘It’s none of your business,’ and ‘it’s irrelevant’ were both common reactions.  Silence — or an absence of opinion, as evinced by a shrug of the shoulders — was probably the most frequent reaction.  But there were also people who understood why it was important to know about the past…"

This is toward the end of the book.  Just as interesting is how the book begins, with an observation on a bridge.

"Yet although they lasted as long as the Soviet Union itself, and although many millions of people passed through them, the true history of the Soviet Union’s concentration camps was, until recently, not at all well known.  By some measures, it is still not known.  Even the bare facts recited above, although by now familiar to most Western scholars of Soviet history, have not filtered into Western popular consciousness.

"I first became aware of this problem several years ago, when walking across the Charles Bridge, a major tourist attraction in what was then newly democratic Prague.  There were buskers and hustlers along the bridge, and every fifteen feet or so someone was selling precisely what one would expect to find for sale in such a postcard-perfect spot.  Paintings of appropriately pretty streets were on display, along with bargain jewelry and ‘Prague’ key chains.  Among the bric-a-brac, one could buy Soviet military paraphernalia: caps, badges, belt buckles, and little pins, the tin Lenin and Brezhnev images that Soviet schoolchildren once pinned to their uniforms.

"The sight struck me as odd.  Most of the people buying the Soviet paraphernalia were Americans and West Europeans.  All would be sickened by the thought of wearing a swastika.  None objected, however, to wearing the hammer and sickle on a T-shirt or a hat.  It was a minor observation, but sometimes, it is through just such minor observations that a cultural mood is best observed.  For here, the lesson could not have been clearer: while the symbol of one mass murder fills us with horror, the symbol of another murder makes us laugh."

I do not play the game myself, but a friend tells me that there is a similar controversy in Civilization IV concerning the presence of Stalin as a player character in this PC game and the absence of Hitler.  Here is a small flame war over it, with links to more flame wars.  Another friend, who is ethnic Chinese, resents the presence of Mao in the game.

Perhaps the greatest trick the Devil ever played, to paraphrase Kaiser Sose, was to convince people that he was Adolf Hitler, while men like Alexander Solzhenitsyn worked to convince us that things were otherwise.  To quote the man himself:

"If only there were evil people somewhere insidiously committing evil deeds, and it were necessary only to separate them from the rest of us and destroy them. But the line dividing good and evil cuts through the heart of every human being. And who is willing to destroy a piece of his own heart?”  – The Gulag Archipelago