Archive for the ‘Writing’ Category.

Displaying html code listings your blog

I’ve long admired technical bloggers who spout seemingly reams of code listings to illustrate and support their blog articles, whatever the subject.

My recent forays into testing html5 and reporting the findings has lead me to want to produce my own listings. Really simple I thought, just dump the plain text from the source between two <code> tags and hey presto, one listing. Um… No, not quite that simple. It works fine for css - it’s considered plain text unless found in the <head> of a document between <style> tags. Html, however, is more tricky as the browser wants to render it <code> tags or no <code> tags.

Veteran code geeks may laugh and point at my obvious stupidity but I can honestly say it was only after several frustrating minutes of forum searches that the doh! moment struck and I remembered html entities.

So for anyone else out there bashing their head on this seemingly simple conundrum here’s the solution:

  1. type or paste your html code into your favourite blog software between <code> tags
  2. change every & to &amp;
  3. then change every < to &lt;

If you fancy showing the line numbers as well you can always mark up each line as a line item <li> within an ordered list <ol>.

Simple - now I know that is…

… happy code listing!

Saille 1

She tasted and smelt mud and then raised her head and spat. Why was it always like this she wondered? why could it never happen when it was dry or just as she was about to fall into her blankets at the end of a long day. “Grandfather, Grandfather! come quickly!” The sound of her young brother’s voice pierced the painful haze surrounding her head. She felt the steady rain soaking her back as the rest of her body awoke, twinging and leaden.

Between them the two men helped her rise and stagger into the nearby hut, her basket of eggs forgotten. They would be broken and wasted but it did not matter, this was more important.

“What did you see?” Clamoured young Llew. “Go outside, impatient boy! Fetch the others, we will all hear then,” ordered their Grandfather. They all came, no one questioned a summons from Derw; Saille’s visions were not rare but they were always important. Everyone remembered when she foresaw the flooding last spring and the whole village left just in time to avoid being destroyed by the new path of the river.

As the thumping in her head receded and her normal vision cleared, Saille saw the waiting anxious faces around her and began to speak:

“I sat on a darkened hilltop and heard voices speaking quietly in some strange harsh language. They were coming towards me up the hill so I hid and watched from behind a rock. Ten geese flew across the moon as I waited for them to appear. They were strangers dressed for battle but muffled so their swords would not strike against their belts. They were happy to see such an open land in front of them, quiet in the dark with no lookout. ‘And so shall the daughters of the sea be unprotected as we come upon them and though their fathers shall rise, they will be cast down’. Then the mists rose and fell and I stood above a battlefield and all the pennants of men were broken and torn and blood ran in streams down the cliffs into the sea. As the sun set, a wolf stood and howled above the Dragon’s Tail and the laughter of men and marching of feet rang in my ears. The moon was full and the night black with ravens that covered every path and stream and rock like a cloak.”

“What does it mean?”

“A darkness is coming and we must be vigilant,” Derw concluded. “The king should know of this.”

“But when is it coming and how?”

“We will have to watch and be ready, be it ten days or ten generations until they come.”

A note on confidence

I’ve always stuggled with confidence in my own voice whether singing, writing or taking photos. There is so much already ‘out there’ on the infinitely accessible web it seems as though my voice is too small to be heard. In all that volume there must be someone out there with more important things to say than me and if there is I shouldn’t be saying anything.

In defence of myself and others like me, I now think that’s nonsense, as I’ll explain.

I read an article (in The Countryman of all things) in which a professional photographer waxed lyrical about the sheer volume of photography on the internet which is a direct consequence of the ease of access of the internet and the rise in affordable digital photographic equipment. I’ve noticed this volume first hand on Flickr. There are groups for specific types of photography such as ‘flowers’ which are posted to by hundreds of people world wide every day. That is a lot of photographs and I must admit I find it very daunting. My one little picture of a primrose (of which I am very proud) has been lost a day later under the weight of new entries.

The gist of the article as I understand it is that to get noticed (and rise above the crowd of equally amazing macro shots of exotic petal edges or whatever) you have to take photographs with impact, relevance and purpose. In other words your pictures (singing or writing projects) have to tell a story that stops people in their tracks. I find this concept incredibly daunting. In order to have a voice that is heard (assuming you don’t write or photograph for your own amusment or simply to pass the time) you have to be better than everyone else at finding the right shot, subject, turn of phrase at the right time and then publish first.

Inside all of us is a wish, not to be better than everyone else, but to be valued and listened to. Perhaps we believe that maybe just one person will read what you’ve written or see what you photographed and regardless of what they took from it, it will change their life.

There will be many people out there who would read that article and not worry whether the internet is overloaded by confident people shouting their opinions and so perhaps they shouldn’t overload it any further. They won’t worry that there might not be any small arenas anymore where tiny lights can shine. Are they the ones overloading the internet in the first place? Why should we who care shy away from having our voice ‘out there’? Are we afraid that actually the internet is being overloaded by those people that seem to need their voice ‘out there’ as a boost to confidence?

Perhaps there are three types of people: 1] people with something to say who are confident in their forum choice, 2] people with something to say who feel daunted in their forum choice, and 3] people who want to be heard before they have something to say.

I feel an affinity with people of type 2 but as this journal is witness I no longer feel as daunted as I once did.

So I now present the opinion:

If you’re worried about it, you probably shouldn’t and if you’re not worried you possibly should be.

People who think long and hard about their views and whether or not they should voice their opinion may be more infomative, rational and full of sense than someone who hasn’t wondered whether there’s already a lot of ‘guff’ on the internet and if they should be adding to it.

There’s always the option of local gatherings, small clubs or writing groups and if you do find them full of ‘guff’ at least you’ve had the chance to get out and meet new people!

So much less and yet so much more

When there is so much more to be seen we record so much less, have you noticed? Even though I’ve decided to commit more to paper (or at least virtual paper) I’m so frightened I might miss something, I daren’t look at the keyboard. In the last couple of weeks the weather has got warmer, I’ve seen blackbirds fighting over territory and Hazel catkins have opened, glowed and gone brown.

All the crocuses I planted in the garden are out and I don’t know which day they first opened. I remember I noticed it the day the first daffodil opened but I didn’t write it in the diary so I can no longer tell you when it was. The wintry hedges have been revitalised with flashes of bright green hawthorn leaves and pale ghostly blackthorn flowers. Pussy willow catkins are showing their first silver fur and my neighbours ornamental plum has turned pink and frothy seemingly overnight.

Even though I work in an office in the country with a window overlooking paddocks, drive over the Malverns every morning and evening and apparently have more time than everyone else (I am employed part time) I miss things. I make it a habit to notice the world around me and yet sometimes it still spins away to appear reborn anew and different a couple of weeks later.

As I get older I find I’m not so afraid of missing seeing things; I carry a notebook and diary around with me. Now I’m just afraid of forgetting to write them down.