Archive for the ‘coding’ Category

Moin, all moin…

[EDIT: for anyone else looking for help with this, see How To.]

Does anyone know offhand of a way to batch-convert old MoinMoin pages (circa version 1.5) into the new markup?

Until tonight I didn't even know they HAD new markup. This afternoon I downloaded the latest version and was quite surprised. Firstly, the Windows offline version is no longer a stand-alone exe (BOO, means I've got to learn to run Portable Python to continue using my wiki on my portable drive).

Secondly, they've changed the markup syntax, especially the links, so that it's much closer to the markup used by MediaWiki (what Wikipedia runs) – and hence also the markup used by MediaWiki's older brother, UseMod, which is what I run on my site. Good move. Apart from its being (in my opinion) a more logical markup scheme to begin with, I will now be able to copy and paste from one of my wikis to the other. Which is great! I never particularly liked Moin's silly let's-be-different-for-???-and-profit markup anyway.

The only problem is that all my offline pages use Moin's silly let's-be-different-for-???-and-profit markup…

Hence my original question. My Googlefu hasn't turned up anything yet and MoinMoin's support wiki has, well, never been the greatest.

If I find no lazybones way to do this midtimes, I'll see if Notepad++ has a global find and replace that uses regexp. If not, HomeSite definitely does, so a lunch break next week will be usefully spent. I have edited a lot of pages the long way in the past, when I didn't have nearly as much stuff in my wiki, and don't fancy editing EVERY page link in there now. Nope.

HTML-CSS organisation charts

Just before I start reinventing the wheel from the axle out…

Has anyone come across a decent HTML-CSS template for organisation charts? Google isn't particularly helpful. It's for work, which may rule out solutions released under attribution and non-commercial licences, etc.

On this page you can find the PDF of the org chart I'll be asked to recreate. I don't think the A&M and Vision Productions boxes are important here, just the staff, meaning it's a straightforward top-down org chart.

Solutions involving an XML schema aren't viable/available to me in this case. HTML-wise, I'm thinking nested lists, probably. What do you think?

Buy web books in aid of bushfire peoples

SitePoint 5-for-1 web technology book sale

"Proceeds from this sale will be donated to victims of the recent Australian bushfires."

Yet more fun with hCard microformats

Another few tricks with hcards.

These guys' details are freely available on the web, so I hope they'll forgive me for using them as examples.

Example 1

Paul Rodgers, Editor, 6 Music
Phone: (020) 7765 4763
Email: paul.rodgers@bbc.co.uk

When someone's email address contains their organisation's full name, it'd be churlish to refuse the opportunity, and no little thing like lower-case letters is getting in my way.

A couple of points to note in our first example:

  • Paul's job title also includes the department he works for (well, controls, actually). That's fab, since it lets us kill two cats with one ballbearing.
  • You'll also notice a big org span, which has to encompass his department (organization-unit) and company name (organization-name) and a bunch of other stuff.
    • I'm hoping this is ok semantically. As I understand it, when both unit and name are specified, anything else should be ignored; and indeed, exporting to Notepad through Operator shows that it seems to have been interpreted correctly.
<p class="vcard">
  <span class="org"><span class="fn n"><span class="given-name">Paul</span> <span class="family-name">Rodgers</span></span>, <span class="title role">Editor, <span class="organization-unit">6 Music</span></span><br />

  Phone: <span class="tel">(020) 7765 4763</span><br />

  Email: <a href="mailto:paul.rodgers@bbc.co.uk" class="email">paul.rodgers@<span class="organization-name" style="text-transform:lowercase">BBC</span>.co.uk</a></span></p>

Which creates:

Paul Rodgers, Editor, 6 Music
Phone: (020) 7765 4763
Email:

Example 2

Second example:

Robert Gallacher, Editor, Planning & Station Sound
Phone: (020) 7765 4373
Email: robert.gallacher@bbc.co.uk

And Robert's department isn't stated here, so we'll just mark it up as a role, which is easier. The org span can now go just around the letters BBC:

<p class="vcard">
  <span class="fn n"><span class="given-name">Robert</span> <span class="family-name">Gallacher</span></span>, <span class="title role">Editor, Planning & Station Sound</span><br />

  Phone: <span class="tel">(020) 7765 4373</span><br />

  Email: <a href="mailto:robert.gallacher@bbc.co.uk" class="email">robert.gallacher@<span class="org" style="text-transform:lowercase">BBC</span>.co.uk</a></p>

Which creates:

Robert Gallacher, Editor, Planning & Station Sound
Phone: (020) 7765 4373
Email:

Please note the date on this entry. It could well be that these people's details are no longer accurate. View them as examples only.

Drupal UG meetup

Well, most importantly, I learned that it's pronounced "droople". ;)

(Also that I'm in the minority by saying "micicle" where most people say "my-sequel". I can't resist it, though; it's too much fun to say.)

Other than that, while chatting to the organiser I brought up (what I guessed, from brief reading, to be) the main requirement I have of a CMS that could cause problems with Drupal's way of viewing the world. Thanks to having read through drupal.org in advance, I was able to convey this intelligently and ask the right sorts of questions.

*waits for disbelief to die down*

In brief, building on my last entry, this potentially problematic thing is creating sub-users as part of a user profile:

  • a user can post as themselves (their main profile) on every type of node
  • on some types of node, a user can post as any of their sub-users
  • sub-users are switchable using a simple interface (with UI design issues here too, obviously)
  • the switcher interface is only visible on the appropriate node types (this much I know should be easily done with *blanks and looks up the term* blocks or something similar)
  • some site features are organised per user (user role/permissions, sitewide communication)
  • some site features are organised per sub-user (though the main user gets one too) (blogs, 'profiles' which are also encyclopaedia entries)

For sub-user, of course, read "character". Aha, Ceiling Dog sees where I'm going with this.

I was told that I'm the first person to ask about this. Whee, I'm special! However, I'm also told that it should be possible, and that a module called Node Profile is what I need to look for.

Other random features I'll need — list may be updated as I think more:

Read the rest of this entry »

Bells announcing changes for the better

Two wushu lessons down, my hip really doesn't like me. Nor does my tremor. Let's not even ask my sense of balance. My worst enemy, however, is as ever my charming self, who really seems to delight in messing up the crappy easy movement I'd been practising all week as soon as something unexpected and disastrous happens, like someone else being in the room. Epic fail.

On the upside, my weight is fluctuating downwards again. I'm not doing anything different, I don't think. Maybe this amount of variance is normal.

Finally got blood tests done on Tuesday morning and, with any luck, will soon be told that something not-too-serious, easily-fixable and not-imaginary is wrong with me. Somethings suggested so far (not by medical personnel) include B12 deficiency.

The range of diseases that can cause tremors, muscle weakness and confusion includes some real nasties. If it was a choice between pansy bloodlessness on the one hand and something horrible and demyelinating or metastatising on the other, I know what I'd be hoping for. However, let's not panic just yet. Maybe it's only, er, an inner ear infection combined with spontaneous subcutaneous ice formation? Or better yet, psychosomatic and curable by teaching myself to think about butterflies or PHP.

Drupal user group meeting tonight. I'm going to ask them if what I want to do can be done with it.

From what I understand of the documentation, the most difficult thing may be that I want users with switchable sub-users [edit: expanded in next entry]

Also some features associated with collaborative authorship (such as co-written sections – ideally with the option to attribute per paragraph) and lots of other things I haven't thought of yet.

Current music: Angra, Wishing Well, in head. It's all Ayreonnish.

hCard specification confusion

Anyone any good with hCard microformats?

I've been adding info to my blog for fun, but I'm running into issues (when testing exporting it as a contact file through Operator and opening with Outlook): in a couple of cases it is incorrectly getting its data from the tag contents instead of the title attribute. (I'm using titles simply to make the human-readable part flow a bit more nicely.)

Code:


<address class="vcard">Contents &copy; <a class="url" href="http://hellhound.net/"><abbr class="fn" title="Herm Baskerville">Herm</abbr> '<span class="nickname">Mutt</span>' Baskerville</a></span>. <span class="org">Mutt <span class="title role" title="admin">administrates</span> <a class="organization-name" href="http://profusion.hellhound.net/" title="Profusion">Profusion writing and roleplay</a></span>.</address>


produces (edit: following code removed while I test stuff):



It's correctly picking up Herm1 Baskerville as the full name. (The abbreviation tag with title is apparently best practice, better than classing separate words [plus a space] as name-parts, and clearly it does make more semantic sense.)

It is incorrectly picking up "Profusion writing and roleplay" for the organisation (instead of "Profusion") and "administrates" (instead of "admin") for the position.

Now, the title attribute is meant to overrule tag contents, unless I misunderstood something; perhaps it doesn't count in these specific cases? And no I'm not sure I really want to include all this info on the page, but I'm trying things out, godsdammit. :)

edit: Responses and interesting stuff to be found on the LJ mirror of this entry

1 Less confusing than "Herman or Hermia, depending on my mood", right?

Granddaddy of all horrible table-based grrngrgrgrrrr…

I need to vent here.

With this job, I inherited a page layout dating all the way back to 2003. It's tables-based and, for various staffing reasons, work can't or won't give me the time to ++redo from start++. Which is a pity, because every time I have to tweak the layout or add bits, it's like pulling teeth. (Shout-outs must be directed to the gas and air that are FireBug and Web Developer with its 'outline table cells' function. But still.)

The additions I make to this heap, I do with CSS, since working with the existing layout is so unwieldy and I'm always rushed for time. So it's improving slowly, piecemeal. This still feels like buffing and painting the fingernails of an 89-year-old EMI care home patient (with the crucial difference that this 'patient' cannot appreciate it) and I wish there were more than two of us here because given a couple of days I could come up with a more-or-less working page with no tables at all, except what Barley imposes on us (the left-hand nav found across all bbc.co.uk pages).

Graaaah. However, I have managed to solve an IE-specific layout bug that's been catting my footsteps for some time on several different projects. IE likes to stick unwanted gaps between images and divs, ignoring whatever margins you set. Solution: wrap an additional no-margin div around the image.

"Grab a book, post random sentences" meme

Because the nearest books to hand are quite amusing, I'll lift this meme from Thad:

1. Grab the nearest book.
2. Open the book to page 123.
3. Find the fifth sentence.
4. Post the text of the next 4 sentences on your LJ along with these instructions.
5. Don't you dare dig for that 'cool' or 'intellectual' book in your closet! I know you were thinking about it! Just pick up whatever is closest.
6. Tag five people, if so inclined.
(I'm not)

Teach Yourself Allaire ColdFusion in 21 Days1 by Charles Mohnike and Mews by Herm Baskerville were about equidistant (one on my desk, the other in my backpack) so let's do both. MIXED TOGETHER.

Read the rest of this entry »

Simply cobolled together

What programming languages fix.

True story I probably shouldn't admit to. A while back, I was listening to a friend enthuse to me on the phone about Fortran and how much fun he was having DDoSing sites like Habbo with it.

That is, I thought he'd said Fortran and assumed he was talking about DDoS attacks, and was thus very confused until I worked out he'd actually said 4chan and was describing a raid. Ah. /b/tard, then, not l33t h4×0r. Explained a lot. (I had never gone near either the language or the anime boardplex, but knew of the existence of both, so I've no idea why I 'heard' one over the other.)

Your geekiest misheard phrases, folks?

Monstah trucks! Monstah trucks!*

Today I'm amusing myself by recoding something I've had my eye on for a while. Yes, at last I have an excuse to take a hammer whelk and chisel to [flagship religious current affairs programme]'s pages.

This is not part of the job spec—not that there is a job spec; it was just "[Herms], could you find out why this big gap's appearing in half these pages?"—but the pages in question are so outdated that, despite having a Firebug to help with diagnosis, it's about as quick to strip it all out and refit it. And what the hey, I'm in late anyway because of the doctor this morning, so I really don't mind.

Well. Test subject #1 was tables upon tables upon pointless spacer gifs. It is now CSS and a lot tidier.

Or will be if I can solve this final bizarre spacing problem on Firefox, that is. Much as I find IE sickening from a usability standpoint, it seems to interpret padding and suchlike much more sanely than the Mozilla family.

*management makes no guarantee that title of entry is in any way representative of contents, although it may give insight into poster's mood

<cfquery name="isthisfunnyorisitjustme" datasource="friendslist">

I think this guy (from a BBC Backstage mailing list) has the funniest signature I've seen this month.

SELECT * FROM remarks WHERE witty=1 LIMIT 1

It's SQL, and (I'm sure someone who actually knows SQL will correct me on my translation) says "select one record from everything in the 'remarks' table, with the condition that it must be witty". So it's a SQL way of saying "insert witty remark here".

(I think this statement would always return the same witty remark unless you added some kind of command about ordering the results. Not sure, though.)

I'm very easily amused by jokes in languages I don't know well, purely from the excitement of being able to understand them.

I'm walking blindfolded, completely automattic

My Perl Akismet module is installed. Now I've absolutely no idea what to do with it. Won't this be fun!

(I anticipate a lot of help-cadging from people on UnitedHosting's support fora.)

Galleries are go

Religious, ethical and other stuff photo galleries!

The web developers did the design and all the Javascript, the index design and overall colour scheme was another colleague, a different colleague made most of the galleries (i.e. cropped images and wrote the copy), and all I did was to build the index and make or modify various bits of CSS, and the monkeywork in checking things worked and debugging a few little 'quirks' and polishing SPG and correcting alt text and copyright links and stuff, but I'm proud.

I feel like I've done some real work for a change, even though it's hardly what I think of as real coding.

'Allo 'allo (in Frisian)

A nice coworker, when I mentioned my much-beloved and rather hackishly abused wiki, put me onto MoinMoin. Faster and better than UseMod, he says. Written in Python.

Which would generally stop me in my tracks (that's why I chose UM – single Perl script), but he says Python's easy to learn…

I assume my impressive and competent webhosts won't blink if I ask them about mod_python.

Comparing MoinMoin to UseMod on other counts does sound positive. For example, MM supports the inclusion of 'boilerplate' text (which is what I painstakingly hacked UseMod to do) and footnotes. Even the markup is largely the same.

Migration'd be a pain, though. A script or something would be very nice.

(And, of course, those of you who've friended my LJ know I don't need another project just at the moment…)

*chants like a Mudokon*

I think I'm going to cut down Shaded psis' maximum ranges again. About ten metres, plus one in exceptional circumstances, is plenty – possibly too much.

(Actually, I thought I already had changed it to ten… but Twine says differently. Bah. Probably dreamed I had, or decided to then forgot.)

This randomness brought to you by the Trying To Edit Other People's CSS Brigade. (Today I got called a CSS whizz, which is laughable. Depending who you compare me to, anyway.)

Twelve Days of LJ meme

Firstly and unrelatedly, I need to go through the recovered files from my hard drive/s and see if I've still got the source for my 'Twelve Days' interactive Xmas card. For those who haven't seen it, 12D is a cutesy little text adventure written in Inform, and good gods that was fun and frustrating to make! In any case, I want to update it, otherwise some people will be stuck with 'generic' ones instead of personalised.

Anyway, I'd hate to have lost the source for that and the Rocca Vs Umaa game I started ages ago.

Read the rest of this entry »

Search
Categories
Archives
Writing groups
The Out Campaign: Scarlet Letter of Atheism