Know More
http://jeremygoodell.com
Know More

Quiet and Dark

It didn't rain at all today. It was really quiet and still outside tonight.

Good night for a run. Or, in my case, a walk and a run.

Day 2 of the Couch to 5K program is the same as Day 1:
5 minute walk
2 minute jog
5 minute walk

It was definitely easier than Monday, and I didn't end up coughing at all. Not sure if that's because I got it all out of my system or maybe the air is different. After all that hacking on Monday night, my sinuses felt cleaner than they had in a long time. I felt extremely refreshed.

I did my 12 minutes tonight, then did some stretching and then put some salmon in the oven.

I liberally covered the fish with a Texas-style mango pico de gallo, some Tapatillo sauce and salt and pepper. I'm also steaming some zucchini and yellow squash splashed with olive oil and salt and pepper.

I really like to cook, but I'm the only one in my household that eats regular food, so I can only cook for myself.

When you're doing any sort of intentional exercise at all, it's impossible to eat badly because it makes you feel like all that work you put in on the exercise is for naught.

So, it's a vicious cycle. In a good way.

 del.icio.us  Digg 

From Couch to 5K

So, it's been almost exactly five months since we moved to Texas.

I weighed myself the other day and found I was about 35 pounds overweight. Since my ideal weight is about 205, an extra 35 pounds is like 20 pounds on a smaller man. But still, I consider myself as borderline fat right now.  I was about the same weight two years ago and then I spent six months getting into shape. I got down to about 210 and was doing a regular routine of cardio-lifting. Exercising tended to make me want to eat right as well, so I was tracking calories and reading labels. I felt awesome.

But I faltered and gained just about everything back in less than the time it took me to lose it.

Then, as we were preparing to move to Texas, I did quite a bit of exercise for a couple months (painting, cleaning, packing), and was feeling fairly trim. However, Texas is all about lots and lots of really tasty meat and other fatty snacks, so it didn't take long  to get back to a pretty uncomfortable heft.

Today I decided to gradually work into shape again. Unfortunately all of our workout gear is in storage in a POD in California and isn't scheduled to make the trip out here until April. So, for now, I'm just starting with some jogging.

I decided to try the Couch to 5 K program, which I'd heard good things about, so according to plan, today I walked 5 minutes, jogged 2 minutes and walked another 5 minutes. The symmetry is cool, because you can just walk 5 minutes away from your house, jog 1 minute, then turn around and come home.

I set off walking at a pretty brisk pace, and found myself breathing hard after about 2 minutes. I did not feel a great deal of exertion though, even after five minutes, but then came the jogging. Two minutes of jogging at a moderate pace and I was winded. It took the entire five minute walk home to recover. Then I did some stretching and took a shower.

But here's the thing that always baffles me about starting to exercise when I'm out of shape. Once my heart rate was back to normal, I started coughing and hacking like a pack-a-day smoker, but I don't smoke anything ever (at least not in the last ten years). Where is all this phlegm coming from? This condition definitely hammers home how out of shape I am. TWO MINUTES OF JOGGING and it takes me almost two hours to feel relatively calm and normal afterward.

It's not pleasant to be coughing and realizing how much work it will take to get in shape, but on the other hand, it sure feels good to have started to do something about it. Exercising has always been a love-hate relationship for me; I don't believe I've ever exercised consistently for more than a year consecutively, and over the course of my adult life, the periods of time that I haven't exercised probably outweigh the times I have by a factor of three or four to one.

There's something to be said for a job that forces you to exercise. When we flipped a couple houses in Tustin, I was working very hard every day for months, doing concrete, tile, drywall, framing, painting, cleaning, fencing, and landscaping, and I was definitely in as good a shape as I'd ever been. It didn't feel like exercise because it was my job at that time. I think computer programming is possibly the single job with the least exertion of any other on the face of the earth. A computer programmer sits very, very still for most of the day, moving only his fingers and eyes. A programmer's best work gets done when they exert the least amount of energy. Meetings, phone calls, going to lunch, anything that requires physical exertion detracts from writing code. And the worst part is, the more involved you get in the code you're writing, the harder it is to want to get up and do anything; you want to work until it's done. Today I worked 10 consecutive hours and spent about 9 hours and 45 minutes of that time sitting quietly at my desk.

According to plan, I should be doing the same 5 minute walk, 2 minute jog, 5 minute walk on Wednesday, but the forecast calls for rain, so we'll see what happens.

 del.icio.us  Digg 

Sisterly Love.


These are my two youngest daughters. They love to make videos.

 del.icio.us  Digg 

U.S. Carbon Footprint Shrinks

U.S. CO2 emissions fall 2.8% in 2008
May 21, 2009

Source: mongabay.com

united states co2 emissions from fossil fuel use
Carbon dioxide emissions from fossil fuel use in the United States fell 2.8 percent in 2008, the largest annual drop in more than 20 years
, reports the Energy Information Administration. A slowing economy and high gasoline prices contributed to the decline.

Emissions fell for all major fossil fuels: emissions from petroleum fell 6 percent, natural gas dipped 1 percent, and coal retreated 1.1 percent.

Emissions also fell across most end-use sectors including electricity generation (down 2.1 percent), industrial use (down 3.2 percent), and transportation (down 5.2 percent). The only sector to see a rise in emissions was commercial, which increased 0.5 percent.

Despite the largest decline since 1990, the transportation sector remained the largest end-use source of energy-related CO2 emissions. Since 1990, transportation sector carbon dioxide emissions have risen by 21.1 percent — 1.1 percent per year.

The carbon efficiency of the economy also improved, with emissions per unit of GDP dropping 3.8 percent in 2008.

U.S. emissions from fossil fuel burning in 2008 were 15.9 percent above the 1990 level (the baseline for the 1997 Kyoto Protocol) and 2.8 percent below the 2005 level (the baseline proposed under the American Clean Energy and Security Act of 2009 [Waxman-Markey bill]).

 del.icio.us  Digg 

rich:modalPanel doesn't display/update data from backing bean.

Problem: rich:modalPanel doesn't display/update data from backing bean

Possible Solution:
This one has taken me weeks to solve. But finally, with the help of Max Katz, author of Practical Rich Faces, I was able to tackle it. There are many reasons why you might be having these problems. Your best bet is to go take a look at a tutorial that Max wrote on using a rich:modalPanel to allow editing of data in an underlying page. Max' solution even allows you to reRender just the row that was edited. I extended the code to allow adding a new entity as well.

Click to see the tutorial.

Click here to purchase Practical Rich Faces.


If you have problems with the tutorial, Max is pretty good about answering comments/emails.

Max is also conducting free webinars on Rich Faces for redhat/Exadel. You can view the previous sessions and register for the upcoming sessions by clicking here.

THANKS MAX!

 del.icio.us  Digg 

detached entity passed to persist

Problem: detached entity passed to persist

Possible Solution: This error can occur for a number of reasons. I suggest that if my solution doesn't help you, then you keep doing google searches. There's a lot of different forum posts about this one, and there's a lot of different problems that can cause the error message.

I was getting this error (apparently) because I was bi-jecting a Seam entity though multiple session beans. When I changed this to bi-jecting just the id for the entity and then doing an entity manager lookup using the id (in each of the session beans), the problem went away. I worked on this for a long, long time, and when I found a solution that worked, I was happy to just stick with it. However, I don't believe that this is the absolute correct solution, because it means doing a database lookup on the entity each time a new page is displayed.

Anyhow, right or not, here's the details. I had a Seam entity called coupon, defined in Coupon.java. My first screen is a table to look up the coupon to work with. Previously, I had this screen's session bean setting an out-jected conversation context variable called selectedCouponObj. Then, the next screens would inject selectedCouponObj and work with it. Note that this actually worked as far as getting and setting the values inside the object. BUT, as soon as I did an entityManager.persist(selectedCoupon), I'd get the detached entity error.

So, the fix was: instead of out-jecting and in-jecting the Coupon itself, I out-jected and in-jected the Coupon id: selectedCouponId. Then, I' set the selectedCouponObj in each session bean by calling selectedCouponObj = entityManager.find(Coupon.class, selectedCouponId)

Like I said, this does not seem like the ideal solution, but it worked for me.

 del.icio.us  Digg 

Imogen Heap (a.k.a Frou Frou)

I have recently discovered the very talented Imogen Heap, shown here performing Goodnight and Go, in April, 2006 on David Letterman, and in the video of It's Good to Be in Love from the 2002 album Details (recorded as Frou Frou).




 del.icio.us  Digg 

value bound to h:selectOneMenu doesn't get set

Error: value bound to h:selectOneMenu doesn't get set

Possible Solution:

This problem has given me serious problems on three different occasions. To summarize the problem, I've created an h:selectOneMenu control on a form. I've set the value attribute to be a property of a Seam component. The value is supposed to serve a bi-directional purpose. If it is non-null when the control is rendered, then the specified value will be selected in the resulting combo box. I haven't had any problems at all getting this to work. The problem is with the other direction. When the user selects a new item in the combo box, the property in the value field is supposed to get set using the class setter for the property.

So, I've had several issues, including just not understanding some things. I will try to document them all here.
  1. The name specified in the value field should be a Seam component property, NOT a Seam context variable. For example, you should probably be using value="#{myList.selectedValue}" AND NOT value="#{selectedValue}". The first way will call the setSelectedValue() method of the class corresponding to the myList Seam component. The second will get the correct value when rendered, but I don't believe it will result in setting the value when it's changed. But I might be wrong about that.
  2. The name you specify must equate to a Seam component name (i.e. something specified as @Name("name"). So, in the example above, you would need a class with @Name("myList") that defines a selectedValue property and implements a getter and setter for the selectedValue property. Note that if it's an EJB3.0 bean, then you will also need to define the getter and setter in the corresponding interface.
  3. Of course, you're probably going to want to promote the changed value to a Seam context, so you'll probably declare the selectedValue property as an outjected context variable by placing an @Out annotation above the property declaration.
  4. This to me was one of the trickier points that I did not see documented anywhere: the setter method is NOT called when the user selects one of the items in the combo box. Coming from a heavy JavaScript background, I assumed I'd see the setter get called each time I changed the combo box selection. However, instead, the setter is only called when the page goes away. Note, that if you have commandLinks on the page that rerender the page, that will also cause the setter to get called. Hence, the value should remain set after a rerender. The setter gets called whether the destination page is the same page or not. So, if you're debugging and trying to follow along, don't expect the setter to get called until a button is pressed.
  5. This one was also tricky for my JavaScript-addled brain. The valueChangedListener attribute is NOT used to specify a method that gets called when the user selects a new item. The valueChangedListener only gets called when the property value changes.
  6. Now for the most tricky point of all. THE selectOneMenu control MUST RESIDE IN THE SAME FORM AS THE BUTTON WHICH IS USED TO EXIT THE PAGE!!! I spent about eight hours trying to figure this one out. My page had two separate forms, one of them for my wizard-style buttons (because they are defined in a template.xhtml). I finally discovered the cause of the problem when I realized that one button on the page that just did a reselect of data for the combo box DID result in calling the setter, but the other button (to go to the next page) DID NOT!!. Once I put all the buttons into the same form as the combo box, it worked perfectly.

 del.icio.us  Digg 

org.jboss.deployment.DeploymentException: Trying to install an already registered mbean

Error Message: org.jboss.deployment.DeploymentException: Trying to install an already registered mbean

Possible Solution:
It seems that if you are seeing this message, something is wrong with your JBoss installation. I ended up getting this error message after a weird sequence of events. First, my computer completely froze up on me -- like a memory problem or something. My application was running in JBoss (through eclipse) at the time. Then, after turning the computer off and back on, I repeatedly got an error when I tried to start JBoss that port 1098 was already in use (I documented the fix for this in another entry: "Port already in use: 1098").
Once I fixed the port problem, I started getting the already installed mbean error. A little research showed that I needed to try either reinstalling JBoss, or messing around with stuff in the deployment directory (the JBoss deployment directory, not the eclipse one). So, I deleted a few folders in there. Then the error went away, but JBoss wouldn't start because it needed those folders. I was able to fix this problem by retrieving the folders from a backup location. Then everything worked fine again.

I wouldn't really recommend this approach. Probably better to resinstall JBoss if you have this problem and can't easily make it go away. The first thing you might check for is if you have your application EAR deployed in both the eclipse deployment location and the JBoss server deployment location.

 del.icio.us  Digg 

Port already in use: 1098

Error Message: Port already in use: 1098

Possible Solutions: 
JBoss tries to use port 1098. But there is nothing preventing another application from using it if it finds it first. I actually had a bit torrent using the port. I disabled the torrent and jboss started fine.
I discovered the application that was using the port by typing netstat -b from the command line in Windows XP. I understand this command only works in XP. Look around to find something similar if you're not on XP.
One condition that causes this error is if JBoss was shut down improperly (or if it's still running). In that case, you might just want to reboot.

There is a way to reserve port numbers so that other applications don't use them. Also, it is possible to change the port number that JBoss uses. You can read the directions to do either of these here.

 del.icio.us  Digg