Skip to content →

Tag: wordpress

top iTouch hacks

So, you did jailbreak your iTouch and did install some fun or useful stuff via the Install.app … but then, suddenly, the next program on your wish-list fails to install ??!! I know you hate to do drastic things to your iTouch, but sooner or later you’ll have to do it, so why not NOW?

Move the Applications Folder

The problem is that there are two disk partitions (a small one, meant only to host the apple-software and a large one to contain all your music, videos and stuff) and Install.app installs programs in the /Apllications folder on the smaller partition. So, we want to move it to the other partition using a symbolic link trick (as in the wiki-hack post). Here a walkthrough, more details can be found on Koos Kasper’s site.

  • Have BSDsubsystem and OpenSSH installed, so that you can ssh into the iTouch.
  • verify that the second line of the /etc/fstab file reads as below (or edit it if necessary, in my case it was already ok, perhaps this is done during jailbreak?) and reboot the iTouch (if you had to change it)

/dev/disk0s2 /private/var hfs rw 0 2

  • ssh into the iTouch and type in the following commands (to move the folder and make the symbolic link)

cd /
cp -pr Applications /var/root
mv Applications Applications.old
ln -s private/var/root/Applications /Applications

  • reboot the iTouch, ssh into it and remove the old Application-folder to free space

cd /
rm -rf Applications.old

From now on, all (most) new programs are installed on the larger partition. If you reinstall the OpenSSH application (as suggested) make sure to remove on your computer the old key for iTouch.

Stream your Music!

I use the iTouch to read my mail, to read RSS feeds, to administer this blog, to VNC to the home-server and when needed to ssh into the computer at work (running this blog) to restart the apache server. Unless I have to write a lot, there is no need to fire up a computer… But, when someone has a Mac running, I would like to be able to stream the music on my iTouch to hear it loudly. Here’s the procedure, via Rupert Gee’s blog :

  • Have the Auto-Lock set to “Never” in Settings/General
  • Install the UIctl applications (under Utilities)
  • Add a source to Install.app (click on Sources-button lower-right, Edit upper-right and then Add upper-left) http://home.mike.tl/iphone
  • Relaunch Install.app and install FireFlyMediaServer (under Multimedia).
  • Write down the address given during installation to change your password and monitor the Firefly-server (the default root password is ‘dottie’ and so the address should be

http://root:dottie@127.0.0.1:3689

  • Open up UIctl and scoll down to a line saying “org.fireflymediaserver.mt-daapd” and tap on it. Tap on “load-w” and then on “Do It”
  • Now, at the Mac your iTouch should be vusible under Shared in iTunes, click on it and give the password and your music is available!

2 Comments

first things first : jailbreak

You may have surmised it from reading this post : Santa brought me an iPod Touch! (( or rather : Santa brought PD2 an iTouch and knowing his jealous nature ordered one for him as well… )) Ive used an iPodClassic to transfer huge files between home (MacBook) and office (iMac) as well as for backup purposes. I wanted to find out what new tricks this trio could play now that iPod can go online. Major disillusion : one cannot even enable DiskUse via iTunes at the moment. (( rumours are that Apple will enable DiskUse in firmware 1.1.3, coming up next februari… )) What’s wrong with Apple? They make this marvelous piece of technology and then do a Golem-act preventing anyone else from using their precious thing. I understand their business plan, but soon it will make more sense to buy Apple shares than to buy their computers…

Enters the 13-year old AriX writing iJailbreak to free the iTouch. So, before you put any music or video on your pod (( and frankly there’s not much else Apple allows you to put on it )), dare to void the guarantee and risk your new gadget being bricked (( but, if I can pull if off you certainly can.. )) by Jailbreaking it! There are plenty of good guides around, both for Windows and Mac, but most of them can be slightly improved. I’ve followed Let’s Jailbreak the iPod touch 1.1.2 with OS X but shortened his downgrade to 1.1.1 procedure which is the first (and hardest) step in the whole procedure. The moment PD2 will see I can use Maps and Weather she’ll want me to jailbreak her iTouch too, so mainly for myself I list here the procedure before I forget it.

Jailbreak 1.1.2 with Leopard on Intel, use at your own risk.

Get a decent browser such as Firefox or Flock (to prevent the download to selfexpand, so when given the choice to open it with iTunes or save it to Disk, save!) and download Firmware1.1.1 and place it somewhere (why not create a Folder called Jailbreak).

Connect your iTouch and fire up iTunes and select your iTouch in the left column. Hold down the option key and click in the summary pane the Check for Update button. This will open a Finder window allowing you to navigate to the downloaded file and open it. The iTouch will downgrade itself to 1.1.1. Just wait until it reappears in iTunes and disconnect it.

With Safari on the iTouch go to jailbreakme.com and scroll to the bottom and click on the InstallAppSnap button. Let it do its magic and afterwards there is a new Installer-icon on your ‘springboard’ (the opening iTouch page). Open it and refrain from installing all the goodies now, just scroll down to Tweaks (1.1.1) open and select “OktoPrep” and install it (button top right-hand corner).

Connect iTouch to mac, start iTunes and select your iTouch. Click on the update button and now iTunes will bring you back to Firmware 1.1.2. After finishing wait until your iPod reappears in the left column. (Do not panic if you fail to see the Installer-icon on springboard, it will reappear later on). Then, close iTunes (your iPod stays connected via USB to the Mac). Use any browser on your mac to download Jailbreak 1.1.2 and place it somewhere.

Find the Java-applet jailbreak.jar in the folder and double click it. Again, magical things are happening ending with the iTouch booting up several times and you performed the Jailbreak.

Let’s open up the iTouch to the world

So, what was the point of all this? We still have no DiskUse enabled nor can we speak to the iTouch directly. But all of this is going to change rapidly. Let’s make it available to our DeskTop.

With “install package xxx” I will mean : fire up Installer from your springboard, donate as quickly as you can to the guys making this available, then click on the “install” icon lower-left. This will open up lists of packages, scroll down to package xxx, click on it to read more about it, and then hit the “install” button top-right. That’s it. (If you ever want to unistall a package, do the same process now starting from the “uninstall” icon lower-right).

Install first BSD Subsystem (under System packages) and the AFPd (under Network). This will turn your iTouch into an AFP-server. By clicking on its icon in the Springboard you can turn the server on and off (remember to turn it off when not needed!) and turn on Broadcast if you want the iTouch to show up on your Desktop (in the Leopard-Finder under ‘Shared’). You can now connect to the iTouch by clicking on its icon in the Finder and hitting connect. The default user/password combination for a Jailbroken iTouch are
root/alpine. Change this as soon as you figure out how to do it. ‘Alpine’ must be the most popular password right now… The AFPd-page also contains the Wi-Fi IP Address of the iTouch and you will need it soon, so write it down.

For we are going to connect via ssh and sftp to and from iTouch/Mac. Install the OpenSSH package (under System) and the Term-vt100 package (also under System). From the Mac to iTouch you can connect via something like

ssh root@10.0.1.197

(change the number to the IP-Address of the iTouch) and login with the alpine password. You’re in! Conversely, open up the Term-vt100 icon in the springboard which give you a genuine *nix-Terminal. You can connect via ssh to your mac provided you know its IP and your login. That’s all.

Btw. you can also use your favourite file-transport program (mine is Transmit to connect to and from your iTouch via SFTP. Right, now that the iTouch is under control we might as well give it a voice of his/her own.

Install Apache (under System) and PHP (under Development) and follow the instructions from the iTouch Fans Forum (you will need to register, but if you’re not an iTouch-fan there’s little point in you reading this post anyway) and you will have turned your iTouch into a PHP-enabled webserver! On the left is a screenshot of the proof via the php-info testpage.

Finally, we can turn the world upside down completely. Before all of this we had no way to get control of the iTouch, now we can use the iTouch to take control of all our Macs serving VNC (Leopard comes with it, enable the password in System Preferences/Sharing/Screen Sharing/Computer Settings and you’re under iTouch control). To pull this off, just install the VNsea package (under Network). It really works well!

Oh, you’re only here to install the iPhone Apps…

Well, that’s easy enough. Just follow the instructions of the Install and use iPhone Apps in iPod touch from the excellent blog by Rupert Gee. The most difficult part is to get hold of the iPhone Apps if you don’t own an iPhone… Well, I’m happy to provide you with this secret information

Leave a Comment

NeB on Leopard and iPhone

If you have an iPhone or iPod Touch and point your Safari browser to this blog you can now view it in optimised format, thanks to the iWPhone WordPress Plugin and Theme. I’ve only changed the CSS slightly to have the same greeny look-and-feel of the current redoable theme.

Upgrading a WordPress-blog running under Tiger (Mac OS 10.4) to Leopard produces a few anxiety moments. All of the standard tools (Apache, PHP and MySQL) seem no longer to work as before. For those of you who do not want to waste too much time over it, I’ll walk through the process.

After upgrading to Leopard you want to check whether your blog is still alive, so you fire up Safari and will be greeted by the message that Safari cannot find your server. Sure enough you forgot to start the WebServer in SystemPreferences/Sharing/Web Sharing. Having fixed this you will see the default Apache-screen because Leopard put these default-files in your webserver-root directory (/Library/WebServer/Documents). In case you installed your blog under a user account you will get a message that you enter forbidden territory, see below for the solution to that problem. Having removed all those index.html files (making sure NOT to delete the index.php of your blog) a more serious problem presents itself : you see the text-version of index.php meaning that PHP isnt working. You check the /etc/httpd/httpd.conf file and it still contains all the changes you made to it to get PHP running under Tiger, so what is going on?

Googling for something like ‘enabling PHP under Leopard’ you’ll discover that the configuration file used by the webserver is in a different location. It now resides at /private/etc/apache2/httpd.conf. You will have to remove the hash sign (#) at the beginning of line 114 so that it reads

LoadModule php5_module libexec/apache2/libphp5.so

Next, you have to create a php.ini file and change one line. The first thing is settled by the following Terminal-commands

cd /private/etc
sudo cp php.ini.default php.ini

and in the php.ini you have to modify line 305 so that it becomes (removing the latter part of the line)

error_reporting = E_ALL

Restarting the webserver enables PHP. If you need more details check out the article Enabling PHP and Apache in Leopard. However, you are not quite done yet. Your blog will now show the WordPress-page that something is wrong with your mysql-database. However, mysql seems to be running fine as you can check from the Terminal so PHP cannot find it.

To remedy this, you have to add the locations (after the = sign) in the follwing two lines of the php.ini file

mysql.default_socket = /private/tmp/mysql.sock
mysqli.default_socket = /private/tmp/mysql.sock

Restarting the webserver should resolve the problem. But then your blog can still choke on old PHP-code in one of the plugins you use. In my case I was using an ancient version of the PHP-Markdown plugin but after replacing it with the newest version NeB looked just like I left it with Tiger…

A final point : webpages stored in personal Sites-folders cannot be served by Apache2 and will produce a message that you have not enough privileges to view the page. To resolve this, type the following command from the Terminal

sudo cp /private/etc/httpd/users/*.conf /private/etc/Apache2/users

2 Comments

the unbearable lightness … (2)

Two brand new math-related blogs on which you can test my survival prediction :

The EMS Committee on Women and Mathematics Weblog “has the purpose to work as a fact-finding unit exposing the problems and supporting the recognition of achievements of women in mathematics. It is directed to take such actions as it deems appropriate to encourage more women to study mathematics at school level, at university level, and at research level, and to support women mathematicians in the academic positions.”

Timothy Gowers now has a blog called Gowers’s webblog and will no doubt soon change his default about page

Gowers’s post What might an expository mathematical wiki be like? addresses the ongoing discussion (mainly at the n-category cafe and the secret blogging seminar ) of the (dis)advantages of a wiki over a blog to communicate mathematics.

I think a wiki is way better at this, but it is also more problematic to maintain (for example, memory-wise). But then, there is the obvious solution : join Wikipedia! Probably it is a much better time-investment to set-up/modify/update a math-related wikipedia page than to use the volatile blog-format when it comes to explaining mathematics…

I admit, Ive never done this myself but instead spend (too much) time trying to blog about math I like. By chance, I found this sci.math thread on my previous tertra-lattices post, showing the futility of it all. If only these guys would have left a comment then I might have explained it better.

Since then, Im in a sort of a bloggers’ block.

3 Comments

the unbearable lightness of math-blogging

Back from vacation and wanting to know what I’ve missed. Not much, it seems. Hence this rant.
Sit back and relax, I appreciate all hard work done by the few math-bloggers around entertaining thousands of math-lurkers wordwide. Still, I cannot refrain from adding this version of Carly Simon‘s refrein :

“You’re so vain, you probably think this post is about you
You’re so vain, I’ll bet you think this post is about you
Don’t you? Don’t you?”

Let’s start on a positive note. Here is the math-blogpost that touched me most this vacation. But then I’m (old) European, Ive been to their place and even know where they’ve taken their picture, so I’m a big fan of Vivatsgasse 7.

One Comment

Hexagonal Moonshine (3)

Hexagons keep on popping up in the representation theory of the modular group and its close associates. We have seen before that singularities in 2-dimensional representation varieties of the three string braid group $B_3 $ are ‘clanned together’ in hexagons and last time Ive mentioned (in passing) that the representation theory of the modular group is controlled by the double quiver of the extended Dynkin diagram $\tilde{A_5} $, which is an hexagon…

Today we’re off to find representations of the extended modular group $\tilde{\Gamma} = PGL_2(\mathbb{Z}) $, which is obtained by adding to the modular group (see this post for a proof of generation)

$\Gamma = \langle U=\begin{bmatrix} 0 & -1 \\\ 1 & 0 \end{bmatrix},V=\begin{bmatrix} 0 & 1 \\\ -1 & 1 \end{bmatrix} \rangle $ the matrix $R=\begin{bmatrix} 0 & 1 \\\ 1 & 0 \end{bmatrix} $

In terms of generators and relations, one easily verfifies that

$\tilde{\Gamma} = \langle~U,V,R~|~U^2=R^2=V^3=(RU)^2=(RV)^2=1~\rangle $

and therefore $\tilde{\Gamma} $ is the amalgamated free product of the dihedral groups $D_2 $ and $D_3 $ over their common subgroup $C_2 = \langle~R~\rangle $, that is

$\tilde{\Gamma} = \langle U,R | U^2=R^2=(RU)^2=1 \rangle \ast_{\langle R | R^2=1 \rangle} \langle V,R | V^3=R^2=(RV)^2=1 \rangle = D_2 \ast_{C_2} D_3 $

From this description it is easy to find all n-dimensional $\tilde{\Gamma} $-representations $V $ and relate them to quiver-representations. $D_2 = C_2 \times C_2 $ and hence has 4 1-dimensonal simples $S_1,S_2,S_3,S_4 $. Restricting $V\downarrow_{D_2} $ to the subgroup $D_2 $ it decomposes as

$V \downarrow_{D_2} \simeq S_1^{\oplus a_1} \oplus S_2^{\oplus a_2} \oplus S_3^{\oplus a_3} \oplus S_4^{\oplus a_4} $ with $a_1+a_2+a_3+a_4=n $

Similarly, because $D_3=S_3 $ has two one-dimensional representations $T,S $ (the trivial and the sign representation) and one simple 2-dimensional representation $W $, restricting $V $ to this subgroup gives a decomposition

$V \downarrow_{D_3} \simeq T^{b_1} \oplus S^{\oplus b_2} \oplus W^{\oplus b_3} $, this time with $b_1+b_2+2b_3=n $

Restricting both decompositions further down to the common subgroup $C_2 $ one obtains a $C_2 $-isomorphism $V \downarrow_{D_2} \rightarrow^{\phi} V \downarrow_{D_3} $ which implies also that the above numbers must be chosen such that $a_1+a_3=b_1+b_3 $ and $a_2+a_4=b_2+b_3 $. We can summarize all this info about $V $ in a representation of the quiver

Here, the vertex spaces on the left are the iso-typical factors of $V \downarrow_{D_2} $ and those on the right those of $V \downarrow_{D_3} $ and the arrows give the block-components of the $C_2 $-isomorphism $\phi $. The nice things is that one can also reverse this process to get all $\tilde{\Gamma} $-representations from $\theta $-semistable representations of this quiver (having the additional condition that the square matrix made of the arrows is invertible) and isomorphisms of group-representation correspond to those of quiver-representations!

This proves that for all n the varieties of n-dimensional representations $\mathbf{rep}_n~\tilde{\Gamma} $ are smooth (but have several components corresponding to the different dimension vectors $~(a_1,a_2,a_3,a_4;b_1,b_2,b_3) $ such that $\sum a_i = n = b_1+b_2+2b_3 $.

The basic principle of _M-geometry_ is that a lot of the representation theory follows from the ‘clan’ (see this post) determined by the simples of smallest dimensions. In the case of the extended modular group $\tilde{\Gamma} $ it follows that there are exactly 4 one-dimensional simples and exactly 4 2-dimensional simples, corresponding to the dimension vectors

$\begin{cases} a=(0,0,0,1;0,1,0) \\\ b=(0,1,0,0;0,1,0) \\\ c=(1,0,0,0;1,0,0) \\\ d=(0,0,1,0;1,0,0) \end{cases} $ resp. $\begin{cases} e=(0,1,1,0;0,0,1) \\\ f=(1,0,0,1;0,0,1) \\\ g=(0,0,1,1;0,0,1) \\\ h=(1,1,0,0;0,0,1) \end{cases} $

If one calculates the ‘clan’ of these 8 simples one obtains the double quiver of the graph on the left. Note that a and b appear twice, so one should glue the left and right hand sides together as a Moebius-strip. That is, the clan determining the representation theory of the extended modular group is a Moebius strip made of two hexagons!

However, one should not focuss too much on the hexagons (that is, the extended Dynkin diagram $\tilde{A_5} $) here. The two ‘backbones’ (e–f and g–h) have their vertices corresponding to 2-dimensional simples whereas the topand bottom vertices correspond to one-dimensional simples. Hence, the correct way to look at this clan is as two copies of the double quiver of the extended Dynkin diagram $\tilde{D_5} $ glued over their leaf vertices to form a Moebius strip. Remark that the components of the sotropic root of $\tilde{D_5} $ give the dimensions of the corresponding $\tilde{\Gamma} $ simples.

The remarkable ubiquity of (extended) Dynkins never ceases to amaze!

One Comment

group think

The
moment I read about it, I ordered the book, but received at least three
emails from Amazon.co.uk apologizing for not being able to find me a
copy of Lee Smolin’s The trouble with physics.
A very
considerate review of the book can be found at Background Independence, Christine Dantas’
old blog. Btw. I’m happy Christine has set up a new blog called
Theorema Egregium. Here’s the section
in her review that convinced me to have a look at the book myself.

I do not wish to make public some of my old, deep own
feelings about what I think science is and how it should be conducted.
There are of course certain points that I often do make public, but
there are some others that tormented me for quite a long time now, and
are so personal and even of emotive nature that I would rather keep them
to myself. But this is the fact per se that should be mentioned here,
since this is the contribution that I feel I can give on examining his
book: I found out that he was addressing some of my personal views and
doubts, of course from his own perspective and wisdom, but it was like
talking to an old friend who followed my own career in science and
understood what troubled me most for all those years. So this book is
for you if you want to be challenged over your own vision of science and
how you fit in it.

Finally, after all these months, just
before going on vacation I discovered a copy in one of my favourite
bookshops in Antwerp and took it along. I dont know Christine’s
favourite chapters of the book but I feel somehow I’ll be not too far
off mark in believing that chapter 16 “How Do You Fight Sociology?” will
be among them. This chapter (just 27 pages) should be read and reread by
all scientists. In it, Lee Smolin describes community behaviour of
certain scientific groups (he has the stringtheory-community in mind but
I’m sure anyone will recognise some of its behavior in groups closer to
ones own research-interests. I certainly did…). Here we go (citing
from page 284)

1. _Tremendous self-confidence_ ,
leading to a sense of entitlement and of belonging to an elite of
experts.
2. _An unusually monolithic community_ , with a
strong sense of consensus, whether driven by evidence or not, and an
unusual uniformity of views on open questions. These views seem related
to the existence of a hierarchical structure in which ideas of a few
leaders dictate the viewpoint, strategy, and direction of the field,
3. In some cases, a _sense of identification with the group_ ,
akin to identification with a religious faith or political platform.
4. A strong sense of the _boundary between the group and other
experts_ .
5. A _disregard for and disinterest in_ the
ideas, opinions, and work of experts who are not part of the group, and
a preference for talking only with other members of the commnity.
6. A tendency to _interpret evidence optimistically_ , to believe
exaggerated or incorrect statements of results, and to disregard the
possibility that the theory might be wrong. This is coupled with a
tendency to _believe results are true because they are widely
believed’_ even if one has not checked (or even seen) the proof
oneself.
7. A lack of appreciation for the extent to which a
research program ought to involve risk.

Although spotting
such behaviour can be depressing and/or frustrating, Smolin’s analysis
is that such groups are doomed to perish sooner or later for it is
exactly the kind of behaviour sociologists and psychologists recognize
as groupthink, following the Yale psychologist Irving Janis, “a mode
of thinking that people engage in when they are deeply involved in a
cohesive in-group, when the members’ strivings for unanimity override
their motivation to realistically appraise alternative courses of
action”. Groupthink is responsable for failures of decision making by
groups of experts such as the “failure of NASA to prevent the Challenger
disaster, the failure of the West to anticipate the collapse of the
Soviet Union, the failure of the American automobile companies to
feresee the demand for smaller cars, and most recently – and perhaps
most calamitously – the Bush administration’s rush to war on the basis
of a false belief that Iraq had weapons of mass destruction.” (Smolin,
page 286). An aspect of these groupthinking science-groups that worries
me most of all is their making of exagerated claims to potential
applications, not supported (yet) by solid proof. Short-time effect may
be to attract more people to the subject and to keep doubting followers
on board, but in the long term (at least if the claimed results remain
out of reach) this will destroy the subject itself (and, sadly enough,
also closeby subjects making no outrageous claims…). My advice to
people making such claims is : do a Perelman! Rather than doing a
PR-job, devote yourself for as long as it takes to prove your hopes,
somewhere in splendid isolation and come back victoriously. I have a
spare set of keys if you are in search for the perfect location…

Leave a Comment

mathML versus LaTeXRender

No math
today. If you’re interested in the latest on noncommutative geometry,
head over to the NCG-blog where Alain Connes has a post on
Time.
Still, Alain’s post is a good illustration of what Ill be rambling about
TeX and how to use it in a blog.

If you’re running a math-blog,
sooner or later you want to say something more than new-age speak like
‘points talking to each other’ and get to the essence of it. In short,
you want to talk math and it’s a regrettable fact that math doesnt go
well with ASCII. In everyday life we found a way around this : we all
use TeX to write papers and even email-wise (among mathematicians) we
write plain TeX-commands as this language is more common to us than
English. But, plain TeX and the blogosphere don’t mix well. If you’re
expecting only professional mathematicians to read what you write, you
might as well arXiv your thoughts. Im convinced the majority of people
coming here (for whatever reason) dont speak plain-TeX. Fortunately,
there is technology to display TeX-symbols on a blog. Personally, I was
an early adapter to
LaTeXRender and even today a
fair share of page-views relates to the few
posts I did on
how to get latexrender working on a mac. Some time ago I
switched to mathML and now I’m
regretting I ever did…

Mind you, I’m convinced that mathML is the
‘proper’ way to get TeX to the internet but there are at the moment some
serious drawbacks. For starters, it is highly user-unfriendly. You
simply cannot expect people to switch browsers (as well as installing
extra fonts) just because they come to your site (or you have to be a
pretty arrogant git). Speaking for myself, Im still having (against my
better judgment) Safari as my default browser, so when I come to a site
like the n-category cafe I just
skim the plain-text in between and if (and only if) the topic interests
me tremendously I’ll allow myself to switch to Flock or Firefox to read
the post in detail. I’m convinced most of you have a similar
surfing-attitude. MathML also has serious consequences on the
server-side. If you want to serve mathML you have to emit headers which
expect everything to follow to be purified XHTML. If I ever forget a
closing tag in a post, this is enough to break down NeverEndingBooks to
all Firefox-users. I’ve been writing HTML since the times when the best
browser around was something called NCSA Mosaic so Ive a
pretty lax attitude to end-tags (especially in IMG-tags) and Im just
getting too old to change these bad habbits now… It seems I’m not the
only one. Many developers of WordPress-plugins write bad XHTML-code, so
the last couple of weeks I’ve been spending more time fixing up code
than writing posts. If you want to run a mathML-wordpress site you might
find the following hints helpfull. If you get a ‘yellow screen of
death’ when viewing your site with Firefox, chances are that one of your
plugin-authors missed a closing tag in the HTML-rendering of his/her
plugin. As a rule of thumb : go for the IMG-tags first! I’m sorry to
say, but Latexrender-Steve
is among the XHTML-offenders. (On a marginal note, LaTeXrender also has
its drawbacks : to mathematicians this may seem incredible but what
Latexrender does to get one expression displayed is to TeX an entire
file, get the image from the ps-file turn it into a gif and display it,
so one gets a GIF-folder of enrmous proportions. Hence, use Latexrender
only if you have your own server and dont have to care about memory
constraints. Another disadvantedge was that the GIFs were displayed with
a vertical offset, but this has been solved recently (use the ‘offset
beta’ files in the distribution)). Wrt. to that offset-beta version, use
this latex.php file instead (I
changed the IMG-line). Some plugins may not serve the correct headers
to display mathML. So, if you want to allow readers to have a
printer-friendly version of your mathML-post, get the WP-print plugin BUT
change to this wp-print.php file in order to
send the proper headers. Sometimes there are just forgotten lines/tags
in the code, such as in the [future calendar plugin](http://anthologyoi.com/wordpress/plugins/future-posts-calendar-
plugin.html). So, please use this version
of the future.calendar.php file. And so on, and so on. The joys of
trying to maintain a mathML-based blog… So, no surprise I’m seriously
considering to ditch mathML and change to normal headers soon. One of
the things I like about LaTeXRender is that it can be extended, meaning
that you can get your own definitions and packages loaded whereas with
mathML you’re bound to write iTeX, which Ill never manage. But, again,
mathML will be the correct technology once all major browsers are mathML
capable and the font-problem is resolved. Does anyone know whether
Safari 3 (in Leopard, that is Mac OS 10.5 to the rest of you) will be
mathML-able?

Leave a Comment

mathML and work ahead

It has
been a difficult design decision, but I’m going to replace the LaTeXRender WordPress
Plugin
for mathML as the
default TeX-interface for NeverEndingBooks. I will keep LaTeXRender on
standby as I may have to use exotic packages or commands that iTeX does
not deliver, but for most math-related posts, MathML will do the job
nicely (as the n-category
cafe
shows every day (or even more often)). Not that I stopped being
a dilettante but I’m going to do most of my writings (including
blog-posts) using Scrivener (more on this
another time) and Scrivener supports MultiMarkdown and allows exporting to LaTeX and XHTML (using MathML).

I could never have pulled this off in such a short time without Jacques Distler
more or less on constant stand-by (thanks Jacques!). Looking at the
times his emails were send I have no idea in which time zone he lives
(let alone sleeps…). So, here a walk-through the changes :

As
I’m on WP 2.0.5 I’ll start with Frederick’ post. He tells me I have to install first the itex2MML binary as
explained by
Jacques
but I find that there is more recent
material
and therefore download the most recent imath2MML-package
and follow the readme. There is a Mac OSX binary but it’s not clear
for what processor (PPC/Intel/Binary) but a quick mail to Jacques learns
me that it’s PPC which is fine by me but on the spot he puts a
universal binary online, so whatever your Mac is you can just download
the binary, copy it to /usr/local/bin and make sure its chmodded
755.

Back to Frederick’s post, download and install the plugin itexToMML.php in the usual way
(fortunately I spot just in time that I have to change one line saying
where my itex2MML binary is (in Frederick’s file it is NOT the default
location)). You can verify whether the plugin and itex2MML do what they
are supposed to do by typing a LaTeX-command in a post and save it. The
output will not produce the desired formula but have a look at the
source file and see whether there is some mathML code in it. If so,
fine! If not, go back and check everything.

If this works, it is
“merely” a problem of getting your mathML served. Frederick suggests
to unpack wordpress_mathML.zip in the wp-includes directory (but you
better make sure you have made a copy of the original class.php and
functions-formatting.php files. In the end I decided against this
approach (that is, to replace only the functions-formatting.php but NOT
the class.php file). If you have two or more themes you want to
maintain, it is probably better to change the headers (because this is
what we have to do to get mathML served) only in those themes which are
XML-sound. In my case, the Command Line Interface theme most certainly is NOT!!!).

Go to your
theme-files and look for the header.php (or similar) file and replace
the default header by the code in the addendum to
this post
within php-tags. If you can go to your blog-page then you
are in good shape and things should work well (apart possibly from
layout considerations, see below). Of course, in my case i was greeted
by ” XML “yellow screen of death” (as Jacques calls
it) and I was convinced I did something wrong, so I tried out several
useless things for a couple of hours before it dawned on me that the
reason might just be that my blog-files were not valid XHTML (and the
new headers are very demanding on serving only well-form XHTML). I had
to modify all changes I made to sidebars etc. as well as rewrite parts
of my first posts (I used to take a rather liberal view on writing
blog-posts, writing a mixture between Markdown and improvised HTML and
in the process was very lax about closing IMG-tags and the likes).
But after some time and numerous corrections to the files I got the
main-page up and running (and even had the mathML served as a readable
formula) apart from the fact that I barely recognized my own site.

I printed out source files of the page with and without changed
headers and couldn’t find a difference. So, it had to do with the
CSS-style files, but why on earth would the new headers be picky about
CSS? But as a last resort, after narrowing the search down to one
CSS-line, I asked Jacques whether he had an idea what went on. His reply
will be remembered for quite some time :

A fascinating
question. The answer is that it *is* following the CSS directive, but
in XHTML, ‘body’ is not what you think it is. ‘body’ is just big enough
to contain its content. It does not fill the viewport. ‘html’ fills the
viewport. The solution (a solution) is described in
http://golem.ph.utexas.edu/~distler/blog/archives/000203.html

Many hours later, I still haven’t got a clue what
this is all about, but I blindly followed the hint and surely all
problems vanished. In short, another day wasted in front of a
computer-screen.

At the moment I’m back to old headers and
will not be writing mathML for some time as I have the vast job ahead to
validate all my previous posts to XHTML-standards (if not you would see
more yellows screens of death than anything else. So, here’s the
strategy I’ll be taking in the weeks ahead (I’ll sleep on it tonight
so if any of you think there is a better way, reply quickly)

  • rewrite each and every post in proper MultiMarkdown using iTeX for
    the most common math and only resorting to LaTeXRender for exotic things
    (such as Sudoku, Chess, Dvonn) and run these posts through Markdown
    (to get basic HTML and all links in place).
  • download these
    files to the WP-database (so that in the CLI-interface you will be able
    to follow all links, but will read all iTeX as TeX-commands (as the
    command line intended after all).
  • in the process change all
    broken links to the default permalink-structure (with index.php?p=231 or
    so).

Clearly, this is a work that will take a couple of
weeks but it may be fun to reread these old posts and possibly add new
information about the subjects. When I’m making these changes, I’ll
use the new headers so if you are using a smart browser look out for the
yellow screens. When they happen, either use a dumb browser (such as
Safari) or go into CLI-interface mode where everything should still
work. I plan to start with the oldest posts as this seems more fun to
me.

One Comment