Saturday, 13 August 2011

Half way between a giant anteater and a baboon

Lauren and Phil Ruse on Paignton beach
Away for a week, where two really good days sandwiched one really bad day... and the rest were average. I spent a lot of time reading; finishing The Shipping News and the larger part of Kerouac’s On The Road - more on that later.

Little Miss R spent an age on the beach building sand castles - or more accurately demolishing mine - and digging a large hole in the sand which inexplicably she was determined to fill with water; this was - I later found out - her favourite part of the holiday. Later that day she had her first swim in the sea - which was my favourite part of the holiday.

The following day she was sick, so sick; I have never seen so much produced by someone so little, and for so long. Was it the small taste of seawater, the ridiculously large meal or too much time in the sun? It’s to her credit she was uninterested in blame, and it was probably my fault.

If a first swim in the sea was the moment, the best day was a visit to Paignton Zoo. How pedestrian I am, yet it’s never easy finding the balance in our band of three. It’s a big zoo and fills much of the day - perhaps five hours; I am thus satisfied with a long walk whilst Little Miss R - amongst other creatures - is content with a cool Kangaroo. It’ll do.

Friday, 5 August 2011

'Fun' with CSS

For further fun I have been aiming at horizontal (only) scrolling, for the purposes of displaying code samples. Taking a previous post; it overflows correctly in Chrome and Firefox but fails to do so in Internet Explorer 8, and I presume earlier versions. Worse - or to make it more convoluted - I can specify exact width, extract the CSS and the HTML and have it working in IE8, but the same code still fails within the context of Blogger. I’ll trace the cause eventually (and use the <pre> tag rather than a <div>) yet it’s possibly a little obsessive; in all my posts I’ve only displayed code twice, and only once has it required scrolling.

Thursday, 4 August 2011

‘Fun’ with JavaScript

With some on-going tinkering yesterday evening - styling the search widget on my blog - I wasted hours on a difference between how Chrome and Internet Explorer (and later, I discovered Opera) executed some JavaScript compared to Firefox. ‘Hours’ because I managed to side-track myself with the onblur event, and the problem was something far simpler. I put it down to rustiness - an accidental mixing of syntaxes - though the truth may be less kind; never mix alcohol and coding, kids.
<html>
<body>
<input name="search" type="text" size="10" /><br />
<input name="search" type="text" size="20" /><br />
<input name="search" type="text" size="30" /><br />

<script type="text/javascript">
var x = document.getElementsByName("search");
var i = 0;
for (i=0;i<x.length;i++)
  {
  document.write(x(i).size+' ');
  };
</script>

</body>
</html>
As usual it was a case of reducing the code to something more manageable. On executing the example above, Chrome (my default browser) and Internet Explorer will write out the sizes of the three text boxes, whereas Firefox will not. The reason is all to do with brackets; we use square brackets to access an entry in a nodelist, and parenthesis (rounded brackets) for the optional arguments to a function or method call. Chrome and others are effectively treating item as the default method on a NodeList object - hence the example JavaScript works, whereas FireFox isn’t - and the example JavaScript fails.

Sunday, 31 July 2011

Developer reading The Shipping News

A Sunday the same as any other. Walk to shops. Reward myself with large latte and a very berry muffin. Exercise the guilt. Then watching Inception, at least think I did. Poor joke that. And reading The Shipping News. Good book; how to impart flavour? Present tense. Choppy sentences. Missing pronouns. Sparse. Don’t get that, not at first. Clever though, has a reason. Unlike this. This is poor. Embarrassing. Worse than a joke. Worse than that joke. Sound like HULK. HULK HUNGRY. MUFFIN NOT ENOUGH. HULK WANT MORE.

Thursday, 28 July 2011

Applied imagination

Brainstorming, whether via a formal group or with thoughts collated electronically, is one of the valid methods to problem solving. It does however require an environment that encourages unusual ideas and one that (crucially) reserves criticism; it’s to be expected that the majority will be dismissed. New and successful ideas will only be created in a setting where common assumptions can be freely challenged, even when those assumptions usually turn out to be correct.

Where it is less successful therefore, is in the public domain; when, for example, you’re Steve Hilton, the Prime Minister’s strategy director. That’s not to say it’s any less valid an approach, more that you’re unlikely to find a mature audience (you’ll certainly not find a grown-up press or opposition party) willing to hold back criticism until the later stage of the process. Perhaps that’s the way it should be, we are a democracy, though the danger will be evaluation apprehension, which is to nobody’s benefit.

Steve Hilton’s offence was to address a perceived problem - that maternity leave hurts women by discouraging employers from hiring them - by suggesting the scrapping of such leave. It’s not even close to being government policy, nor will it ever be, it’s the “challenge common assumption” role; Hilton challenged, the group dismissed, everything worked as it should. What’s depressing - or should that be predictable - is the response when this iteration of the process was made public.

I’ve read several comments inferring he devalued women (he didn’t) and/or pointing out the valuable contribution women have made and continue to make; well, you don’t say. The problem with such statements is they brush over the problem at hand; they don’t even trouble themselves by addressing whether there is a problem, though the long list of female achievements that usually follows implies there is.

Let’s assume as much; some employers are dissuaded from hiring women. What then is the answer? Clearly not scrapping maternity leave, but then constant references to an untapped ‘pool of female talent’ haven’t appeared to work either. Put simply, we have an employer choosing between prospective employee A and prospective employee B; if employee B has more rights (or is more likely to exercise those rights) than employee A, and the employer identifies the exercise of those rights as carrying an administrative cost, it doesn’t take much to figure out what might happen next.

One suggestion is to ensure not only equal rights, but the real possibility of those rights being used equally. A shared paternity allowance available to either partner would make discrimination on the basis of sex, patently pointless. Of course I’m only brainstorming, this hasn’t been thought through and anyway... it’s only an idea.

Wednesday, 27 July 2011

Reading and writing and the other thing

I’m in a bit of a post-happy mood on WWGCA, as those in the know like to call this blog. Admittedly the subject isn’t always too cheerful, but I am pleased - probably too pleased - at my ability to string a few words together; into what those in the know like to call a sentence. I’ve also been reading a lot, or more than usual, and the catalyst has been my Kindle. Those books I can’t find for my new friend, I read the old fashioned way. After watching Brokeback Mountain last Friday and discovering it’s based on a short story by Annie Proulx, I’ve started on The Shipping News, which already feels like a favourite. I remember liking the film too, though my image of Quoyle is now somewhat distant from that of Kevin Spacey. It’s so good I even found myself reading in the evening, imagine! That’s when I’m not distracted by the collaborative writing exercises of daughter and friends (hopefully) some years ago, now pinned to the board:
Exercise one
Exercise two

Tuesday, 26 July 2011

To entertain a thought

It is the mark of an educated mind to be able to entertain a thought without accepting it.
-- Aristotle
I too was impressed with the Norwegian Prime Minister’s response of “more democracy, more openness”, in answer to the bombing and shooting in his country that cost so many lives. Yet I also find it instructive that following an objection from the police, the perpetrator was denied a public statement; which was no doubt to the relief of the court. I can certainly understand - and suspect - the reason this action was taken, but I note a wider sympathy for denying him any opportunity to speak.

Democracy isn’t the freedom we are given, it is the freedom we give to others; even to those who commit the most terrible acts. It gains strength not through brushing repellent types under the carpet, but by having the courage to confront those more unpleasant elements. It is a willingness to be challenged. If we really are to shut down debate on some subjects - as a recent Guardian article seemingly suggests we should - then whatever the argument, we’ve already lost.