Wednesday, June 29, 2005

Another JavaOne Trip Report

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

Greg Murray and I gave a talk on AJAX yesterday. They're tracking the attendance numbers for all technical sessions at JavaOne and as of this morning it was in the top 10! It has probably dropped down a couple of notches by now though... The talk went well and I've only received positive feedback, so I think this is a technology a lot of people are excited about.

A couple of people have already tried the AJAX component library for Creator and have asked where the other AJAX components are. The component library only contains my auto completion textfield so far; the other components written by Greg (Murray), Ed Burns, Roger Kitain etc. have not yet been adapted for Creator - we really should do that ASAP but we've all been too tied up with JavaOne. I'll post something once it's ready. And we desperately need that JSR for component metadata, so we can directly embed designtime metadata in the same files already used to generate component classes!

I had a fun challenge this morning. During the launch of the new Ultra 20 computer, I was challenged to code up an application using our tools as fast as possible. I had roughly an hour. While I was coding away, there was a panel discussion followed by some presentations. I was listening to my own music so I wouldn't get distracted. A couple of times I caught myself tapping with my feet - hope I didn't distract the nearby journalists! My screen was visible though so they could see that I wasn't "cheating" (e.g. just pulling up previously created content). I had planned in advance roughly what to build, but hadn't tried it - after all what fun is a challenge if it isn't actually challenging? However, thanks to this I got to get pretty stressed! My plan was to build a translation web service, by first pulling down a free dictionary word map (English to Spanish and vice versa), then read the words into a map, then build a Creator web app which takes pasted text, splits it into words and calls the web service to generate a translated text segment. Plus various web controls to convert the translation direction etc.

Well, I started out with NetBeans to create the web service. I knew this would be most of the job. I looked at the format of the data file - a perfect job for the new JDK 5.0 Scanner API, so I wrote some methods to parse the data files using it, storing it all in typed Maps (using generics). Ah, what a delight it is to use the new JDK 5.0 features - the code is so much cleaner. By now it was definitely time to deploy the web service - I had used up half of my time already (but I knew I could do the Creator part really quickly). So I hit Deploy, and .... disaster!! I got an error message from the ant file responsible for deploying the web service. What's going on??? And at this point they stopped the
briefing and asked me for status... uh oh... "I have another half hour, right? Right? Phew". I've done a web service before - a couple of weeks ago I did a simple dictionary lookup one (the one shown in the AJAX keynote), so I thought this should work. The only significantly different thing is that I had used JDK 5.0 apis this time - the format of the datafiles, maps etc. couldn't matter - so I decided to cut my losses, not try to debug it and just rip out the generics and rewrite the scanner portion to just do simple String iteration instead (e.g. iterate over the String, look for the first tab, that's the English/Spanish delimiter, then look for the first comma or newline, that's the first translation word, etc.)

Done... ahh....

That strategy worked - another ten minutes I had a working web service, and twenty minutes later I had built a Creator web app with dropdowns for choosing Spanish to English, English to Spanish, and English to Spanish to English. I also modified the output to be HTML for the text such that I could mark up any nonmatched words (which I left untranslated) in a light red background color. When it came time to report what I had done, I opened the browser, cut & pasted Sun's mission statement (from our web site), and translated it from English to Spanish and back to English. With the poor dictionary and complete lack of heuristics, the result was a pretty interesting Mission Statement - one I hope we won't adopt!

I realized right after the demo what the problem with deploying my original web service had been: Even though App Server 8.1 is capable of running JDK 5.0 code, I had started it from Creator (so it was using Creator's VM, JDK 1.4!) instead of NetBeans' (JDK 5.0). Doh!!

By the way, those new Ultra 20's are just fantastic. Deploying my app takes just a couple of seconds! I thought my existing W2100z opteron workstation was fast, but my, I want one of these!

Later this morning I went and attended the vendor panel on JSF components. That was really interesting - I got to see great demos of JSF components. ESRI and SoftwareFX showed components tightly integrated into Creator, which is always a proud moment since I wrote the code which renders their components on the screen :) Otrix showed some really powerful components - but only in the browser, which surprised me a bit since I'm sure they work in Creator (Stephane, Otrix' CEO who gave the talk, has provided a lot of great feedback to us over the last year). Craig McClanahan showed the new Creator builtin components. The Theme Switch feature appeared not to work but what had happened was that there were multiple projects open, and the theme switch was applied to a different project than the one for the current page!

I have a lot more to say about JavaOne, but I'm running out of time - I have some more people to meet this evening, and tomorrow morning I go on vacation! Just for 4-5 days but it's going to be great - I haven't taken much vacation the last 2-3 years and after the Early Access milestones followed by the JavaOne buildup followed by the JavaOne events I'm quite ready for it.

I've met several people at JavaOne who stopped by and said they read my blog and encouraged me to keep it up (a few even said to blog more). I appreciate that. It's very hard to get any kind of reliable statistics on blog readership - the page counts could be almost entirely due to search engine crawlers, and on the other hand RSS news aggregators completely hide the true number of readers. So getting actual thumbs up from people is great encouragement. And now that Creator 2 is out I have a lot of new things to talk about so once I'm back I'll get back into it!

Tuesday, June 28, 2005

Confessions of a Demo Dollie

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

As promised, here's my "trip report" from my keynote demo yesterday - click on the images to
view larger versions.

Preparations started
on Sunday with an afternoon rehearsal. Here's most of the Creator crew involved - Val Lipman,
me, and from marketing David Folk, Shar Chander, and
Dan Roberts. Keynote demos are serious
marketing vehicles!
The keynote demo was limited to three minutes, and I needed to show both the new Creator 2
highlights as well as the new AJAX work - and fitting that into the time slot required quite
a bit of planning; boiling down everything you need to say into a couple of essential
messages to get across, and ensuring that the demo has broad appeal to the audience.

The rehearsal took several hours. On the left you can see a crane in operation; on the right
Chris Webster
Charles Beckham
from the Enterprise tool team setting up their machine. My machine is
the one to their left. The machine is one of the new Ultra 20's Sun announced during the
opening keynote. I had played with the system on Friday, installing the demo bits
and testing them out - and wow, I've never seen Creator deploy a project so quickly. So
I was shocked to hear the price - $900! Granted, the system I was demoing on was a higher
configuration, but the technical specs aren't all that different.

Here's Adam Leventhal
from the Solaris kernel group preparing for his DTrace + Java demo.
I got some great tips from him afterwards on how to be able to connect into the Sun
intranet using Solaris 10 on x86, so I'll be checking that out after the show.

This picture also gives you a sense of the size of the stage, and the giant projection screen!

Here's the action backstage. The giant center screen is just amazing - it's huge yet
is also extremely sharp. Notice how the image is reverse - this is where there are giant
projectors sitting on towers projecting onto the screen that the audience is seeing from the other
side. There's also an unbelievable amount of hardware here - computers driving all
kinds of effects, slides, video clips and audio shown on the projector, and all kinds
of other stuff that I don't know anything about. Backstage is generally dark except
from the glow of the monitors (all facing away from the projection screen). Thus it would
be easy to trip on a wire and cause what can only be described as a career limiting move.
However, that's solved by having various "paths" through the jungle carved out by white
tape indicating the routes - including little arrows guiding you out to the stage.

And now it's suddenly Monday morning, and time for the keynote. I needed to check in at
7am. Luckily I have one of the "All Access" passes which can get you anywhere in the
conference. Gets you right past that long lineup outside of Moscone in the morning! However,
they're very hard to get - unless you're crew or part of the keynote you can't get one
because obviously if you're part of the rehearsals you'll hear announcements before they're
ready to be made public.

It's time to get anxious... the picture shows the countdown counter on the stage monitors
that are visible from the stage. 20 minutes to go... time to get some coffee!

The buildup to the keynote is really fun. They play great music and combined with the adrenaline
and excitement it's just a very good feeling. I didn't even realize that this time, it was
a live band -- Magnetic Poetry! I walked up and snapped the picture on the right.

I then ran out and got a coffee -- there's a Peet's Coffee stand outside that had a double shot
latte. Eight packs of sugar and I'm all set! You can see Tim Cramer's back,
Bob Brewin next to me,
and Jeff Jackson's leather jacket!

When the show started, John Gage listed some statistics. They did not exactly make me calmer...
8,000 people in the audience, plus several overflow rooms. A quarter of a million viewers tuned
in to the simultaneous web cast. You can see a recording of the web cast yourself

And finally, the moment is here -- the Creator demo!! I got up on stage, talked a little bit
about Creator 2, showed some of the new rich components I had just mentioned, and then showed
the new AJAX autocompletion component. I'll blog about that separately since people have asked
for more details, so stay tuned.

After the software demos, there was a Happy Birthday to Java segment, since Java is 10 years old
this year. After the band had played they dropped confetti. Seated near the front I was actually
under the confetti being dropped, so it was unreal - confetti raining all around me. I
shot another picture - note how there are large blocks of confetti falling right in front of
the lens!

I'm going to end this photo blog with a picture from New Energy's theater presentation that I
mentioned yesterday. In this picture Neal is describing his Shrek architecture model: layers
and layers and layers!

Monday, June 27, 2005

Live From the Show Floor

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

Hi there - I'm posting this from one of the SunRay terminals on the show floor at JavaOne in the pavillion. It's been a great show so far. It started with NetBeans day yesterday. The event was packed - in fact hotel staff was getting concerned (and got involved) when they thought we'd exceed the allowed limit (for safety issues). I thought the keynote addresses by Tim Cramer, Jonathan Schwartz and Rick Ross were very good as well. We then broke into individual sessions, and I gave an hour demo of Creator. Since less than half of the audience had seen Creator I did a lot of Creator 1.0 things, such as showing the basic JSF web event driven programming model. I showed some of the new powerful components, such as the table, and the file upload component. I was working up to a REALLY cool demo with the file upload component, but unfortunately I ran into a bug - and couldn't get file upload to work. It turns out that the component doesn't work right when you both have installed the app server in a directory with spaces AND you're using Internet Explorer to do the upload! Unfortunately we didn't discover that that was the problem until the demo was over. All in all though I think the attendees got a feel for what WYSIWYG web development with Creator is like.

This morning I demoed Creator in Jonathan Schwartz' keynote, in Jonny Loiacano's software segment. I started out showing Creator 2, and then showed the new AJAX component. You can find this component library on the Creator Early Access site. I will blog about that demo separately - and I have LOTS of pictures from the show and backstage that I want to share with you. When I get to a place where I can upload my pictures I'll post another entry.

I JUST went to a really fabulous presentation in the pavillion theater by Neal Tisdale from New Energy, and his lead engineer, Dick Wall. They were presenting their experiences using Creator (1.0) on a time crunched project and their experiences. The presentation was really great, especially because it made use of humor. And after a while there was a whole crowd gathered behind the theater listening in.

It's time to head over the the Ask The Experts tables where I'll be fielding Creator questions. Check back tomorrow for event pictures!

Saturday, June 25, 2005

It's Out!!

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

Creator 2 Early Access is now available. I'll be showing it at NetBeans Day tomorrow and several times during JavaOne this week, so if you're coming to the conference you'll have plenty of chances to see it and find out what we've been up to. The rest of you should download the bits and start reporting bugs, feature requests and anything else we should know about.

I'm taking off in a few minutes to head in to San Francisco and will spend the whole week there for JavaOne. I hope to meet many of you after some of the talks or by the Creator booth in the pavillion -- I don't have booth duty but will stop by several times and observe the action and hopefully strike up interesting conversations as in previous years.

I'm bringing a digital camera so hopefully I can get network access and blog occasionally from the conference!

Friday, June 24, 2005

Positive Creator Review

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

Check out
this review of Creator in InfoWorld.

The review is covering Creator 1.0. I'll be demoing Creator 2 on Sunday at NetBeans Day - be the first to see it! Sign up here. And of course see all the new cool things coming in NetBeans. I personally cannot wait for the
new GUI builder!

The Rave Room

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

Part of the Rave room, taken on Marco's cell phone yesterday.

Picture of the Rave room

Roumen, one of the NetBeans engineers in Prague,
about his trip
to the U.S. For JavaOne, and mentioned that he's heard about the
infamous Rave room here in Menlo Park:

I've heard that there is some special huge office with 12 Creator developers on one place and it's interesting to see how they work together (I cannot imagine how this works, I need relative silence to be able to work efficiently).

Rave was the project name for the tool that eventually was named
Sun Java Studio Creator. When we started out, we had an extremely
aggressive schedule. (Some things never change...)
The project was unlike any I had worked in, or even heard about,
at Sun before. We had a small, very focused team that worked
like a small startup company. The team has since grown, but
we still hold on to some of the core aspects started two and
a half years ago.

The team is too large to fit in the Rave room now. But I still
spend all my office time there. In fact, I'm one of those Sun
engineers who have given up their regular offices. I figured
it was time to do that when I hadn't been in it for over a year!
I come in to the office twice a week, and on the other two
(actually, four :) I work at home.

My corner. Back off! Hey, who took my good chair?

Picture of my corner

When I'm in the office,
I sit in my Corner Office. This is a spot I've had since the
very beginning, so nobody dares to challenge me for it...
In the picture, you can see a Viking guarding my corner,
and the Dukie award I got two years ago for my

demo trouble

You may wonder how one can get any work done surrounded by
so many people. The key to that is that most of us
only work there twice a week. Those are days when you
schedule meetings, or work out technical issues on one of
the boards, or just get the pulse of the product and find
out what's going on by talking to people or overhearing
conversations. Of course there have been times when I need
to get some coding done at the last minute for a milestone build.
That's when I wear my noise cancelling head phones and
crank up some suitable coding music to drown out the
background conversations. Those who want peace and quiet
tend to disappear, probably to their offices, or for those
like me without one, to one of the flexible offices.

Having a shared space like this makes it easier to have
a team culture. For example, we have various artifacts
spread throughout the room - such as early marketing
posters, or award trophies and diplomas. There's even
a picture on the wall from the JavaOne 2003 keynote demo
when the product was launched. And, when we get near
a code freeze, we write the number of days left until
code freeze on the door.

Speaking of that, let me go see how many days we
have left...

<voice type="panic" pitch="high" volume="high" >AAAAAAARGH!<voice>

Sunday, June 19, 2005

How to Write a JSF Component

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

As JSF is gaining popularity, more JSF components are being written. In fact
is running a competition on writing components. (Sun is a

However, some of the components written work, but do not work well in tools
like Creator, or do not work well when used in conjunction with CSS. In this
blog entry I will provide some hints that will make sure your components do
not fall in that category.

How to actually write a JSF component is covered in many places; it's
not hard. You need to write 3-4 classes, plus write a .tld file and
a faces-config file with some information about your component.

a document which takes you through this process.

However, there are some additional Rules You Should Follow when
you write your component.

These rules serve two purposes:

  • They ensure that your component will work right when it is
    sized and positioned using CSS properties.

  • They ensure that your component will work well at designtime
    in a tool like Creator.

Here they are:

  1. First and foremost, you MUST use the
    endElement and writeAttribute methods. Do NOT
    write out markup by simply streaming out HTML bytes linearly using the
    write method. There is one minor exception to this rule: some components
    need to emit HTML provided by the user, such as the HtmlOutputText
    component when its Escape property is set to false. In this limited
    scenario you should use write.

  2. Always pass in a component reference to the startElement method on the
    ResponseWriter. E.g. if your UIComponent is a PanelGrid,
    and you want to emit <table><tr><td>... you would

    writer.startElement("table", gridpanel);
    writer.startElement("tr", gridpanel);
    writer.startElement("td", gridpanel);

  3. Every component should have a style property, which will render
    to a style attribute on the rendered HTML markup.
    This will allow tools like Creator to position and size the component (using CSS).
    It is vital that you remember to replicate this style attribute on your top level
    rendered HTML tag. However, there are some complications...

    1. In the normal case, you render a single top level HTML element (possibly with
      children) from the JSP tag. In this case, simply duplicate the value of the
      JSP tag's style attribute to the top level HTML tag attribute. For example,
      if you have <h:commandButton style="width: 100px"/> in the
      JSP, you would render <input type="submit" style="width: 100px"/>

    2. If you need to render multiple top level HTML tags, but only one of them is visual,
      duplicate the style attribute on the one visual tag. For example, your component
      may want to render a <script> tag before it renders its one visual
      element, <table>, and then perhaps another non visual element, an
      <input> of type hidden.
      In this case, simply emit the <script>, then emit the
      <table> with the style property value from the JSF component,
      and finally emit the hidden <input>.

    3. If you need to render more than one visual element as siblings at the top level, you
      need to wrap these in a single container component, such as a <span>
      or a <div>. (Use span only if all the children being rendered are
      inline elements.) The style property should be placed only on this outer, wrapping
      <span> or <div>.

  4. Don't throw exceptions from your renderer! Even if for example value is a required
    property, don't throw a configuration exception just because it's null when you're rendering!
    If you really want your component to alert the user to the problem, I suppose it's okay to
    throw an exception when the component is used at runtime, but at designtime, it's quite normal
    for a component not to be correctly configured yet - after all, the user may just have dropped
    the component and is about to configure it. If necessary, you can have code in your renderer which
    checks if the component renderer is being used at designtime:

    if (java.beans.Beans.isDesignTime()) {
    // Designtime - better render error handling here
    } else {
    // Runtime - throw your exceptions if you must

    One thing you might consider doing is having the component render exactly the problem message
    to the user. As an example, in Creator, if you drop the Message component, it will
    tell you if it is not bound to anything (since the for property is null, so the
    component is not yet configured.)

Once you have written your component you should package it up such that it can easily be
imported into Creator and used out of the box by your users. That is also covered in
the component library article I linked to earlier.

Please let me know if you develop components that work well with Creator!

Monday, June 13, 2005

See you soon?

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

JavaOne logo

JavaOne 2005 is getting closer. I'm hoping many of you will be able to make it.
One of my favorite things about the conference is meeting people, especially
users, and now with this blog, readers!

If you haven't been able to talk your boss into sending you to JavaOne,
you should still come to
NetBeans Day
the day before - it's free. Check out the list of speakers!
I'll be giving a Creator demo there. Be the first to see Creator, The Next Generation!
(As you can see from the schedule, there are two tracks, and the Creator talk is
track B around one o'clock.)

At JavaOne, I will also be giving a talk on AJAX, with
Greg Murray,
the Servlet specification lead:

TS-7986: Rich Web Applications With the J2EETM Platform and AJAX

It's not a Creator talk; we will discuss strategies and implementation
issues for implementing AJAX-based web applications on the J2EE platform.
Be there or be static. (Put it in your schedule now.
Tuesday, June 28, 11am - Esplanade 307/310. Room capacity 1200.)

I might also be involved in some other demos but that's still TBD. And of
course, I'll be hanging around the Creator booth a lot, so if you find it
(which wasn't easy last year - I hope we get a better spot) please stop
by and introduce yourself!

Last but not least - not even CLOSE to least - the parties!
I'm not sure if we're having a Creator party, but if we do, I'm there.
And I definitely don't want to miss the Borland party! And I'll try to
crash as many other events as possible too!

OnlyOneReturn Considered Harmful

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

The other day I

mentioned PMD
and how it's vital to learn how to customize the ruleset, since by default
it includes some rules that are evil. Evil I tell you!

My favorite rule to hate is the OnlyOneReturn rule. This rule basically
says that

A method should have only one exit point, and that should be the last statement in the method.

Unfortunately, the rule author does not provide supporting documentation
for this point of view, and I personally cannot think of any.
In fact, restricting yourself to a single return statement makes the code
less readable. Take the following method from the JDK's Integer
class for example.

public static String toString(int i) {
if (i == Integer.MIN_VALUE) {
return "-2147483648";

int size = (i < 0) ? (stringSize(-i) + 1) : stringSize(i);
char[] buf = new char[size];
getChars(i, size, buf);

return new String(0, size, buf);

We have a special case, and it's dealt with right at the beginning of
the method. If we hadn't done that, we would need to slap a big else
block around the remainder of the code, as well as introduce a temporary
variable, e.g. result, to hold the return value that we then
return as the last statement of the method.

The above is a trivial example, but I frequently write code where I have
multiple exit points early in the method that deal with special cases, and
this avoids the need for deeply nested code.

Creator's Visual Page Designer Source Code: Proud OnlyOneReturn Rule Violator
Since 2003.

Friday, June 10, 2005

NetBeans plugins I use, part 2

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

PMD logo

In my first favorite plugin
I described Jalopy. The other external plugin I use is PMD.

PMD is a source code analysis tool which parses java source code, and then
runs a large number of rules over the source code. For example, it checks
for program errors, like double checked locking patterns, or overriding
equals without overriding hashCode. It checks
for potential program errors, like having an equals method
with a single parameter that is not of type Object. And it
checks for a number of coding style "violations", such as for example
failing to use uppercase letters for class constants, or using excessively
long or short variable names.

Here's a screenshot of PMD in action: you select a class or a package and
run PMD on it, and all the rule violations are listed in the output window,
where you can click to bring up the relevant source (or hit F12 and Shift F12 repeatedly
to iterate forwards and backwards in the list.)

Thankfully, the ruleset is configurable. That's important, because I the
default set of rules you get is not particularly good. It includes a rule
I truly hate (and because I disagree with the result, I violate it all
over my code, with the result that unless I customize the ruleset I get
a bajillion rule violations when I run PMD on my code. I might write a rant
about that rule in another blog entry...)

Customizing the ruleset is easy, once you know where to find the
dialog: Tools | Options | IDE Configuration | Server and External Tool Settings | PMD Settings. Open the Rules customizer in the property sheet,
and you get the following dialog:

Here you can move available rules to and from your chosen set of rules.
Try adding all at first, then removing rules that get flagged in your code
that you don't care about, or that you disagree with. More importantly, you
can click on each rule to see a description and example of the kind of code
that triggers the violation. This is really useful if you want to see if this
is a rule you want to check for - and to get the rationale from the person
who contributed the rule.

Note that you cannot get it to be happy if you use all the rules, since
there are contradictory rules. For example, if your bean class has no
constructor, you get the AtLeastOneConstructor violation telling
you your class needs at least one constructor. But once you add one, the
UnnecessaryConstructor rule will tell you
that a constructor is not necessary when it's public and has no arguments!
So learning how to configure the ruleset is essential.

I've been following PMD for quite a while. A couple of years ago
I wrote a plugin that took the PMD integration a bit further in the IDE.
I had written a suggestions window for NetBeans, and I plugged PMD
into it, along with automatic fixers for some of the rules. So for example,
if PMD flagged a method as unused, you could just double click to get
a removal preview dialog, and then click again to nuke the method.
Here's a screenshot of this in action on an unused field:

As you can see, this screenshot is old - look at the old icon style, or the old property sheet,
and the old window manager... I think this was in NetBeans 3.4.
(More suggestions window screenshots here)

Unfortunately, this was a hobby project, and I suddenly got
extremely busy working on
since we were trying to design
and develop it with a suicidal schedule, so my spare time become occupied
by work instead. I haven't been able to keep it up, and now it looks like
it will take some work to bring it up to speed. However, in the meantime
part of the suggestions framework has been incorporated into standard
NetBeans (specifically the TODO scan portion of it), and I saw some
comments on the dev@tasklist alias that Jan Jancura is going to do some
work in this area so perhaps we can get this going again.

It also looks like the PMD plugin itself on SourceForge is getting some
attention with some recent development, so I think this going to get
even better soon.

To download the plug-in, visit
this link,
download the most recent release, unzip it, and then from the Tools | Update Center choose
to install a locally downloaded nbm file.

Wednesday, June 8, 2005

Converting an int to a String

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

I came across
this tip in a blog referenced from
Eric's linkblog.

The author mentions that you can convert from an int to a String like this:

int one = 1;
String str = one + "";

And he calls that cute!

I disagree - I think that's ugly (and as he points out it's less efficient).

There's a clean way to do this, not listed in his blog:

int one = 1;
String str = Integer.toString(one);

Nice efficient bytecode too:

0: iconst_1
1: istore_1
2: iload_1
3: invokestatic #2; //Method java/lang/Integer.toString:(I)Ljava/lang/String;
6: astore_2
7: return

and there are variations of the method which lets you convert using another base - so you
can convert to hex using Integer.toString(one, 16) for example.

(String.valueOf(int) will turn around and call the above method by the way.)

Tuesday, June 7, 2005

Dr. Dobbs Journal Article

WARNING: This blog entry was imported from my old blog on (which used different blogging software), so formatting and links may not be correct.

July issue of Dr. Dobbs Journal

contains an article I've written, covering the combination of
and the
nice synergy you get from combining these.

You can read the

article online here
. I've covered this material in various blogs before, but in the article I try to tie it
all together nicely. I hope you find it useful!

DDJ has a special place in my heart. In high school and college I was really interested
in computer graphics (and in fact I ended up specializing in it in grad school). DDJ had a regular column
on computer graphics by
Michael Abrash.
I remember pouring over his article on fast
Bresenham line drawing, and another one describing Wu's technique for antialiasing. I tried to
google these articles just now but all I can find are references to them, not the actual
articles. Probably a good thing since I'm really busy with a deadline and can't afford
to get excited about graphics algorithms at the moment!