Friday, September 14, 2007

Adding reverse directive to DFC App Router

Assume simple subscription ordering for all addresses in a system:

Originating: A-B-C-D
Terminating: D-C-B-A

Scenario 1 - In orig region, application B issues a reverse. We assume that application B has already made the necessary changes to the request to 'swap' the source and target addresses. This can't be the job of the router since it can't change the message. So, let the Source Address = s and the Target Address = t in the request as presented to AR. Algorithm proceeds:
  1. Calculate TermRouteSet(t) = {D,C,B,A}
  2. Calcualte Suffix(B, TRS(t)) where the suffix of a ordered list is those elements in the list that occur after the first parameter. So it's {A} for this scenario.
  3. Proceed as usual.

Scenario 2 - In term region, application B issues a reverse. Source Address = s, Target Address = t. Algorithm proceeds:
  1. Calculate OrigRouteSet(s) = ORS(s) = {A,B,C,D}
  2. Calculate Suffix(B, ORS(s)) = {C,D}
  3. Proceed as usual.
I rediscovered today that reverse support requires that the invoking application be known to the AR. To do this, I'll have to either add a parameter to the state information or, more easily, change the way the route set is stored to keep the current application in it until the AR is invoked again.

Wednesday, September 12, 2007

Changing ECLIPSE workspace JRE and Java compiler setting

I wanted to upgrade my ECLIPSE workspace to use Java 5 by default rather than Java 1.4.2. I changed my JAVA_HOME and JDK_HOME env vars but that didn't help. When creating a new project, ECLIPSE continued to pick up the 1.4.2 JRE as seen under Project...Properties. The JRE preference seems to be at the workspace not project level. To change the JRI, Window...Preferences. Open up the tree under 'Java'. Choose "Installed JREs". If there's only one there, you can't remove it. Click 'Add...'. Browse to the base directory of the Java installation, e.g. /usr/java/jdk1.5.0_08. Give the JRE a name and click OK. This adds the new JRE to the list of JREs available. To select it as the default JRE, it must be checked in the Installed JREs window.

But that's not all. I still couldn't add statements that used the new enum type even after doing all the above. In addition, one must make a change to the workspace for the compiler: Window...Preferences. Click on 'Compiler' - don't expand the tree. On the page in left pane, change the Compiler compliance level to 5.0.
I'm not sure, but I assume that the '5.0' choice wouldn't have even been there if I had not changed my JDK_HOME and JAVA_HOME env vars already.

Cantata nightly build and approuter build

Occurs on dart.research.att.com. Java 1.4.2 build occurs under uid, bbcbuild while Java 1.5.0 build occurs under uid, cantatabuild.

Java 1.4.2 Build
Checks out cantatabuild module under HEAD/cantatasrc
then,
$ ant all
in HEAD/cantatasrc/build

Java 1.5.0 Build
Checks out cantatabuild module under HEAD_java5 /cantatasrc
then,
$ ant all
in HEAD/cantatasrc/build

The fetch target checks out the various modules including EChartsCPL and SipServletAppRouter.
The compile target builds all the modules. To build just the SipServletAppRouter module,
From top level directory (one above SipServletAppRouter),
$ cvs co cantatabuild
$ cd build
$ ant copy-servlet-jarsBuildfile: build.xml

copy-servlet-jars:
[copy] Copying 1 file to /home/khp/Projects/CantataApps/lib
[copy] Copying 1 file to /home/khp/Projects/SipServletAppRouter/lib
[copy] Copying 1 file to /home/khp/Projects/CantataApps/lib
[copy] Copying 1 file to /home/khp/Projects/SipServletAppRouter/lib

BUILD SUCCESSFUL
Total time: 0 seconds

This copies both sipservlet.jar and servlet.jar to SipServletAppRouter/lib directory.

However, while this allows ant to resolve the dependencies needed for the SipServletAppRouter build, it does not, by default, enable ECLIPSE to do the same. However, an ECLIPSE project can be created from an ant build file. You'll see this option when using File...New...Project in ECLIPSE. However, Tom believes that external changes to the build.xml file will not be automatically incorporated into the ECLIPSE project.

Monday, September 10, 2007

Jensen MySQL

$ mysql -u root -p
Enter password: su.......

Using tutorial at:
http://dev.mysql.com/doc/refman/5.0/en/tutorial.html

For facebook example 4 app (display counter):
mysql> create database menagerie; /* this was name of database in above tutorial */
mysql> use menagerie;
mysql> show tables;
Empty set (0.00 sec)

mysql> create table counter (count INT);
Query OK, 0 rows affected (0.06 sec)

Friday, September 7, 2007

Dell Ubuntu vs. Build it Yourself

Now that Dell will sell you a Desktop machine with Linux, I was curious if one could still build a machine oneself cheaper than buying one from a vendor like Dell. Heretofore, I maintained that building one was always cheaper primarily because the vendor was paying Microsoft for the Windows license. When the intended OS is Linux, this is throwing money away and contributing to the evil empire.

I first configured a basic Dell Inspiron 530N:
PROCESSORIntel®Pentium® dual-core processor E2140 (1MB L2,1.60GHz,800 FSB)edit
OPERATING SYSTEMUbuntu Desktop Edition version 7.04edit
MONITORSNo Monitoredit
MEMORY1GB Dual Channel DDR2 SDRAM at 667MHz- 2DIMMsedit
HARD DRIVE160GB Serial ATA Hard Drive (7200RPM) w/DataBurst Cache™edit
OPTICAL DRIVE48X CD-RW/ DVD Combo Driveedit
VIDEO CARD128MB NVIDIA GeForce 8300GSedit
SOUND CARDIntegrated 7.1 Channel Audioedit
KEYBOARD & MOUSEDell USB Keyboard and Dell Optical USB Mouseedit
FLOPPY & MEDIA READERNo Floppy Drive Included

Total cost: $379

Then I went over to newegg.com and chose the cheapest components I could find that matched the above. I did this even when the user reviews were somewhat bad and would've caused me to buy something more expensive.

Here's what I came up with:


Linkworld 3210-04-C2628 Black/ Silver Steel ATX Mid Tower Computer Case - Retail
Item #: N82E16811164040
Return Policy: Standard Return Policy


$27.99

Maxtor STM3160215AS 160GB 7200 RPM SATA 3.0Gb/s Hard Drive - OEM
Item #: N82E16822144454
Return Policy: Limited 30-Day Return Policy


$46.99

PNY VCG8400SXPB GeForce 8400GS 256MB 64-bit GDDR2 PCI Express x16 HDCP Ready Video Card - Retail
Item #: N82E16814133203
Return Policy: Limited 30-Day Return Policy

$10.00 Mail-in Rebate
$69.99

LG Black IDE DVD-ROM Drive Model GDR-H30NK - OEM
Item #: N82E16827136126
Return Policy: Standard Return Policy


$17.99

Crucial Ballistix 1GB 240-Pin DDR2 SDRAM DDR2 667 (PC2 5300) Desktop Memory Model BL12864AA663 - OEM
Item #: N82E16820146558
Return Policy: Memory (Modules, USB) Return Policy


$51.99

ECS 945GCT-M (V1.0) LGA 775 Intel 945GC Micro ATX Intel Motherboard - Retail
Item #: N82E16813135051
Return Policy: Standard Return Policy

-$5.00 Instant
$10.00 Mail-in Rebate
$54.99
$49.99

Intel Dual-Core E2140 Allendale 1.6GHz LGA 775 Processor Model BX80557E2140 - Retail
Item #: N82E16819116037
Return Policy: Processors (CPUs) Return Policy


$75.99
Subtotal: $340.93


Total Cost: $340.93

I disregarded taxes and shipping because I believe they would be comparable. So the Dell is $40 more. Bear in mind that the Dell comes with a keyboard and mouse and a 1 year warranty.

So, what's my new take on this: Only build yourself if you already have some number of components lying around and can save money by not buying everything.

Thursday, September 6, 2007

Fighting NATs and firewalls

Trying to get apache and PHP5 up on home machine to host some baby facebook applications. packard runs Fedora Core 3 which has PHP4 - too old, too hard to update. Jensen is running Fedora Core 5 which has PHP 5.1 - start there. In meantime, work on bringing up CentOS 4.5 on edsel. Then use yum to update its PHP 4 to PHP 5.1 as follows:
yum --enablerepos=centosplus update php*. Still need to bring up mysql on edsel.

After much strife, got "Hal's Test Application 1" to work. FIOS seems to block port 80 so I'm running on port 5080 on digimojo.dyndns.org. Gotta love dyndns.