=^.^=

Two (plus one) Typesetting Characters I Wish I Knew About Sooner

I'd often wondered why AjaxChat sometimes inserts an apparently invisible character that breaks links if one attempted to copy and paste them. Today I was able to select one while using Opera for debugging, thanks to the font it used not covering it. I wasn't really sure what to do with it at first, I don't have any character map-like tools installed and Google search didn't recognize it as a query. Eventually I noticed it was producing search suggestions and among them was ​.

As Wikipedia explains, the character is a

Zero-Width Space
The zero-width space (ZWSP) is a non-printing character used in computerized typesetting to indicate word boundaries to text processing systems when using scripts that do not use explicit spacing, or after characters (such as the slash) that are not followed by a visible space but after which there may nevertheless be a line break. Normally, it is not a visible separation, but it may expand in passages that are fully justified.

It continues with a great demonstration:

Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?Antidisestablishmentarianism?

"On browsers supporting zero-width spaces, resizing the window will re-break the above text only at word boundaries."

Another neat character is the

Soft Hyphen
In computing and typesetting, a soft hyphen (U+00AD soft hyphen, HTML: ­ ­), also called a discretionary hyphen or optional hyphen, is a kind of hyphen used to specify a place in text where a hyphenated break is allowed without forcing a line break in an inconvenient place if the text is re-flowed. The soft hyphen's semantics and HTML implementation are in many ways similar to the zero-width space.

Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­Antidisestablishmentarianism­

Bonus round: check out the Zero-Width Non-Joiner.

Download: 32 & 64-bit Xen Paravirtualized domU initrd-free Monolithic Kernel 3.10.17

This is a significant step up from the drop-in kernels I have posted previously. Thanks to a massive cleanup this is the first Xen PV kernel I've been able to build with heap randomization and stack smashing protection. Other improvements include:

  • EXT4 support
  • NFS4 support
  • Full-range IPSec support (untested)
  • Head-to-toe netfilter and crypto
  • Per-process i/o stats (see iotop)!
  • dmesg_restrict

Download
kernel-domU-3.10.17-32 739ca0128e68b33164fdccc66bd53bb8 (.config)
kernel-domU-3.10.17-64 0e59bba671893715b04a16f7ee8edb3a (.config)

As always, these kernels are monolithic (lack loadable module support) for security and do not require an initrd to boot a Xen virtual machine.

Your udev or other parts of userland may require upgrading or downgrading to play ball with this kernel version. I'm migrating from 3.2.12 without any issues.

Compiled from gentoo-sources-3.10.17

Lulzy Fraudulent RCMP Popup

I encountered this lulzy geo-targetted fraud popup on a video site today and felt it was worth sharing. Just like the Rob Ford scandal I'm always thrilled to see people taking an interest in Canada, even if it's in a negative way.

fraud phishing popup
ALL YOUR FILES ARE ENCRYPTED.

The popup purports to be an RCMP notice that "Your browser has been locked. All activities of this computer have been recorded. All your files are encrypted." then proceeds to spout a bunch of what I am assuming passes for legalese before being Google translated into English. At the bottom there are logos of real places you can buy Ukash in Canada, with the hope that the subtle mention CP on your PC will have you bolting out the door. h5841.com is, only too naturally, hosted in Ukraine.

Nostalgia Files: Macintosh Risk Game for System 6+

I was invited to play low-stakes Risk recently and figured it would be prudent to brush up a little.

Imagine my delight when I came across this childhood favourite:

risk

I recall becoming quite the little dictator playing this game on my Mac SE and, of course, most of the macs at school. Apparently it was released in 1986 by Antonie J. Engel a.k.a. Tone Engel as shareware (remember that?! on floppies!).

A big thank-you to Richard Loxley for preserving this gem and making it available as part of a Mini vMac virtual machine for Windows and OS X at http://www.richardloxley.com/fun/risk/.

Shimmie Arrow Key Navigation Extension Fix

I recently acquired a Shimmie based image board and have been playing with some of the beta extensions available at the shimmie git repo. I've just made a quick revision to the Arrow Key Navigation extension by "Drudex Software." Unfortunately, at the time of writing drudexsoftware.com is expired/parked so I never contacted the author.

In main.php the magic happens in this block:

    # adds the javascript to the page with the given urls
    private function add_arrowkeys_code($prev_url, $next_url) {
        global $page;

        $page->add_html_header("<script type=\"text/javascript\">
            document.onkeyup=checkKeycode;
            function checkKeycode(e)
            {
                var keycode;
                if(window.event) keycode=window.event.keyCode;
                else if(e) keycode=e.which;

                if (e.srcElement.tagName != \"INPUT\")
                {
                    if(keycode==\"37\") window.location.href='$prev_url';
                    else if(keycode==\"39\") window.location.href='$next_url';
                }
            }
            </script>");
    }

We have two problems here:

  • srcElement is only available in Internet Explorer. In all other browsers it's called target.
  • srcElement always returns null, at least on this board, which defeats the whole purpose of the if block anyway - to prevent using the left or right arrow keys from navigating while a user is editing an input. Textarea would obviously be a good addition.

Rather than waste eternity trying to find a workable solution that accomplishes what the author was after on IE and make it cross-browser compatible I clubbed it over its head in such a way that the arrow keys always trigger in IE and trigger outside of inputs in non-IE browsers.

    # adds the javascript to the page with the given urls
    private function add_arrowkeys_code($prev_url, $next_url) {
        global $page;

        $page->add_html_header("<script type=\"text/javascript\">
function checkKeycode(e)
{
	var keycode;
	if(window.event) keycode=window.event.keyCode;
	else if(e) keycode=e.which;

	if(navigator.appVersion.indexOf('MSIE') != -1)
	{
		if(keycode=='37') window.location.href='$prev_url';
		else if(keycode=='39') window.location.href='$next_url';
	}
	else
	{
		if (e.target.tagName != 'INPUT' & e.target.tagName != 'TEXTAREA')
		{
			if(keycode=='37') window.location.href='$prev_url';
			else if(keycode=='39') window.location.href='$next_url';
		}
	}
}
document.onkeyup=checkKeycode;
</script>");
    }

All in all, a tidy wee feature (when it works) which I will probably rip off for Ychan.

UPDATE Make that definitely have ripped off ;)

UPDATE The comment field is a textarea so it is necessary to add TEXTAREA (updated code snippet).