Sunday, June 22, 2008

The Tipping Point : How Little Things Can Make A Big Difference

I just finished reading the book The Tipping Point by Malcolm Gladwell. On the surface this does not seem to be a book on programming, and it is not.

I really liked the book because it assembled a number of political and social theories into a readable and digestible items. The Broken Windows Theory, which makes hypothesized that if a vacant building gets a broken window, you should fix it as soon as possible. The consequences of not-fixing it result in people assuming that no one really cares. The result is the rest of the windows getting broken. If you fix the window, then it is likely that no further damage will be done. This policy was implemented in New York in the 1990s. The result was a dramatic reduction in crime, and vandalism. This is the case of making a small change which results in further downstream effects. The explanation in the book is insightful and makes these theories easy to understand.

How does it relate to software and technology? It covers a methodology for making trends and social behaviors "stick". The ideas covered in the book speak in terms of epidemics. Those who understand viral expansion loops (viral marketing) will be able to understand the book and its underlying premises. If you are looking for some material on viral expansion loops (Viral Marketing), there is a really good one on Fast Company which is very well done. Fast Company had a cover article for May 2008 on CEO Gina Bianchini of Ning. They mention the use of viral expansion to attempt to grow Ning into a social powerhouse.

The book details items on how to make things stick, and how to spread the word about something. My stickiness factor is how to make social networks stick. For example, why is Facebook becoming more popular than MySpace. Why do people use LinkedIn? What benefits are there to blogging. This book can provide a wealth of information into social and environmental factors which make software and technologies popular.

The book is a real quick read, and I would recommend it with 4/5 stars.

Wednesday, June 18, 2008

Apache Derby (JavaDB) INSERT Statement with IDENTITY

If you are trying to insert values into a table which has an identity column, the documentation is not very clear. If I create a table in an Apache Derby (JavaDB) database which has a primary key which is generated always, the syntax for doing a query based insert is a little different.

Here is the table:
CREATE TABLE FAMILY (
ID INT PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
DESCRIPTION VARCHAR(50) NOT NULL
)
Now if I want to insert values from another table here is the query I used:
INSERT INTO FAMILY (DESCRIPTION) ( SELECT DISTINCT FAMILY FROM EQUIPMENT_GROUP WHERE FAMILY IS NOT NULL)
Please note that I did not put anything into the ID column. If I try to specify a value, it will result in an exception
Exception: Attempt to modify an identity column 'ID'.
Since the column has been marked as GENERATED ALWAYS, it handles incrementing the key and assigning it.

Monday, June 16, 2008

Configuring Apache 2 HTTP Server on Solaris 10

How do you configure Apache 2 HTTP Server to run automatically on Solaris 10 using rc init scripts.

Log into the Solaris box as root, or su root.
Go to the /etc/init.d directory.
Copy the apache startup script to apache2
cp apache apache2

Change the group to sys
chgrp sys apache2
Next change the flags on the file to execute
chmod u+x apache2
Open the apache2 file with your favorite editor and modify the following lines:

APACHE_HOME=/usr/apache
CONF_FILE=/etc/apache/httpd.conf
RUNDIR=/var/run/apache
PIDFILE=${RUNDIR}/httpd.pid

as follows:

APACHE_HOME=/usr/apache2
CONF_FILE=/etc/apache2/httpd.conf
RUNDIR=/var/run/apache2
PIDFILE=${RUNDIR}/httpd.pid

Check to make sure you have a valid httpd.conf file located in /etc/apache2. You can copy the httpd.conf-example file to httpd.conf. This will create a basic httpd.conf file.

Next go to the /etc/init.d directory and try executing the apache2 file. You should see something like this:

[dev1:init.d:root]#./apache2 start
httpd starting.
You can check your configuration by using a browser to check it.

Next you will want to configure it to start/stop at the various runlevels.

Go to /etc/rc0.d and add the following:
ln -s ../init.d/apache2 K17apache2
Go to /etc/rc1.d and add the following:
ln -s ../init.d/apache2 K17apache2
Go to /etc/rc3.d and add the following:
ln -s ../init.d/apache2 S51apache2
Go to /etc/rcS.d and add the following:
ln -s ../init.d/apache2 K17apache2

This will complete the configuration for your server. Next time you change run levels, or reboot, the Apache 2 HTTP Server will restart as you expect.

Addendum:

Zaphod commented on my page about using Solaris SMF. This is truly easier.

1. Check to make sure you have a valid httpd.conf file located in /etc/apache2. You can copy the httpd.conf-example file to httpd.conf. This will create a basic httpd.conf file.

2. Execute svcadm -v enable -rs apache2

3. You are now running on Apache2 on SMF.

Popular Posts