Mit The Destroyer’s archive for March, 2007

Top Ten Worst Puns… by Mit The Destroyer

  1. 10. I went to a seafood disco last week… and pulled a mussel.
  2. 09. Two antennas met on a roof, fell in love and got married. The ceremony wasn’t much, but the reception was great.
  3. 08. A jumper cable walks into a bar. The bartender says, “I’ll serve you, but don’t start anything.”
  4. 07. An invisible man marries an invisible woman. The kids were nothing to look at either.
  5. 06. Patient: “I can’t stop singing ‘The Green, Green Grass of Home.’”
    Doctor: “That sounds like Tom Jones Syndrome.”
    Patient: “Is it common?”
    Doctor: “It’s Not Unusual.”
  6. 05. Two cows are standing next to each other in a field. Daisy says to Dolly, “I was artificially inseminated this morning.” “I don’t believe you”, says Dolly. “It’s true, no bull!” exclaims Daisy.
  7. 04. Two Eskimos sitting in a kayak were chilly, so they lit a fire in the craft. It sank, proving once again that you can’t have your kayak and heat it too.
  8. 03. A group of chess enthusiasts checked into a hotel and were standing in the lobby discussing their recent tournament victories. After about an hour, the manager came out of the office and asked them to disperse. “But why,” they asked, as they moved off. “Because”, he said, “I can’t stand chess-nuts boasting in an open foyer.”
  9. 02. Mahatma Gandhi, as you know, walked barefoot most of the time, which produced an impressive set of calluses on his feet. He also ate very little which made him rather frail and with his odd diet, he suffered from bad breath. This made him….. A super calloused fragile mystic hexed by halitosis.

And #1 Top Ten Worst Puns for the week is…

  1. 01. And finally, there was a person who sent 10 different puns to his friends, with the hope that at least 1 of the puns would make them laugh. No pun in ten did.

So now that IE unerstands pure XHTML… by Mit The Destroyer

The question remains can the technique I showed in Fix for IE’s lack of application/xhtml+xml mean we can now embed other XML based formats inside the XHTML, as XML promises? The answer is, absolutely!

Here is a XHTML, SVG, MathML example page, that shows MathML and SVG embedded right along side an XHTML document. To properly view the page you will need to download these MathML Fonts, and these SVG and MathML plugins if viewing in IE.

What do we need to change to make this work?

  1. Modify the doctype to the XHTML file
  2. Modify the html tag to add the additional name-spaces
  3. Add object tags to head to inform IE to use plugins to render SVG/MathML
  4. Modify the xsl:stylesheet tag to include the additional name-spaces

Example of doctype, html and head tag modifcations


<?xml version=”1.0″ encoding=”utf-8″?>
<?xml-stylesheet type=”text/xsl” href=”svgMathMlXhtml.xsl”?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN”
“http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd”[
<!ENTITY % MATHML.prefixed "INCLUDE" >
<!ENTITY % MATHML.prefix "math" >
<!ENTITY % SVG.prefixed "INCLUDE" >
<!ENTITY % SVG.prefix "svg" >
]>
<html
xmlns=”http://www.w3.org/1999/xhtml”
xmlns:svg=”http://www.w3.org/2000/svg”
xmlns:math=”http://www.w3.org/1998/Math/MathML”
xml:lang=”en”>
<head>
<title>Advanced Example</title>
<meta http-equiv=”Content-Type” content=”application/xhtml+xml; charset=UTF-8″ />
<object id=”AdobeSVG” classid=”clsid:78156a80-c6a1-4bbf-8e6a-3cd390eeb4e2″></object>
<?import namespace=”svg” implementation=”#AdobeSVG”?>
<object id=”MathPlayer” classid=”clsid:32F66A20-7614-11D4-BD11-00104BD3F987″></object>
<?import namespace=”math” implementation=”#MathPlayer”?>
</head>

Example of xsl:stylesheet modifications


<xsl:stylesheet xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”
xmlns=”http://www.w3.org/1999/xhtml”
xmlns:math=”http://www.w3.org/1998/Math/MathML”
xmlns:svg=”http://www.w3.org/2000/svg”
version=”1.0″>
<xsl:output method=”xml” encoding=”utf-8″/>
<xsl:template match=”/”>
<xsl:copy-of select=”node()”/>
</xsl:template>
</xsl:stylesheet>

Fix for IE’s lack of application/xhtml+xml by Mit The Destroyer

Have you ever tried sending a 100% strictly compliant xhtml to IE, so that IE would use It’s xml engine to render the page? If so, you know that IE borks on it and forces you to download the xhtml file. I’m here to tell you that I’ve found a work around, that is standards compliant and gets around that limitation and forces IE to use the XML rendering engine. Two steps are required for it to work:

  1. Configure web server to send xhtml files with the mime type of application/xml
  2. Then attach a XSL sheet to each xhtml file you serve to IE

Exmple File

Example xhtml code


<?xml version=”1.0″ encoding=”utf-8″?>
<?xml-stylesheet type=”text/xsl” href=”fixMe.xsl”?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en”>
<head>
<meta http-equiv=”Content-Type” content=”application/xhtml+xml; charset=UTF-8″ />
<title>Simple Example < /title>
</head>
<body>
<!– xhtml code here –>
<body>
</html>

Required fixMe.xsl code


<xsl:stylesheet xmlns:xsl=”http://www.w3.org/1999/XSL/Transform” xmlns=”http://www.w3.org/1999/xhtml” version=”1.0″>
<xsl:output method=”xml” encoding=”utf-8″/>
<xsl:template match=”/”>
<xsl:copy-of select=”node()”/>
</xsl:template>
</xsl:stylesheet>

Why does this work?

As far as IE is concerned you sent it a XML file, with an XSLT sheet applied to it. It’s XML rendering engine then applies the XSLT sheet which converts the XML page into an XHTML page. Without the XSLT sheet applied IE would have just showed us the source code to the page.

How did you ever figure this out?

I discovered this when I was developing this website, to teach myself XSLT. And knowing what I know about mime-types I figured it should work if I just changed the mime-type for XHTML from application/xhtml+xml to it’s alternate compliant mime-type of application/xml1, seeing as IE wasn’t having any issues displaying XML files sent as application/xml.

Additional Notes

Update: To see an example with SVG and MathML mixed in with the XHTML read So now that IE unerstands pure XHTML…

Some great parodies of the I’m a Mac/PC comercials by Mit The Destroyer

Here are a couple of links to parodies of the I’m a Mac I’m and I’m a PC Mac commercials:

  1. Video Parodies
  2. PC VS MAC VS Linux

If you haven’t yet seen the original Mac commercials, get off your lazy but and head over to the apple site and watch them.

Did God evolve due to a genetic mutation in humans? by Mit The Destroyer

The New York Times is running a piece entiteld Darwin’s God. Which analyzes why throughout human history mankind has universally had some sort of belief in a god and or the supernatural. The article summarizes the work DR Scott Atran, who has spent several years researching and hypothesizing the reason why anthropologists are constantly finding religious artifacts among dead and living civilizations. His argument boils down to the concept that the belief in a higher power is a side effect of our ability quickly asses our surroundings in order that we survive. The example given:

Agent detection evolved because assuming the presence of an agent — which is jargon for any creature with volitional, independent behavior — is more adaptive than assuming its absence. If you are a caveman on the savannah, you are better off presuming that the motion you detect out of the corner of your eye is an agent and something to run from, even if you are wrong. If it turns out to have been just the rustling of leaves, you are still alive; if what you took to be leaves rustling was really a hyena about to pounce, you are dead.

The problem with his argument is that he doesn’t take it to its logical conclusion. If you did take the argument to the logical conclusion you would arrive at the fact that nothing exists at all unless there was a primary first cause, out side the natural system, a higher power if you will. Don’t take my word for it as Alvin Plantinga has argued it much more eloquently.