Archives

All posts by Lemon Grass

I really enjoy learning new things in the field of computer science.  Recently I have been learning some new computer languages and having a great time into the bargain.  Ruby is my favourite, but I’ve also started playing with node.js which is an asynchronous IO library bundled with an implementation of JavaScript (or ECMAscript) because substack has been Plurking about how wonderful it is.  I’m not all that keen on JavaScript so far, partly because I’m so keen on Ruby and partly because of the criticism of it by Douglas Crockford in his book JavaScript: The Good Parts.  However he is not totally anti-JavaScript and has spent a lot of time working on its standardisation as described in a YUI Theatre video called The State and Future of JavaScript.  (This was very interesting for me, for reasons some people may know, though of course I didn’t agree with everything he said.)  There’s a bunch of intriguing talks available at The YUI Theater which I’d love to watch.  I did watch the one by Ryan Dahl on node.js and I expect I will go back for more.

The computer on my desk at home runs Windows (XP SP3 at the moment) rather than my beloved NetBSD or a Linux variant.  Of course my servers run real OSes, but I wanted to work on my desktop machine and so spent a while installing node.js, its package manager and associated packages under Cygwin, which is what makes programming on a Windows machine bearable for me.  The node.js installation instructions cover Cygwin separately and the instructions there worked for me.  However I had a problem using the Node.js Package Manager to install third-party modules.  As described in this email thread, Cygwin pipelines into gzip can hang in certain environments.  I spent hours rebooting, reinstalling and futzing around until I found that thread, which goes on to lay the blame on a “BLODA“.  It turns out that certain antivirus applications can cause this, by hooking themselves into the system call invocation chain in a way which doesn’t actually work perfectly.  I turned my AVG Antivirus Free (v11) off for 30 seconds during the installation of this particular package (called “request“) and the installation went like a dream.

Node.js is young software and under frenetic development.  One promising use-case is the implementation of very scalable web applications, where the asynchronous IO model can yield great efficiencies.  My interest in it is as a web client, where I hope to use it to retrieve and execute JavaScript from websites whose applications depend on it, but with which I want to interact with programatically rather than manually in a browser.  Some such websites (for example Plurk) provide proper APIs for this, whereas others, such as Facebook, do not.  Facebook requires you to write a Facebook application instead.

A consequence of node.js’s youth is the immaturity of adjunct libraries for interaction with other services.  Although HTTP is treated as a first-class application with built-in support, that support is primitive at this stage when compared with Ruby’s net/http.  I’ve been exploring the available libraries for node, which for HTTP client applications include node-httpclient, node-get, node-http-digest, request and abstract-http-request of which the last two look particularly promising.  None of them appear to offer cookie storage between requests, which is something I will need.  At the moment I’m thinking of using one of the available key-value storage libraries which are available to store cookies.

Once one receives the appropriate page from the server, the HTML may need parsing (and there are plenty of HTML parsers for node, such as this), and scripts therein will need executing (aha! That’s why I’m using JavaScript to write the program!).  That’s all in the future.  For now, I’m able to run simple JavaScript programs which fetch pages from websites, and ready to start the real work.

Sitting here in China, wondering what to do, I decided to write some code to help with analysis of moves in a wargame.  Rather than write it though, I started to wonder why people like to write code.

I find writing computer programs fun. When they work, it’s fantastic. When they won’t, it’s frustrating.  I love learning new skills in computing, new languages, environments, toolkits. That’s not to say I like all the ones I come across; there are some which put me off, or which I fail to understand quickly enough to keep my interest. (Ruby on Rails is one such.)  I claim that learning to use these new tools keeps my brain sharp.  Recently I’ve been writing web-hosted database applications, for fun!  I used to think databases were the pits; the boring, commercial end of computing, but now I’ve found a need to use them and find lots of interest, particularly in constructing complicated queries. I never cease to be amazed at how much one can persuade the server to do, rather than have to code into the client application.

This morning though, it wasn’t the challenge which excited me, or even the benefit the new code would bring once it was completed – it was the aesthetics of the code itself.  There are two aspects to that, one serious and one more trivial.   Since I learnt my original computing skills (in assembly language and BASIC), the power of languages has changed greatly.  There’s a good deal of satisfcation in being able to write small chunks of code which do a lot.  I find Ruby particularly rewarding in this respect.  Secondly, editors with syntax highlighting make code so attractive!  Pretty code draws the eye; colours help understanding.  I want to code because the result is pretty!

Pat Metheny Orchestrion, originally uploaded by lemon.grass.

I am fairly hooked on Pat Metheny’s music, so I was really looking forward to seeing him live with Orchestrion at the Barbican Centre last night.  The atmosphere was good, and I had one of the best seats in the house, 7 rows back and right in the centre of the stalls.  The technology is fascinating – lots of solenoids controlling mainly acoustic instruments and some electric guitars.  He can control the whole setup from his guitar in almost real time.  It’s a great setup.  OK, so the technology let him down last night near the end of the concert, and his closing number had to be cancelled; that didn’t matter as we were treated to some more familiar pieces instead.  The trouble is that the automated setup has some serious musical limitations which in the end left me feeling that it was frankly boring.  Pat’s act used the orchestrion in two distinct modes: pre-programmed, and live.  In the pre-programmed mode, computers had previously recorded Pat’s playing of the orchestrion, and on stage he soloed as it accompanied.  In the live mode, the automated instruments sounded in response to Pat’s playing, detecting the tones of the notes and playing them on the many percussion and strung instruments in the ensemble.

Player pianos are fascinating devices, as Pat points out, and one can watch them for ages.  But frankly one doesn’t look to them to produce inspiring performances.  What makes an inspiring performance on stage?  The interplay between the players; the way they react to one another and inspire each other to go a bit further; the feeling that we, as members of the audience, are privy to the excitement which flows between the performers.  All that is lost with a pseudo-solo performance like this, and worse, the automaton doesn’t read and react to timing and mood changes in the live performance.  When Pat starts a soulful solo, and then the orchestrion comes in, it often comes in at the wrong speed.  A live backing group would be listening to the soloist and timing their entrance to match his tempo.  The opposite problem occurs when Pat leads the performance in the live mode.  The detection of which notes are playing and the reaction time of the mechanics leads to a noticable lag between the soloist’s performance and the accompaniment.  I did become use to this delay after a while, but it is a serious limitation, compared with multiple performers playing together.

Overall, I found the Orchestrion experience flat and somewhat disappointing.  As he freely admits, it’s an experiment, and he’s feeling his way. The most interesting part of the evening was listening to him talking about how it worked, and demonstrating the machine. He has a very pleasant manner and comes across well. I hope I get the chance to see him performing live with live performers soon, so that I can experience the real music.

Ten or 15 years ago when I used to visit the National Railway Museum in York very often, I was very excited about the realtime railway signalling display they had installed on a balcony overlooking the East Coast Main Line which runs past the musuem.  Could this really be live, I wondered?  And yes, it was.  Five screens showing real time train movements along the lines from north of Doncaster to Northallerton in Yorkshire.  I spent hours looking over the displays and learning how everything worked.  It was a real treat for a signalling enthusiast.  Many lunchbreaks I spent there, after eating my lunch at the rather nice cafe (at which I receive a discount of 36.25% for being a member of the museum’s Friends).  After a while I had picked up enough information, from watching the displays and from talking to more knowledgable visitors, to be able to explain the display to other visitors, and I would also give short talks to groups of schoolchildren as they visited the museum.

There were problems, however.  The analogue monitors were subject to disturbance from the electrical interference generated by powerful electric locomotives as they drew power from the overhead lines.  This would scramble the displays for a minute or so as trains left the station travelling north towards Newcastle.  Over time the displays themselves became tired and began to fail, and it proved too difficult for the museum to arrange for them to be repaired.  Such systems are built by disparate consortia and put into museums as a result of goodwill and negotiation.  As people move on and firms are taken over or close down, the network of contacts which installed the displays can disperse.  First, the departures board stopped working, and then one monitor after another failed and was switched off.  I recall the day when I went to the museum to see a notice declaring that the display was to be removed; I was very sad.  This became one reason why I no longer regularly visited the museum.

Earlier this week however I visited once again to have lunch, and went up to the gallery to see what was going on in the workshops.  Imagine my surprise and joy to see that the live display had been modernised and re-presented, with five new flat-screen displays offering a much improved view of ECML operations.  I was thrilled.  The NRM had pulled a rabbit out of the hat.  My future visits to the NRM will be much happier ones.  Thanks, NRM!

 

NRM IECC display – overview.

NRM IECC Display – North of Doncaster.

Humphrey Littleton, before he died, used to host a comedy programme on Radio 4 in the UK called “I’m Sorry, I Haven’t a Clue“.  After his death, the BBC put up several extracts from the show on their site, one of which just makes me laugh and laugh.  The programme often featured audience feedback from a Mrs. Trellis, of North Wales, as in this case, the Mornington Crescent Audience Response Survey.  I’ve seen several transcriptions on the web, but none are quite right, so here’s my own:

“We asked 20,000 listeners ‘How would you rate your level of Mornington Crescent satisfaction? Excellent, good, or merely well above average?’  and the reply we got back, …,  came from a Mrs. Trellis of North Wales, who I see has ticked the box marked ‘Neither Good nor Bad,’ and also the boxes marked ‘Poor,’ ‘Very Poor,’ ‘Really Extremely Poor,’ ‘Words Begin to Escape Me as to Quite How Poor,’ and ‘Buttock-clenchingly Piss-Poor’.  In fact, Mrs. Trellis sent us back the wrong form, and if there’s anyone listening at Virgin Rail wondering where it got to, …”

Asterisk is an open-source PABX.  It can connect existing telephones, “soft phones” running on a PC, and physical IP phones to the VOIP networks and to existing “POTS” telephone lines.  Connectivity to existing telephones and exchange lines is provided by either external hardware boxes such as Astribank (for large systems) or PCI plug-in cards such as Digium’s TDM400P.  Cards are also available to connect to digital lines such as T1/E1 to provide multiple lines.

Using Asterisk, I can connect telephones in my children’s bedrooms to the one in the kitchen, and allow them to make phone calls (with restrictions).  I can also connect to my home telephone system from the Internet and call my wife on a real phone from my iPod Touch, or make a call apparently from home when I am in a conference room in the USA.  Also, I can provide new telephone numbers in minutes (via VOIPuser for example) which connect directly to a particular phone in my house, or my PC wherever it is in the world that day, or to an automated message.  I can receive voicemails and have them sent to me by email.  I can also write simple teleohony apps which (for example) tell my wife how many emails she has when she dials *90 on the phone in the kitchen.  The telecoms world becomes my oyster.

Asterisk is available in many forms, both in source and binary distributions designed to run on a PC.  The easiest approach is to dedicate a PC to running Asterisk (though mine also runs a firewall for my home network and a disk server).  Pre-packaged distribtions for this are available and the one I prefer is Trixbox.

Getting Asterisk to work in the UK with caller-id can be tricky.  Having struggled with it several times and found a solution which works, I thought I’d write it down both for my own reference and to help other people struggling with this problem.

  1. Install Trixbox 2.8.0.1 from CD.  Trixbox is based on the CentOS Linux distribution.  Mind, it will find and destroy *all* your hard disks at installation time.
  2. Upgrade to Asterisk 1.6.0.10 (I think)
  3. # yum clean all
    # rpm -del –nodeps kmod-dahdi-linux dahdi-linux
    # yum -y update           (this takes a while)
    # yum install kmod-dahdi-linux dahdi-linux

  4. Then edit /etc/modprobe.d/dahdi to add a line as follows:
  5. options wctdm opermode=UK fwringdetect=1 battthresh=4

  6. Then edit /etc/asterisk/chan_dahdi.conf to add the following lines after “usecallerid=yes”
  7. cidsignalling=v23
    cidstart=polarity

NOTE that Asterisk seems to refuse to use the outgoing line after a reboot until the line is unplugged and plugged back in again!

In England, the extended family has become less extended than it used to be.  Grandparents often get shoved into old peoples’ homes and children and young people choose to spend more time online than talking to granny.  When I was young my grandparents were too far away to see often, but I had a godmother with whom I had to have tea once a week after school.  I can’t really remember whether I initially wanted to go or not, but I was soon convinced by the wonderful selection of biscuits and cake and sweet drinks which she set out.  She had a cupboard of toys and I could go and choose.  As I got older, we played card games.  She was a very wise lady, reserved, totally calm.  I can’t remember any single piece of wisdom I got from her, but I remember mostly the attention she paid to me: the non-judging, calm interest, and the quiet love behind it.  I think a child really needs a mentor, a person outside their immediate family whom they can trust and can talk to about issues which they can’t resolve with their parents.  This need doesn’t go away when they reach teenager-hood, and maybe it gets more important then.  (I was cast loose by my parents when I was 16, as my mother died, but an exciting new life took over, with great new relationships to support me.)

The middle teenage years and the time up until one goes into full-time employment seem to me the most exciting and turbulent time of life emotionally, and one to be lived fully, drunk deeply.  The ups and downs of teenagerhood can seem extreme.

I would like to understand better how other people were cared for during their growing years.  Does a supportive adult outside the immediate family play a role in most people’s growing-up?  How has that changed over the last few decades?  The Internet might suck our children’s attention into their computer screens, but it doesn’t change their emotional needs.  So where do today’s teenagers get the emotional support they need and the wisdom that they will need?  Can the Internet have a positive role to play here, as well as the negative tendancy to diminish social contact with older people?

I have always wanted to be a godparent, and it’s been one of the disappointments of life that no-one has ever asked me to take that role.  Godparents are of course a mixed bag.  I’ve had three, only one of whom I can really even remember.  My children have 10 between them.  We chose them with as much care as we could, but only two or three of them have been any good.  It’s obviously not an easy thing to get right, nor an easy role to fulfil.

In addition to the normal banter of our social-networking friendships, I have been talking to some of my younger social networking contacts about issues they have in their lives.  I didn’t set out looking for mentoring-type relationships at all, and in fact I generally steer clear of younger contacts so that I can behave badly online without corrupting children.  However a few carefully-chosen such contacts have really added a special element to social networking for me.  It’s a far cry from godparenting with the commitments which that implies, but it’s not unrelated.  It’s almost tempting to think of setting up a service to put wise old folk in touch with needy teenagers; for about a second.  I think such contacts are much more personal (spiritual) than would be best served by an on-line matchmaking service.  Vouching for the wizened wisearses would be impossibly dicey, with reputation scores being impracticable, and all sorts of undesirable results possible.  However, I do think that social network sites can provide places where such contacts can be made, slowly and carefully.

The flip side of all this is that one has to be careful not to end up letting the activity of supporting others drown out the support one needs oneself.  I use social networking for amusement and to let out my own feelings, and gain a supportive buzz from my online friends.  Other people have told me that sometimes this can become a real burden.  Just as in the rest of life, a healthy balance is needed.

It does seem that demand outstrips supply in this market! I wonder if this will change over the next decades.  There are lots of wise old folk out there who are also lonely.  Perhaps as the population ages, older people will become sufficiently computer literate to get connected with younger folk looking for advice and support.  This is an outcome devoutly to be wished.

I have been enjoying Plurk since June 2008 and have found people there of whom I have become very fond.  They are individuals, but they’re also a group.  I have received and given an awful lot of emotional support there which has been helpful in many ways: helpful in avoiding depression and defusing anxiety; helpful in learning more about people (really a lot – I understand a lot more about the emotional life of women now than I ever did before, for example); helpful in terms of feeling valued.

One of the troubles with Plurk, though, is that it sucks up a lot of one’s time and energy.  Fairly early on I became Plurk-obsessed, spending all night typing messages to people (you know who you are!).  After a while I got over it and scaled back to a manageable level.  One of the key features of Plurk is the ability to turn on and off one’s subscription to the posts of one’s “friends”, without dropping them as friends, and without them being informed.  There are lots of ways of managing one’s reading load on Plurk, but mine is to reduce my friend list as much as possible and then to switch on (“follow“) only those friends whose Plurks I genuinely want to read.  In this way I can pay full attention to those people.  If I tire of reading someone’s Plurks, I switch them off for a while and try again in a few weeks.  If they stay off for ages, I eventually drop them as a friend.  Usually, they haven’t been commenting on my Plurks, so the uninterest is mutual!

In these ways, I select and get to know a group of people of whom I eventually become quite fond.  Some of them, I get awfully fond of.  To be fair to me, I haven’t fallen hopelessly  in love with anyone on Plurk (you know who you nearly were!), but that’s only because I’m older and a little more balanced than perhaps I once was.

Then comes the sad part: sometimes people leave Plurk.  As I mentioned before, it can be a terror in stealing one’s free time, or one’s otherwise committed time, or one’s creative time.  (I have worried about this myself a bit, because my creative activities have certainly suffered.  But my social life has certainly benefited.)  So they leave, and leaving is usually a struggle, because those left behind cling on (“We’ll eat you up – we love you so”, said the Wild Things).  The manner of leaving therefore becomes sudden and shocking – a clean break is the only way to do it.  Then comes the grieving.  I’m doing some of that today as you might have guessed.

As a one-horse social networker so to speak, I lack the confidence in cyberspace that some of my friends have – “I’ll see you elsewhere on the Internet”, some of them say.  But I think, “But what if I don’t?”  So I need to grow up and remember that real contacts made will last beyond Plurk.  I still remember the brother of one of my remaining Plurk friends, who left last Summer.  I was so upset that I tracked him down and met up with him in the pub.  Must do that again actually.  I almost managed to meet another plurker at Leeds station a few weeks ago, and have every hope of meeting a Canadian plurkfriend in Vancouver next week.  Physical hugs are more satisfying than virtual ones, but the sad thing is, one gets them so much less frequently.

Of course, one makes contacts and loses them again in person as well as on the Internet.  One big difference though is the turnover rate.  I’ve made more deep contacts online since June last year than I have in person in the last 10 years.  (I’ve likened it to a second teenagerhood.)  With those who have left Plurk, I know that I won’t have the daily contact in the future that I have enjoyed in the last months.  There’s no doubt that I will be grieving.

Will I “learn” from these natural, blameless losses not to get into such deep emotional commitments?  Perhaps getting into deep relationships on Plurk has been part of the recovery from my mid-life crisis, exploring the possibility of making commitments again, having lost the ability to do that completely a few years back.  Part of me really hopes I don’t “learn” not to do that – the part of me that has always been an over-committer; someone who is willing to throw themselves into an activity or commitment without reserve, without keeping something back for a rainy day.  I love that attitude, because it represents the living of life to the full, the plunging deeply into incarnation and getting the most out of one’s experience of life.  If I have re-learnt part of that through Plurk, then it’s been an experience well met, well sent, well planned.

Catch that speck of hate, which you created;
Hold it, and convert it into love.
Grow with it, then release it
To the world.

I wrote those lines for a fellow student and friend at university, Andy T.,  who had a lot of anger.  He was much impressed and took the poem away with him.  It also worked for me, as part of the introspection which was already part of my life by then.  I was really able to catch myself in the process of thinking a nasty thought, and hold the thought, cherish it and change it into a loving one.  It was quite a revelation and several of my friends took it on board.  Nowadays there’s not much hate in my life, but I filter my feelings less too.

Fear and anxiety are powerful stalkers, and this prayer tackles them in a wonderfully original and peaceful way.  It might seem strange at first, but it really works. It is taken from Meditative Prayers For Today by Adam Bittleston, published by The Christian Community Press.

May the events that seek me
come unto me;
May I receive them
with a quiet mind
Through the Father’s ground of peace
on which we walk.

May the people who seek me
come unto me;
May I receive them
with an understanding heart
Through the Christ’s stream of love
in which we live.

May the spirits which seek me
come unto me;
May I receive them
with a clear soul
Through the healing Spirit’s Light
by which we see.