vim: Binding C-i bad for tab

Note: This entry has been restored from old archives.

In the unlikely case that anyone made use of the C-i binding I suggested for toggling vim 7.0 spell-checking they may have noticed that it messed with the use of their tab key! So it turns out that tab and C-i are the same thing from vim’s point of view!

Choose a different combo. Like C-c for *c*heck, or C-s for *s*pell, that’s surely better! Meta maybe?

I’m now using C-a:

" Set spelling language.
set spelllang=en_gb
" Toggle spell checking for the current buffer with Ctrl-i
map   :setlocal invspell
imap   :setlocal invspella

Note 1: The ‘i‘ at the end of the imap is now an ‘a‘ so that the insert position comes back the same.

Note 2: The C-i is only a problem for the imap and if you remove that you can then use C-i or tab in command mode to toggle spelling and live without the ability to toggle spelling when in edit mode. This’ll clash with any other command mode binding of tab of course, but I have none. I like to toggle in edit mode though so I’ll stick with C-a for now (hrm, what does it clash with?).

Update

Of course, a few minutes later I try to use C-a for it’s normal purpose, incrementing a number under the cursor. I use this surprisingly often. *sigh*

Oriental City

Note: This entry has been restored from old archives.

Men's Pocky
Men’s Pocky: Not for women!

On Saturday we visited Oriental City, also known as “London’s real Chinatown”. Reading its tea-leaves will apparently tell you stories of demolition and replacement with new cultural icons, such as hardware stores. This “real Chinatown” proved to be up to the title, but don’t expect the tourist-ready gloss of London City’s Chinatown area. The Oriental City rendition of Chinatown is raw and gritty; from the old men in the food court chatting in Chinese and puffing on their cigarettes to the “Japanese Lifestyle” shop selling “essentials” from chisels and drill bits, through sushi making equipment to hair accessories. For those in Sydney who’re familiar with the places, my impression of the feel of Oriental City is: “Blacktown Westpoint and surrounds cross-bred with Parklea Markets”. Well, prior to the Westpoint upgrade – I haven’t been in the area since about 2002.

Feeling famished after a rushed morning with no breakfast we headed straight for the food court. The aroma in the air was unmistakeable… cigarette smoke. There are signs overhead delineating “smoking” and “non-smoking” zones, all they need to do now is teach smoke how to obey signs. We ordered ourselves some lunch anyway, Gyu Don for Kathlene and “Eel-and-Egg” Don for me, and with a little difficulty navigated our way to a patch of lesser smokiness. The meal was decent, large and cheap – above expectations for Japanese in a food court. There are about 15 different outlets in the food court, including Japanese, Thai, Drink/Sweets, Indian and several Chinese stores. The drinks/sweets stores later prove not to have any taro/yam/ube drinks at all (the purple ones).

We trundled around the centre and scoped out some of the non-food shops. There are a couple of decoration/junk/”artefact” shops, a furniture store with a 1.5m long jade boat, a shop with a huge range of ceramics, a Japanese “lifestyle essentials” shop, a real-estate agent, a small dojo and down the far end there seemed to be some sort of large “Sega”-branded arcade. The ceramics shop impressed us, shelves and tables stacked with plates, bowls and tea-sets; mostly in Japanese styles. We perused stacks of chop-sticks, various trinkets and Kathlene paid special attention to some large bento boxes. The Japanese “lifestyle essentials” shop amused us, a quick sample of some items you can find there: drill bits, bento boxes for kiddies, sushi making equipment, plastic replacement teapot handles, hair accessories, cookware, stacks and stacks of clear plastic storage boxes, pulleys in multiple sizes and items I couldn’t identify like small iron squares with nails sticking out.

We didn’t escape empty handed, we now have a tea-ball and some vegetable shape-cutters, perfect for our “Japanese lifestyle”. In wandering past the dojo we watched a video demonstration of spray-on-attacker permanent-UV-reactive-dye playing on a screen in their display window. Alongside this a random collection of knives, swords, pointy things and an entire wall hung with nunchaku. The dojo turned out to be the source of a heavy drum-beat we’d been hearing since shortly after lunch, inside were four youngsters learning to give a drum a good new-year style beating.

The final stop for the day was the most interesting: the supermarket. Unlike London Chinatown with it’s couple of streets and several smaller supermarkets/grocers the Oriental City mall contains just a single supermarket. It’s a big’n though, possibly offering a wider range of goods than found in Chinatown proper. One example: I found some shiro-miso and there were also several other misos, but all I can ever find in London is aka-miso [Update: I found a great stash of miso in London near “Chinatown” in this place: Japan Centre]. We even found a Filipino section, but try as we might we didn’t find some essential Filo foodstuffs. No belacan/baga-ong! There were some ube wafer sticks, but no other ube! Not satisfactory! Fermented shrimp aside, the range or food available in the supermarket is impressive. The distribution of goods is somewhat chaotic, we found kombu in three different locations. The fresh fruit & vege selection was good but low-volume, there were some interesting items and all the usuals, including: okra, bitter melon (two we do not buy, but I like to taunt Kathlene with them), banana leaves, dragon fruit, and eggplants in about 10 different combinations of shape, size and colour!

Oriental City Goodies
Oriental City Goodies

We passed many a freezer filled with the weird, wonderful and even slightly disgusting. Up the back we found a wall of meat with everything from steak to any extremity or organ you’d want to devour. The fish counter was… a little fishy. I didn’t like the look of it but there was a good selection of piscine wares, including cuts ostensibly suitable for sashimi (I had my doubts).

At one end of the supermarket we wandered into a land of cookware and rice. Rice can also to be found in several other locations, but at the far end you’ll find rice in huge sacks, stacked in piles on pallets – there must literally be tons of rice. The cookware selection is small but it fulfilled our bamboo steamer and Tamagoyaki pan quest, more ways to make dinner! To add to the days education we discovered that Pocky is for wussies, real men eat Men’s Pocky. Eventually we escaped; with a small hoard of oriental delights.

I’ll Keep My Head, Thankyou

Note: This entry has been restored from old archives.

Well, here’s one for the record: My first ever call from a headhunter.

Mobile vibrates, unknown number (I assume they don’t mask their number in case someone has second thoughts), I pick up, “Hello, Yvan speaking.”, “Hello Yvan! I’m a headhunter!”. I guess there’s no point being indirect. “Interesting communications start-up.”

I wonder where these guys get contact details from. The work mobile number they called isn’t listed, not against my name anyway. I guess these details just make their way around somehow… but into the hands of a headhunter?

Anyway, life’s too complicated at the moment to be considering such things. Plus there are things I need to finish.

Head staying on my shoulders. On with the show!

EZRSSFeeds and other WebSuckers

Note: This entry has been restored from old archives.

For random primates, such as myself, friendly spiders and assorted maladroit suckers of all the Internet’s most rank drivel must represent near 100% of our readership. Since, in truth, most people are little better than the few lines of code behind my most frequent website visitors I bid you all welcome. You’re welcome to be my friends Googlebot, Baiduspider, Gigabot, TurnitinBot, Zeusbot, msnbot and the other 65 or so eaters of my robots.txt I have seen in the last year. But those of you who shun my robots.txt, especially those of you lacking decent user-agent strings, can crawl back into your dingy holes with the slugs and worms (I’m looking at you: bots from EZRSSFeeds, WebSense (Konqueror my arse) and other houses of deception). Alas for you, even these clammy denizens of dank and musty places will probably shun your presence.

One of your number seems to have more in common with the leech than any other form of life. To me this nefarious creature appears to propose: “I’ll make it easy for you to steal content to put on your website to fool Google into thinking you actually have content of your own.”.

Highlights:

  • No mention of copyright or content ownership on the site, none that I can find.
  • The “spider” page doesn’t tell you about the spider employed, it tries to sell you some kind of “spider”.
  • The bot grabs RSS with high regularity. (>30 hits in the last 8 days.)
  • The bot doesn’t advertise its self via user-agent, it doesn’t send a user-agent string at all. (But it’s IP reverses to the domain name: 147.202.50.50)
  • I’m guessing here, but I bet the bot pays no attention to robots.txt! (The IP above started hitting RSS on my site in September 2006 and has never requested the robots.txt file).

I’m blocking the little bugger’s IP now, for general bad behaviour and likely evilness… but that’s only effective up until it starts crawling with a different IP. In truth, if you put stuff on “the Web” there isn’t any way to protect it, consider it “fair game”. With just a little work this bot could be made much harder to identify, since you’re already behaving in a questionable way why not start employing bot-nets to do the surfing, and use some legitimate UA strings! You’re a dumb bot! As a friend of mine might say: no bot-biscuit for you! I think there is a viewpoint floating around that sees providing an RSS feed as permission to play free and easy with the content. People who write weblogs are essentially attention whores so any distribution of their content must be a good thing in their eyes, right?

Now, to some squishy human life-forms: If you’re considering using the service associated with this bot, or anything similar, you might want to consider potential copyright implications. It might be fine, maybe it just provides excerpts and properly references the source, or maybe not. Like I said, their website makes no mention of copyright and their bot doesn’t identify its self, this is incriminating behaviour in my opinion. If it is legitimate why doesn’t it do the right thing?

Alternatively, just write some bloody content you poop fairy.

To the leeches: My apologies if I offended you.

Back to the good bots: Goodnight my friends.

Vim 7.0 Can Spell!

Note: This entry has been restored from old archives.

I’ve been using an external spell-checking plugin for vim for some time now. Today I upgraded my systems to vim-7.0, to do this on Debian Sarge (stable) add to /etc/apt/sources.list:

# Backports  - A "Pin" in preferences file required is to prefer backport pkg.
deb http://www.backports.org/debian sarge-backports main

And add to /etc/apt/preferences:

Package: vim
Pin: release a=sarge-backports
Pin-Priority: 999

Package: vim-common
Pin: release a=sarge-backports
Pin-Priority: 999

Then do an apt-get update and apt-get install vim.

Start up vim and do :help spell for full documentation! The first thing you’ll want to know to play with it is turning it on: setlocal spell spelllang=en_gb (for real English, surprisingly it also has en_au). It will highlight unknown words, for suggestions sit the cursor on the word and type z=.

I didn’t see anything immediately obvious in the doco for simple on-off toggling of the spell-check mode. So I knocked up this little bit of vim-code to toggle the spellcheck with Ctrl-i (more obvious combos already taken) for the current buffer (i.e. on/off is maintained independently for each buffer). This is now^W^Wwas in my .vimrc:

" Toggle spell checking for the current buffer
function ToggleSpell()
    if &l:spell
        setlocal nospell
    else
        setlocal spell spelllang=en_gb
    endif
endfunction
map   :call ToggleSpell()
imap   :call ToggleSpell()i

It’s a good thing that vim can spell, because I shore can’t.

Update:

A quick scan of some vim doco moved me to simplify the above toggle to:

" Set spelling language.
set spelllang=en_gb
" Toggle spell checking for the current buffer with Ctrl-i
map   :setlocal invspell
imap   :setlocal invspelli

Duh. 🙂

Update 2:

Silly me, there is a slight problem with binding C-i in vim.

Aussie Police Have Weird Web Primates

Note: This entry has been restored from old archives.

Sometimes I bump into something on the web that makes me wonder…. Like the news bulletin posted here: MAN ARRESTED AFTER SUSPICIOUS DEATH – CROWS NEST. We used to have the occasional gelato at that bar, it was just up the road from our home in Wollstonecraft. I suspect the guy, now dead, even served us our gelato sometimes. Sounds like there is a story behind that murder “It is believed the victim and alleged offender are known to each other.”, the alleged offender was found nearby clutching a knife.

But just look at that URL:

http://www.police.nsw.gov.au/news/recent_media_unit_information?sq_content_src=
   aHR0cDovL2N1c3RvbXNjcmlwdHMucG9saWNlLm5zdy5nb3YuYXUvbmV3cy9kZXRh
   aWxzX21lZGlhLnBocD9NZWRpYUlEPTg0MTk%3D 

(Additional line-breaks/white-space my own of course.)
Sorry I had to subject you to that… sq_content_src? Equals something that looks like base64? (Note “%3D” is a URI encoded “=”.) Hrm:

$ echo 'aHR0cDovL2N1c3RvbXNjcmlwdHMucG9saWNlLm5zdy5nb3YuYXUvbmV3cy9kZXRh
aWxzX21lZGlhLnBocD9NZWRpYUlEPTg0MTk=' | openssl base64 -d
http://customscripts.police.nsw.gov.au/news/details_media.php?MediaID=8419
$

If you visit the URI you get basic HTML for the news story, which is dumped verbatim into the page at the link above (i.e. including , etc).

I guess they want to make sure the input URI can’t stuff up the site URI? But we do have URI encoding designed for this very purpose, in fact they even use it for the “=”! Or maybe they want to hide the content URI? I can’t see why, and if this is the reason they chose a pretty dumb method.

It turns out that they’re not too dumb, a basic attempt at getting them to show content from another website failed. Bummer, this entry would have been so much more fun otherwise (and being arrested upon arrival in Australia would have been good too!). It is probably best not to poke police websites too much, personal experience (police questioning and a court appearance as a witness when a friend was being put through the judicial wringer) has taught me that the NSW police wouldn’t know what an Internet was if it bit them on the arse. In fact, such knowledge is considered highly suspicious, virtual proof of criminal tendencies.