Question: I am trying to add trusted sites to Mac OS X's firewall via command-line. I understand that previously, we were able to use **ipfw** to configure the firewall on a packet level by using port numbers or IPs. In Leopard (10.5) and on, there is a new feature to add a trusted application to a list. This can be accomplished using the UI: 

*System Preferences > Security > Firewall*

As well as using the command-line: **socketfilterfw**

```
%sudo /usr/libexec/ApplicationFirewall/socketfilterfw -t "[binary path of application]"

```

However, I am having problems when I execute the above command, the utility "hangs" and doesn't seem to do anything. This is the output I would receive, and then does nothing:

```
kyue:/usr/libexec/ApplicationFirewall> sudo ./socketfilterfw -t \~/[my binary path]\
adding ~/[my binary path] to the list of trusted applications
GetSignException: creator ‘BNUp’
GetSignException: creator ‘BNu2′
GetSignException: creator ‘SWar’
GetSignException: creator ‘StCm’
GetSignException: creator ‘Dbl2′
GetSignException: creator ‘PJ03′
GetSignException: creator ‘PJ07′
GetSignException: creator ‘FP98′

```

There was great guidance from this article:

<http://krypted.com/mac-os-x/command-line-alf-on-mac-os-x/comment-page-1/#comment-547>

Just wondering if anyone here may know why it doesn't seem to be working.

Kat

Answer: 
Have 2 tables, Team and Game, where Team has a team name, and a team ID, and game has 2 team IDs (team 1 and team 2) and the score of the game. Then, you have foreign keys (for integrity) between the Game and Team tables. This will reflect who played who and what the score was with a minimal schema and a very simple structure.

```
Team
|-------------------------|
| Primary (int)| id       |
|         (chr)| name     |
|-------------------------|

Game
|-------------------------|
| Primary (int)| team1    |
| Primary (int)| team2    |
|         (int)| score1   |
|         (int)| score2   |
|-------------------------|

```

So, some sample data would look like:

```
Team
|------------------|
| id | name        |
|------------------|
|  1 | Blue Devils |
|  2 | Cardinals   |
|  3 | Fish        |
|  4 | Lemmings    |
|------------------|

Game
|---------------------------------|
| team1 | team2 | score1 | score2 |
|---------------------------------|
|     1 |     2 |      7 |      8 |
|     1 |     4 |      2 |     25 |
|     2 |     3 |      8 |      2 |
|     3 |     4 |     17 |     18 |
|---------------------------------|

```

This data indicates that team 1 (Blue Devils) played team 2 (Cardinals) with a score of 7 to 8. The rest of the data is similar.

If you do not need to track the team names, you can leave that field out, but this is often useful information.

So, with this schema, you would get the scores for a particular team with a query like

```
SELECT * FROM Game g 
 INNER JOIN Team t on t.team1 = g.id

```

You could then also add additional information if you need to, like when the game took place (date), and any other information, such as other statistics about the game or team.
The first response is correct. If you organize your data into relations, and create one table for each relation, the data will be a lot easier to work with. The background learning you need to do in relational database design will teach you more about this.

If you use the Team and Game structure from the response, you can still convert that structure into the kind of structure you imagined in your question. This process is called "crosstabulating" or "pivoting" and it's well documented in the tutorials.

While it's easy to move from a relational structure to a crosstabulated one, it's monstruously difficult to go the other way. It's also difficult to compose other queries against crosstabulated data. An example might be finding the highest score scored against each team. If you put your data in a database, sooner or later you are ging to want to do more than one thing with it.