Thursday, January 24, 2013

An Unfortunate Conversation

This is a brief extract of a conversation I had with myself today.  My sincere wish is that you'll never have this kind of conversation with yourself.  I was playing around with ActiveMQ's persistence (see http://activemq.apache.org) after getting basic queuing working...

Me: "How do I get persistence to work properly?" (I start googling and get some pointers...)
Me: "Oh, this is easy.." (sounds of typing)

    KahaPersistenceAdaptor adapter = new KahaPersistenceAdaptor();

Me: "Hmmm... ah, just dump the database in my home directory   for now..."

    adaptor.setDirectory("~");
    ...

Me: "Ok, now I just need to set it up... cool."
(Some more typing and thoughts of leaving early...) 

Me: "Okay, let's see what happens..." (clicks run).
Me: "Cool! Yes! It works... let's see how the database looks."

    $ cd ~
    $ ls -la

    <Home directory listing here, without the database file(s) I expected...>

Me: "That's funny... what does the project directory look like?"

    $ cd ~/workspace/activemq-test
    $ ls -la

   total 12
   drw-r--r-- 1 jaco 4096 Jan 24 06:58 ~
   -rw-r--r-- 1 jaco 1924 Jan 24 06:58 pom.xml
   <some other files>

Me: "Hmmm... What the hell? What is that ~ doing there..."

    $ rm ~
    rm: cannot remove `~': It is a directory

Me: "Ag... dammit... just delete the damn thing!"
(At this point reason and intellect was replaced by the primordial aggressive hunter/gatherer)

    $ rm -rf ~

(Reason and intellect reasserts itself in my recently installed cerebral cortex...albeit, just briefly.)
Me: "...."

   $ cd ~
   $ ls -la

   total 0

(I felt the hair in my neck stand on-end, that eery sensation and that metal taste... At this point I experienced a complete take-over of the medulla & cerebellum part of the brain, rendering me completely and utterly speechless...)

Me: "..."
Me: "..."
(sounds of soft crying...)

After a few hours of trying to get my system in a semi-working state (and realising that the program was never checked in anywhere), I vow never to use rm again.