Olli Toivanen's tedium dispensary

Technical notes

Update: A medium-size update was made in December 2021: The content was lightly refreshed, and the CSS was rejiggered. Those ankhs were added; annoying rotating pictures of my face on the top left were removed.

These homepages (homepage?) were/was launched on 20th of February, 2015. Right now (i.e. May 21st 2015) they contain around 100k words of text, excluding headers and footers and the few pdf and epub/mobi files. A paperback novel has around 250 words per page, so 100k words is about 400 pages.

These pages are made of HTML and CSS.

These pages use MathJax in the standard TeX-AMS-MML_HTMLorMML configuration on the pages that contain display mathematics. (I should change that; I don't write anything in MML. I don't even know how.)

These pages use no other JavaScript.

Portions of these pages are dynamically generated using PHP... look, the random header and footer stuff are server-side done, so that's why there's no code in your page source. You came here curious about that, right? All PHP; it doesn't burden your browser any.

If things work, this text is set in Lato, a lovely Polish font, and the headers are set in Lobster, a lovely non-Polish font.

I'd like to use letter-spacing instead of italics for emphasis, German-style, but that's a little ugly and spread-ey when you have a longer emphasized bit, and browsers don't (in my experience) handle spacing before/after the emphasized bit all that well.

But let me use that formatting here to tell you a joke— Three mathematicians walk into a bar. You'd think the third would have ducked.

No but seriously. What's brown and sticky? Hover over to see: A stick. I am so sorry.

No no, this physicist, biologist and mathematician are in an out-air cafeteria, drinking coffee and watching people. They see two people ducking to a doorway, and soon after three leaving.

“Ah ha!” says the biologist. “We have observed breeding.”

“Nonsense”, the physcist says, shaking his head. “This is a measurement error, nothing more.”

The mathematician drinks her coffee, and says, with a far-away look in her eyes: “Now if someone goes there, the doorway will be empty.”

Thank you! I'll be here all week.

These pages are generated—

I'd also like to draw your attention to my “smart” use of matching English-language-world quotes instead of "lazy" old-timey computer-writing before-the-Fall (MS Word) world both-the-same quotes, but it's likely (since the content of these pages comes from across many years) that I use one here and another there. (It's not trivial to search for a " in my source files because it's used all over HTML for different purposes. There are too many hits, and I just sigh and promise myself I'll fix problems when I come across them.

Also, there are the slightly old-fashioned quote marks «like these», which I used to see in Finnish books all the time. They look nice too, but would probably be a little distracting.

Also, I use … for … and — for — and – for –. Except I keep writing --- and -- because I've written so many things in LaTeX — basically since about 2004 or so I've only written things in raw text, LaTeX and HTML, except for a single handful of times using Word or OpenOffice because I was in a hurry and not concerned with prettiness or ideological purity.

As for ideological purity — I said these pages don't use JavaScript, right? That's not a smart works-for-everybody decision, that's a decision made to conform to my personal sense of aesthetics, my (subjective, irrational) sense of what is beautiful when doing things with computers.

If I wasn't distracted by pretty toys I might make a set of homepages that had nothing but text, and a few “a” and “br” and “hr” here and there, and no style; just content. Not because I dislike style, but because my archaic aesthetics value aggressively plain “no style” as a pretty good style to have.

These pages are generated, before they're uploaded to the server, with my own kludgy collection of BASH scripts. Basically I glue together a standard header, the raw content file (what's inside the "content" div) and a standard footer, and then run sed over the result to insert the last-modified date of the content file and the highlight on the link to that page.

A separate script takes care of creating the correct second line of navigation links (the navib div) so that they correspond to that particular (sub)page. For example, for the page "w-loco.php", the script sees that the first character is "w", so it's a subpage of "write.php", and needs write.php's list of subpages. It then finds all files that start with "w-", greps a file for their link titles (for itself, "locomotion") and hovery tooltips ("a universal problem of locomotion: a story leading to a dumb denouement"), and writes them into the line of links. If I've been negligent, there might not be titles for some page; but in that case the link title and hover-tip will be the filename and hopefully sooner or later's I'll notice that looks really bad.

The great benefit of this, in addition to the computery fun of doing these things, is that with this (and CSS) I can change the common elements of these pages in one place and they're changed everywhere. I want all the text to be green? Edit just one file. I want every footer to contain a picture of Hitler? Edit just one file. I want to replace every instance of the word "geometry" with the word "pooprazors"? Edit just one file!

These are not good design decisions, however.

And in the last case I would need to, um, edit three files, because the generation of the "main" pages --- about write math hobby finnish --- and their subpages and pages without a navib div are done by three almost identical scripts instead of one discerning snippet.

One additional benefit is that I never have to scroll past the html head body crapola when going in to edit a file, or worry about accidentally deleting a line of it.

I was going to say that the process of raws, done files and uploaded files serves as a backup of sorts, but of course if I screw something up, deleted half the content from a page, and don't notice it before I've uploaded everything, well, I'm boned. I should add a few lines that, when generating all the pages, zip the raw files into a backup if… the time is… hang on a minute.

What? A segmentation fault? I must really be misunderstanding how file-roller works.

Wait, file-roller? Let's appear all hackery and use tar.

Grn grn… check the date on the newest file in the backup directory… if it's older than one day… 86 400 seconds… then tar -cf backup something date in this format dot tar, um, this directory… let's see…

Ha! Done and works now. Not very elegant, but it works. And with my skills elegance comes through iteration, not raw creation. Or raw backup creation, as it may be.

The particular BASH bits used by the scripts that generate these pages are: basename case-esac cat cp date echo exit for-in-do grep if-then-else rm sed.

And now tar too. (Checks if there's a command called "too". Apparently not. (I mean isn't. Not that "not" is "too".)

As an example of the CSS trickery, see the source of a random page, and the title encased in h1 tags. It has proper capitalization, right? Now look at your browser: no capitalization. Just a CSS trick to enforce an aesthetic decision that, at this moment, feels good.

I try to keep my CSS so simple that it (a) works on most new browsers, (b) breaks down gracefully with the other ones, and (c) does not look like a colostomy pressurization accident if you turn the CSS off. (Most browsers can do this, and it's very educational. Mobile browsers might be deficient in this, as with showing the page source, saving the page you're on, and doing many other nice things.)

Oh, and the "raw content files"? They contain just normal HTML. I don't think I'm doing anything complicated enough to merit another layer of conversion there, but maybe I'm just being stodgy. I made my first homepages when GeoCities was the hottest thing, when Microsoft didn't own HoTMaiL, and when animated gifs of burning torches and random explosions were de rigueur of personal pages; way back when nobody had said the word "blog" yet, much less felt slightly foolish for saying such a syllable. I was too late for the BBS age, but I've been here since the dawn of HTML, in the early Nineties. The major change in my process has been that I now use gedit instead of Notepad.

I mean, there was a time when I decided to use this newfangled CSS thing for the first time. And there was the last time I included a BLINK tag.

Oh, and I use Mathjax because it lets me do this without any work except the extrusion of some LaTeX code: \begin{align*} &\int_{B_\rho} |\nabla (u-k)_+|^{p(x)}\,dx \\&\leq C \left( \int_{B_R} \left(\frac{u-k}{R-\rho}\right)^{p(x)}\,dx + C_2|A(k,R)|^{1-1/t}\right) \end{align*}

And yes, I'm slightly cheating by placing the object whose generation may take a few seconds so far down the page.

powered by:
Powered by MathJax