Everyday Coder

eve·ry·day cod·er [ev-ree-dey koh-der, noun]
a person who designs, writes and tests computer programs daily

Need a website? Want to give your store an online presence? Just want to share photos with family and friends? If you need a reliable, local (Chattanooga area), experienced software developer, then I'm your man. I give solid estimates, and have fair prices for every project. Check out the services I offer and please send me a message. I make websites everyday for everyday people and businesses. I can make one for you. Oh yeah, I'm also an experienced software developer, so I can handle just about any project.
Everyday Coder Blog

Soft Clipping with Java 2D

The current application that I'm coding uses an interface composed mostly of rounded rectangles. Initially it looked really cool. I later added transparency to some of the panels so that the parent panel's background would show through. On the Mac, it looked really great. I had since ran the application on Windows and a few of my decisions regarding how I made the rounded rectangle backgrounds came back to haunt me.

With a little more testing, I discovered that the issues lied with anti-aliasing and clipping using Graphics2D. Since this issue was purely asthetic, I moved on to more pressing issues. Then, about a week later I got my monthly Tech Tips from Sun. Talk about reading my mind. The Java 2D Trickery - Core Java Technologies Technical Tips contains 2 excellent Java 2D tips. The first one titled Java 2D Soft Clipping was the answer I needed.

After about 5 minutes, the problem was resolved and it now looks great on both platforms. Excellent tip! Well done Chris Campbell! I suggest you check it out and subscribe if you haven't already done so.

Our Old Friend: GridBagLayout

I stumbled across this article about my old friend the GridBagLayout today. I for one thought I was in a very small minority when it comes to actually using and liking the GridBagLayout. Well, Jeff Friesen proved that he is also on my side when he wrote Harness the Power of Java's GridBagLayout. The article is a very good demystifier for those non-believers out there.

Since this is the first article in a series, it really only covers the basics, but it promises even more. Jeff does say that in case you're still not impressed with GridBagLayout, part 3 presents the JGoodies FormLayout alternative, and compares this layout manager with GridBagLayout so you can choose the layout manager that works best for you. I can't wait. People are always telling me to switch to FormLayout, but I've used it in the past and have not looked back. I just did not like dealing with those cryptic configuration strings ("3dlu p d:fill 4f 5u") all the time. I look forward to the 3rd part of the series.

If your scratching your head over which LayoutManager to use for forms, I would recommend the GridBagLayout. Our old friend.

All Grown Up

Today, I bit the bullet and bought the everydaycoder.com domain. I also setup my own blog so that I have more control over the look and feel as well as standards compliance. I feel like I just graduated from kindergarten to first grade. It does feel really nice to put my own shinny cool header and customize this site to my heart's content.

My speech (as valedictorian of my recent graduation): I'd first like to thank the little people without which I would not be here today. I'd also like to thank my new school. I love what you've done with the place and I can't wait to learn more.

Ok. I think I've carried the metaphor far enough. Seriously, Blogger was a great home for getting started. But I do like, so far, WordPress and love the new found freedom.

So what do you think? Can anyone guess what computer has the text "Everyday Coder" printed on it in the header? Good luck.

An Incredible Machine

While working on large projects, it's good to have a distraction
every now and then. My son and I can't watch this video enough. If you're into
Rube Goldberg Machines, you'll love this video. It's a full 13 minutes long and is absolutely mesmerizing.

I hope you enjoy it. I can't get that jingle out of my head. Pi-ta-go-ra Su-icchi.

Subversion Goodies

I use Subversion for source code management now on all my projects. Before, I used to use CVS like everyone else. Recently I discovered some things about subversion that I hadn't known.

On Windows, I *can* use putty as an ssh wrapper for subversion (svn+ssh://). This was a welcome surprise, because I was using TortoiseSVN which included its own ssh wrapper. TortoiseSVN is widely accepted among most developers on Windows, but I'm still used to the old CVS command line ('cvs up', 'cvs co', etc) and I always hated wading through Explorer to do an update. Anyway, I happened to notice a Subversion folder in my Application Data folder the other day. I went in there and found a file called config. In that file, I saw the old familiar line commented out:

# ssh = $SVN_SSH ssh

I immediately uncommented the line and changed it to:

ssh = \\putty\\plink.exe

In my CVS days I did know that plink is the program you use to tunnel through ssh. I tried to go in and run svn, but I kept getting a "file not found" error. I then looked more carefully at the config file and noticed there was a commented-out section: [tunnels]. I uncommented this section and it worked! That was easy.

My other great discovery was that SVN does, in fact, support keyword substitution like our old friend CVS. You know, $Id$, $Revision$, etc. I have such a habit of putting '// $Id$' at the top of my source files; its not even funny. So the following command magically makes keywords work for svn:

svn propset svn:keywords "Id Author Rev" build.xml

There are more keywords, of course, and you can see the reference to them in the subversion documentation. Executing the above command works for the file given, but if you want it to work with every file, you'll need to specify the keywords in the [auto-props] section of your subversion config file (See above). After trolling a bit, I did find a nice example of a subversion config file on an Apache site.

I hope you put these "discoveries" to good use.

« Prev - Next »