MathTran and TeX as a web service
This is a modal window.
The media could not be loaded, either because the server or network failed or because the format is not supported.
Formal Metadata
Title |
| |
Title of Series | ||
Part Number | 23 | |
Number of Parts | 33 | |
Author | ||
License | CC Attribution 3.0 Unported: You are free to use, adapt and copy, distribute and transmit the work or content in adapted or unchanged form for any legal purpose as long as the work is attributed to the author in the manner specified by the author or licensor. | |
Identifiers | 10.5446/30787 (DOI) | |
Publisher | ||
Release Date | ||
Language | ||
Production Place | Cork, Ireland |
Content Metadata
Subject Area | ||
Genre | ||
Abstract |
|
1
2
4
7
8
12
17
18
19
20
24
28
30
00:00
Computer-assisted translationTrailWeb browserExtension (kinesiology)Computer programmingSoftware developerMultiplication signComputing platformSign (mathematics)Web 2.0Web pageWeb serviceWebsiteIntegrated development environmentMathematicsWell-formed formulaInformationSingle-precision floating-point formatSpeciesPhysical systemLine (geometry)Instance (computer science)String (computer science)outputInformation securitySet (mathematics)CASE <Informatik>Game theoryWeightMessage passingAreaRight angleReading (process)Revision controlBitSound effectDifferent (Kate Ryan album)Metropolitan area networkMereologyComputer fileProxy serverInsertion lossParameter (computer programming)Electronic mailing listSummierbarkeitComputer virusPhase transitionNumerical analysisWordVirtual machineData structureTerm (mathematics)Type theoryCovering spaceFood energyInteractive televisionComputer fontMassStudent's t-testState of matterGroup actionProper mapInstallation artRule of inferenceReal numberArithmetic meanEndliche ModelltheorieFraktalgeometrieSequenceGame controllerPrimitive (album)Subject indexingStatement (computer science)Point (geometry)Existential quantificationBeta function1 (number)QuicksortAlpha (investment)Software frameworkDemonLaptopUniverse (mathematics)Nichtlineares GleichungssystemPresentation of a groupDivisorProof theoryGoodness of fitDialectChannel capacitySource codeMoment (mathematics)Online helpProcess (computing)Medizinische InformatikCodeLibrary (computing)Semantics (computer science)Video gameCondition numberSemiconductor memoryProjective planeBlock (periodic table)Slide ruleMacro (computer science)Complete metric spaceFormal languageAnalytic continuationSinc functionView (database)Monster groupSystem callSocial classControl flowDemo (music)Link (knot theory)Normal (geometry)Token ring2 (number)Computer programServer (computing)Digital video recorderGoogolQuery languageInterface (computing)Plug-in (computing)Information technology consultingPlastikkarteBookmark (World Wide Web)Cartesian coordinate systemLevel (video gaming)Functional (mathematics)Context awarenessOpen setProgramming languageAuthorizationException handlingError messageWeb applicationInternetworkingDistanceStreaming mediaSymbol tableBlogPlanningMaxima and minimaInternet forumPasswordGreatest elementText editorData storage deviceOpen sourceComputer animation
Transcript: English(auto-generated)
00:02
OK, so this is MathTran and Tech as a Web Service, and all the useful sites have got MathTran in their name, except, well, that's my personal blog at the bottom, erm, oh sorry, I need the internet for this talk, erm, so first of all a bit, sorry, I'm sorry,
00:25
I'm not familiar with this laptop and it's got twitchy controls as far as I'm concerned. OK, so the first thing is about the Open University, it's a pioneer of distance learning in the UK,
00:41
and has enormous numbers of students, the math courses, some of the math courses have something like two or three thousand students each presentation, two presentations a year, so you can see that over the life of courses that might be eight or ten years, there's an enormous number of people going through, and as hard as a tech expert, I've since moved my speciality a bit more to mathematical content, and for the last year,
01:07
for the last two years and for the next year, I've been working two days a week, from a number of projects related to Math on the Web, part of that has resulted in a short fall in tech skills at the Open University, so if you've got some tech skills that you'd
01:22
like to volunteer for pay, then come see me afterwards, because we are looking for those sorts of skills. Anyway, let's just go through the introduction. The web browser is now a major application platform, lots of software development going on on web browsers,
01:44
and JavaScript is the language of the web browser, I don't think many people would use it if it wasn't for that reason, and MathTran is tech typesetting as a public web service. There's going to be three asides in the talk, one is expanding all the macros, the second is
02:02
what Pythonistas want, and the third is line breaking as a web service, just to sort of link in with other things that have been going on in the conference, then we'll have some demos, the main thing here I think is the demos, and then we'll have discussion, so I'm going to race through some of the stuff so that we can get to the demos. So what do we have next?
02:22
Oh yes, so what is the MathTran web service? Well I've got a lot of the inspiration from MindTech, which is a C program that roughly speaking emulates tech, and it's used quite widely even though it doesn't have all the capabilities of tech, and Google charts is also, who's heard of MindTech? Just a few? Google charts? No? Or you should look at Google
02:51
charts, it's quite interesting, and it will validate for you the concept of a web service and show you what a web service can do and why they're important. So what you do is you encode the mathematics you want to typeset as a query string, and you make an HTTP request
03:05
to the MathTran server, and you get the typeset image back again. You don't have to install anything on your machine except a web browser. The MathTran server returns a PNG image,
03:22
which has been typeset by tech, it's been rendered by DVR-DMG, you also get the log and DVR for the typesetting, sorry there's a typo, I say the DVR twice, and you get the depth of the image which is quite important when you want to put the image on a web page. So basically
03:43
you're getting the little run of tech or one formula. Now we use a trick, I hope it's not too controversial yet now. At the top I ask tech to do nothing and it takes 0.2 of a second. I then ask tech to typeset some material and it takes 0.2 and a bit of a second.
04:07
So you see, starting up, expensive. Look at those times, it took a point, my arithmetic, it took a fiftieth of a second to do the typesetting, and a fifth of a second to start up.
04:27
So simply by removing the start-up cost you increase the speed by 10 for this example. So all users of the public MathTran server share a single long-lived instance of tech.
04:40
Tech is running on a machine over in Milton Keynes, waiting for somebody to do something, and everybody shares that instance. And that's the way we avoid having to start it up for every request. So it's very important for the performance, the tech is just waiting there.
05:03
Now, some of you might know enough to be either black hats or white hats and say, we can screw things up. So the first one is actually the worst way of screwing things up because it doesn't seem to make any change. We simply make a global change and whatever alpha
05:23
meant it now has the meaning of beta. So when somebody types and alpha equals it will show as beta. Another one is you try to typeset the password file. And a third one is you might try to use csname to get something that you couldn't, not supposed to get to. So do you see
05:42
that these are all sorts of ways of attacking the daemon? And of course the worst one is when the daemon thinks everything's fine. Well anyway, secure plane works by saving the definition, saving the meaning of def somewhere where the user can't get to it,
06:05
and then un-defining it. Have you got that Steve? You got that? He just said, now we know the secret. Well it's open source, it is open source. I wanted to offer rewards but I wasn't allowed to
06:21
because it's public money. So anyway I'm going to have to scroll this down which is going to be another miracle if I can manage it. Here we go. Okay so to get that to work, well you could write everything out longhand but I've defined a custom programming environment where def means wherever I put the real def command and backslash frack means the token
06:46
that the user can get. So on this example here the backslash frack is the user's frack command, is the control sequence frack. Whereas def without the backslash in front of it simply means the def primitive that we already know about, wherever we put it. So we take all
07:08
the primitive control sequences, move them somewhere else, scrub them out from here, so nobody can get to them unless they can get a backslash here, because they all begin with a
07:21
backslash. Then we have a custom environment that allows us to write here and write here as we please and the dirty tricks at the top don't work. Perhaps I'll show you that, I should show you that. Okay so here's the MathTrans server waiting for some input,
07:47
it's waiting for a formula, let's do it. Alpha, there it is, all the way from Milton Keynes. Right, alpha sub one, there it is, alpha sub one sub two, tach error.
08:03
Do you see we've got an error message at the bottom? Yep, can you read the line number? I can, it's 11 48. Right, let's change it, you can see the line number is now 12 33. Okay, it wasn't 11 48, now 12 33, some other people have been using it.
08:25
Right, not just me using it, let's just see how busy we are, 12 33, 5 40, it's restarted. Occasionally it has to restart, we have to work on that to make it better. Let's try again, 6 40. So people are using it as I'm talking and it's all a single instance
08:44
and if we try and do something dirty like global let alpha beta, what do we get?
09:02
We get undefined control sequences, because I told you what happened, I put them somewhere else, they're not there, so you can't get them. From somewhere else? Yeah, you have to change, you have to change the cat code of underscore and I'll make sure that only one character which
09:24
is I think null allows you to access that, so as long as the input stream doesn't contain a null it's okay. So it's very easy to filter the input stream to say oh if it contains a null in it there's something dirty going on and I'll throw it away. So I think it's secure.
09:51
Okay, so anyway, let's go back to this, sorry let's go back to here. So that's the programming
10:01
environment, people ask me do you support LaTeX? And I say well I will as soon as we have a secure version of LaTeX. LaTeX was something like 2000 lines to make secure, I could do it a couple of days. Making LaTeX secure is a bit more work. Now let's move on a bit,
10:25
I'm going to race through, next slide, oh that's backwards, forwards,
10:44
forwards, oh yes expanding users to find math, this is going to be a very quick aside but it came up, so we've got this rich programming environment and I think this is a broad interest way beyond what MathTrend does. It makes it easier to code tricky things,
11:00
it compiles the source into macros, the current version uses something called ActiveTech which I did a long time ago that makes all characters active while uploading macros. I want to redo it in Python because I think that's a good idea. Well anyway yesterday the problem came between Frank and Manjusha about expanding user macros and what we do is we use existing technology to
11:28
read the whole file one token at a time and if the token happens to be new command we say okay let's make it do something like its normal thing and we'll store some information and if we get a subsequently come to one of those commands,
11:43
well sorry I'm not explaining, I'm going to just skip this and say that it can be solved fairly easily using this technology, there's already something existing called tech to toke that so to speak copies all the tokens from input to output, it's a cat program and a 50 line
12:01
extension will solve the problem and I am of course skipping over some details and this is another aside which is. Because we started late, if we start on time for the next one you have five minutes. How long do I really have? Well if we keep on track you have five minutes,
12:25
if not then you have ten. All right. You started late. Okay I guess this better go on this and this side. I was at the Python conference and they're interested, this is what they're interested in, they want something, oh no that's what,
12:44
sorry that's something else, let's move on. Okay this is how to put math on web pages with bathtran. You simply write an image with the right alt text, that's all you do
13:03
except you need to put in a bit of JavaScript and if you want to have, if there's a tech to MathML service and you want to use that tech to MathML service you simply use different JavaScript. So you've got an immense amount of future proofing here because you're only writing down what you need to write down, namely the tech formula and how we're going to get there.
13:26
So let's move on. So this means whenever a user accesses this, you will get another bottom up track. That's right, that's right, we're serving about two million images a day at the moment. Sorry, no no that's our maximum capacity,
13:43
we're serving about one million a month at the moment, we could serve two million a day. No no, JavaScript just doesn't have that difficulty, you can get the JavaScript from wherever
14:04
you like, maybe you shouldn't but you can. Okay let's move on to the demonstrations. Okay so do you see I've got a formula in the top here?
14:24
Let's just type away and do you see that as I type I get a preview? Do you see? Okay next thing we've got is we've got a help system here,
14:41
so let's go to the index of equations. Here are some equations that are generated on the fly. We can put this equation here and edit this as a template. Here we've got material here and again I can type and as I type things happen,
15:00
so if I want to change the equation to 40, there we go. So this is something that students can use and I think this is something that the Open University was willing to put some resources into. So there's that, we've got a, sorry, we've got a proof of concept
15:28
editor here. So this is a WYSIWYG editor, such as you commonly get, and again if I go into here and start editing, so we can make a plugin that uses the web service that will go into this
15:44
sort of editor. This is a proof of concept that you can do and I think the final thing I want to show you is a demo, if I can get there. Oh yes, all right, this is all a bit bald but
16:01
let's put in a method. This is mostly Christoph Halfmeister's work, it's part of the Google Summer of Code, so we'll type a backslash and we get some help and we'll type an A and we get a list of all the commands that begin with A and we'll say that we want alpha. So we select alpha and the alpha goes in. Would you see the
16:27
foot? Okay we get the backslash alpha for technical reasons I won't go to, we can make it go, we can make it disappear. And then if we want to put in a beta we type backslash B and then we find a beta. So this is jolly nice I think for somebody who has not used tech
16:45
before. And if we go back to this one here, you see I've got a little help system here, complete with an index. So here's Greek letters for example in the index.
17:00
Now if we go to what Christoph did, which might be here, no it's not, it's here. Okay when we're getting the information up here we can also, so here we scroll up and down here we can put information on the right hand side about all these commands. So let's move on to see what else we've got. We've got this,
17:27
this is the blog that's worth looking at and I'm racing against time. So we've got two slides left. I've got nobody left to tell us to stop. When do we stop Cheryl? Any questions? Yes.
17:48
And I think I missed one actually. Okay so I showed you auto-completion and I think one of the important things with auto-completion is that we want to align with techworks and other systems and we want a shared syntax and semantics for help files so you can just
18:02
author for one system and it goes everywhere. And I'd really like somebody who's able to learn tech on a web browser and then move over to techworks or whatever without having a great big thump. I want it to be the same environment across. So we've got that and this is actually a LaTeX 3 goal. LaTeX 3 in 1997 error handling will be improved by adding an effective
18:26
interactive help system. That's what I want to produce and I want it to work with techworks and other things. And the final thing is what to do next. Please help with help. So at the Open University they want to, well I believe that they will want, let's put it that
18:45
way, to put resources into this because they have thousands of students every year doing mathematics and they need to be able to put mathematics into their forums and so forth. So there are resources there and one of the things that is quite interesting I think is Scott Paikin's excellent LaTeX symbol list which if we're going to get an online version
19:06
of that I thought that would be quite nice and help get everybody working together. Getting the help information together is actually a starting point for a web-based online tech course which I think is a good goal for the community.
19:23
I'll repeat my final thing which is I'm working two days a week on this sort of thing. I don't get the proper cover internally because tech skills are so special. So if you've got tech skills and you're interested in doing consulting work for the Open University or if you've got an interest in tech and got Python or JavaScript skills and want to do some consulting
19:46
for the Open University you should approach me and I'll give you my card. Cheryl can take some questions now. Okay I've got one or two questions. Yes. French.
20:09
Ah JavaScript is not my favorite programming language and you have quite a bit of difficulty already with the various variants. I would like to produce something that is international
20:24
and if you're a yes you have to have international JavaScript. I don't know how to do it. But we have to do it. We have to have a French interface and a German interface and we have to have help in all the languages at least for some things.
20:40
Another question. Frank. I can see now how you secure the plain tech version. I wouldn't say it's easy enough but it helps that plain tech is plain tech. I don't believe that there is any chance to do a similar thing for a system like context or
21:01
in other words the statement you make you would like to do it to offer that kind of service on late tech level would mean that you have to take away actual functionality that late tech offers which is having complex structures that you can't really really take away without
21:22
effectively taking away late tech. Do you think there is a chance or do you think that those two conflicting goals make that kind of interface impossible for anything further than say individual formulas? I think it is possible. I think that some things may
21:42
have to change and you might not get absolutely everything. The main thing we want it for is the mathematics of course. The mathematics is possible. I think with the mathematics one ought to be able to do it and I would like the tech macro programmers to think
22:03
there's actually this new platform, the secure platform and if you can write code that works for secure and ordinary platforms that would be a plus because the secure platform does give us something. One more? No. I'm sorry.