September 2008 - Posts

If we can't take the law into our own hands, whose hands should it be in?

Quis custodiet ipsos custodes? (Who watches the watchers?)

  • Lawyers are professional weasels. General public consensus -- as well as private experience -- is that they are deceitful grasping sneaks and not to be trusted.
  • Public servants don't care.
  • Politicians are untrustworthy. They are expected to lie. They are also demonstrably detached from reality. Nearly all of them have declared conflicts of interest, too -- party affiliations that inhibit their ability to represent their constituents.
  • Police officers are people like you and me, their judgment no better than ours, and they are almost never where they are needed. They cannot be everywhere, and so they fail before they begin.

The only sensible answer is that we watch each other. That obliges us to take the law into our own hands.

Whose law is it anyway?

On another level, the level of deciding what the law should be, I once again ask in whose hands the law rests. Frighteningly, the current situation places it in the hands of politicians and lawyers, with police given exclusive licence to enforce it.

Let's look at the mechanism by which our law allegedly works. There are millions of us, so to mitigate complexity, individuals -- you, me and every other citizen -- delegate our decision-making to a hierarchy of people paid out of our collective pockets to determine our collective will and codify it. It is from us that our government draws the authority to make decisions.

Delegation of authority through an hierarchy of proxies is a scheme for mitigating complexity. It is an expedient only, and in our technological age it is not the only option. It is now practical for everyone who cares to vote on any issue dear to his/her heart. In the presence of political parties, (mis)representative government is an instrument for the perversion of justice.

Even the choice of names betrays the truth: government is about power, about ordering people about. I take exception to that, and the real reason the government doesn't want me to have a weapon is that guns are the foundation of democracy -- the power of the individual to tell the government where to get off.

I have no problem with administration. Roads, water, electricity, core communications, gardeners for public parks, public libraries and hospitals, building codes, vehicle inspection. All are worth paying for and all are essentially centrally administered. Well, water and electricity shouldn't be but that's another diatribe. But government is obscene and to be resisted at every opportunity.

Posted by peterw | 1 comment(s)

Windows Server 2008, SQL Server 2008, IIS7 and Reporting Services 2008 - latest and greatest, made for each other. ASP.NET developed using Visual Studio 2008, showing the reports in the Microsoft supplied ReportViewer web control.

"Oh, that's easy!" said the documentation. "You just use the ReportViewer control. The server-side part of it acts as a proxy that runs in the process of your ASP.NET application's AppPool, so you just need to give database permissions to the AppPool user and Bob's your uncle."

Bollocks. There are two other steps, both of which are poorly documented and neither of which is self-evident.

Handler mappings

First you have to set up a handler mapping so that Reporting Services gets first crack at AXD requests. Start the IIS Manager,select the server node and double click this icon:

Add managed handlert

Now click Add Managed Handler... (it will be at top right) to get the dialog shown below, and fill in the blanks. There maybe several ReportViewer web form HttpHandlers; pick the version appropriate to your web app (probably the most recent).

Add managed handler

Having set this up, select the web in which you want ReportViewer to work and again double click on the Handler Mappings icon. The handler will appear, but it will be greyed-out. Enable it by double clicking on it and ticking execute in the dialog that appears. Repeat and rinse for any other affected web apps. Once you've done this you stand a snowball's chance in hell of getting it to work.

The next step is to provide credentials. If the report server and your ASP.NET applications live on the same box, you can specify http://localhost/ReportServer and you won't have to supply credentials.

Specifying credentials

You do this by implementing IReportServerCredentials. Here's a deliberately simplified example.

using System;
using System.Data;
using System.Configuration;
using System.Net;
using System.Security.Principal;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Microsoft.Reporting.WebForms;

[Serializable]
public sealed class MyReportServerCredentials : IReportServerCredentials
{
  public WindowsIdentity ImpersonationUser
  {
    get
    {
      // Use the default Windows user.  Credentials will be
      // provided by the NetworkCredentials property.
      return null;
    }
  }

  public ICredentials NetworkCredentials
  {
    get
    {

      //please don't hard code this
      return new NetworkCredential("userName", "password", "NT domain");
    }
  }

  public bool GetFormsCredentials(out Cookie authCookie,
              out string userName, out string password,
              out string authority)
  {
    authCookie = null;
    userName = null;
    password = null;
    authority = null;

    // Not using form credentials
    return false;
  }
}

Once you've set this up you are in a position to control the credentials presented to reporting services on the basis of the forms authentication identity — per user rather than per application. Here's how you get the report viewer control to use your implementation of IReportServerCredentials:

    protected void Page_Load(object sender, EventArgs e)
    {
      ReportViewer1.ServerReport.ReportServerCredentials = new MyReportServerCredentials();
    }
Posted by peterw | with no comments

I have been accused of "saying that women are ***" in the following post. The text below the line is the entire original post. This preamble is a rebuttal to the accusation.

If you actually read it, I start with a cynical and not very flattering speculation on why men might originally have exhibited certain behaviours. Then I extend this into the modern world and use it to successfully predict a situation every man knows all too well. While I do say that in this situation women become insufferable, if the reader is paying attention it should be clear that I have attributed this to the situation - I am saying that both parties are victims of circumstance. I follow that with an oblique chuckle about men's venality, and change track to muse on past solutions to this conundrum, and how social evolution has deprived us of any relief. At no point do I suggest that any of this was right or fair or deserved, I merely comment on its social function.

If you're a feminist baying for blood you have a bit of a problem at this point, because in order to prove me wrong you'll have to be nice to me.


The great "men's secret" of hunter-gatherers was that hunting entailed a couple of days bushwalking with your buddies culminating with a bit of light trapping on the way back. Why come back at all? Laundry, sex and the opportunity to be the conquering hero. You leave again just before your exalted status expires.

We can't live like that any more. We're trapped with them. So we have to use other means to prevent familiarity from breeding contempt. A woman who holds you in contempt is a pain in the ass. Worse, she will not hesitate to badmouth you and deliberately run interference on any attempts to replace her with a younger model.

Curiously, a lot (most?) women like being dominated. While the evidence for this statement is anecdotal, it is also widespread. Anyone who doesn't think so is clearly a virgin.

The question, then, is how to dominate them. Traditional societies - including, until quite recently, our own - were very specific. Periodic beatings of his woman were regarded as an unpleasant duty necessary to the welfare and happiness of a man's household.

Administration of corporal punishment was strictly regulated to balance compassion with necessity. Who could do it, how and with what, how hard and how often were strictly governed by a mixture of social convention and law. This was hardly gratuitous violence. The whole exercise was regarded as an unpleasant chore.

Control of all but the most recalcitrant younger women fell to the wife, who might, if all else failed, ask her husband to apply corporal punishment. Vestiges of this remain: "You wait till your father gets home!" deliberately abstracts the punishment so that a child learns that there are rules and the enforcer is just the messenger. This is not domestic violence, it's a local justice system. Domestic violence is what you get when idiots dismantle a vital part of their social system.

Posted by peterw | 1 comment(s)