swisspig.net - To hell with the pig... I'm going to Switzerland.

Green America (Friday, July 18, 2008)

For the past few years, whenever I heard Al Gore's name, all I have been able to think of is the former Vice President's poorly impersonated voice, screaming "Pig Bear Man!" on South Park. While that's good for a laugh, I suppose I should try a little harder to take the Nobel Peace Prize-winner seriously.

To that end, Gore gave a speech [text of speech available here] yesterday, calling on America to largely eliminate our dependence on carbon-based power by 2018. His proposal goes beyond just eliminating our use of foreign oil, but reducing the use of all non-renewable sources, including coal, which accounts for 50% of our energy production, right now.

I don't believe that the government, nor the people of America have the balls to make the proposal a reality in the time frame suggested, but if we can do anything, it will be a massive step in the right direction. We need to invest heavily in solar and wind power. We need investments in plug-in electric vehicles (like the Tesla), and bio-diesel, which can be made at home from waste cooking oil and commercially, on a large scale using algae.

I have collected hundreds of ideas for energy efficient living over the past few years. Six solar panels would provide most of the energy needed by my (terribly inefficient) house, most of the time, and even at today's insanely high price for photovoltaics and assuming that energy costs never increased (which they certainly will), the system would pay for itself in less than fifteen years. Considering the rising cost of grid power, the real break-even point would probably be sooner. But more to the point, the $10,000 invested would be rolled into the value of the home, and the system and the home should last fifty, or a hundred years — far longer than it takes to get a huge return.

Another no-brainer is efficient appliances. There are now high efficiency washers and dryers — in particular, dryers with moisture sensors that automatically shut off when the clothes are dry. No one should by anything without an Energy Star label. For those of you who like gadgets, the Kill-A-Watt can tell you exactly how much power a particular device or appliance is consuming — even when the device is off. How much power does your computer or TV use, when it's not even turned on?

There are many other things that can be done with new construction. One of my favorites is the ground source heat pump, which uses the Earth for heat exchange, rather than the outside air. The greater than difference between the outside temperature and the desired inside temperature, the more energy your heat pump has to use. In the winter, that means a temperature differential of nearly forty degrees, and in the summer of more than twenty degrees. But since just a few feet under ground, the temperature is constant year round, those temperature differentials become just ten degrees year round, for an energy savings of thirty to seventy percent. Considering that heating and cooling account for more than half of your utilities during the year, that's a serious savings.

These sorts of reductions in power consumption mean that those few solar panels are able to provide an even higher percentage of your electricity, to a point that your utility costs be close to zero — and in fact, you might be able to sell power back to the grid (and you know, the power companies are required by federal regulation to buy it from you — your meter spins backwards).

So yeah, we just need to grow some balls and actually do this stuff. Instead of just waiting around for someone else to fix the problem. The more people who do it, the less it will cost at the outset, and the greater our returns will be in the long run.

—Brian (7/18/2008 10:43 AM)
(0 comments)

The Water Jug Puzzle (Thursday, July 10, 2008)

While reviewing for my PhD qualifying exams, I came across the following puzzle:

In the water-jug puzzle we are given a 4-liter jug, and a 7-liter jug. Initially, both jugs are empty. Either jug can be filled with water from a tap, and we can discard water from either jug down a drain. Water may be poured from one jug into the other. There is no additional measuring device. Explain how to measure out precisely 1, 2, 3, 4, 5, 6, and 7 liters of water.

Obviously, measuring out 4 liters is as easy as filling the 4-liter jug, and measuring out 7 liters is as easy as filling the 7-liter jug. But see if you can figure out how to end up with the other amounts in one of the two jugs. Remember, there is no "half a jug" nor any other place to store water. Leave a comment with your solution!

—Brian (7/10/2008 2:16 PM)
(1 comments)

Brian Ziman, GMU Grad! (part 2) (Thursday, June 26, 2008)

After much anticipation, it is official!

GEORGE MASON UNIVERSITY
Student Information
Name:Brian L. Ziman
College:School of IT and Engineering
Degree Information
Awarded:Master of Science
Degree Date:May 17, 2008
Departmental Recognition:Outstanding Academic Achievement Award
Major:Computer Science
GPA:3.88
—Brian (6/26/2008 9:34 PM)
(1 comments)

Wrong Default TimeZone in Java on Red Hat Linux (Friday, June 20, 2008)

While I have the fortune of running Ubuntu and Debian at home, I have the misfortune of working with Red Hat (Fedora Core 9, specifically) at the office. Today, I spent the afternoon fighting Java, which insisted that the time was an hour earlier than reality. I found a solution.

So here's the environment. My computer lives in Eastern Daylight Time (UTC-04:00 at this time of year). Obviously, when Daylight Saving Time is not in effect, we're five hours behind UTC. My system is "properly" configured, with the time zone set to "America/New_York". My test program looks like this:

Listing:

import java.util.*;
public class Test {
    public static void main(String args[]) throws Exception {
        System.err.println("Default TZ="+TimeZone.getDefault());
        System.err.println("Now="+new Date());
    }
}

Output:

$ date
Fri Jun 20 17:17:09 EDT 2008

$ java Test
Default TZ=sun.util.calendar.ZoneInfo[id="GMT-05:00",offset=-18000000,\
dstSavings=0,useDaylight=false,transitions=0,lastRule=null]
Now=Fri Jun 20 16:17:09 GMT-05:00 2008

As you can see, it reports the non-DST version, because it's really just guessing. And it is also off by an hour. After reviewing a ton of literature and discussion online, the most commonly accepted work-around for this issue is to specify the TZ environment variable, which should be totally unnecessary. But it works:

Output:

$ date
Jun 20 17:22:04 EDT 2008

$ TZ="America/New_York" java Test
Default TZ=sun.util.calendar.ZoneInfo[id="America/New_York",offset=-18\
000000,dstSavings=3600000,useDaylight=true,transitions=235,lastRule=ja\
va.util.SimpleTimeZone[id=America/New_York,offset=-18000000,dstSavings\
=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDa\
y=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMo\
nth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]]
Now=Fri Jun 20 17:22:04 GMT-04:00 2008

But I was not satisfied by this... if the OS is properly configured, and Java is anything better than brain-dead, it should work. So I pulled out my trusty "strace" tool, for following system calls. You have to remember to use the "-f" parameter, so that it actually digs down into the useful child processes that get spawned.

What I ended up finding was that it was trying to open the file $JRE_HOME/lib/zi/America/New York. Looking in that directory, I found a file named New_York — with an underscore, instead of a space. Now, I'm not sure where it is getting a time zone name with a space instead of an underscore, but the solution was immediately obvious to me. Create a symbolic link to the underscore version using a name with a space:

Output:

$ su -
Password:

# cd $JRE_HOME/lib/zi/America

# ln -s New_York New\ York

# logout

$ date
Fri Jun 20 17:31:17 EDT 2008

$ java Test
Default TZ=sun.util.calendar.ZoneInfo[id="America/New York",offset=-18\
000000,dstSavings=3600000,useDaylight=true,transitions=235,lastRule=ja\
va.util.SimpleTimeZone[id=America/New York,offset=-18000000,dstSavings\
=3600000,useDaylight=true,startYear=0,startMode=3,startMonth=2,startDa\
y=8,startDayOfWeek=1,startTime=7200000,startTimeMode=0,endMode=3,endMo\
nth=10,endDay=1,endDayOfWeek=1,endTime=7200000,endTimeMode=0]]
Now=Fri Jun 20 17:31:10 GMT-04:00 2008

I have to wonder if this only shows up for people with a space in their time zone name, like America/Los_Angeles and America/New_York. If that's the case, making that symbolic link might be the best solution for you, as it doesn't rely on system configuration. I hope this is useful for other folks, so they don't have to bash their heads against the wall for hours like I have. Good luck!

—Brian (6/20/2008 5:35 PM)
(1 comments)

Who Are You Voting For? (Sunday, June 15, 2008)

For our daily dose of satire, I present I'm Voting Republican.

—Brian (6/15/2008 12:48 PM)
(0 comments)

Sweet Fiber (part 2) (Sunday, June 8, 2008)

Private post. Click on title to log in.


Sweet Fiber (Thursday, June 5, 2008)

Private post. Click on title to log in.


The Willow Flycatcher (Tuesday, June 3, 2008)

A source of amusement for me and my office mates over the past two weeks has been the persistent attempts by a small green bird to peck its way through our office window. After some research, I believe the deranged creature is a Willow Flycatcher, but it's hard to be certain. Every morning and afternoon, this bird arrives, occasionally with a friend, and they sit on the sill of our third floor window and peck at the window repeatedly for a few moments, then jump to another spot on our window, and continue pecking. They do this for upwards of a half hour or more, for no apparent reason.

I've read about birds flying into windows, because they think their reflection is a rival bird in their territory, but I can't imagine that this is attack behaviour, since he's sitting on the sill. Perhaps he thinks that the windows are made of bugs, and he's trying to find a snack? If so, he's very persistent, and likely to starve to death. The windows are so covered in grime that it wouldn't be surprised if there was something tasty growing there... but hardly suitable for a fly-catching beak.

But little Willow Flycatcher will only be able to keep us company for a few more weeks, before we move to our new office in Sterling, which will likely be devoid of any fascinating wildlife.

—Brian (6/3/2008 08:53 AM)
(1 comments)