Author Archives: bhyde

php domxml misery

Argh.

So I could have some fun; I rebuilt my php4 with-dom, (with-zlib, with-iconv), and the tidy extension via pear (with just the right automake, et. al. – of course). I can tidy up stuff I fetch. I can build dom trees and convert them to text. I can parse stuff, I know because the parser complains about malformed inputs.

But there is no sign that it’s returning much that’s useful from this parsing. It’s as if I have some configuration toggle set to “don’t bother to build the dom tree.”

<html>
<body>
<?php
$doc = domxml_open_mem('<?xml version="1.0"?><a><b/></a>');
echo "<hr/><pre>",htmlspecialchars($doc->domdocument_dump_mem),"</pre><hr/>";
?>
</body>
</html>

That displays two horizontal lines with nothing betwix. The $doc object has assorted slots; no sign of substructure.

Argh.

Blooming Notification Networks

I’ve been toying with ideas around an update notification network that would:

  • take notifications of updates from readers and writers and deliver them to readers,
  • reduce the cost of polling for readers and writers,
  • shorten the time it takes for updates to get to the readers, and
  • avoid concentrating power in hubs while leveraging and giving value to the masses

Two corners of this design space I’ve been kicking around in recently.

  • How to maintain privacy for readers.
  • How to deal with bad actors.

Bloom filters might provide a scheme to help deal with the privacy problem; but how they interact with the class issues is hard to think about. Each member of the network would then publish the bloom filter bit map of his interests and his peers would notify him when they saw updates that matched that filter. Notification rattle around in the network only among those peers that who’s filters intersect for that notification’s bit settings. A peer in the network can set additional bits either to protect his privacy, but also because those bits reflect the interests of his peers. A voracious reader, like the elite readers, can fill in all the bits. Notifications might not even mention the resource that was polled, instead they just enumerate the bits effected.

A cool insight about the bad actors came out of a chat with Ben Laurie. It’s not really the quality of the participants you care about. You care about the quality of the notifications. That’s the same problem we find in open source projects – where we take all input and then strive to let thru the good stuff. In this case you could treat notifications injected into the network as rumors that something might be new and then let some process in the network promote that into an assertion that something’s changed. For example you might put a quality value into the notification; decaying that quality as it cascades thru the net; amplifying that quality when ever a peer acts upon the information and asserts that it’s correct. That could have nice synergies with the need for a mechanism that assures participants in the network that the resources they care about are being regularly monitored; i.e. the watch dog problem.

I’m not really satisfied with the bloom filter approach to the anonymity, it looks like it has problems of many kinds – but it’s a fun idea anyway. Similarly I doubt that the notification QA approach is robust against really committed bad actors.

All this is an interesting window into the class problems. The elite often solve the anonymity and bad actor problems using business agreements, lawyers and the courts. That allows them to punt on designing the protocols to solve them. That tends to force the masses to go thru bottlenecks created by the elite. The function of that bottleneck is to have the elite dude vouch for their not being a bad actor while laundering their traffic (hopefully) to given them some anonymity.

Mystery Mushroom

Mystery Mushroom
This mushroom emerged up the street, here in New England, between the sidewalk and the street. On the roots of an apparently healthy maple. I have no idea what it is; that’s quite a solid mass at the base. Smells great. It’s slightly, but very slightly orange. The tops are dry.

Update: I checked again. It actually is on the remains of a very large street tree that probably fell down 5 or more years ago. The roots of the adjacent trees probably haven’t invaded the space yet.

Mystery Mushroom sliced in half

Helping Giants

Thinking around the efficiency problems for blogs, or URI in general. Here two things that don’t look too hard to do (one about polling, one about diffs); along with some clarification about the populations that yearn for these improvements.

First let’s block out some givens. There are content consumers and content providers. Two populations, call them readers and writers. Then we have all the stuff in-between them that makes it work. We would like to make that stuff more efficient; presumably so life is better for those two populations.

The readers and the writers are power-law distributed. You can make a cartoon of that. Each population has its elites and its masses. There are billions of readers, billions of writters – most of them very low volume – that’s the masses. There are a much smaller number of elites. A few voracious readers like Google, or Technorati. A few very popular and prolific writers. Live Journal is a good example in the blog space. For the purposes of this discussion I’ll just ignore the middle classes and the scale free networks that really describe the situation.

With that picture – two populations broken into elite/masses – it becomes clear that the stuff in the middle might be broken out into four design problems: {reader,writer}*{elite,masses}. It certainly helps to generate cases to think about. For example the elite readers yearn for a way to lower to the cost of polling all the masses of writers.

So one simple idea is to just attempt to address the polling problem. Do something so that it is easier to know if a site’s been updated. Building a distributed system that provides a standard where all parties can rendezvous and collaborate about notification of changes wouldn’t be that hard a design problem. But is sufficiently complex to take some real work to get it right. For example it would be a bad thing (I think) if that design encouraged a single notification hub owned by one entity.

I suspect that elite authors and the elite readers are the only ones who really care about solving the bandwidth problems at this point; or at least they stand to gain the most from getting the problem solved. I started thinking that after it occurred to me that the current bloom of interest in these problems came out of Microsoft deciding to stop providing full feeds for a mess of blogs they host. I found myself thinking “Oh please! What they can’t afford the bandwidth? Bandwidth is practically free. … hm. I bet they are really just trying to get those reader eyeballs to come back to their site.” Who knows if all that is true or not, just a though in my head, but it’s clear that you need a lot of readers before you start finding the bandwidth problem all that serious. My blog is in the top .5% of all blogs and I run it on a little DSL connection off a discarded computer in my basement.

In some standardization situations when you set out your four boxes you discover that most of the benefit of introducing a standard is captured by fixing the elite to elite exchanges. That happens when the elites mostly exchange with each other. That’s not the case in this scenario – at least I don’t think so. It would be very interesting to see some data about that for various subsets of the reader/writer markets. Microsoft’s misery with their developer network blogs is a particularly ironic case study though. Developer networks are all about large platform vendors creating relationships with masses of small developers.

Well so in thinking about the bandwidth problem it seems to me that there is one simple hack I’ve not seen suggested so far.

Just add a new encoding type. Clueful readers write “Accept-Encoding: gzip” in their requests and responsive content providers then act on that to reduce bandwidth. In addition clueful readers do conditional gets and include an ETag so that if the resource hasn’t changed at all then they can get back a very efficient (i.e. practically empty) response. What if the elite readers started doing: “Accept-Encoding: gzip, x-diff-from-etag”?

Ah, but I hear you say. “That will never work, we’d have to revise all the entire installed base.” Well yes, if we wanted the entire installed base to get the benefit of this efficiency improvement. But what if we only really care about the elites? For example if Technorati (an elite reader) started doing this and Typepad, Live Journal, MovableType and WordPress all started responding appropriately it would have a huge impact on the total bandwidth being consumed.

Of course we could spend a few years negotiating exacltly what “x-diff-from-etag” means, and how many variations there are. While that is the usual approach I suspect in this case somebody could hack up a proposal that everybody could sign onto pretty quickly. You’ll notice who I think should fund that labor. It’s simple enough that it is unlikely to be biased toward one of the four classes of users ({reader,writer}*{elite,masses}).

Social Physics

In my morning mail (Thank’s Karim!) a pointer to Social Physics yet another assault on the tough problem of how to manage the identity, persona, privacy problem. This assault distinguishes it’s self by attempting to push the problem to the edges of the network and thus reduce the role of the middlemen. A fine design goal as far as it goes. People who strive for that are often running blind to both power-law nature of what emerges on top of these platforms and the value that middlemen bring to the party.

Blindness to the power-law can be fatal; or more typically it just limits your scale. I see signs that they suffer from it in their somewhat gassy introductory manifesto. It’s on the front page. It insists on framing the problem into the well worn 20th century dialectics where big is bad and small is good, and middlemen are ways suspect. For example: “Who has 687,389 trusted friends? Nobody.” This just misses the point so widely it makes my head spin. Most of the economy runs thru entities of that kind – governments, the credit card firms, etc. etc. So lots of entities have millions of of trust relationships. To fail to take this to heart only assures that we encourage the emergence of two solutions; one for each class. That’s a horse race I’d rather we avoided.

There is a lot to like here. Particularly for the engineer of software/network-systems/standards. A commitment to severing the desires and needs of the small player in the persona/relationship market. They have pulled a lot of fun technology cards out of the deck: P2P, Jung’s data model, etc. They are not naive about what it takes to get the bandwagon to pick up speed – particularly when doing a bottom up standards play.

I’m going to enjoy taking a closer look.

Consistency

The official 5am forecast discussion for hurricane Ivan contains this quote: “If I did not have a previous forecast to maintain some continuity with. I would have shifted the track even further to the left.”

Professionalism assures that these guys are striving to output the very best forecast they possibly can. I assume they know that you get better forecasts if you don’t start from scratch every day. Better may mean more effective, or it might mean more accurate; I wonder.

But do realize how broad the distribution of predictions really is at this point. They may say they are predicting land fall near the border between Alabama and Mississippi; but really they aren’t. That statement is just the highly condensed version of a set of predictions. This enumerates their real prediction. For each location along the gulf coast it has their current probability that the hurricane will make landfall close to it. None of them rise above 16%. At one end of the coast line the chance that Key West get’s it is 9%; while at the other end all the way over in in Galveston Texas it’s 6%. New Orleans is 14% only 2% lower than the center of their forecast landfall probably curve.

That means that shifting the center a bit left or right would only change the threat level for these locations by one or two percentage points.

King for a Day

Will Pate asks and Tim Oren responds. A long fun Just So story. Maybe he doesn’t answer the question but at least he illuminates it. “So why do shareholders have limited liablity?”

The nugget in his story is that limiting share holder liability lowers the risk for shareholders of investing their capital.

Sounds like moral hazard to me. I.e. it’s an invitation to investors to engage in morally suspect behaviors because they know they can avoid the consequences of those behaviors.

Tim’s story is fun because he’s entirely honest that this benefit for investors came about because it was a benefit that King’s enjoyed. When kings take risks that bear foul fruit the peasants smile cheerfully and eat the fruit. When power began to devolve from the king into the hands of the wealthy the limited liability corporation was a way to get the same benefit for the corporation’s investors.

There are many models of what a corporation is. For example some folks think of a corporation as a knot of contracts. But clearly one model of the corporation is that it’s a license to investors take a risk and dodge the full liabilities there in. A chance to pretend to be king for a few days.

Of course risk taking is necessary part of economic growth; so it’s in societies best interests to make choices of where and how much risk to license.

To hear Tim tell it America – pause for a moment of silent respect – would not exist if not for this devolution of kingly powers unto the investor class. It’s a story that takes my breath away.

Actually, to be a bit more accurate Will’s question was “What is the best reasoning behind why shareholders have limited liability for a corporation’s environmental and social costs? …”

In my noodle that collides with Tim story of early english colonialism’s corporate roots. I find myself remembering things. after the european-asian germs wiped out most of the native populations. That the European earth worm spread across the continent and wiped out much of the ecology. The slave trade. The cod. The elm. The beech.

Nothing is simple.

Collaborative model synchronization

Jim Winstead wrote a nice note on “decentralized web(site|log) update notifications and content distribution.” He plays some cards into the design game that I found fun to toy with. One of these cards the cloud. The idea being that as blogs update things (notifications of update, entire postins) are injected into the cloud. Blog readers tap into the cloud to gain access to that traffic. Signatures is another card he plays; this draws our attention to the spam problem – for example bad actors posting false notifications about other people’s blogs.

Here some commentary from the sidelines.

On the input side: Better I think if a distinction is made between asserting that Ted:actor wrote P:posting v.s. Sam:actor inserted P:posting into the cloud.

Interesting challenge: how to the avoid condensation of the cloud into a small number of players. Splitting the Sam set out from the Ted set actually encourages condensation.

Inside the cloud: How much persistent state is in the cloud and how out of synch that can become from the origin data?

One branch in the design space makes the cloud is just a notification mechanism. That’s tempting and seems at like the right choice. Understanding if it’s a workable choice demands that we understand what the recipients of these notifications are doing with the data.

Each client Carol of the output of the cloud is maintaining a model of N data sources. After service interruptions the clients have to bring their model back into synch. They might just go poll the original sources, or they might patiently wait for the cloud to send them additional notifications. They can also work with other players who also have models, e.g. their peers Cathy or specialized caching middlemen Charlie.

The real design problem here is “collaborative model synchronization.” The service interruptions are what allows the models to get out of synch. Some of those service interruptions are apparent – i.e. you were off line – some of them aren’t – i.e. a unknown portion of the cloud was offline.

Watch dog timers are the usual means by which a client becomes suspicious that a service interruption has taken place in some unknown portion of the cloud. That implies a background of dogs barking. Who signs these barks? You want the dogs as close to the edge as possible, i.e. outside the cloud. Sam obviously barks. But what about Cathy and Charlie? If we are collaborating with them in our model synchronization they clearly need to bark as well. When they fall silent we can then go seek other model maintenance collaborators.

Two other issues come to mind. How critical is is to merge multiple atomic updates into single messages. How much privacy can we offer the cloud’s listeners? If I subscribe into the cloud for updates I’m revealing too much information about my reading habits. To whom? Cathy and Charlie at least and of course to the cloud P2P presence scheme. Both these issues will need work.

In once sense this isn’t a new problem. The real time control industry has lots of design patterns for how to distribute and keep models in synch across the many machines that are doing the control. Expert systems are full of analogous design patterns for inferring models via backward and forward chaining. The scale, privacy, spam, and reputation issues add spice to this version of those problem.

I often use the term “pedigree” when discussing problems of this kind. Because in many cases the data at hand traveled. It passed thru various hands. It underwent some number of transformations. It took some time to get here. I expect we will see an explosion of scrapping over the next few years. Well maybe we shouldn’t call it scraping, maybe we should call it automated data representation transforming. Signatures help to remove some of the reasons you need a pedigree, but not all of them. If your data about Ted’s site came via Sam, thru the cloude, via’s Cathy cache’d model your are happy that Ted signed the posting. But to know why how it came to be four hours late you want at least Sam and Cathy to extend the pedigree.

Fun problem.

Hm, interesting I wrote about this almost exactly a year ago.

Versions of the Data Cloud