The crisis in the TeX Users Group Saturday, Apr 2 2016 

Kaveh Bazargan took office as President of TUG in May 2015. I was shocked to read the Board’s announcement, on 13 October, that they had suspended him from office. This, if not reversed, would lead to his removal. It’s not been reversed.

The Board removed him because they decided that he was not working in the best interests of TUG. Kaveh Bazargan was elected 307 to 110 in the first contested election since 2005, and the acting President is now Kaveh’s opponent Jim Hefferon.

I’ve written a letter about this to TUGBoat, the journal of the TeX Users Group. It will appear in the next issue. You can read it now here (PDF).

I ask that comments be posted either to comp.text.tex, or to the TUG members mailing list (TUG members only, can be reached via the TUG members area).

Candidate Betti numbers for linear homology Monday, Feb 25 2013 

In April this year I’ll be giving a talk, with the title Candidate Betti numbers for the linear homology of convex polytopes. at the Université Libre de Bruxelles. Here are Candidate Betti numbers for linear homology slides that I originally prepared.  And here’s the Finding linear homology slides that I’ll actually use for the seminar. The second set is short, and gets to the main definitions more quickly.  The first set puts the material in context, but is much too much for a single talk. [Second set of slides added April 1, 2013.]

Here’s the abstract:

The middle perversity intersection homology (mpih) Betti numbers of the toric variety associated with a convex polytope are linear functions of the flag vector of the convex polytope.
In this talk I define similar linear functions, which I hope are the Betti numbers for a not yet defined homology theory. This linear homology theory should exist wherever mpih does.
Such homology would prove that these candidate Betti numbers are actual Betti numbers, and so non-negative on all convex polytopes (being the dimension of a vector space).

Combinatorial polytopes and intersection homology Tuesday, May 22 2012 

I gave a maths seminar talk at the Maths department of the Open University today. Here are the slides cpih-2012-slides (PDF)

I hope before to long to write some posts on the contents of the talk.

Is TeX obsolete? Sunday, Apr 10 2011 

The conversion, in 2010–11, of the Summa paper mill in Finland to a Google data center is a clear sign of the growing importance of electronic media and in particular web pages in human communication. In this note we ask and provide a preliminary answer to the questions: Globally, how much server CPU time is spent running TeX or one of its descendants?  And for what purpose?

For Google’s data centers the answer might be zero.  I don’t know of any Google web application that uses TeX or descendant for back-end typesetting.  The closest I know of is Google charts, which provides typesetting of  TeX notation mathematics.  But there is strong evidence that they are not using TeX’s algorithms for this.

The major site that has back-end TeX typesetting is, of course, arXiv.org.  There are also some publisher sites that use a similar service for author submissions.

WordPress and PediaPress are two other major sites using TeX or similar. WordPress allows bloggers to put LaTeX notation mathematics into their posts and comments.  PediaPress provides a typesetting service for Wikipedia pages, which uses LaTeX as the backend.

The only other significant TeX or typesetting as a web service site I know of is MathTran (developed by myself with JISC and Open University funding).  This provides, as does WordPress, translation of formulaes for images, but this time intended for use on third-party web sites.

The more traditional reader might say: I agree that TeX is not widely available as a web service, but what does this have to do with it being obsolete?  My view is that at present TeX and its descendants are well-established only in a few paper and PDF oriented niche areas, of which mathematics and physics research is by far the most important.

If TeX does not establish itself as a ubiquitous notation and typesetting system for mathematics on web pages, and if it does not consolidate and extend its use for server-side document typesetting, then these failings may cause the system as a whole to become obsolete.  This would not be due to any inherent failings, but to a failure to provide an interface that meets the needs of electronic media, particularly the web.

Explicit use of JavaScript’s global object Friday, Jul 17 2009 

A lot of JavaScript programmers use an anonymous function at the top level, to establish a scope. This allows variables to be defined in a file (or module if your prefer), without adding anything to the global namespace.

The problem with this, however, it that it becomes awkward when you do need to add something to the global namespace.

Here’s a trick that solves this problem.

    (function()
    {
        var global = (function(){return this;}).call();
        global.Formula = function (){
            // body of function
        };
    })();

This code is equivalent to:

    var Formula;
    (function()
    {
        Formula = function (){
            // body of function
        };
    })();

Both forms have the same number of lines of code, but the first pulls ahead for each additional object added to the global namespace.  But there are other advantages.

  • It is made explicit, that the assignment to Formula is being made in the global namespace.
  • Suppose you decide that Formula and its companions should live in a different namespace.  In the first, simply search and replace on ‘global’ and replace the definition of global.
  • In the first, we take care to explicitly obtain the object we are changing, namely the global object.
  • According to Douglas Crockford, “JavaScript’s global object […] is far and away the worst part of JavaScript’s many bad parts”. Writing as in the first example discourages and makes explicit the use of the global object.

Is JavaScript’s new syntactic sugar? Sunday, Jul 12 2009 

JavaScript has a ‘new’ operator for creating objects. Each object in JavaScript has a hidden pointer to a prototype object, from which it inherits properties. This pointer is set when the object is created, and cannot be changed during the lifetime of the object.

When ‘new’ is used, an object is created that has other than the usual default Object prototype object.

From ‘new’ we can define a function create(proto) that returns an object whose prototype object is ‘proto’. (I first saw this in Douglas Cockcroft’s book JavaScript: The Good Parts, but he calls it ‘beget’.)

Conversely, from ‘create’ we can define a function, say ‘New’ that has the same functionality as the ‘new’ operator. (In JavaScript ‘new’ is a keyword, whose meaning can be changed.)

The ‘create’ operator is in some sense simpler than the ‘new’ operator, but each can be defined in terms of the other. According to Wikipedia, syntactic sugar “is syntax designed to make things easier to read or to express, while alternative ways of expressing them exist”.

I think ‘create’ is simpler to use and understand than ‘new’, and so I don’t regard it as syntactic sugar for the creation creation of objects.  The same Wikipedia term also suggests the term  syntactic saccharin for gratuitous syntax which does not actually make programming easier.  I consider ‘new’ to be syntactic saccharin.

Javascript and skeletons Monday, Feb 9 2009 

Here’s an analogy (and I don’t know how useful it is). It’s about writing JavaScript for web pages.

A beetle, for example, has a hard external skeleton, to which everything else is attached. A cat, for example, has a hard internal skeleton, to which everything else is attached. A cat is soft outside (although with teeth and claws) while a beetle is soft inside.

So what’s this got to do with JavaScript and HTML? Well, a simple HTML page spruced up with some JavaScript for say form entry is a bit like a beetle, where the HTML is the hard external skeleton.

But a complex web page, constructed mostly from JavaScript and Ajax supplied data is something else. It’s too big and complex to be supported just by HTML and the DOM. It needs some sort of skeleton. And so perhaps should be built more like a cat.
(more…)

TUG board election Saturday, Jan 31 2009 

I’m standing for the board of the TeX Users Group. You’re invited to make comments on my election statement below.

I work for the Open University (the UK’s leading provider of distance education) as a TeX expert for print media. I’m also halfway
through a two-year project on putting mathematics on web pages.

In 2006–7 I set up MathTran, which now provides typesetting of
TeX-notation formulas to images as a public web service, serving
about a million images a month.

MathTran shows the value of TeX as a web service, which I’d like to
extend to whole documents. Installing and configuring TeX can be
slow and difficult. Using TeX through a web browser will help
beginners.

Part of my math-on-web project is a page where students can
interactively create a TeX-notation formula, say for putting on a web
page or in a word-processor document.

I have a doctorate in Mathematics and although not my career I still
have research interests. I have been using TeX for over 20 years,
and joined TUG in 1989. For the past two years I’ve been Chair of the
UK TeX Users Group, and have recently been re-elected for another
two years.

The past three years have seen UK TUG come out of a long period of
inactivity and decline. The credit for this of course belongs to the
Committee and the members, and not simply myself. We’ve organised
three successful meetings, adopted a new constitution, and set up a
website with links to UK TeX resources.

As a board member I would bring to TUG a focus on a key core
community, namely those who write material with lots of mathematics.
I have a particular interest in providing help and support,
particularly through web pages.

TUG, by virtue of TeX being a typesetting program, rightly has a
focus on print media. But to flourish we must also use new media
effectively. The Open University faces the same challenge, and my
experience there will help TUG.

TUG has a special responsibility, to publicise TeX and related
fonts, programs, documentation and other resources.

I’d like TUG to offer more to institutional members. In particular,
we should help them share user support experience and resources.
Supporting TeX can be daunting without outside help.

When I joined TUG there were over 150 institutional members. There are
now just 27. The loss I feel the most is the Library of Congress.

Implementing super in JavaScript Sunday, Sep 21 2008 

The problem

JavaScript has objects and what is called prototypal inheritance, but it does not have built-in support for many features provided by other languages. In particular, it does not have built-in support for classes and instances. Nor does it have built-in support for methods of one class to call super-class methods.

Here is an example. Class C is a subclass of class B, and both have an init method. We would like the init method of Class C to be able to call the init method of class B. In other words, when writing init for class C, we wish to call the super-class init method. Note that class B might in fact be a subclass of class A, and that B might inherit init from A, and not have an init method of its own.

This post of focussed in the single topic of providing access to super-class. It does not for instance cover how to provide support for class hierarchies and how to manage instance creation.

Motivation

Over the past few days I’ve been trying to understand John Resig‘s post on Simple JavaScript Inheritance, on both the technical and the practical levels. John’s goal was to extract the soul of the implementations of classical inheritance in base2 and Prototype, and to present them as a stand-alone package.

Well, I’ve not succeeded, but I do understand the problem better. In particular, I couldn’t get a clear understanding of what his _super method did. So to help me understand I set out to write my own. And this is what I came up with.

I hope in a later post to compare the two approaches. Be warned that this post is unavoidable quite technical, and that if you’re a JavaScript novice you’ll learn a lot if you manage to understand it all.

(more…)

Data objects in JavaScript Saturday, Sep 20 2008 

The Problem

Suppose we want to count the words in a document, or the identifiers in a computer program. We’ll need to keep a dictionary (aka hash or mapping) whose keys are the words and whose values are their frequencies. When we come across a new word (or identifier) we add it to the dictionary as a key, with value equal to one. When we meet a word already in the dictionary, we increase the value by one.

The starting point, of course, is an empty dictionary (or mapping or hash or whatever you want to call it). In JavaScript creating one of these requires some thought, and seems not to have been done before. Here’s the problem. In JavaScript we have to store the data (key-value pairs) in an object, and every object comes with some builtin methods. Here’s some command-line JavaScript:

js> data = {};  // Create empty data object, we hope.
js> data.foo === undefined; // true
js> data['foo'] === undefined;  // true
js> data['constructor'] === undefined; // false - not what we want.

(more…)

Next Page »