Filter

Hierarchical Database & MySQL

We are starting a projet that requires a hierarchical DB structure. We have to keep track of the hierarchy of a company. I am using the nice tutorial found at Mike Hillyer’s site as a first guide.

Using a simple local MAMP stack and Navicat: I get to work:

The Nested Set Model

CREATE TABLE nested_category (
        category_id INT AUTO_INCREMENT PRIMARY KEY,
        name VARCHAR(20) NOT NULL,
        lft INT NOT NULL,
        rgt INT NOT NULL
);

INSERT INTO nested_category VALUES(1,'ELECTRONICS',1,20),(2,'TELEVISIONS',2,9),(3,'TUBE',3,4),
 (4,'LCD',5,6),(5,'PLASMA',7,8),(6,'PORTABLE ELECTRONICS',10,19),(7,'MP3 PLAYERS',11,14),(8,'FLASH',12,13),
 (9,'CD PLAYERS',15,16),(10,'2 WAY RADIOS',17,18);

SELECT * FROM nested_category ORDER BY category_id;

+-------------+----------------------+-----+-----+
| category_id | name                 | lft | rgt |
+-------------+----------------------+-----+-----+
|           1 | ELECTRONICS          |   1 |  20 |
|           2 | TELEVISIONS          |   2 |   9 |
|           3 | TUBE                 |   3 |   4 |
|           4 | LCD                  |   5 |   6 |
|           5 | PLASMA               |   7 |   8 |
|           6 | PORTABLE ELECTRONICS |  10 |  19 |
|           7 | MP3 PLAYERS          |  11 |  14 |
|           8 | FLASH                |  12 |  13 |
|           9 | CD PLAYERS           |  15 |  16 |
|          10 | 2 WAY RADIOS         |  17 |  18 |
+-------------+----------------------+-----+-----+

Two man startup

Well, my business partner Kevin has been busy setting up the backend in MacOS X for the radiobox service. He scored a band to do a live test in the studio in Atlanta (not going to name the band, becuase we are working on the record label logistics)…Anyway, the technology is there and we are busy coding and building the interface. Cannot wait to release theRadioBox into the wild.

We are limiting to 50 listeners, but if you are around on this fine thursday night tune in:

http://theradiobox.com

Click the orange triangle at the bottom. Maybe an hour of programming -

Stay tuned

One Man Startup

Its just me in an office being productive all summer. Lots of road biking!

PHYSICS / DYNAMICAL SYSTEMS AND MAPS

Many problems in science and mathematics have Hamiltonian structure. I investigated the BCH series to approximate certain types of maps.

sclosescompsopendjaaflow.001

WEB / DJAA FINANCIAL

This is a website that displays the computed Dow Jones after-hours index. It updates every 5 seconds with fresh prices using AJAX.

PROGRAMMING / BASINS 4

BASINS 4 is an open source hydrology tool integrated into the MapWindow application. I helped integrate WinHSPF with BASINS and wrote a few plugins for vector math.

SCRIPT / PHOTO NAME SEQUENCER

A real quickie bash shell script that will recursively rename all JPEG images in a folder to a sequence.

PROGRAMMING / WinHSPF

A windows application written for the U.S. EPA. I converted the app from VB6 to VB.net, tweaked the UI and made algorithms run more better.

WEB / AQUATERRA CONSULTANTS

I worked at an engineering firm that was in serious need of a web upgrade. So I took on the upgrade as a side project.