May 2004
I've started writing articles, and hence I've linked to the Articles page. Deceased. I've spent a whole lot of time reading about web related stuff, so I figured it's time I wrote something myself, since only now do I feel proficient enough to do so. I'm also planning on making an HTML tutorial and if that goes well, a CSS one, so consider the articles a warm-up for this. I'm having troubles figuring out how to structure them though, since I have so much to say about subjects peripheral to HTML, and a lot of rants lurking in my brain which could potentially ruin an otherwise decent tutorial. I also sometimes have a tendency to rush my explanations on given subjects, if I know a lot about them myself. Oh well, I'll just have to try to see, right?
In other news, the much-anticipated Deus Ex modification Redsun 2020 has finally, finally been released. I've played a couple of levels into the mod, and I can tell you, it's been worth the wait.
Rockstar North's Manhunt is cool. The gameplay is sweet, and the AI seems to be incredibly advanced. And I absolutely love the comments from NPCs.
Ever wanted to play a blob of tar with more maneuverability than Jackie Chan, twice the toughness of Jet Li, and with a wider range of facial expressions than Steven Seagal? Look no further: Gish is what you need.
I've been trying and trying to integrate \(a^x\) but never made it. That is, until a class-mate of mine helped me. The answer was right in front of me, but I didn't see it. Anyway, here goes. We set it up:
$$\int{a^x} dx$$
Next, we transform it a little:
$$\int{e^{\ln a^x}} dx$$
The rest is pretty straight-forward:
$$\begin{align*}\int{e^{x \ln a}} dx &= \frac{1}{\ln a} e^{x \ln a} \\&= \frac{1}{\ln a} e^{(\ln a^x)} \\&= \frac{1}{\ln a} a^x \\&= \frac{a^x}{\ln a}\end{align*}$$
I removed the links on all the code examples. There's really no need for them.
And now, for a pretty cool math task I did today.
Find the indefinite integral of the following function:
$$f(x) = ae^x - \frac{1}{2b\sqrt{x}}$$
We start by setting it up:
$$\int{\left(ae^x - \frac{1}{2b\sqrt{x}}\right)} dx$$
I'll turn the expressions into exponentials, so that we can integrate them:
$$\int{\left(ae^x - \frac{1}{2} b^{-1} x^{-\frac{1}{2}}\right)} dx = ae^x - b^{-1}\sqrt{x} + C$$
This gives us the following integrated function:
$$F(x) = ae^x - \frac{\sqrt{x}}{b} + C$$
The W3C validator has got a face-lift, and it looks sweet. Other new things include a fallback DTD in case one isn't specified and better explained error messages. So if you're one of the sloppy guys writing invalid HTML, you'll love the new error messages. :-)
Been spending some time acquainting myself with regular expressions. Although I haven't found any practical use for it myself yet, I definitely see the power they entail. For instance, had I known about regular expressions before my switch to ISO 8601, the whole process of converting the dates from DD.MM.YYYY to YYYY-MM-DD would be automated, and I wouldn't have had to spend half an hour doing it manually. I could have searched for ([0-3][0-9]).([01][1-9]).(200[34]) and replaced it with 3-2-1. *sigh*
Added some more links to the CSS section of the links page.
MathML is very cool, and viewing a piece of MathML in, say, Firefox (with the associated fonts) is an utter bliss. But do you realize how extremely verbose it really is? Take the example of x^2. Here's how you would mark it up with HTML:
x<sup>2</sup>
Which renders as such:
x2
Here's the same expression in MathML:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mi>x</mi>
<mn>2</mn>
</msup>
</math>
Which renders like this (assuming, of course, you're using Firefox or Mozilla):
x2
Not really too verbose. But it gets worse if you have something like 2x^5a. HTML:
2x<sup>5a</sup>
Which renders as:
2x5a
And with MathML:
<math xmlns="http://www.w3.org/1998/Math/MathML">
<msup>
<mrow>
<mn>2</mn>
<mo>⁢</mo>
<mi>x</mi>
</mrow>
<mrow>
<mn>5</mn>
<mo>⁢</mo>
<mi>a</mi>
</mrow>
</msup>
</math>
And rendered:
2x5a
That's pretty verbose, no? There are several reasons why I bother.
- It's superior to using images and plain text.
- It can nest expressions to arbitrary depths.
- It prints and renders well.
- It's computable. I haven't seen a UA which can do this yet, nor have I really looked for one. But the idea is exciting.
I have thoroughly tested Firefox, and come to the conclusion that it's awesome. In addition, and after some tweaking, I got it to behave kind of like Opera, too. Firefox, when installed, is lightweight and doesn't really have all that many features. This is where extensions come into play. If there's a feature you're missing, simply install the corresponding extension. Here are two good repositories that I've found: David Tenser's extension page and MozDev's Extension Room. Here are the steps required for Firefox to behave almost exactly the same as Opera:
- Download and install Session Saver. This will make Firefox remember opened windows and their history after you close an instance.
- Download and install Mouse Gestures. This enables, well, mouse gestures. To perform a mouse gesture you hold down a mouse button (configurable) and move the mouse in a set pattern. (People who have played Black & White should be familiar with it.)
- I really like how the mouse cursor didn't change when you hovered over normal text in Opera. You can mimic this behavior in Firefox by adding this to your html.css file (located in the /res/ folder where you've installed Firefox):
*:hover { cursor: default; }
Other extensions of interest include Minesweeper, BlockFall (a Tetris clone) and the Mozilla MNG Decoder, which enables MNG support.
I feel like talking about BNF. BNF is a method for describing syntax. The CSS specs use a slightly modified version of BNF, which was what got me interested in finding out more about it in the first place. As far as my understanding goes, there are two offsprings of BNF; EBNF, which is standardized in ISO 14977, and ABNF, which is documented in RFC 2234. The differences between the three are small and annoying, so I'll try sticking to EBNF. So. BNF (whatever the flavor) is composed of production rules. A production rule looks like this:
foo ::= bar
::= means "is defined as". The production rule is read "foo is defined as bar". The production then looks like this:
foo
bar
We start with foo, and bar is produced. Fairly simple. We can complicate things a little:
foo ::= bar
bar ::= baz
baz ::= diligo
This gives the following production:
foo
bar
baz
diligo
We take what's on the left side of ::= and substitute it with what's on the right side. Consider the following:
foo ::= bar | baz
The vertical bar indicates a choice. "foo is defined as bar or baz, but not both". The production can then be either
foo
bar
or
foo
baz
but it can't be
foo
bar baz
There are several operators which make things all the more interesting. We have the three wildcard operators ?, * and +. ? means that an item must appear zero or one times (or, if you prefer, the item is optional), * means that an item must appear zero or more times and + means that an item must appear one or more times. If you want to explicitly specify how many times an item is to appear, you use {A,B}, where the item appears at least A times and at most B times. If you want foo to appear exactly five times, you'd write foo{5,5}. Parentheses are used for grouping, and quote marks denote a string (that is, it's supposed to be written out exactly how it's represented, without the quote marks). Strings are called terminals, since they can't be further defined. Similarly, number and digit are non-terminals, since they can be further defined. Here, I've defined the construction of a number that can be negative and/or fractional. See if you can decipher it. :-)
number ::= "-"? digit+ ("." digit+)?
digit ::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9"There are 11 posts for May 2004.