Boyce-Codd Normal Form

The definition used by Chris Date. Quite nice as a mnemonic:

Each attribute
Your data must be broken into separate, distinct attributes/columns/values which do not depend on any other attributes. Your full name is an attribute. Your birthdate is an attribute. Your age is not an attribute, it depends on the current date which is not part of your birthdate.

must represent a fact
Each attribute is a single fact, not a collection of facts. Changing one bit in an attribute changes the whole meaning. Your birthdate is a fact. Is your full name a fact? Well, in some cases it is, because if you change your surname your full name is different, right? But to a genealogist you have a surname and a family name, and if you change your surname your family name does not change, so they are separate facts.

about the key,
One attribute is special, it’s a key. The key is an attribute that must be unique for all information in your data and must never change. Your full name is not a key because it can change. Your Social Insurance Number is not a key because they get reused. Your SSN plus birthdate is not a key, even if the combination can never be reused, because an attribute cannot be a combination of two facts. A GUID is a key. A number you increment and never reuse is a key.

the whole key,
The key alone must be sufficient [and necessary!] to identify your values; you cannot have the same data represented by different keys, nor can a subset of the key columns be sufficient to identify the fact. Suppose you had an address book with a GUID key, name and address values. It is OK to have the same name appearing twice with different keys if they represent different people and are not the “same data”. If Mary Jones in accounting changes her name to Mary Smith, Mary Jones in Sales does not change her name as well. On the other hand, if Mary Smith and John Smith have the same street address and it really is the same place, this is not allowed. You have to create a new key/value pair with the street address and a new key.

You are also not allowed to use the key for this new single street address as a value in the address book since now the same street address key would be represented twice. Instead, you have to make a third key/value pair with values of the address book key and the street address key; you find a person’s street address by matching their book key and address key in this group of values.

and nothing but the key
There must be nothing other than the key that identifies your values. For example, if you are allowed an address of “The Taj Mahal” (assuming there is only one) you are not allowed a city value in the same record, since if you know the address you would also know the city. This would also open up the possibility of there being more than one Taj Mahal in a different city. Instead, you have to again create a secondary Location key with unique values like the Taj, the White House in DC, and so on, and their cities. Or forbid “addresses” that are unique to a city.

So help me, Codd.

Categories: Databases | Leave a comment

Windows 7 clean install with upgrade media

As I have a legitimate Windows 7 upgrade lic. and a full XP bleeding-paid-for retail version, I have some troubles trying to grasp the necessity to first install a barebone XP and then do an upgrade. As I’ve paid my fees I want to make a clean install without the time-consuming task to install a version I’m going to get rid of in the first place, let alone to view the remnants of this XP installation scattered around.

In the ol’ days you where asked to enter any of your previous product keys when you entered an upgrade key, but now I’m only getting the 0xC004F061 error from the Microsoft validation server meaning I have to perform the above steps.

My Digital Life has a great solution (workaround #3) which is to alter a setting in the registry (MediaBootInstall from 1 to 0) and rearm the machine using the Windows Server License Manager and reboot. After boot you can now activate W7 using your upgrade key without problems.

Sweet.

Categories: Windows | Leave a comment

Mikrotik RouterBOARD 450G capacitors

My 450G died on me this weekend. I’ve had it running for some two years or so with no problems whatsoever. I had the feeling it was a serious hardware problem as it wouldn’t beep when I applied the power. Also a reset (holding reset and plugin in power) didn’t made any difference. Serial cable didn’t report any chars when booting and the link leds on the interfaces stayed off. Could be a was the proud owner of an overpriced brick.

I posted the issue on the MikroTik RouterOS forum and apparently a lot of boards are plagued with faulty capacitors. The electrolytic capacitors on the PCB seemed a little bulged and indeed that was the problem.

So I paid a visit to the local radio shack and he was positive those electrolytics where bulging. Spent €1.20 for two new ones. Cannot get 560uF but the consensus is that 470uF will suffice just as well. On another note, I have an 25W or so soldering iron but the guy at the counter was positive I could replace them as there is enough empty space around the mount so heat won’t have much influence on the other components.

So I dove in. I replaced the old capacitors with new 470uFs and it spun back into life. Sweet! I repaired the RouterBOARD for less than a beer.

The Routerboards are an amazing piece of hardware and I would buy one again in a heartbeat if this one fails beyond repair in a near future. Too bad there are series out there that are plagued with the faulty capacitors, but that’s some upstream component problem a lot of hardware builders are troubled with.

At work we have some RB 450Gs in service. We have some spares on the shelve, but I think we have to spend some 10 mins for each board to replace the capacitors on forehand. The one at home was the first to fail, but as people on the forum state that they are replacing caps for years, failure must be imminent.

There are a lot of pointers on the MikroTik forum about these capacitor problems and ways to replace them. Even came across a rule of thump to get an uF replacement value.

Categories: en_US, Mikrotik | Leave a comment

Ubuntu 10.04 LTS: DHCP3-server and bridge running late

In Ubuntu 10.04 LTS (and also in previous versions as well) the DHCP3-server fails to start when using a bridged config. There are some solutions, but the best one is using the post-up and pre-down directives in the /etc/network/interface file and disabling the daemon from automatically starting in the same runlevel.

# The loopback network interface
auto lo
iface lo inet loopback

auto br0
iface br0 inet static
      address x.x.x.x
      netmask 255.255.255.0
      gateway x.x.x.x
      bridge_ports eth0 eth1 ethN
      bridge_maxwait 0
      post-up /etc/init.d/dhcp3-server start
      pre-down /etc/init.d/dhcp3-server stop

update July 2011: Ah, turns out there’s another card to be played. The bridge_maxwait 0 ensures that the network interface is presented as being instant up and running so other network dependent daemons can attach to it.

Categories: en_US, Networking, Ubuntu | Leave a comment

Ziggo: SMTP outbound blocked

Ha! En waar ik al jaren loop te zeuren dat inbound SMTP blocken alleen maar lastig is – maar dus zeker niet je SPAM stopt – heeft men bij Ziggo eindelijk een nette uitbreiding doorgevoerd om nu eens echt de rommel te stoppen vanuit het eigen netwerk. Ziggo heeft sinds 4 maart outbound SMTP geblocked. Ik kreeg al een paar dagen geen mail meer van een paar cronjobs en vanavond maar eens gekeken.

Oplossing is dus als SMTP relay server smtp.ziggo.nl te gebruiken voor je mailserver configuratie. Hier is dat sSMTP, maar binnen postfix is zoiets net zo makkelijk. Gebruik je een email client (Outlook en consorten), ook hier gewoon deze server gebruiken ipv die-van-je-werk. Deze ziggo.smtp.nl zal vanuit eigen segment toestaan voor de wereld.

Categories: nl_NL, SMTP, Ziggo | 2 Comments