Be Your Own Therapist

ABSTRACT

We spend our lives being seduced by the outside world, believing without question that happiness and suffering come from “out there.” In reality, Buddhist teachings explain that they come from the way we perceive and interpret things, not the things themselves.

This deeply held misconception is at the root of our dissatisfaction, self-doubt, anger, depression, anxiety, and the rest. But our minds can change. By becoming deeply familiar with the workings of our own cognitive processes through introspection and learning to deconstruct them – truly, being our own therapists – we can loosen the grip of these neuroses and grow our marvelous potential for contentment, clarity, and courage, which are at the core of our being.

… very very deep!

Do what you love …

Rob wrote a wonderful piece earlier this week on Passion, personal brand and doing what you love. We’ve both spent time reflecting, individually, on how our paths led us to Talis and the work we are now doing. We’ve also discussed this subject on a number of occasions and I think we’ve both reached the same conclusion – life is too short to waste it away doing something you dont love. It takes time to come to a realisation like this, and sadly, it often require some external event to force you to stop and reflect on your life, how you got to where you are and most importantly where is it your heading. I know some people describe this as a kind of awakening, and I guess if you honestly believe that life is a journey then it’s moments such as these that can feel like a fork in the road…

One path leads back to the world that you know, its the world that you’ve become used to, it’s the world in which you don’t have to love what you do to get by, it feels comfortable because there is no risk, you don’t have to deal with the unknown too often, you don’t have to rock the boat. In many ways you’ve already reached a destination … or is it more true to say that you’ve reached an empasse?

The other path leads to somewhere else, unfortunately you don’t know what’s down there. You don’t necessarily even know where you’re going. Here’s the thing though … maybe you don’t have to care about the destination, maybe it’s less about the where, and much more about the how?

I guess that’s how I see things these days. There’s a part of me that believes that if do what I love, then it won’t feel like my life is just slipping away, one monotonous day to the next. I lived my life like that once, it’s so easy to do, you become so used to it that you don’t even realise that something is wrong … I actually had to come to within a heartbeat of losing my life before I realised that life is far to precious a gift to waste like that. To spend so much of it doing something that I felt completely indifferent towards, even hated at times … Isn’t it fascinating how the the worst prisons are the ones we create for ourselves?

There’s two quotes I want to end with, the first is from Paul Graham’s essay entitled How to do what you love, I remember reading it a couple of years ago, and although I don’t agree with some of it, it’s still a wonderful piece. His essay ends with this obeservation:

Finding work you love is very difficult. Most people fail. Even if you succeed, it’s rare to be free to work on what you want till your thirties or forties. But if you have the destination in sight you’ll be more likely to arrive at it. If you know you can love work, you’re in the home stretch, and if you know what work you love, you’re practically there.

The second quote is much shorter, but far more profound, you see for me loving what I do is a part of a much greater truth, one that underpins everything I’ve said, and I think almost everything I now hold dear:

There is life in every breath

Anime Reviews: Sky Blue, Vexille and X


Vexille

Set in the year 2077 relations between Japan and the rest of the world have deteriorated to the extent that the country has cut off all communication with the other inhabitants of Earth. Vexille is a female commander who leads a team of U.S. special forces, named SWORD, who have been charged with infiltrating Japan to discover the potentially dangerous technological advances the country is making. Their mission, and their discoveries, reveal that the Japanese have created a new breed of android virtually indistinguishable from human beings. I really enjoyed this movie, which came as no real surprise because it was made by the same people that created excellent Appleseed. The sound is excellent, and the visuals use the same superb blend of 2D and 3D animation that made Appleseed so memorable. This movie is not dubbed into English which might disappoint some people, I personally don’t mind watching it in Japanese with subtitles. If you like Appleseed then you’ll almost certainly love this, whilst it is somewhat formulaic the action is breathtaking.


Sky Blue
An environmental catastrophe has left the future of mankind in the year 2140 fighting against extinction. Slaves inhabit the outside world whilst the lucky ones live in comfort in Ecoban. One man dares to fight against the injustice – he enters the city to find its secrets and bring freedom to the slaves who have been consigned to an early death. This movie had me captivated from start to finish. The animation is flawless and the attention to details is absolutely breathtaking. This film also uses a blend of 2D and 3D animation and actually surpasses almost every other such anime I’ve seen ( yes that includes Appleseed!). The plot is somewhat convoluted and the ending did leave me with more questions rather than answers, yet to me that didn’t take away from how much I enjoyed the movie.


X
I have no idea where to start with this. It has to be one of the most confusing anime’s I have seen, yet it’s absolutely briliant. This falls squarely into the realms of old skool anime. Yet I have to admit I enjoyed it. It is pretty violent, so I wouldn’t recommend it to anyone who is squeamish. In a nutshell its about good vs evil. Tokyo is the city where the final battle between the Dragon of Earth and the Dragon of Heaven will take place The Dragon of Earth wants to wipe out humankind because of the damage people have inflicted on the Earth, while the Dragon of Heaven is fighting to protect civilisation. At the centre of all this is Kamui, the chosen one, who must pick a dragon to fight for. It’s a deeply philosophical movie, far more so than I expected. It also has that eerie haunting beauty that makes it so memorable. Definitly one to watch.

The Lucifer Effect: How ordinary people becomes monsters … or heroes

Philip Zimbardo knows how easy it is for nice people to turn bad. In this talk, he shares insights and graphic unseen photos from the Abu Ghraib trials. Then he talks about the flip side: how easy it is to be a hero, and how we can rise to the challenge. Some of the imagery in the talk is disturbing, yet for all the horror Zimbardo describes to us, his overarching message is one of hope.

Why do some people always complain about something, yet do nothing to change the situation?

By far the simplest answer to this question is: complaining is easy but actively trying to change things requires work!

I always hated it when people start off a diatribe by saying “There’s two kinds of people in this world …”, yet I find that I’m about to do exactly that. It feels to me that you’re either the kind of person that see’s something that’s wrong and decides to do something about it openly and honestly… OR you’re the kind of person who sits there whining and complaining about things but doesn’t have courage or the conviction to get up off your ass and actually do something about whatever it is that is bugging you.

If you disagree with something, if you think you’re being treated unfairly, or you perceive that there’s some kind of injustice being perpetrated then, grow a set of balls, find you’re voice and confront the issue. You might actually find that other people lend their voice to yours and you can actually effect change, or at the very least they’ll respect you for speaking up.

I don’t require or expect anyone to agree with me over anything I do in life or write on this blog … I always speak my mind, openly and honestly, my words are my own and they reflect what I believe, and how I perceive the world around me. I hide behind no-one. I always try to change those things that I disagree with, I don’t always succeed but at least I speak up. If you don’t like me, or you feel differently to me then find your own voice, and make yourself heard and fight to change that which you disagree with … but in doing so, please, have the courage to do it openly rather than cringing like a coward behind the anonymity you’ve chosen.

You must be the change you wish to see in the world.
            Mahatma Ghandi

It ain’t about how hard ya hit. It’s about how hard you can get hit!

Inspiration can come from the unlikeliest of places occasionally you read something or in this case hear something that resonates so deeply that you can’t help but smile …

I'd hold you up to say to your mother, "this kid's gonna be the best kid in
the world. This kid's gonna be somebody better than anybody I ever 
knew." And you grew up good and wonderful. It was great just watching 
you, every day was like a privilege. Then the time come for you to be 
your own man and take on the world, and you did. But somewhere along 
the line, you changed. You stopped being you. You let people stick a finger 
in your face and tell you you're no good. And when things got hard, you 
started looking for something to blame, like a big shadow. Let me tell you 
something you already know. The world ain't all sunshine and rainbows. 
It's a very mean and nasty place and I don't care how tough you are it will 
beat you to your knees and keep you there permanently if you let it. You, 
me, or nobody is gonna hit as hard as life. But it ain't about how hard ya 
hit. It's about how hard you can get hit and keep moving forward. How 
much you can take and keep moving forward. That's how winning is done! 
Now if you know what you're worth then go out and get what you're worth. 
But ya gotta be willing to take the hits, and not pointing fingers saying you 
ain't where you wanna be because of him, or her, or anybody! Cowards do 
that and that ain't you! You're better than that! I'm always gonna love you 
no matter what. No matter what happens. You're my son and you're my 
blood. You're the best thing in my life. But until you start believing in 
yourself, ya ain't gonna have a life.

                                                       - Rocky Balboa

Fix multiple ghost aliases in Finder Sidebar

I’ve been experiencing an odd problem in Finder for some time now. It intermittently duplicates the aliases under Places in the Side Bar. I have no idea why it does that but I finally figured out one way of fixing the problem. If like me you find that you have duplicated aliases in the Sidebar, all you have to do is delete the following file, then logout and log back in.

  1.  

Once you have done this and logged back in you’ll find that you have very little under the Places heading, at this point you need to drag back into here any folder shortcuts you want to make available. Thanks to this my sidebar is now looking nice and tidy again …

Test-Driven JavaScript Development with JsUnit

The last time I used JsUnit was when I first joined Talis. At the time my colleague Ian Davis asked me to write a JavaScript client library for one of our platform API’s to make it easy for developers to perform bibliographic searches. It wasn’t a particularly difficult task and I did it relatively easily. It was around the same time that Rob was extolling the virtues of Test Driven Development to me, and to try to prove his point we agreed to do an experiment: he asked me to set aside the library I had written and to see if I could develop the library again using test driven development. It meant I had to figure out how to unit test JavaScript, and thats when I found JsUnit. I did the exercise again and even I was impressed with the results. By having to think about the tests first, and design the interface to the library as I wrote each test it evolved very differently to my original solution. Consequently it was also far superior.

Anyway fast forward two and half years and I find myself in a similar situation. We have only just begun to start writing bits of JavaScript code based around prototype.js to help us create richer user experiences in our products if we detect that JavaScript is enabled in the browser. This now means I want to ensure that we are using the same rigour when writing these bits of code as we do in all other parts of the application – just because its JavaScript and executed inside the browser this doesn’t mean it shouldn’t be tested.

I’ve just spent the morning getting JsUnit installed and figuring out how to get it to run as part of a continuous integration process, as well as thinking about how to write tests for some slightly different scenarios. Here’s what I’ve discovered today:

Installing JsUnit

Couldn’t be easier … go to www.jsunit.net and download the latest distribution, and extract into a folder on your system somewhere, lets say
/jsunit for now. The distribution contains both the standard test runner as well as jsunit server which you will need it if you want to hook it into an ant build.

Writing Tests

In JsUnit we place our tests in a HTML Test Page which is the equivalent of a Test Class, this test page must have a script reference to the jsUnitCore.js so the test runner knows its a test. So lets work through a simple example. Let’s say we want to write a function that returns the result of adding two parameters together. The Test Page for this might look like this:

  1.  
  2. <html>
  3.  <head>
  4.   <title>Test Page for add(value1, value2)</title>
  5.   <script language="javascript" src="/jsunit/app/jsUnitCore.js"></script>
  6.   <script language="javascript" src="scripts/addValues.js"></script>
  7.  </head>
  8.  <body>
  9.     <script language="javascript">
  10.     function testAddWithTwoValidArguments() {
  11.         assertEquals("2 add 3 is 5", 5, add(2,3) );
  12.     }
  13.   </script>
  14.  </body>
  15. </html>
  16.  

For now lets save this file to /my-jsunit-tests/addTest.html

To run the test you need to point your browser at the following local url:

file:///jsunit/testRunner.html?testPage=/my-jsunit-tests/addTest.html

The test will not run since we haven’t defined the add function. Let’s do that (very crudely):

  1.  

Now if you go to that URL it will run the test and report that it passed. Excellent, we’ve written a simple test in JavaScript. Now lets extend this a little, lets say I want to write something more complicated like a piece of JavaScript that uses Prototype.js to update the DOM of a page. Is this possible? Can I do that test first? It turns out that you can …

Lets say we have a div on the page called ‘tableOfContents’ and we want to use Prototype.js to dynamically inject a link onto the page that says [show] and lets say we want to write a function that will toggle this link to say [hide] when the user clicks on it, this link will also set the visible state of the table of contents itself which for now we’ll say is just an ordered list (OL). Our test page is going to be slightly more complex …

  1.  
  2. <html>
  3.  <head>
  4.   <title>Test Page for multiplyAndAddFive(value1, value2)</title>
  5.   <script language="javascript" src="/jsunit/app/jsUnitCore.js"></script>
  6.   <script language="javascript" src="scripts/prototype/prototype-1.6.0.2.js"></script>
  7.   <script language="javascript" src="scripts/tableOfContents.js"></script>
  8.  </head>
  9.  <body>
  10.     <div id="tableOfContents">
  11.     <h2 id="tableOfContentsHeader">Table of contents</h2>
  12.     <ol id="list-toc">
  13.     </ol>
  14.     </div>    
  15.     <script language="javascript">
  16.     function testTOC()
  17.     {
  18.         var title = $(‘lnkToggleTOC’).title;
  19.         assertEquals("should be Show the table of contents", "Show the table of contents", title);
  20.        
  21.         toggleTableOfContents();
  22.        
  23.         var title = $(‘lnkToggleTOC’).title;
  24.         assertEquals("should be Hide the table of contents", "Hide the table of contents", title);
  25.                    
  26.     }
  27.   </script>
  28.  </body>
  29. </html>
  30.  

There are some differences in this test. Firstly the html contains some markup, that I’m using as the containers for my table of contents. The table of contents has a header and the contents in the form of an empty ordered list. Now I know that I want the javascript to execute when the page is loaded, so I’ve written this test to assume that the script will run and will inject and element called ‘linkToggleToc’ which is the show/hide link next to the heading. Therefore the first line of the test uses prototype.js element selector notation to set a local variable called title to the value of the title of the element that has the id ‘linkToggleToc’. If the script failes to execute then this element will not be present and the subsequent assert will fail. If the assert succeeds, then we call the toggleTableOfContents function and then repeat the same evaluation only now we are checking to see if the link has been changed.

The code for tableOfContents.js is as follows:

  1. span class=”st0″>’load’‘Show the table of contents’‘Hide the table of contents’‘list-toc’).hide();
  2.     $(‘tableOfContentsHeader’‘inline’‘a’, { ‘id’: ‘lnkToggleTOC’, ‘href’: ‘javascript:toggleTableOfContents()’, ‘title’: titleShowTOC, ‘class’: ‘ctr’ }).update("[show]");
  3.    
  4.     $(‘tableOfContentsHeader’‘after’‘list-toc’‘lnkToggleTOC’).update(‘[show]’);
  5.         $(‘lnkToggleTOC’‘lnkToggleTOC’).update(‘[hide]’);
  6.         $(‘lnkToggleTOC’).title = titleHideTOC;
  7.     }
  8. }

Now if we run this test in the same way we executed the previous test it will pass. I accept that this example is a bit contrived since I know it already works and I’ve skimmed over some of the details around it. The point I’m trying to make though is that you can write unit tests for pretty much any kind of JavaScript you need to write, even tests for scripts that do dom manipulation, or make AjaxRequests etc.

Setting up the JsUnit server so you can run it in a build

JsUnit ships with its own ant build file that requires some additional configuration before you can run the server. The top of the build file contains a number of properties that need to be set, here’s what you set them to ( using the paths that I’ve been using in the above example)

  1.  
  2. <project name="JsUnit" default="create_distribution" basedir=".">
  3.  
  4.   <property
  5.     name="browserFileNames"
  6.     value="/usr/bin/firefox-2" />
  7.  
  8.   <property
  9.     id="closeBrowsersAfterTestRuns"
  10.     name="closeBrowsersAfterTestRuns"
  11.     value="false" />
  12.  
  13.   <property
  14.     id="ignoreUnresponsiveRemoteMachines"
  15.     name="ignoreUnresponsiveRemoteMachines"
  16.     value="true" />
  17.  
  18.   <property
  19.     id="logsDirectory"
  20.     name="logsDirectory"
  21.     value="/my-jsunit-tests/results/" />
  22.  
  23.   <property
  24.     id="port"
  25.     name="port"
  26.     value="9001"  />
  27.  
  28.   <property
  29.     id="remoteMachineURLs"
  30.     name="remoteMachineURLs"
  31.     value="" />
  32.  
  33.   <property
  34.     id="timeoutSeconds"
  35.     name="timeoutSeconds"
  36.     value="60" />
  37.  
  38.   <property
  39.     id="url"
  40.     name="url"
  41.     value="file:///jsunit/testRunner.html?testPage=/my-jsunit-tests/tocTest.html" />
  42. </project>
  43.  

You can then type the following command in the root of the jsunit distribution to launch the jsunit server, executes the test, and outputs a test results log file, formatted just like JUnit, and reports that the build was either successful or not if the test fails.

  ant standalone_test

Remember that in this example I’ve used a simple Test Page, however JsUnit, like any XUnit framework allows you to specify Test Suites, which is how you would run multiple Test Pages. Also the parameters in the build file woudn’t be hardcoded in you continuous integration process but would rather be passed in, and you would want to call it from your projects main ant build file … all of which is pretty simple to configure, once you know what is you want to do and what’s possible.

Visual Interfaces to the Social and the Semantic Web (VISSW2009)

I’ve recently been invited (and accepted) to join the Program Committee for the Visual Interfaces to the Social and the Semantic Web workshop which will be held as a part of the 2009 International Conference on Intelligent User Interfaces which takes place in February in Florida. Here’s a brief description of the workshop:

This workshop aims to bring together researchers and practitioners from different fields, such as Human-Computer Interaction, Information Visualization, Semantic Web, and Personal Information Management, to discuss latest research results and challenges in designing, implementing, and evaluating intelligent interfaces supporting access, navigation and publishing of different types of contents on the Social and Semantic Web. In addition, the workshop also serves as an opportunity for researchers to gain feedback on their work as well as to identify potential collaborations with their peers

I’m quite excited about this workshop, I’ve been spending some of 10% time at work on playing with ideas around how to visualise data on the Semantic Web just over eighteen months ago I was already using and extending Moritz Stefaner‘s excellent Relation Browser to visualise semantically structured data, and was effectively walking around entire graphs of data:

However there were problems with this approach, performance over large sets of data was one, and I spent a considerable amount of time extending the tool. However it occurred to me that with Relation Browser and other similar tools you are forced to take a very node centric view, when sometimes whats more useful is to be able to take a graph or named graph centric view – its not only important to be able to center on one node and see it’s direct relationships it’s often just as important to understand where that node sits with a much wider context. To that end I’ve been experimenting with visualisations that allow you to not only center on a particular node and ‘follow your nose’ but to also pan out take a more hollistic view of that graph of data – I’ve also been thinking about ways to visualise the provenance of data.

I wish I had known about this workshop sooner, it might have been the kick I needed to actually finish demonstrators of these ideas, I think I might still have time though …

With reference to the workshop itself though here’s some important dates and other bits of information if you’re interested in submitting a paper:

  • Paper submission deadline: 14th November, 2008
  • Notication of acceptance: 7th December, 2008
  • Camera-ready paper submission deadline: 14th December, 2008
  • Full papers which should be between 6 and 10 pages.
  • Short papers and position papers which should be up to 5 pages.
  • Demo papers – 2 page description with a screenshot of the working prototype or preferrably a link to an online demo.
  • Submissions must be in PDF format and prepared according to the IUI format.

It promises to be an excellent conference, and one that I will definitely be attending.