Technology: November 2003 Archives

Mac Annoyances

| | Comments (0)

John Gruber takes issue with external editor support in apples new XCode application. I’m wondering what the Mac is like as a development platform? I love the hardware, and there are lots of neat things about the Mac, but is it a viable platform to switch to?

Update: Yes, it is. I switched a few months after this was written and haven’t looked back.

I’ve been looking at the new streaming API for XML (JSR-173), I’ve been generally impressed but have found a bug in the reference implementation, here’s the details, using this test program:

import java.io.*;
import javax.xml.stream.*;

public class StaxWriterTest {
    static String nsURI = "http://ianp.org/nsURI";
    static String nsPrefix = "a";
    static int depth = 0; // Used to pretty print the output.
    static XMLStreamWriter w;

    public static void main(String[] args) {
        try {
            OutputStream os = new FileOutputStream("StaxWriterTest.xml");
            w = XMLOutputFactory.newInstance().createXMLStreamWriter(os);
            w.setPrefix(nsPrefix, nsURI);
            w.writeStartDocument();
            indent(1);
            w.writeStartElement(nsURI, "root");
            w.writeNamespace(nsPrefix, nsURI);
            indent(0);
            w.writeEmptyElement(nsURI, "levelOne");
            w.writeAttribute(nsURI, "foo", "foo");
            indent(0);
            w.writeStartElement(nsURI, "levelOne");
            w.writeEndElement();
            indent(1);
            w.writeStartElement(nsURI, "levelOne");
            indent(1);
            w.writeEmptyElement(nsURI, "levelTwo");
            w.writeAttribute(nsURI, "foo", "foo");
            indent(-2);
            w.writeEndElement();
            indent(0);
            w.writeStartElement(nsURI, "levelOne");
            w.writeEndElement();
            indent(-1);
            w.writeEndElement();
            w.flush();
            w.close();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(1);
        }
    }

    static void indent(int d) {
        try {
            if (d < 0) depth += d;
            for (int i = 0; i < depth; ++i)
                w.writeCharacters("  ");
            if (d > 0) depth += d;
        } catch (XMLStreamException e) {
            throw new RuntimeException(e);
        }
    }
}

This is using version 7 of the reference implementation, by the way. The program should produce this output:

<?xml version='1.0' encoding='utf-8'?>
<a:root xmlns:a="http://ianp.org/nsURI">
    <a:levelOne a:foo="foo"/>
    <a:levelOne/></a:levelOne>
    <a:levelOne>
        <a:levelTwo a:foo="foo"/>
    </a:levelOne>
    <a:levelOne/></a:levelOne>
</a:root>

But actually produces this:

<?xml version='1.0' encoding='utf-8'?>
<a:root xmlns:a="http://ianp.org/nsURI">
    <a:levelOne a:foo="foo"/>
    <a:levelOne/></a:levelOne>
    <a:levelOne/>
        <a:levelTwo a:foo="foo"/>
    </a:levelOne>
    <a:levelOne/></a:levelOne>
</a:root>

Line 5 is generated as an empty element instead of a start element. I’ve pointed this out the to JCP committee, we’ll see if they repsond.

Fedora

| | Comments (0)

By coincidence I just finished reading up on the Fedora Project before I read this post from Diego. As I see it Redhat are going to push the Fedora project as their replacement for the Professional edition (i.e. Red Hat 9). This probably makes sense since they can free up a lot of resources whilst hopefullty maintaining market visibility. If they can increase the speed of the release cycle for this it may even help them gain some more converts (and it sure does look pretty!).

Appropriate Technology

| | Comments (0)

This says it all:

Web services technology also gets more than its fair share of misuse. Web services are great, if that’s really what you need. The problem arises when people use web services ‘just because’, or apply web services inappropriately, like using SOAP as an internal messaging bus.

We get this all the time in RFC’s and RFP’s at work, the obligatory how do you support web services question. For internal integration projects. Urghh… .

The Semantic Web

| | Comments (0)

Clay Shirky’s latest newsletter on networks, economics and culture discusses the semantic web. In a nutshell, he’s not very impressed.

The starting point for this argument is that syllogisms don’t model the real world well, an example:

The creator of shirky.com lives in Brooklyn. People who live in Brooklyn speak with a Brooklyn accent.

Well in this case clearly they don’t, the second assertation is clearly false, it’s obvious that not everybody who lives in Brooklyn calls birds boids, so that absolute assertaion does not hold. The example later on using Nike and the first amendment of the US constitution has more merit, in this case the fact asserted (the first amendment covers the rights of US citizens) is a subset of the actual applicability rather than a superset as in the Brooklyn case. I think that this is still a surmountable problem, but it may require a more complex representation of ‘facts’ than initially considered.

I think that maybe the way forward if not, as Clay suggests (if only to point out it’s impracticality), to attach context to each assertation and then cross check against this. A better approach surely would be to attach an accuracy value to each statement, then the syllogisms could have attached accuracy values also. For example, the following pseudo code:

LET clay lives in Brooklyn ACCURACY 1.0
LET people who live in brooklyn say boids ACCURACY 0.7
DEDUCE clay says boids ACCURACY 0.7

With the final 0.7 being the product of the two ‘fact’ accuracies. Now this is just something that I’ve come up with on the spur of the moment, not a result of research so I don’t know how generally useful this would be, but in tools designed for human use it should be possible to tolerate a level of inaccuracy, so long as it is marked as such. Reading further, the examples about merging databases I can agree with the fact that it’s way more complicated that just simply mapping field names!

When it comes to meta data, this is probably best if it can be extracted from the data itself automatically, of course this would reduce the amount of available data, but maybe we could tag any manually added meta data with a date and allow it’s accuracy to deteriorate as time goes by (or as the tagged data is revised), and you could always tweak your reasoner to reduce the accuracy of human added data anyway.

Hmmm, but this goes against what the semantic web is supposed to be for to a large extent. Machines need to be able to rely on absolute (i.e. ACCURACY 1.0) facts to be able to use them a lot of the time. I think the conclusion that I’m coming to is that there is a benefit to be gained from the semantic web and it’s related technologies and ideas, but probably not as great as it’s champions make out. So it’s another web related technology with potential that has been overmarketed. Nothing new there then.