Thursday, April 16, 2015

California's Water - Agriculture

Last time, in this series on California's drought, I talked about the distribution of California's water and how "environmental" uses get 50% of all the water.  This time I'll talk about the next largest allocation of water in California which is agriculture.  Agriculture uses 40% of California's water leaving only 10% for urban use.

[Note: Sometimes this statistic is reported as 80%.  When this happens they choose to ignore the 50% of California's water that is not diverted for man's use.  Whether it's 40% agriculture / 10% urban or 80% agriculture / 20% urban the statistic is the same, a 4:1 ratio.]

Some people, especially people in California who are required to conserve water, will get annoyed that agriculture gets so much water.  If only farmers would use less water then there would be plenty for the rest of us.  It's my hope to defend the farmer and enlighten the average person on this situation.

Obviously those farmers are not just wasting the water, they are using it to grow food.  The same food you and I eat in the grocery store.  And when I say "we" I'm talking about everyone in the US and a large number of people in the world.  Whereas the midwest grows tons of corn and grain, the vast majority of fruits, vegetables, and nuts are grown in California.  Here is a very small partial list of the largest crops grown in California.
  • Peaches
  • Plums (and prunes)
  • Grapes (and raisins)
  • Figs
  • Apricots
  • Strawberries
  • Apples
  • Oranges
  • Nectarines
  • Dates
  • Kiwi
  • Lemons
  • Melons
  • Tomatoes
  • Broccoli
  • Cauliflower
  • Carrots
  • Onions
  • Garlic 
  • Celery
  • Mushrooms
  • Lettuce
  • Artichokes
  • Peppers
  • Avocados
  • Olives
  • Asparagus
  • Almonds
  • Walnuts
  • Pistachios
If you live in the US and you eat these foods, chances are it came from California.  Many of these items are grown almost exclusively in California.

In addition to the above, California is the second largest grower of cotton.  Also, California produces 90% of all the wine made in the US.

Oh, and let's not forget things like milk, beef, chicken, eggs, sheep (and wool), pork, and turkey.  Yep, you guessed it, California produces the majority of that as well.


In these lists, did you see anything you enjoy eating?  Chances are the majority of the food you eat, regardless of where you live in the US, comes from California.  So hopefully you see the importance of the agriculture sector and giving water to farmers.  Without water for California farmers everyone's food would be significantly more expensive!


Ok, so farmers are important - but do they have to use so much water to grow our food?  Well believe me when I say that farmers have long been doing EVERYTHING they can to cut water use.  When growing food is your job, and water is scarce and expensive, you do everything possible to make the most of it.  If you think your water bill is high, image the water bill for a farmer!  They buy their water by the acre-foot.  Several decades ago 1 acre-foot of water might have cost $50.  Now that same acre-foot of water might cost $300, $500, even as high as $1000.  This is why, long ago, farmers switched to drip-irrigation systems, smarter watering practices, changing crops to those that require less water, using reclaimed water, etc.

So it is true that agriculture uses 4 times as much water as urban uses here in California, but hopefully you understand the importance of that water and believe that farmers are doing everything they can to make every last drop count.

Next time I'll finally talk about water use in the home.

Friday, April 10, 2015

California's Water - Distribution

In this second post on the subject, I wanted to talk about how Califnoria's water is distributed.  One thing you can definitely say about California, because water is such a precious commodity water is heavily studied, tracked, and reported on.  Knowing where water is going and how it's being used are the first steps in conserving it.  Below is a graph showing the breakdown of all water that falls in California in the form of rain and snow.


The first thing you'll notice is the largest piece, a full half of the water supply, is "environmental."  What exactly is that?  Environmental is my blanket term for what all the surveys break down into smaller categories.  This is basically water that is NOT captured or used directly by man.  This is water that is allowed to remain in streams, pass through dams, flow into lakes, estuaries, wetlands, and the ocean.

At this point you're probably asking yourself, if there is a water crisis why isn't California capturing and using this half of the available water?  The answer to that is more political.  Because of federal, state, and local regulations this water must be allowed to flow free - whether that's to preserve native habitat, help with an endangered species, etc.  Some people get very emotional on this issue - after all is a fish really worth preserving when we're running out of water?  I don't want to get into a political issue here and take sides either for or against these environmental regulations.  But I will say that the issue is far more complex and, like many things in life, the answer is a balance.

We cannot simply take all of the water for our use and the environment be dammed (no pun intended).  We need the environment more than people realize.  Wetlands filter pollutants and debris out of water.  Trees and forests clean the air.  And this is to say nothing about the recreation from going to the forest, lakes, rivers, etc.

Even though this "environmental" piece accounts for half of the available water in California, consider this water off the table when it comes to conservation and California's water issue.  In the next post I'll look at the next biggest piece of the pie - agriculture.

Wednesday, April 8, 2015

California's drought and water issues

Anyone who has watched the news lately knows that California is in the middle of a severe drought.  Now before you say to yourself "I don't live in California, this doesn't affect me" - I implore you to continue reading as this does affect you.  Anyway, I was born and raised in California, so drought is nothing new to me.  Over my lifetime California has always been in and out of drought.  That said, this one is by far the worst I've seen.  I don't know if it's the scope, the severity, or the longevity of this drought, but over the last 2 years I have seen reservoirs drying up that have never dried up during previous droughts.  Put simply, our available water is disappearing!  That should alarm you.

Because of this, I am taking this matter very seriously.  Everyone, especially us in California, needs to conserve water, and I fear most other people aren't taking it as seriously as they should.  Either that or they don't know what or how to act.  After all, Governor Jerry Brown mandates the state consume 25% less water, but I haven't seen a single tip, guideline, or rule on how to consume less water.  So I wanted to blog a whole series about water usage and, more importantly, how to conserve water.

In this first post I wanted to talk about how and why this affects you, even if you don't live in California.  Hopefully this will encourage you to save water where ever you are.  I can think of 4 great reasons why everyone should conserve water.

1.  Water is a resource, just like electricity, food, and oil.  There is a finite amount of it, so anytime we frivolously waste it we're only hurting ourselves.  Clean fresh water may be plentiful where you live today, but that may not always be the case.  Large swaths of the USA are prone to droughts, so adopting water conservation now is in your best interest.

2.  Cost - pure and simple.  Clean fresh water costs money, usually in the form of a monthly water bill.  But it could come in the form of an electric bill to operate a well, in which case there is also the hidden cost of digging deeper wells when the water table drops.  If you conserve water you will save money, period.

3.  California's drought affects everyone when you buy groceries.  As someone who grew up in California's central valley, I know why the state is referred to as "the nation's bread basket."  The vast majority of vegetables, fruits, and nuts are grown in California.  Take for example almonds - California grows 99% of the almonds in the USA, and over 92% of the almonds in the whole world.  The plains of the midwest primarily grow grains like wheat, corn, and barley.  But everything else primarily comes from California.  So a drought here very much will affect your food prices regardless of where you live.

4.  Most people who live west of the Rocky Mountains share the same water supply with California.  California's water does not just come from California.  Some water flows down from Oregon.  But thanks to the Colorado river, rain/snow that falls as far away as Wyoming, Colorado, and New Mexico can end up in California.  So the more we all conserve the more we all benefit.

Hopefully this first post at least encourages you to take this drought seriously.  In the coming days and weeks I'll post more on what you can actually do to help conserve water.

Read the next post about water distribution.

Wednesday, March 4, 2015

C++ virtual destructors

Several times recently in other people's code I have run into a problem with virtual destructors - specifically the destructors are not "virtual."  Now to be fair, this is a mistake I have made myself in the past, so I am not just being overly critical of other people's code.

I think a lot of C++ developers do not understand when or why to use virtual destructors.  And admittedly virtual class functions are one of the more difficult parts of C++ to understand.  So let me simplify it and make it easy.  ALWAYS MAKE YOUR DESTRUCTORS VIRTUAL!  Unless you truly understand what you are doing it is hard to think of a scenario where you would want a non-virtual destructor.  Having virtual destructors will not hurt, but non-virtual destructors will cause problems, usually in the form of resource leaks.  Let us look at an example:
class CBase
{
public:
    CBase() {}
    virtual ~CBase() {printf("Base class");}
};

class CDerived : public CBase
{
public:
    CDerived() {}
    virtual ~CDerived() {printf("Derived class");}
};

This is the simplest possible base and derived class you can have.  Now let us look at 3 different ways of using these classes:
CBase *p1 = new CBase;
delete p1;

CBase *p2 = new CDerived;
delete p2;

CDerived *p3 = new CDerived;
delete p3;

So what happens in this code depending on if CBase and/or CDerived have virtual destructors?

Scenario 1: No virtual destructors
In the first delete the CBase destructor is called, which is correct.  In the second delete only the destructor for CBase is called, which means cleanup for CDerived did not happen (resource leaks).  In the third delete both destructors were called, which is correct.

Scenario 2: CBase has a virtual destructor but not CDerived
In the first delete the CBase destructor is called, which is correct.  In the second and third deletes both destructors were called, which is correct.

Scenario 3: CDerived has a virtual destructor but not CBase
In the first delete the CBase destructor is called, which is correct.  In the second delete it actually results in a heap corruption.  Most of the time this heap corruption will not result in a crash, which is actually worse.  It will lead to random sporadic bugs that are hard to track down.  In the third delete both destructors were called, which is correct.

Scenario 4: Both classes have virtual destructors
In the first delete the CBase destructor is called, which is correct.  In the second and third deletes both destructors were called, which is correct.


Both scenario 2 and 4 work without issue, but 2 is potentially dangerous because another class may derive from CDerived in which case problems will not occur.



Similarly, say you are writing code that extends the functionality of another class outside of your control.  For example, you wish to extend a class from an SDK.  Only derive from a class that has virtual destructors.  I often times forget to check this, which is where I got bit in the past.  Older versions of Microsoft's STL implementation had non-virtual destructors.  But what do you do if you have an SDK class that does not have a virtual destructor?  Simple, instead of deriving your class from that class, make what would be the base class into a class member variable.  For example, instead of doing this:

class CDerived : public CBase
{
public:
    CDerived();
    virtual ~CDerived();

protected:
};

You would do this:
class CDerived
{
public:
    CDerived();
    virtual ~CDerived();

protected: 
    CBase m_base;
};

This is effectively the same thing, but avoids the problems caused by non-virtual destructors.




So to sum up, always make your destructors virtual!  Also, always make sure the classes you derive from have virtual destructors and if not then do not derive from them.  Some compilers will warn you about these conditions, but not all.  I wish more compilers warned about this condition.

Hopefully this helps C++ developers of all skill levels out there.

Thursday, January 22, 2015

How to secure your home WiFi

These days most people have a home wifi network, yet it's my experience that very few people (even technically minded people) know how to properly and completely secure their wifi network.  So here is my guide to securing your home wifi network.

First, I'll briefly cover why you should secure your home wifi.  There are multiple reasons, all of which revolve around protecting you and your privacy.
  1. Keep others (like your neighbors) from freeloading off your Internet which you pay for.
  2. Keep the data on your network from prying eyes.  Even if an attacker doesn't use your network to access the Internet they can still monitor your network in hopes of grabbing things like credit card numbers.
  3. Protects you from possible lawsuit.  Suppose someone uses your wifi and downloads illegal material.  Since they did it using your network you could be held liable for their actions, even though you didn't know it was happening.
  4. Keeps you safer from viruses, malware, trojans, etc.  Suppose your neighbor is stealing your wifi and they get a virus - since they're on your network now you're more vulnerable to getting infected.

So here are my top 17 recommendations of things to do to protect yourself and securing your wifi network.  Since every router is different I can't tell you exactly how to implement the following, you'll need to research your specific model.
  1. Buy your own wifi router.  Many times the ISP (e.g. ATT, Charter, or Comcast) will give customers a free wifi router.  These are almost garbage and should not be used.  First off their router is likely to have security holes in it, and the manufacturer is not likely to publish an updated firmware fixing the problem.  Also, some ISPs have a feature whereby they turn your home wifi router into a "wifi hotspot" for anyone else who's a customer.  So other people might be sharing your connection with your ISPs permission, and there's nothing you can do to disable it (yes it's an isolated network so in theory they can't access your files, but it still uses your bandwidth and electricity).  So I recommend ditching their free wifi router and buying your own.  If their wifi router is integrated with the modem (a.k.a. a gateway) then look in the settings for a way to disable the wifi access point and add your own router.
  2. Update the firmware of your router.  Good router manufactures release updated firmwares from time to time that add new features and (most importantly) fix security issues.  So check for an update and install it if available.
  3. When buying a router, use a well-known and trusted manufacturer.  If a manufacturer makes a lot of routers, chances are they have worked out the security flaws in the operating system of the router whereas that no-name manufacturer may have lots of issues.  Probably the biggest router manufacturers are Asus, Belkin, Cisco, D-Link, Linksys, and Netgear.  Of these, I personally prefer Netgear, Asus, and D-Link.
  4. Enable the strongest wifi security available to you.  WEP is awful, don't use it.  WPA is good, but WPS2 is better.  TKIP is okay, but AES is stronger.
  5. Disable WPS (Wi-Fi Protected Setup).  This feature (which might go by other names) is a convenience feature where you press a button on the outside of your router then you can connect a device without having to input your wifi password.  It can be convenient, but there is a well-known security flaw in the design that allows an attacker to gain access to your network in a few short hours.  So disable it!
  6. Disable access levels and points you're not using.  If all your devices are 5GHz then disable the 2.4GHz band. If all your devices are wireless-N, then disable wireless-A/B/G.  The idea is to minimize the ways in which someone could try and access your network.
  7. Disable remote administration.  Most routers allow you to remotely login to them via the Internet.  Chances are you don't need this feature, so disable it.
  8. Consider disabling wifi administration.  Most routers allow you to enable/disable the ability to login to and mange the router from a wireless device.  Assuming you have at least one wired computer connected to the router, then disable this feature.  Anytime you need to manage your router, do it from a wired connection.  In the event someone hacks into your network, this at least keeps them from gaining access to the router itself.
  9. Enable HTTPS login for the router management and disable HTTP.  Many routers allow you to login to the router management via HTTP and/or HTTPS.  Don't use unsecure HTTP and always use HTTPS (the S stands for Secure - literally!).
  10. Check port forwarding and DMZ, and disable unless necessary.  All routers offer features like port forwarding and DMZs.  Close any you're not using as each of these is one more security risk.
  11. Use firewalls on all computers and devices within your network.  This helps protect your computers in the event your network is compromised.
  12. Use long complex passwords everywhere.  This includes your router login, the wifi network password, and the DSL login (where applicable).  The longer the better, the more random the better.  Use a password generator if necessary.  The password "myDSLaccount" is easy to crack whereas "zcXZadF0SmIZCspqw9vG9CUf1aj6NYOa" is hard to crack.
  13. Change passwords from time to time.  Maybe once a month.  If someone hacks in, if you change the password you'll lock them back out.
  14. Record all MAC addresses for the hardware you own.  Any good router will show you the devices connected to it, but most of the time it's just a MAC address (10:23:E3:F6:03:1A).  Unless you've taken the time to figure out all your devices and their MAC address(es) then you won't know if someone else is on your network.
  15. Do not use hidden SSIDs.  This used to be a recommended security practice.  But this does nothing good, and in fact has negative side-effects.  Any would-be hacker will be using tools that shows him all wifi networks, regardless of hidden SSIDs or not.  So don't fool yourself into thinking you're safe.  But they've also shown that hidden SSIDs also reduce the battery life of your portable devices because the device is constantly having to verify the hidden network is in fact the one it thinks it is.
  16. Don't put personal info into the SSID.  Don't have an SSID of "StephensWiFi" or "375PalmAve."  SSIDs like this compromise your personal info and/or give away your location.  If someone wants to hack into your network, don't make it easier for them.
  17. If you have friends and family visiting, enable the guest SSID(s), use a strong password, and give them access to the guest account.  This keeps them off your main secure network.  If you're not expecting friends or family, then disable the guest SSID.  Again, expose as few of avenues of attack to hackers as you can.

With security there is always a trade-off.  One the one hand there is convenience, on the other is security.  Rarely do they overlap, which means if you want your home network to be more secure, ultimately it will be less convenient for you as the user.  But once you accept this fact you can secure your network and enjoy piece of mind.

Homemade Yagi antenna - design and model


In addition to the Gray-Hoverman antenna I designed and built, I wanted to construct a single-channel Yagi antenna to try and receive channel 19 - the one weak signal in my area.  As with the Gray-Hoverman design I used 4nec2 to design and model the antenna.


Here's the actual NEC file.  Feel free to download, use, modify, etc.  If you're interested in building this model, I suggest using this file and 4nec2 to get the exact dimensions of each element.

CM D--EVAL --num-cores=2 --uhf
CE
SY RAD=0.003175
SY FRAD=0.00215
SY DIPOLE_WIDTH=0.3
SY DIPOLE_HEIGHT=0.039
SY DIPOLE_A=DIPOLE_HEIGHT/3.41421356
SY DIPOLE_Z=DIPOLE_HEIGHT/2
SY DIPOLE_CENTER=0.013
SY REF_Y=0.296
SY REF_X=0.14
SY EL1_Y=0.261
SY EL1_X=0.07
SY EL2_Y_DIFF=0.008
SY EL2_X_DIFF=0.151
SY EL2_Y=EL1_Y-EL2_Y_DIFF
SY EL2_X=EL1_X+EL2_X_DIFF
SY EL3_Y_DIFF=0.008
SY EL3_X_DIFF=0.2
SY EL3_Y=EL2_Y-EL3_Y_DIFF
SY EL3_X=EL2_X+EL3_X_DIFF
SY EL4_Y_DIFF=0.002
SY EL4_X_DIFF=0.214
SY EL4_Y=EL3_Y-EL4_Y_DIFF
SY EL4_X=EL3_X+EL4_X_DIFF
SY EL5_Y_DIFF=0.013
SY EL5_X_DIFF=0.2
SY EL5_Y=EL4_Y-EL5_Y_DIFF
SY EL5_X=EL4_X+EL5_X_DIFF
SY EL6_Y_DIFF=0.007
SY EL6_X_DIFF=0.278
SY COND=2e+07
GW 1 1 0 -DIPOLE_CENTER/2 -DIPOLE_HEIGHT/2+DIPOLE_Z 0 DIPOLE_CENTER/2 -DIPOLE_HEIGHT/2+DIPOLE_Z FRAD
GW 2 9 0 -DIPOLE_WIDTH/2 DIPOLE_HEIGHT/2+DIPOLE_Z 0 DIPOLE_WIDTH/2 DIPOLE_HEIGHT/2+DIPOLE_Z RAD
GW 3 5 0 -DIPOLE_WIDTH/2 -DIPOLE_HEIGHT/2+DIPOLE_Z 0 -DIPOLE_CENTER/2 -DIPOLE_HEIGHT/2+DIPOLE_Z RAD
GW 4 5 0 DIPOLE_WIDTH/2 -DIPOLE_HEIGHT/2+DIPOLE_Z 0 DIPOLE_CENTER/2 -DIPOLE_HEIGHT/2+DIPOLE_Z RAD
GW 5 1 0 -DIPOLE_WIDTH/2 -DIPOLE_HEIGHT/2+DIPOLE_Z 0 -DIPOLE_WIDTH/2-DIPOLE_A -DIPOLE_HEIGHT/2+DIPOLE_A+DIPOLE_Z RAD
GW 6 1 0 -DIPOLE_WIDTH/2 DIPOLE_HEIGHT/2+DIPOLE_Z 0 -DIPOLE_WIDTH/2-DIPOLE_A DIPOLE_HEIGHT/2-DIPOLE_A+DIPOLE_Z RAD
GW 7 1 0 -DIPOLE_WIDTH/2-DIPOLE_A -DIPOLE_HEIGHT/2+DIPOLE_A+DIPOLE_Z 0 -DIPOLE_WIDTH/2-DIPOLE_A DIPOLE_HEIGHT/2-DIPOLE_A+DIPOLE_Z RAD
GW 8 1 0 DIPOLE_WIDTH/2 -DIPOLE_HEIGHT/2+DIPOLE_Z 0 DIPOLE_WIDTH/2+DIPOLE_A -DIPOLE_HEIGHT/2+DIPOLE_A+DIPOLE_Z RAD
GW 9 1 0 DIPOLE_WIDTH/2 DIPOLE_HEIGHT/2+DIPOLE_Z 0 DIPOLE_WIDTH/2+DIPOLE_A DIPOLE_HEIGHT/2-DIPOLE_A+DIPOLE_Z RAD
GW 10 1 0 DIPOLE_WIDTH/2+DIPOLE_A -DIPOLE_HEIGHT/2+DIPOLE_A+DIPOLE_Z 0 DIPOLE_WIDTH/2+DIPOLE_A DIPOLE_HEIGHT/2-DIPOLE_A+DIPOLE_Z RAD
GW 11 9 -REF_X -REF_Y/2 0 -REF_X REF_Y/2 0 RAD
GW 12 9 EL1_X -EL1_Y/2 0 EL1_X EL1_Y/2 0 RAD
GW 13 9 EL2_X -EL2_Y/2 0 EL2_X EL2_Y/2 0 RAD
GW 14 8 EL3_X -EL3_Y/2 0 EL3_X EL3_Y/2 0 RAD
GW 15 8 EL4_X -EL4_Y/2 0 EL4_X EL4_Y/2 0 RAD
GW 16 7 EL5_X -EL5_Y/2 0 EL5_X EL5_Y/2 0 RAD
GE    0
LD    5    0    0    0    COND
GN    -1
EK
EX 0 1 1 0 1 0 0
FR    0    7    0    0    500    1
RP    0    1    73    1510    90    0    1    5    0    0
EN


The big question is - after construction, how did it perform?  I compared the antenna to a Channel Master 4-bay antenna (CM4221), which is kind of an unfair comparison since the Channel Master is a wide-band antenna whereas the yagi is designed for one frequency.  Anyway, I mounted each antenna in the same location and used my TV to scan for all channels.  For each digital channel I wrote down the average signal strength.  My TV reports two signal numbers, the overall signal level in percentage, and the signal-to-noise ratio in decibels.  For both numbers, higher is better.

Channel CM4221 Yagi (ch. 19)
15 98% (32db) 98% (31db)
16 89% (26db) 89% (27db)
19 56% (15db) 62% (20db)
24 95% (29db) 98% (30db)
31 84% (25db) 76% (22db)
34 89% (27db) 78% (23db)
41 87% (26db) 87% (26db)
50 98% (32db) 62% (17db)

As you can see, at the design frequency (ch. 19) the yagi outperforms the Channel Master.  For the most part, all other channels the Channel Master outperformed the yagi (as expected).  I was surprised to see channels 16 and 24 where better than the Channel Master, probably because those channels aren't far off of the designed channel.

Even with the antenna specifically designed for one channel, I was disappointed with the results.  62% is very low, I expected at least 80.  But I think the main problem was the mounting location which was 1 foot away from and behind my house from the broadcast antenna.  I could move the antenna and try again, but it's actually moot.  In the few weeks it took me to design, build, and test this antenna, channel 19 installed a low power digital repeater closer to my house.  So I no longer need this dedicated yagi antenna.  I guess you could say it was obsolete before it was completed.  Oh well, good thing it was relatively inexpensive to construct.  I estimate the cost of materials at $20.


Here is a youtube video I uploaded showing design and construction of the antenna.


Here are download links useful to antenna modeling:
4nec2 - http://www.qsl.net/4nec2/
nikiml's python scripts - http://clients.teksavvy.com/~nickm/scripts.html
Optimized versions of the NEC2 engine - http://users.otenet.gr/~jmsp/

Homemade Gray-Hoverman antenna - design and model


I recently designed and built a homemade antenna for TV reception.  The design is called a Gray-Hoverman.  The idea behind this antenna is to replace my existing Channel Master 4-bay antenna (CM4221).  There is nothing wrong with the Channel Master antenna, mainly I'm just curious if I can construct a better antenna.  That's the type of nerd I am. :)

To design the antenna I used a free piece of software called 4nec2, which allows you to design and model (or predict) how the antenna will perform.  I also used some python scripts to optimize the design.  I'll include links to all the software below.  I'm not going to go into the details on antenna modelling and the use of 4nec2 as it's a very complicated subject that took me a while to learn.

The Gray-Hoverman design I came up with is optimized for my specific area.  The TV channels in my area that I care about are 15, 16, 19, 24, and 31.  So my design is optimized just for this range.

Here's the actual NEC file.  Feel free to download, use, modify, etc.  If you're interested in building this model, I suggest using this file and 4nec2 to get the exact dimensions of each element.
CM D--EVAL --num-cores=2 --uhf
CE
SY GAP=0.086
SY RAD=0.003175
SY FRAD=0.00229
SY SRAD=0.00635
SY SX=0.121
SY SY=0.642
SY SZ=0.054
SY COND=2.0e7
SY L=.1629
SY W=0.109
GW    1    1    0    -GAP/2    0    0    GAP/2    0    FRAD
GW    2    11    0    GAP/2    0    0    GAP/2+L    L    RAD
GW    3    11    0    GAP/2+L    L    0    GAP/2    2*L    RAD
GW    4    11    0    GAP/2    2*L    0    GAP/2+L    3*L    RAD
GW    5    4    0    GAP/2+L    3*L    0    GAP/2+L+W    3*L    RAD
GW    6    11    0    GAP/2    0    0    GAP/2+L    -L    RAD
GW    7    11    0    GAP/2+L    -L    0    GAP/2    -2*L    RAD
GW    8    11    0    GAP/2    -2*L    0    GAP/2+L    -3*L    RAD
GW    9    4    0    GAP/2+L    -3*L    0    GAP/2+L+W    -3*L    RAD
GW    10    11    0    -GAP/2    0    0    -GAP/2-L    L    RAD
GW    11    11    0    -GAP/2-L    L    0    -GAP/2    2*L    RAD
GW    12    11    0    -GAP/2    2*L    0    -GAP/2-L    3*L    RAD
GW    13    4    0    -GAP/2-L    3*L    0    -GAP/2-L-W    3*L    RAD
GW    14    11    0    -GAP/2    0    0    -GAP/2-L    -L    RAD
GW    15    11    0    -GAP/2-L    -L    0    -GAP/2    -2*L    RAD
GW    16    11    0    -GAP/2    -2*L    0    -GAP/2-L    -3*L    RAD
GW    17    4    0    -GAP/2-L    -3*L    0    -GAP/2-L-W    -3*L    RAD
GW    18    30    -SX    -SY/2    SZ    -SX    SY/2    SZ    SRAD
GW    19    30    -SX    -SY/2    SZ*3    -SX    SY/2    SZ*3    SRAD
GW    20    30    -SX    -SY/2    SZ*5    -SX    SY/2    SZ*5    SRAD
GW    21    30    -SX    -SY/2    SZ*7    -SX    SY/2    SZ*7    SRAD
GW    22    30    -SX    -SY/2    -SZ    -SX    SY/2    -SZ    SRAD
GW    23    30    -SX    -SY/2    -SZ*3    -SX    SY/2    -SZ*3    SRAD
GW    24    30    -SX    -SY/2    -SZ*5    -SX    SY/2    -SZ*5    SRAD
GW    25    30    -SX    -SY/2    -SZ*7    -SX    SY/2    -SZ*7    SRAD
GE    0
LD    5    0    0    0    COND
GN    -1
EK
EX    0    1    1    0    1    0    0
FR    0    17    0    0    476    6
RP    0    1    73    1510    90    0    1    5    0    0
EN


The big question is - after construction, how did it perform compared to the Channel Master antenna?  I mounted each antenna in the same location and used my TV to scan for all channels.  For each digital channel (including those beyond what I care about) I wrote down the average signal strength.  My TV reports two signal numbers, the overall signal level in percentage, and the signal-to-noise ratio in decibels.  For both numbers, higher is better.

Channel CM4221 Gray-Hoverman
15 98% (32db) 98% (33db)
16 89% (26db) 89% (27db)
19 56% (15db) 43% (12db)
24 95% (29db) 98% (30db)
31 84% (25db) 84% (25db)
34 89% (27db) 92% (28db)
41 87% (26db) 89% (27db)
50 98% (32db) 98% (30db)

As you can see, the Gray-Homerman antenna matched or exceeded the Channel Master for almost all channels, even some beyond what the antenna was designed for.  Only at channel 50 was the Channel Master better.  [I'm ignoring channel 19 because that channel is weak and anything below 60% and my TV cannot lock onto the signal.]

Here is a youtube video I uploaded showing design and construction of the antenna.


Here are download links useful to antenna modeling:
4nec2 - http://www.qsl.net/4nec2/
nikiml's python scripts - http://clients.teksavvy.com/~nickm/scripts.html
Optimized versions of the NEC2 engine - http://users.otenet.gr/~jmsp/