Rainy days and Java always get me down


I've Moved My Blog

It's currently located at http://www.urlinone.com/blog

I should say "I'm moving my blog." It's a pretty painful process.

Pebble has blown up on me, and it's been many months since I've been able to blog reliably. I've lost posts. And now I've got to figure out how to migrate my past blog posts from Pebble to my new destination without all the URLs changing, lest external links become 404 Not Founds.

Why does everything in the 21st century have to be a three-day project???

AppFuse encrypts user passwords in the database using SHA by default. This means that my users can rest easy that I can't see their passwords.

However, it also means that I am not able to log in to my own site as one of my users for debugging purposes. And it means that I can't send a user their lost password; I can only generate a new one -- and then somewhat ironically email it to them in plain text! I can't see their password, but anyone sniffing email between me and them can.

Yes, I can send it without their username, but if Alanis Morissette can define ironic however she wants to, then so can I.

Do the sites you register at encrypt your password in their database? Do you even know? Do you care? I know that I've never told my users, one way or the other. I am trying to remember if any site has told me.

We all have so many usernames and passwords that it's unmanagable. To alleviate the pain, we sometimes use the same username and password at multiple sites. By doing so, though, there is the risk that one site's personnel will use your account to log in at another site. But how significant is that risk?

It is a significant risk:

  • if they can guess which other site you might be registered at
  • if they have access to their own site's database
  • if their passwords are stored in clear text
  • if you used the same username and password
  • if it ever even occurs to them to do this
  • if your account happens to be one that they try.
And then comes the biggest if of all:
  • if there is even any damage they can do. I don't use the same password for TheServerSide.com that I do for PayPal.

What do you think about the pros and cons of encrypting passwords within your database? I'm sure it depends a lot on the nature of your data, who has access to your database, etc. As a developer, do you have access? As a user, do you care who can see your password?

Matt Raible has changed BaseObject in the upcoming version of AppFuse so that equals() and hashCode() are abstract, meaning that all your AppFuse model classes will have to implement these methods. Matt suggests using Commonclipse to automatically generate these methods. It certainly beats creating them all by hand!

It's easy enough to add Commonclipse to Eclipse 3 by doing Help > Software Updates > Find and Install > Search for new features to install > Next > New Remote Site. Put Commonclipse in the Name and http://commonclipse.sourceforge.net in the URL. Click OK. Click Next.

Once Commonclipse is installed and Eclipse has restarted, do the following to get it working for AppFuse:

Window > Preferences > Java > Commonclipse. Select the General tab. Uncheck the second and third checkboxes, which are to Append super in hashCode() and Append super in equals(). Click Apply (if you like) and OK.

The body of BaseObject in AppFuse 1.5 contains actual implementations. To delegate these methods to their subclasses, change BaseObject and the methods to abstract, as in the following:

public abstract class BaseObject implements Serializable {
    public abstract String toString();
    public abstract boolean equals(Object o);
    public abstract int hashCode();
}

Now you are ready to use Commonclipse to generate the implementations for these abstract methods in your model classes. In Eclipse, open each class that is derived from BaseObject. You can have Eclipse find them all for you by clicking on the word BaseObject in the editor window and hitting the F4 key. This will open the Hierarchy view and show you all the classes that have BaseObject as a superclass.

Open each class by double-clicking it in the Hierarchy window. In the editor, right-click, go down to the Commonclipse menu item, and select the method you want generated. Unfortunately, Commonclipse makes you repeat this task for each method, and I am not aware of a keyboard shortcut, although I longed for one.

Take note of two quirks I came across with Commonclipse

  1. A couple of times, it actually modified BaseObject, rather than the class I was editing.
  2. More frequently, it would not do anything after I selected the generate menu item. There was no error message, but the method was not generated.

I think both these problems might have something to do with focus of the editor window. I think the key is to left-click in the editor window to ensure that the file you can see is also the one that has focus. (Make sure the insertion point in the editor window is flashing.) One thing I noticed is that you can single-click a class in the Hierarchy window, if the file is already open in the editor. When you do that, the editor window for that file comes to the front, but the focus is actually still in the Hierarchy window.

I'm not positive that's the root cause of the problem, but closing and reopening the file and doing any kind of editing in the file seemed to get past the do-nothing generate task.

This is the single most difficult piece of information to find on all the web.

Lemme see, what did I Google for?

  • SocketAppender layout
  • chainsaw ConversionPattern
  • source line number log4j
  • chainsaw location line number
  • jakarta apache commons-logging log4j chainsaw layout please oh please show me my freaking line numbers

I'm not sure why this is the most elusive tidbit of information on the face of the earth, but I'm going to open the kimono and let you in on the secret...

log4j.appender.chainsaw=org.apache.log4j.net.SocketAppender
log4j.appender.chainsaw.RemoteHost=localhost
log4j.appender.chainsaw.Port=4445
log4j.appender.chainsaw.locationInfo=true

Can I tell you how many variations on the ConversionPattern I tried? It's in the dozens. None of them worked.

log4j.appender.chainsaw.layout.ConversionPattern=%d{DATE} [%-5p] %c {%F:%L} - %m%n
log4j.appender.chainsaw.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.appender.chainsaw.layout.ConversionPattern=%d [%t] %-5p %c {%F:%L} - %m%n
log4j.appender.chainsaw.layout.ConversionPattern=%d [%t] (%F:%L) %-5p %c - %m%n

Pretty sick when you find out all you need is locationInfo=true.

This is why I'm JCranky.

...is Spamusement. (If you were using Mozilla and TargetAlert, you would know whether that link opens a new window or not.)

Spamusement's kind of like eating broccoli chips. You're not sure what you're eating at first, so you try another one. You can't decide how much you like them, but you're puzzled enough trying to categorize the taste that you keep eating them. Eventually, you've eaten the entire bag, and you feel like puking. Oh, and maybe you laugh, once, between wretches.

This one really tickled me. Sorry, Steven, but I hope you never find a spam filter that works. ;-)

The Internet has become such a gift to humanity, but I wonder how aware of this we actually are.

  • My wife got the oil changed in her car, but they put in 10W30 instead of the recommended 5W30. She wanted to know the difference, so she went to Google. How would she have researched this before the web? Go to the library. Try to find a mechanic willing to answer her question.
  • As a developer, I am blown away by the quantity and quality of all the free software out there for the taking. From bottom to top, there is just so much it boggles the mind. Linux, Java, Apache, Tomcat, Eclipse, Spring, Struts, Hibernate, Log4j, JUnit, etc. Look at all the free blogging software! (Thanks, Simon!) As a friend of mine says, we are living in the Golden Age of Software. (It's a GAS, GAS, GAS! <-- That corny part is mine, not his. :)
  • Virtually any question that comes up nowadays, I immediately turn to the web, and primarily to Google.

However, I've become aware of the fact that I have been stingy about clicking on links that would benefit the people and sites that make this treasure trove available.

Have you ever avoided buying something on someone's site, because it was through their affiliate link? I have noticed I have a resistance to that.

Do you ignore or avoid Google Ads on peoples' sites? I have.

Now, admittedly, we're all as busy as we can be, writing our own free software or putting our own free information on the web. But it makes sense for us to support all that we benefit from by taking a moment to encourage and reward the effort.

Where would we all be without Google? I rely on Google hundreds of times a week, if not a day. I make use of tutorials and software I find through Google every day of my working life. And while Google is doing quite well in the process, they offer their service to me for free any time I want, as much as I want. When you think about it, that's an unbelievable gift! Sure, they're in it for themselves, but they genuinely enrich my life. (I could go off on a tangent here, singing the praises of capitalism, but I will restrain myself. You're welcome. :)

I just went to codehaus.org to download Groovy when I noticed that they have Google Ads on their site. I immediately looked away, as if it has become a reflex to block out all rectangular, revenue-generating portions of a web site -- a web site that it giving away a powerful development tool and even the source code for me to use in any way that I please!

This just doesn't make any sense. It costs me virtually nothing to click on a link intended to be relevant to the page I'm on. That click also benefits the owner of the site making something valuable available to me for free. It also benefits Google, and it potentially benefits the advertiser, if I buy what they are selling. And what they are selling may benefit me! Why would it be so automatic for me to ignore or avoid it?

I'm turning over a new leaf. I'm going to start giving back to the sites that give so much to me. I'm going to be more generous with my clicks, in an effort to say thank you for open-sourcing your hard work, thank you for enriching the world wide web, thank you for your generosity.

The more we reward people and companies for providing what we want, the more they'll offer us. (Another nod to capitalism.) I intend to say thank you with my clicks, in order to enrich my own online world. Care to add your clicks to mine?

If you would like to join me in this resolution, please just remember that it is unfair to overdo it. If people start heedlessly clicking on Google Ads or banner ads, it could hurt the advertisers, which would ultimately hurt the providers such as Google. So please be supportive, not abusive.

Here are some of the many sites or products I benefit from daily that ask nothing of me in return for their service:

At the time of this writing, I have no Google Ads or any other revenue-producing banners on this blog. But I reserve the right to add them. :-)

Here's one. From CNN:

...

Whittaker won the largest single jackpot in the nation's history when he hit a $314.9
million Powerball jackpot on Christmas Day 2002. He chose to accept a lump sum of
about $113 million after taxes.

Since then, Whittaker's vehicle, business and home have been broken into
repeatedly. Last year, a strip club manager and his girlfriend were charged with
drugging Whittaker and stealing a briefcase containing more than $500,000 in cash
and cashier's checks. The money was recovered.


Nice. I never realized how lucky I was.

I can't believe how long we browser users have tolerated this fundamental flaw. Ever since the target="_blank" attribute was added to the HTML anchor tag, we have lived with the uncertainty of whether a link would replace the current page or open a new page. I don't know if Jakob Nielsen ever screamed about this issue, but I found it to be a really annoying, fundamental oversight that I bumped into almost every time I clicked a link. (My penchant for opening lots and lots of browser windows is legendary, which led to this.

Once again, I'm feeling a little less cranky than I used to. (If I get too damned cheerful, I may have to rebrand my blog! There, I'm cranky again.) Thanks to TargetAlert, I can finally, after the better part of a decade, see a visual indication of whether a link opens in a new window or not. Kudos, Michael Bolin, kudos! And thank you to the Mozilla Firefox team for creating a platform that allows such extensibility!

Too bad URLinOne doesn't currently work with Firefox. D'oh!

  • ! - bang
  • * - splat
  • \ - hack
  • / - slash
  • # - pound
  • ` - accent grave (Translated into English, this is a grave accident.)
  • : - colon (Not exactly violent, but still pretty graphic.)
  • ; - semicolon (Ew, half a colon! Where's the other half???)
  • , - comma (By now, I think we all realize this is actually coma.)
  • . - period (Also referred to as a menstruation point.)

I cannot think of anything more depraved, more perverse, than women calculatingly killing children. Is there anything more taboo, more unnatural, more counter to Life than this? I've always thought that young men with too much testosterone flooding their brains were the worst perpetrators of evil acts, but these women have trumped nearly all other acts in offensiveness and turpitude.

The Chechnyan terrorists have unwittingly done the world a great service (and their poor victims have made a noble sacrifice) by sinking lower than any of us had ever dreamed we would see, thereby horrifying the vast majority of the planet. By pushing the envelope so far, so fast, these black widows have shaken all but the most hardcore. We may have, G-d willing, seen terrorism hit bottom. Surely, there can't be much lower to go.

One hopeful sign comes in the form of this apology to the world by a group of moderate Muslims. I am heartened by the blunt honesty in this letter. I know nothing about its author or the group behind it, but I appreciate the sentiment. I wish them swift success in their herculean task.

In the process of hunting for the text of the apology, which I heard on the Michael Savage show, I came across An Apology to the Pigs of the World. Perhaps Ms. Stock is finally going to hear a bit of the Muslim outrage that she -- and the rest of us -- have been looking for for so long.

GO KERRY!

-Anand

The sad thing is that you don't really mean "GO KERRY!" You don't believe in him. How can you? You don't even know what believing in him means. What you really mean is "GO !BUSH!" (For all you non-programmers out there, !BUSH in programming terms means "not BUSH.")

Even if Bush has reframed the war in Iraq and the war on terror to be the same thing for his own political gain, I support both, because I strongly believe that there is common ground there. Had we not invaded Iraq, Saddam Hussein could have hit us harder than 9/11/01 did, and then we'd be kicking ourselves for yet another "failure of imagination." Admittedly, the reframing is typical political maneuvering, but the end result is a reduction in violent, genocidal madmen, so that's cool with me.

I agree that Bush has not done everything right, but the choice between him and Kerry is an easy one. At least with Bush, you know what you get. I can live with that. (Pun intended.)

This content has been aggregated from another source. Read more...

"They who would give up an essential liberty for temporary security, deserve neither liberty or security."
           - Benjamin Franklin

"War is an ugly thing, but not the ugliest of things. The decayed and degraded state of moral and patriotic feeling that thinks that nothing is worth war is much worse. The person who has nothing for which he is willing to fight, nothing which is more important than his own personal safety, is a miserable creature and has no chance of being free unless made and kept so by the exertions of better men than himself."
           - John Stuart Mill

What's interesting about Franklin's quote is that liberals like to use it to bash Bush for the Patriot Act and the war in Iraq. Meanwhile, look at the qualifiers Franklin uses: essential liberty and temporary security. I would say that liberals are much more guilty of deserving neither when they institutionalize taxing people and providing government handouts and programs like Social Security, welfare, unemployment, and all the other great ways that our government has created a society upon which its citizens rely for survival. The essential liberty of keeping the fruits of your labor has been sacrified for the temporary security of having the government ease the burdens of life. Do you think people looked to the government to bail them out and take care of them when Franklin made this statement? No, Americans were tough back then. They stood on their own two feet and didn't whine when life was hard. Today, we don't have a population that would fight for its own independence the way they did 228 years ago. Life is hard, and we've grown soft. Listen to people whine about battling the evil we face today. This is not the King of England. This is not taxation without representation. This is televised beheadings and women killing children.

Mr. Franklin was talking about frivilous sacrifices not worthy of the cost of liberty. Protecting our national security is hardly temporary, nor is it frivilous. We are in a battle with an evil enemy that does not tolerate our very existence. What is all of our idealogical debating worth if more attacks disrupt our way of life to the extent that we no longer have an organized government that is able to protect and defend the Constitution? Look at what the 9/11 attacks did to our economy. How much more could we absorb, before it started to genuinely affect our ability to feed ourselves, transport goods, do business, and aspire to more noble things than basic survival? We are indeed vulnerable, and there is nothing without survival. I am confident that Ben Franklin didn't think we should perish from the earth neglecting security in favor of liberty. It makes no sense. Benjamin Franklin made sense.

Which brings us to John Stuart Mill. What a wonderful quote. Peace at all costs is a life not worth living. Our enemies threaten us far worse today than ever before, yet we still have the Supreme Court deciding that prisoners in Gitmo deserve the right to a hearing. The Patriot Act has not turned this nation into a police state, despite all the alarmist propaganda about it. We are still living by our Constitution, in the face of this threat. I am proud of us for that.

I guess what I'm saying is stop worrying so much about the "small stuff." We are imbued with faith in and love of our Constitution. We can be counted on to uphold its principles and remain steadfast in protecting it. The checks and balances devised by the geniuses of the late 18th century really work. Our economy will bounce back. Our liberty will always be safeguarded. Every four years, we will elect a new President and have a peaceful transition of power. This nation will continue to operate by laws it was founded on. Stop being alarmist about the unrealistic threats, and let's not lose sight of who the real enemy is and where the real threats are.

Well, they're just having the best ol' time blaming Bush for everything and burying their heads in the sand over at the Bee-OTCH blog. ("It's not bee-tee, it's bee-AT-tee.")

I posted a comment over there yesterday, but I notice that poor Russ doesn't have the male parts necessary to accept opposing opinions. Fortunately, I anticipated this and saved a copy of my comment:


You people are amazing. Does anyone remember 3000+ innocent civilians who died on American soil on 9/11/01? How about the hundreds of school children and other innocents who just died in Beslan?! You don't think Saddam Hussein had plans to use his sarin gas on more of us infidels?

What on earth are you thinking??? Do you actually believe that John Kerry can make nice with the radical Islamic fundamentalists? Are you that out of touch with reality?

How many attacks took place while Clinton was in office? The WTC in '93, the U.S.S. Cole, two American Embassies.

At least Bush has the backbone to do something about it. All Clinton did was lob a few ineffective cruise missiles. He certainly didn't make friends with the terrorists. What do you expect Kerry to do?

Do you simply not believe that terrorists are out there? I just can't imagine what you think is going on. Please explain it to me. Are you simply going to ignore the problem until we have suicide bombers on our streets the way Israel has? You find it so easy to blame Bush for everything, but how are you going to deal with terrorism?


How much are they going to be whining about the government not taking care of them when our economy falls apart because people are too scared to go to work or school or shopping malls, because terrorist attacks are happening throughout America? It's practically destroyed Israel's economy, and Americans are not as tough as Israelis; we're not used to living with Palestinians. What would happen to air travel (and, therefore, business and leisure industries that rely on it), if two American commercial aircraft were shot out of the sky as recently happened in Russia? How many Americans would be willing to get on an airplane after that? What would that do to our economy? How is the government going to take care of your every want and need if it has to contend with the fallout from that kind of attack?

1,000 Americans have died in a war to keep American civilians safe from terrorist attacks like those that took place three years ago, as well as freeing the Iraqi people from the clutches of an evil despot. While those deaths are indeed a tragedy, and war is a truly terrible thing, 58,000 Americans died in Vietnam for a dubious cause (at the hands of a Democratic president). Even if, in retrospect, we acknowledge we had no business protecting South Vietnam from a communist takeover half a world away, how can anyone question the wisdom of protecting one's own land from the horrors of terrorism? 1,000 soldiers is still only a third of the number of civilians who died in their offices on 9/11/01. Besides, who would have imagined that the tiny-brained miscreants causing all the trouble in Iraq would react so violently to freedom. That just shows you what kind of losers we're dealing with.

Russell and his buddies want to make Bush out to be worse than Saddam Hussein. Not like any of this hasn't been said before, but let's review:

  • Saddam Hussein invaded Kuwait
  • One of the terms of Saddam Hussein's surrender was that Iraq had to submit to UN weapons inspections
  • Saddam Hussein kept the weapons inspectors out of Iraq for about twelve years
  • There is evidence that Saddam Hussein had a weapons program
  • Saddam Hussein gassed the Kurds
  • Saddam Hussein had enough sarin gas to kill about 300,000 people
  • Saddam Hussein had plenty of time and opportunity in twelve years to develop and hide or export all kinds of weapons
  • Saddam Hussein paid the families of Palestinian suicide bombers $25,000 each
  • Saddam Hussein was known to be an evil, cruel tyrant who tortured and murdered thousands of people
  • Saddam Hussein's sons were going to take over the family business
  • Saddam Hussein held plenty of ill will towards the United States, Israel, and the rest of the civilized world
  • Given the right opportunity, he would have been more than happy to attack and destroy the United States
So let's no kid ourselves about how wrong it was to invade Iraq. Once a surprise like 9/11 hits you, you've got to be a freakin' idiot to sit back and wait to be attacked again. We have been attacked. We are at war.

The 9/11 Commission found that it was a "failure of imagination" that allowed the terrorists to use four commercial aircraft as bombs against innocent civilians. Only the genuinely deluded would lack that imagination again, after the events of three years ago and after what just happened in Beslan. Trying to opportunistically blame Bush for everything is so selfishly partisan that it offends me. When you are fighting for survival is not the time to be a liberal or a conservative, a Republican or a Democrat. In this, we are all Americans.

Please stop trying to score points for your chosen party or agenda while brave American soldiers are dying in Iraq to protect your ability to go right on doing so. Acting so lacks grace, gratitude, and honor. Not to mention underscoring how totally clueless you are about the world around you.