The Mayonnaise Jar and 2 Cups of Coffee

Its spam .. but I kinda like it

When things in your lives seem almost too much to handle, when 24 hours in a
day are not enough, remember the mayonnaise jar and the 2 cups of coffee.

A professor stood before his philosophy class and had some items in front of
him. When the class began, he wordlessly picked up a very large and empty
mayonnaise jar and proceeded to fill it with golf balls . He then asked the
students if the jar was full. They agreed that it was.

The professor then picked up a box of pebbles and poured them into the jar.
He shook the jar lightly. The pebbles rolled into the open areas between the
golf balls . He then asked the students again if the jar was full. They
agreed it was.

The professor next picked up a box of sand and poured it into the jar. Of
course, the sand filled up everything else. He asked once more if the jar
was full The students responded with an unanimous “yes.”

The professor then produced two cups of coffee from under the table and
poured the entire contents into the jar effectively filling the empty space
between the sand. The students laughed.

“Now,” said the professor as the laughter subsided, “I want you to recognize
that this jar represents your life. The golf balls are the important
things–your family, your children, your health, your friends and your
favourite passions–and if everything else was lost and only they remained,
your life would still be full.

The pebbles are the other things that matter like your job, your house and
your car.

The sand is everything else–the small stuff. “If you put the sand into the
jar first,” he continued, “there is no room for the pebbles or the golf
balls. The same goes for life. If you spend all your time and energy on the
small stuff you will never have room for the things that are important to
you.

“Pay attention to the things that are critical to your happiness. Play with
your children. Take time to get medical checkups. Take your spouse out to
dinner. Play another 18. There will always be time to clean the house and
fix the disposal. Take care of the golf balls first –the things that really
matter. Set your priorities. The rest is just sand .”

One of the students raised her hand and inquired what the coffee
represented. The professor smiled. “I’m glad you asked.”

“It just goes to show you that no matter how full your life may seem,
there’s always room for a couple of cups of coffee with a friend “

Setting up trac on OSX

Yeowch that was harder work than it should have been.

Firstly I have installed ‘stuff’ before via port,  NEVER again (well almost never).  Darwin port installs apps into /opt/… it will manage the dependencies of an installation (but removing an app does not remove the dependencies).  I had managed to get several versions of python installed, a seemingly harmless situation, more of that later.

I already had subversion installed and integrated with apache2 (per my previous post).  To install trac I had to add a few dependencies:

Firstly add setup tools ;
$ wget http://peak.telecommunity.com/dist/ez_setup.py
$ sudo python ez_setup.py

Here game the problem, as I had installed something via port that installed python (and I had /opt/local/bin in my path) it was installing into port’s python’s site directory.  As _www is the user that runs apache, it was running python from osx’s default thus none of these dependencies were installed.    The solution was to add /opt/local/bin to the END of my path so that port apps are picked up only if there is a non osx version and to rerun the installs.

pysqlite-2.4.1 – (http://oss.itsystementwicklung.de/trac/pysqlite/wiki/

$ python setup.py build
$ sudo python setup.py install

Genshi & Pygments

sudo easy_install Genshi
sudo easy_install Pygments

You may like to install clearsilver (I did not) its required for some trac modules.  I may get to this later.

Now to install trac download trac from here: http://trac.edgewall.org/wiki/TracDownload
and extract and install: sudo python ./setup.py install

This will put the relevent modules into the site directory and some scripts into /usr/local/bin (make sure this is in your path).

Now to setup trac,  I have a single svn repository /usr/local/Subversion/Projects so to match this I created a Trac project /usr/local/Trac-Projects/Projects

$ sudo trac-admin /usr/local/Trac-Projects/Projects initenv

And follow the prompts

At this point you can run trac server directly

$ tracd –port 8000  ../../Trac-Projects/Projects/

This allows you to test the installation,  if you want to run trac in this way look at http://trac.edgewall.org/wiki/TracOnOsxTracdAsLaunchdService for instructions as to how to set it up via lanchd.  I wanted to use apache2.

So to /etc/apache2/other (again)

create a file called trac.conf containing:

LoadModule fastcgi_module libexec/apache2/mod_fastcgi.so

# Enable FastCGI for .fcgi files
<IfModule fastcgi_module>
    AddHandler fastcgi-script .fcgi
    FastCgiIpcDir /var/run/fastcgi
</IfModule>

ScriptAlias /trac /usr/local/Trac-0.11b2/cgi-bin/trac.fcgi
FastCgiConfig -initial-env TRAC_ENV=/usr/local/Trac-Projects/Projects”

<Location “/trac”>
    SetEnv TRAC_ENV “/usr/local/Trac-Projects/Projects”
    SSLRequireSSL
</Location>

<Directory “/usr/local/Trac-0.11b2/cgi-bin/”>
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all
</Directory>

Relative class paths in eclipse

In eclipse you can only reference jars via a path into the workspace, you can use relative paths (if you edit the .classpath outside of eclipse) but this relative path cannot expand outside of the workspace. This is a problem if you are using svn:externals to add an externals directory into a repository that contains many repositories ie:

Projects/Externals/
Projects/Foo/src
Projects/Bar/src

If Foo and Bar are eclipse projects then referencing jars in Externals will find the jars relative to root. This is obviously fragile. There is no complete fix to this, what you can do is use a variable: (you will need to adjust the menus for windows I am using osx)

Eclipse->Preferences
Navigate to Java/BuildPath/Classpath Variables
Add a new variable (LOCAL_INSTALLED_JARS) and point this to the Externals sub dir

Now when you add jars (Configure Build Path) Press add variable, select the variable then click expand, this should popup a chooser in the Externals sub dir, select the jar and click ok. DONE:

This will add the following to the .classpath file:

<classpathentry kind="var" path="LOCAL_INSTALLED_JARS/log4j-1.2.11.jar"/

So if you work from a different root you only have to update the LOCAL_INSTALLED_JARS variable.. magic.

S

How to setup subversion on OSX

This works with leopard.

Firstly turn on web sharing, web sharing uses apache2 under the hood although its config is bizarre to say the least.

Create a repository:
 sudo mkdir /usr/local/subversion/
 sudo svnadmin create /usr/local/subversion/Test

Ensure the repository is readable by apache
 sudo chown -R _www /usr/local/subversion/

Setup a password file (For later)

 sudo htpasswd -cm /usr/local/subversion/svn-auth-file scott
 (enter password)

Now for the first bizarre config, create a file in /etc/apache2/other called dav.conf
Which contains:

loadModule dav_svn_module libexec/apache2/mod_dav_svn.so

<Location /svn>
                DAV svn
                SVNParentPath /usr/local/subversion
                SVNListParentPath On
                SVNAutoversioning on

    AuthType Basic
    AuthName “Scott Subversion”
    AuthUserFile /usr/local/subversion/svn-auth-file
    Require valid-user
</Location>

Restart apache:
 sudo apachectl restart

To upload the project
svn import <project> http://localhost/svn/Test

Freedom of the press

Is it me or are the press TRYING to create a recession?  

Headlines suggesting that 

 o Home owners are going to be worse off becaue the BOE lower interest rates?    How is that supposed to work?    
 o Borrowers are worse off because banks are withdrawing 100% mortgages (given house prices are falling its responsible to remove them!).    
 o Banks adjusting their fixed rate mortgage rates out of step with current rates (IE base rate drops but fixed rates rise). 

There is a huge problem in banking atm in that the money has stopped flowing.  This should not directly affect home owners unless the papers big up the problems!  Interest rates are low employment is high,   if we dont scare ourselves into a recession then all will be fine.  The problem is that the scare stories in the press are forcing people to make rash (and illogical) decisions.     

Freedom is something worth taking a bit of pain for but it should be used responsbily.     Losing a few newspapers is a price I would pay!

Promotion

It is often said that people are promoted to the level of their own incompetence, there is clearly truth in this in so much that if you were not out of ones depth one would be promoted. We get promoted until we cannot do the job we are assigned. Is it also true that we get promoted until our instincts fail us? I have spent my career doing what feels right, I suppose I think to a certain extend but I mostly just reac. It is usually self evidence to me the correct course of action, how to steer the correct course. As I progress the decisions I am asked to make I have seen others make countless times before, its easy to know the right way as I have seen all the wrong ways. But can I choose a new way?

I am thinking now how easy it is to adjust my view and stop thinking what is best and what will be _seen_ as being best. Does this make sense? Consider bridge, it is easier to downplay a hand than to up-play it. It is easy to take a middle road than to excel. This is true in a a world where everyone is down playing their hand, those few that try to shoot for the moon succeed or fail without trace.

Is our working environment not just setup to promote to the level of our incompetence but to promote as long as our nerve holds?