Thursday, July 31, 2008

Belts



Certainly worse exist, but "The Belt-Napper" is not a moniker I want on my headstone.

Pictured are all belts I could find after spending an hour of frantic house/garage/car hunting. Glenn if any of the above even "closely resemble" a belt you may have owned or borrowed for an extended period or even viewed while browsing a local Deseret Industries, then please claim such belt as your own surrogate belt. I understand such a surrogate will be but a shadow of the belt with which she replaces, but in time.. in time wounds heal.

Monday, July 28, 2008

ZoneAlarm: a love / hate relationship

I love the free version of ZoneAlarm. Having a firewall software loaded on a Windows XP computer with access to the internet is a must for the health, security and privacy of a system. However, ZoneAlarm is such a nightmare when I try to do anything "networky". I have added the IP address of the other computer, but the menus in Zone alarm are so poorly named I cannot figure out how to enable network file sharing. So I am stuck, I am trying to get Ubuntu to mount a Windows XP share drive, if I disable ZoneAlarm, BINGO I am in, if I enable ZoneAlarm, when I try to connect I get an infuriating ZoneAlarm message that remote access was blocked. If you know of a better personal firewall software to use (or how to get ZoneAlarm to allow Windows XP filesharing traffic) please let me know.

My dream Windows XP Internet and network firewall software is:
  • Free (can be open or closed source, but nag screens to buy should not be worse than ZA)
  • Configurable (So that I can allow traffic like windows file shares)
  • Good help documentation so I can figure out how to allow different types of traffic in and out
  • Actively maintained
  • Always on and low resource footprint (does not grind my system to a halt)
Yes I should just switch the other computer to Ubuntu as well and be done with it but,
we have and love the Adobe software that is windows/mac specific. This is the major reason left to have MS Windows at home, this and PC games which I never play anymore. I wonder how much Adobe is being paid to NOT develop a Linux version of their software, because as soon as they develop Linux versions... RIP MS Windows forever.

Tuesday, July 22, 2008

Dr Pepper

After bringing home about 4 six-packs of Dr Pepper from the museum in Waco, Texas, there are only 7 left... the original recipe, Imperial Sugar version is so very good. Rebecca has now banned me from them... the remaining cans are now hers and she can't drink them until after the baby comes in March. To be fair, I did not drink all of them in July. I gave out quite a few to friends and family. I would still like to have Steven try one as well, so maybe the last six-pack is Rebecca's.
On another note, the vinyl fence is finally done! I will post pictures if Rebecca does not beat me to it.

Wednesday, July 16, 2008

Java reflection tip of the day

Suppose you want to call a private method of a class called FourGablesGuy. Suppose further that the private method of this class has primitive type arguments.

public FourGablesGuy {
private String privateMethod(int intParm, boolean boolParam)
{
return "four gables guy";
}
}



Using reflection you can do it, but it was a little tricky for me.


...
FourGablesGuy myFourGablesGuy = new FourGablesGuy();
Object[] args = new Object[]{ new Integer(921), new Boolean(true)};
Class[] params = new Class[] { Integer.TYPE, Boolean.TYPE };
String result;
try {
Method privateMethod = myFourGablesGuy.getClass().getDeclaredMethod(
"privateMethod", params);
privateMethod.setAccessible(true);
result = (String) privateMethod.invoke(myFourGablesGuy, args);
} catch (NoSuchMethodException nsme) {
//do stuff
throw nsme;
} catch (InvocationTargetException ite) {
//do stuff
throw ite;
} catch (IllegalAccessException iae) {
//do stuff
throw iae;
}
// at this point the result String should have the value of the private method call
...


Getting the Class object for the primitive types was one issue, it is not java.lang.Integer! Also, knowing that an Object Array of a java.lang.Integer object and java.lang.Boolean object will be acceptable arguments to a Method defined with primitive params was the other big logic hurdle.
Hope this helps someone, maybe some Java professor needs a tough bonus reflection question. Or maybe this is all just obvious to the entire Java community and I am the last one to figure it out.
So if you are getting NoSuchMethodException and the method is using primitives, it is probably because you are not using Integer.TYPE for the Class Array of parameters and are using Integer.class instead.

Tuesday, July 15, 2008

Wisdom Teeth

Dentists have been casually recommending that I have my wisdom teeth removed for about 10 years now... I never felt like paying for it or going through the hassle. Well this past checkup visit the Stonehaven dentist pushed removing my wisdom teeth harder than any previous dentist has. His assistants picked up right where he left off, aggressively pushing the procedure. I still did not schedule to do it at the office, and I was annoyed by his salesman style approach. Then Rebecca started asking me, "When should I schedule to get those wisdom teeth out?" I think I reacted to her the same as the dentist in the office by telling her, we can't afford it, I am too busy at work, it is not hurting me to keep them, and maybe next year. But Rebecca made a good point, these teeth are a "health liability". She said all LDS missionaries are now required to have them removed before leaving on their mission. Keeping them is a liability if a problem develops while in the field away from modern medical facilities in the US and other countries. She also asked me if the roles were reversed and it was her that needed the wisdom teeth removed, would I be against it? I never thought about it that way, and it turned my perspective around on the cost. For six hundred or so dollars I can pay off that "health liability" forever and if Rebecca needed it done, I would let it be her decision and would support whatever she decided.

I am not looking forward to the procedure having read about the recovery: swollen face, oozing and bleeding, smelly foul bacteria breath for a week... but I will get it done in the next month or so regardless. This is also the first time I have been put under general anesthesia, so I hope I don't freak out, have Mom's nausea, or just never wake up.

About Me

My photo
Lead Java Developer Husband and Father

Tags