Archive for the 'Programming' Category

NetBeans 6 problem: editor flags error that doesn’t show up in a compile

OK. I’m about to pull my hair out on this one because it’s driving me completely nuts.

Just a bit of background first: I’m giving NetBeans 6 a test run with the current project I’m on to compare it to Eclipse (with the MyEclipse plugins). I keep hearing great things about it and now that I have my projects set up I am noticing a very odd problem that doesn’t happen in Eclipse. We have the following code in one of our enum classes (actually this same pattern is followed in other enums as well):

private static Map byDBValue;

private AssetImporterTypeEnum(String dbvalue) {
this.dbValue = dbvalue;

if (AssetImporterTypeEnum.byDBValue == null) {
AssetImporterTypeEnum.byDBValue = new HashMap();
}

AssetImporterTypeEnum.byDBValue.put(dbvalue, this);
}

The NetBeans editor is flagging the lines that set AssetImporterTypeEnum.byDBValue as an error of type ‘illegal reference to static field from initializer’. From what I can tell this is completely legal code (enums are initialized before any static initializers are run) and the compiler output doesn’t indicate the same error. Actually the compiler output doesn’t indicate any errors. The compile is perfect. I don’t get this error in Eclipse either (neither in the editor or the compiler output)

It’s driving me crazy that I don’t really have errors in the code but the the flag is still showing up both in the editor and in the project tree. Is there some way to change this behavior? Is it a bug (I searched on the bug tracking site for netbeans with no luck)?

Notes on JSP debugging with Weblogic 9.2 and MyEclipse 6

Here are some things I’ve found the last couple of days when trying to get JSP debugging working in MyEclispe 6 and Weblogic 9.2:

  • You don’t need to modify the weblogic.xml file
    I messed around with the settings here and took them out and debugging still worked.
  • There is an undocumented debug tag in the jsp-descriptor section of weblogic.xml. Looking at the docs it is undocumented.
    The file is checked on load to make sure there aren’t invalid tags there. debug isn’t marked as invalid.
  • Apparently JSP debug information is controlled by the session-descriptor tag and its parameter debug-enabled.
    I determined this by looking at how the weblogic.xml file was affected by changing the JSP debug flag in the administration console. The documentation really doesn’t shed much light on this.

Now, all of that being said, I don’t have any of those items in my weblogic.xml for my web application and JSP debugging still works.

Wow…huge news…Sun hires Jython lead

Was buried in work yesterday and missed this one. Huge news for the Jython community. That along with Tor’s news in the Java Posse podcast that he would start working on another language in NetBeans soon would probably mean Python support coming to NetBeans.

Ruby support really kicks ass in NB. That level of Python support would just be huge.

Wait..Rails isn’t perfect? or Ruby: land o’ web frameworks

And people complain that Java has too many web frameworks…. Now we hear of yet another web framework for Ruby. There is Rails, Merb, Camping, Waves, and I assume others. Funny how the Ruby space is becoming so crowded with web frameworks. And here I always thought Rails was perfect but this guy says in the interview that he was running up against limitations of Rails. I could swear Rails was going to solve everything….

Mercurial and merging branches

I’ve been reading the Hg book today and have found that merging between branches is a much different operation than with CVS or Subversion and much easier. I’m really glad to see this and want to take an even better look at Mercurial by using it a bit. Maybe thats why Tor didn’t talk about it at all in the Posse podcast…there really isn’t much to it ;)

Java Posse on SVN and Mercurial

So the guys were discussing version control systems and Joe was talking about SVN. Tor was talking about Mercurial. The only thing they were talking about was stuff that, quite frankly, really doesn’t matter all that much because any revision control system is going to allow check-ins, etc. Obviously thats the point ;) Joe wonders how dangerous is it to use Mercurial since you’re not checking in to a central repository. You might lose something! Joe…just a note that the same thing is true of SVN if you don’t bother checking in your code ;)
But all this really doesn’t get to what I think is the most important point: what is the merge model like in Mercurial? In SVN when you are merging changes from branch to branch (and in branches I’m including trunk) you have to be really careful with making sure you’re getting the revision numbers right. This is no better than CVS. Sure SVN does most things better than CVS but in this important case it does nothing to make the process better.

I have yet to read about how merging happens in Mercurial. I wonder if you have to track revision numbers as in SVN.

At work we’re looking at Accurev which has a pretty smart model for merging changes. Obviously any merge is going to require some careful checking when you have multiple changes from multiple people to the same area of code but Accurev makes the rest of the process much easier. They use the idea of streams, which are sort of a combination of an SVN branch with workflow attached, and when you merge code you are promoting it to streams higher in the hierarchy. You still have to worry about overlapping code areas, no way around that, but you don’t have to worry about tracking revision numbers.

Now if we could finally get off of CVS…. ;)

How *not* to use the Spring MVC Form tag library

I hadn’t used the Spring form tag library before and decided to give it a shot for a small test form I was creating. I am using a subclass of SimpleFormController to return a simple list of value/name pairs from a database call to populate a select/option list in the HTML. I figured it would be easy enough to return an ArrayList as my command object and that is populated with HashMaps of the key/values. Oops. Doesn’t work.

It appears that I have to create an object that holds the list (or maybe a list of objects with fields that are the items I need displayed in the select dropdown). It’s too bad that I can’t do it the way I want with that tag library ;) Since this is a throw away screen though (I suppose the controller is as well) I’m not going to worry too much about it :)

Making a website? Choose a good color scheme!

Updated!!!

I’ll keep updating this page as I find more tools since this seems to be one of the more popular pages on this blog.

Thanks,

Jason

One thing programmers don’t generally know is good design techniques. You can usually tell when a programmer has created a UI because they’re ugly and difficult to use. There are exceptions to be sure (Romain Guy for one). For those of us that aren’t as blessed I present here a list of color pickers that allow you to pick harmonious color combinations for web sites, etc.

  • Added 03/06/2007:
    Kuler
    From Adobe and pronounced “cooler” this is a fantastic color chooser. Not only can you create your own color scheme using a very intuitive color wheel but you can also search on the hundreds of color schemes people have already generated to find something quickly. This is a fantastic resource.
  • ColorJack Sphere or more generally ColorJack.
    This is another fantastic color resource. Sphere is another easy to use color wheel with options for both the traditional RYB color wheel as well as the standard RGB model. There are many algorithms to choose from (triad, complementary, etc) but the really unique thing about this tool is the ability to see how color blind people interpret colors. Very cool stuff. ColorJack also offers a service similar to Kuler where you can see color schemes others have created using the Studio tool on the website.
  • Colors on the Web
    This site is more than a color chooser (one is available from the Color Wheel menu option) as it also gives user-created color schemes, forums, writing on color theory, etc. It’s a fantastic resource for those who want to learn more about color.
  • Color SynthAxis
    OK. This is a real designers tool and complicated but damn is it cool. I believe it is best explained by the tutorial.
  • Added 11/25/2007:The Color Wizard

The interesting thing is that tools such as these are coming out of the woodwork these days. At one time Harmony, a Photoshop plugin for the Mac from Hot Door, was the only thing available. They now recommend Kuler and their own application hasn’t been updated in years. My how things change.

CentOS 5 graphic login screen bug…and a fix

I’m being forced to run CentOS 5 at my new job and there is a bug in the graphic boot screen where once the boot process is complete instead of getting the graphic login screen you get dumped back to a virtual console. Hitting Alt-F7 brings up the graphic login screen. This bug is documented here.

The fix I tried was to install the Fedora Core 7 version of the RHGB package which fixed the issue (and caused another one…more on that in a second). That fix is located here at rpmfind.net.

In CentOS 5 the graphic boot process itself is glitchy on my Dell laptop (Precision M6300). However it doesn’t cause any problems and I do get the graphic login screen as I should.

“Learnings” is not a word!!!!

I keep coming across people using “learnings” as a word in documents. Here is an example (scroll down to the bottom and you’ll spot it). Just a note for the incompetent: “learnings” is not a word. Go look it up in the dictionary…I dare you. See what comes up? “Learning”.

If you want to sound like Borat then keep using “learnings”. If you want to sound competent try “lessons learned”.

« Previous PageNext Page »