June 22, 2007 at 10:51 am
There is an article in the latest UVA alumni magazine about Conor Grennan, a graduate of UVA (around the same time as me) who started an orphanage in Nepal and helps to reunite trafficked and otherwise lost/stolen children with their families. He has left behind the “American dream” of huge SUVs and McMansions in order to improve the lives of poor children. From the article it seems that he was a typical UVA undergraduate. Who would have thought he would become one of my heroes?
June 22, 2007 at 8:54 am
There are a number of great points in this article. I don’t agree with everything the author says, but for the most part he is spot on, as in this quote:
If I could do one massive experiment on the whole US I would take away TV for a month. Once a chunk of the population survived the mind-poison withdrawal I bet great things would start to happen.
People would shop less, exercise more, talk to their neighbors, maybe even, dare I say, read a book or plant a garden. You can bet the social and political landscape of the US would look mighty different.
The status quo assumes we need a lot of energy for a good quality of life. On the contrary, we have too much energy now and our use of it has damaged our quality of life and the environment as well, which is inextricably linked with our quality of life.
With Jesse and India in the USA this week I’ve been living a very minimal lifestyle. Turned off the heat (yes, it is still chilly in Edinburgh), no TV, mostly simple organic/local foods. I am using barely any electricity – basically just my laptop, the oven and an occasional load of laundry. The only consumerism in sight consists of walking two blocks to buy some fruit, bread or milk at the shop, and that doesn’t count. For recreation I’ll ride my bike across the city for some football in the park. It feels good to use less (external) energy.
via No Impact Man
June 20, 2007 at 5:10 pm
I hear a lot of java programmers complaining about the complexity of GridBagLayout. The GridBagLayout is a bit complicated, but it is also the most flexible layout manager I’ve used in any language. With the aid of a simple utility class it is also the easiest. GridC subclasses GridBagConstraints and provides an easy and concise way to assign properties to components that are added to a GridBagLayout-managed container. Here’s an example:
JPanel p = new JPanel(new GridBagLayout());
p.add(label1, GridC.getc(0,0).label());
p.add(field1, GridC.getc(1,0).field().colspan(2));
p.add(label2, GridC.getc(0,1).label());
p.add(field2, GridC.getc(1,1).field());
p.add(button2, GridC.getc(1,2));
GridC objects have methods for setting virtually every layout property you can think of: column/row spanning, insets, alignment, resize weight along each axis, fill along each axis. Each method returns the same GridC object so that you can chain the calls. For example, the following call puts the component (comp) in location (x,y), spanning two columns, filling along the y axis and aligned to the northEast corner:
p.add(comp, GridC.getc(x, y).colspan(2).filly().northEast())
Please take the GridC code, use it in your projects and rid yourself of GridBagLayout headaches forever.