Saturday, January 29, 2011

firefox4 and mathml - firefox needs font

MathML is a great idea and, in my opinion, offers the possibility for a 'light' way of achieving mathematics rendering on smartphones and netbooks.

To render Mathematics should we require javascript or some ajax plugin/component? The whole point of html5 is to create a web experience that requires *fewer* plugins, and MathML can play it's part here.


What does MathML look like?


...provided you have the full MathML font support installed on your computer!

It is not enough to just install Firefox and expect every MathML site to work.

Mozilla Firefox does an excellent job of bringing down (in 15MB) a full browsing experience suitable for a mid-range user. Yes it will browse regular html, yes it will browse open media. It has a great javascript engine.

What it does not [ necessarily ] cater for, straight from the box, is some 'power users'. If your type of typical web browsing is niche or specialist, then you might have to do a little work yourself, to help Firefox meet your 'power' needs.


How much mathematics do you browse?
  • Hardly ever
  • Once in a while
  • Several times a week
The answer for most users might well be 'Hardly ever', however if you view mathematics more regularly, then you will want full MathML support on your computer, and here is how.

For GNU/Linux you will likely search in your package manager for mathml, and ttf and lyx and otf and stix, or in convenient command line:

apt-get install xfonts-mathml ttf-lyx otf-stix

[ Non debian (and derivatives) might look for similar in yum or whatever auto tool is available ]

Taken together the three packages xfonts-mathml ttf-lyx otf-stix enable your computer to render a large amount of technical / mathematical text.

Here is a list of what ttf-lyx brings:
  • cmex10 - Computer Modern math extension
  • cmmi10 - Computer Modern math italic
  • cmr10 - Computer Modern Roman
  • cmsy10 - Computer Modern math symbols
  • esint10 - Alternate integrals
  • eufm10 - Euler Fraktur (medium-weight)
  • msam10 - Extra math symbols, first series
  • msbm10 - Extra math symbols, second series, including Blackboard Bold
  • wasy10 - Waldi symbol fonts
Those lyx files come down as .ttf, by contrast the stix files come down as .otf as shown here.

The Debian page for xfonts-mathml is quite instructive here:
You will also need to install the packages: otf-stix (STIX fonts) and ttf-lyx (TeX's Computer Modern fonts) to view MathML properly.
For other operating systems, you will need to find equivalent fonts, and should certainly know a little about where (on your system) to install .ttf and .otf files.


Smartphones and netbooks - power and bandwidth considerations:

What MathML offers for smartphones and netbooks is an efficient 'markup based' way of rendering.

This has the advantage of using less power and bandwidth, as compared with an iteration heavy protocol such as ajax.

( Ajax also requires a powerful and stable javascript engine, which sort of limits choice in those low power environments. )

My personal preference would be for all mathematics to be viewable on mid-range phones in developing countries. After all why limit the knowledge of mathematics to just high end smartphones in the Western world?

Hopefully in 2011 and 2012, a range of mid-range MeeGo phones will have support for MathML font addition to the standard browser.


But how do I create the markup myself?:

Firstly let me state that MathML is not aiming to be a wild 'data interchange' format. It concentrates on presentation, and does it rather well (as the image at the start of this article shows)

It is not necessarily 'concise' or 'compact' which is why using an editing tool that generates MathML output for you, is a good idea.


latex2html for those whose native tongue is Tex (Latex)

There are other editors that do similar tasks also.

If you are a web developer who knows a bit of html, then coming to MathML should give you a somewhat familiar markup feel, but you will probably tire quickly of writing all the markup.

( Latex if you are on a project which requires months worth of Mathematics in web documents, perhaps Lyx if you are on a small project. )


Links and Further reading:

Tuesday, January 18, 2011

c, python, go, vala, mono - what go has to offer

If you are on a Debian / Ubuntu system and just want to write a very short go program [ to experiment with syntax ] then:
  apt-get install gccgo

If you are on a Debian / Ubuntu system and want to test out programs that conform to Go 1.0 then:
  apt-get install golang-go

If you are writing more involved programs and have already mastered basic Go syntax, then Debian 8 (jessie) has Go 1.3 available

You can always download a source package from golang.org directly also

If you want to experiment without doing any of the above then you can write and execute Go code directly at play.golang.org

If you came here looking to install Docker, then you should know that docker requires Go 1.1 or newer, however pre-rolled packages for Docker are available and do not require a separate local install of Go.
  apt-get install lxc-docker

( lxc-docker is available once you have added docker own deb repository )

Now back to the article ...

The ordering in the article title was deliberate, and represents how I feel personally about those languages, based on a cursory look at the licensing and patent situation for each.

Here is a patent statement about Go which is a recent language from Google:


So how does go compare in syntax with the other languages?

Here i show a variable definition as this can be a useful first guess as to how high or low level the language is:

var a uint64 = 1;

a := uint64(1);

Focusing on the first form, this looks to be say 'who then what' rather than the C order which would be more like 'what then who'

Go is not designed for people who are entirely happy using ANSI C, if you were entirely happy, then there would be no reason to hanker after constructs from other languages (Cython, Python, C++, whatever).

Go is braces friendly, and semicolon warm:

If you hate braces, then you are probably not a Java or C# coder, and Go will not interest you either.

I say semicolon 'warm'. Here are the words from the Go site:
You might have noticed that our program has no semicolons. In Go code, the only place you typically see semicolons is separating the clauses of for loops and the like; they are not necessary after every statement.
In fact, what happens is that the formal language uses semicolons, much as in C or Java, but they are inserted automatically at the end of every line that looks like the end of a statement. You don't need to type them yourself.
Seems that the language does use semicolons, but providing you use braces as intended, then you can leave it to the language to insert them for you. Yey \o/

Here is that said in Wikipedia words:
automatic semicolon insertion feature requires that opening braces not be placed on their own lines

So I began with a point about the patent situation for Go...
now what about the license?

Go has a BSD style license and you can find the text here:
   http://code.google.com/p/go/source/browse/LICENSE

Now here is the question I always ask:- Are Debian, FSF*, and Red Hat happy to package / distribute the go binaries provided by Google?

(*In the case of the FSF it is more likely that they will be approached for comment or give an opinion rather than necessarily acting as distributor)

Well there has been some work to add Go compilation to gcc, which compiling from source would have you typing:
--enable-languages=c,c++,go

or just maybe install gccgo direct from your repository ... here for Debian.

Here is where things are with Red Hat / Fedora ... some clarification is required before Go is packaged as an rpm.

( I will not play the game of Debian versus Red Hat in terms of approval, I value both opinions in conjunction with the fsf, in order to feel that others with more experience have okayed the thing. There was a time for me when Debian's say so was the key indicator of such things, but with go-oo.org code and mono in debian, I prefer multiple checks these days )


So where does that leave me in regard to 'Go', and will I learn to program in that language?

Having spent the last few months hopping between C and Python, and checked the patent and license situation, Go / Rest / Nimbus are languages I may never need now that Asyncio is part of Python3 standard library.
  https://mail.python.org/pipermail/python-dev/2013-November/130419.html

Above Go in my list of languages/frameworks to learn would be Cython and Django, by which time, Go may have moved up into the top 20 of Dr Dobbs / PyPL popularity lists.

Monday, January 17, 2011

religion versus consumerism - state usefulness

This article was inspired by some observations about the 'shopping experience' and it's ability to turn off critical thinking.

This is not an anti-John Lewis article, they merely provide the example, and a handy term 'Johnlewisitis' which I introduce.

Johnlewisitis:

Where an individual is so overwhelmed by the lovely shopping experience, that they switch off all critical thinking about shopping choices.

The above condition (does it really exist?) is usually short lived and rarely fatal.

(Patients who are near the tipping point of debt versus income, should however visit a financial adviser, especially if first encounter is around christmas, when resistance to infection is usually lowered.)

Symptoms:
  • Electrical items are suddenly new and brilliant. They don't just have TV sets, they have *TV sets*, etc.
  • MyPreviousShop* has become a dirty word, even though the products that it sells are just as good as they were when you favoured them last year.
  • Having words written on a 'nice' display gives them more power, and just makes them more believable. 
  • If John Lewis do not stock it, it cannot be any good.
Please replace *MyPreviousShop with wherever you used to shop last year, before the recent change.

The last point is the worst example of a suspension of critical thinking. John Lewis are a 'premium' shop. By premium, I do not mean to suggest that what they stock is necessarily always the best quality.
The shop is 'premium' in that it stocks only 'high margin' goods. If the markup is not 'premium', then it will not get through the door.

On a personal level, when I visit a high street, it is to exercise choice amongst a range of goods and retailers. My desire is not to have a corporate buyer filter that choice and effectively shrink the high street to just a single shop.

In order to make the next point, I introduce a little known fact.
Electrical retailers in the UK in final quarter 2010 and first quarter 2011 have televisions which are halfHD
halfHD:
Where the screen can do full 1080p, but the inbuilt receiver cannot decode HD television channels.

How can I tell if my freeview TV is halfHD? If it does not have a logo with the words "Freeview HD" in that order, then it cannot decode BBC HD or ITV HD channels.

Admittedly the term halfHD is a bit harsh if your TV is used mainly as an output for gaming consoles, or bluray player, which probably will make use of the extra on screen pixels you paid for by buying a 'HD' set.

Returning to the Electrical Retailers and their position...a shop full of TV technology which was engineered before the demand for BBC HD and ITV HD was significant.

So what to do? Well those TV sets cannot be just thrown in a skip, they have to be sold.
Solution: Be a bit coy about the new fangled 'Freeview HD' thing, at least until we have cleared the old stock (by April 2011), then we can wheel in giant mansized displays for the new 'Freeview HD' branding, and sell loads more stuff.


Here is an extract from the John Lewis website today entitled
"So where does this leave me":
So the term HD Ready concerns the abilities of your TV to display high-definition pictures, as opposed to receiving HD transmissions.
Now to be fair that article (John Lewis magazine/online) entitled "Instant expert - HD & Freeview update" is a fair representation of the current situation by my quick skim reading.

I am not a John Lewis shopper, so have no idea whether the magazine is available near the TV sales area, you might know more.


Consumerism and why it will not go away:

  • It has entered language (a fair sign that it will be around for a while)
    "Retail therapy" anyone?
  • Popular fiction books are written about it
  • Fiscal policy depends upon it.
This last point is the kicker really. Western governments have become more and more focused on 'the housing market' and 'the high street' as drivers of their economy.
When a government moves away from focusing on manufacturing/services/exports to such an extent, then there is something seriously wrong.
Was the global economic crisis caused by this lack of attention on manufacturing/services/exports, in favour of, what in the end, turned almost into a Ponzi scheme?

My feeling is that the housing market did end up becoming a Ponzi Scheme, as the inflationary pressure that was allowed to build, could only be sustained by a constant stream of 'new entrants'.
However rises in cost of living generally, and the long overdue limits on personal debt, depleted this pool of 'new entrants'

Personal debt, admittedly, was a problem in it's own right. However western governments were loath to address it as sales tax/vat receipts would fall if consumer spending was discouraged.

At one point 'the housing market' and 'the high street' took on almost mystical properties, as if those factors were some Jet Stream without which the business climate would fail.

One of the benefits of the rebalancing of property prices and the temporary reigning in of high street overindulgence, has been that governments (Ireland and UK included) have refocused back on the real long term economic drivers.

This does not mean that consumerism has been detached from Fiscal policy, far from it.
Whilst sales tax/VAT provide a useful tool to boost treasury receipts, governments will happily watch consumerism on it's way.

In short it is useful to the state.

Although I am not religious, I do appreciate living in a country that allows multiple religions, and here is why.

When a state mandates a religion, and furthermore bans other religions, then that religion will almost certainly become politicised by the state.

A politicised religion is something that I have never experienced thankfully, but I do think it would be a powerful force, which, as a youngster I would have been very challenged to resist.

I have little problem resisting Consumerism in it's present form. It does involve 'regular rejection' of Consumerist messages, a task made easier by staying away from TV adverts where practical.


Links, Notes, and Further reading:
One of the challenges for the newly partitioned Sudan will be that suddenly each 'half' will have just one main religion.
How can these newly partitioned states be secular? when there is (i) religion (ii) only one religion (iii) strong intertwining of religion and law

Just in case of a joker comment, let me state that 'Consumerism is not the answer'


How can you talk about consumerism and include adverts in your post? Those adverts are relevant to the subject and break up the text somewhat. In other posts I tend to use screenshots to break up large chunks of text, but this is a different sort of post.

Monday, January 3, 2011

LibreOffice and 'variant' OpenOffice writing formats

In truth, I know very little about LibreOffice as it is a new project, with new sign on, and has yet to decide it's own goals and morals.

What I would like of LibreOffice is a non-Oracle managed, truly free office suite.

I feel that instead I will be disappointed, however, that is probably my faulty expectation, which already is likely out of step with the project.

Reading the LibreOffice 'ooxml writing' discussions last night was useful, I learned something that raised some questions for me.

Seems that it is the go-oo.org version of OpenOffice that is now in debian (with ooxml write capability).
Did this happen just because somebody complained about the 'Oracle' logo on startup screen? I do not know.

What I do know is the result: Now that go-oo.org variant is in Debian, this fact is now being used by some, as argument for ooxml writing to be included in the default install for LibreOffice (argument not won quite yet).

LibreOffice has Google and Canonical ?financial? backing, and whilst I like some of what Google does, I do not forget that they are a huge corporation with billion dollar revenue. Compatibility is utmost probably in what both Canonical and Google want, and software freedom, probably lists somewhere lower down.

In the last couple of months there have been two mistakes I think:
  (1) Debian project being so eager to pull code from go-oo.org, without considering that in providing ooxml writing code by default, the project has made a choice on behalf of users.
  (2) My expecting LibreOffice to be more resistant to taint than existing free office projects.

If debian can have an emacs23-nox and a full fat emacs23, can it not simply have openoffice.org-dfsg and openoffice.org-odf-ooxml, with the later including provisional ooxml writing support?
In my opinion this would be much more convenient than having a user fiddle with xcu/xcs config files.

Should the existing debian packages be renamed go-oo.org rather than openoffice.org, seems that it might be a more appropriate name.

*go-oo.org contact email is kendy at novell.com and here is an extract from the main page
Go-oo has built in OpenXML import filters and it will import your Microsoft Works files. Compared with up-stream OO.o, it has better Microsoft binary file support (with eg. fields support)

Back to LibreOffice and it's goals, this message seems to read like a manifesto:
    http://listarchives.documentfoundation.org/www/discuss/msg03870.html
I can find no repeat of these goals as a list of objectives on documentfoundation.org
Is Italo solely responsible for setting goals for tdf, probably not. Was he shooting from the hip in an attempt to curtail a monster thread ... possibly.

The difficulties with what choices to make regarding writing ooxml output are highlighted in this message:
     http://listarchives.documentfoundation.org/www/discuss/msg03880.html
and I repeat an extract below:

"It leaves Libre Office with three choices when it comes to these
formats. It can either:-

1. Write in the format as used by Microsoft.
2. Write in the format as specified in the ISO standard.
3. Refuse to write in the new formats at all."

The above are exactly that - choices. To just say "want docx" without being aware of the choices involved, is something you might excuse a child of doing.
However adult computer users cannot sidestep responsibility for those choices.

Having written on a pretty dry subject I include a funny (or despairing?) extract from slashdot:
Fool me 48 times, shame on you, fool me the 49th... Shit! You did it again!
But you won't fool me 50 times. I'm sure you wouldn't do that.