Monday, March 26, 2007

NetBeans All-In-One IDE

NetBeans.org has been steadily improving their IDE - originally focused on Java, but now with the ability to create C/C++ programs. As most programmers know, whenever you can find single tool to do all your work in, you sell into it. With the C/C++ Development Pack installed, you can develop both Java and C/C++ application from the same IDE. I imagine it's even simpler now to create JNI-based applications in this IDE, in addition to offering full compatibility with JDK 6.0 and the Java EE 5 platform. Even better, it comes bundled with a Java application server (Sun Java System Application Server 9u1), making the effort to find the tools you need to develop solutions less. I've actually started developing my web and enterprise solutions in this IDE because it's easier and can talk EJB 3.0 and JavaEE5 all at once. Now if the IDE could speak AJAX ...

Setting up NetBeans 5.5 to start developing C/C++ projects is a simple process:
(1) Download the C/C++ Development Pack and install it.
(2) Install GNU compilers, debuggers, and make utilities. All these are conveniently accessible through a Cygwin setup process. The only other task is to set your environment variables after installing the utilities. At a minimum, select gcc, g++, gdb, and make - dependencies will automatically be selected by the installer.

If you have Borland C++ Builder installed, you might want to ensure that Cygwin directory paths come before those of Borland tools in environment variables. Otherwise when you attempt to build C/C++ applications in NetBeans, you will get make errors like:
"
Error Makefile nn: Colon expected".
Simply, Borland's implementation of MAKE is not compatible with the GNU version.

When you create a new C/C++ project in NetBeans5.5, it may complain that it couldn't find the compilers. The IDE makers could do a better job of reading environment variables without having to shut down the IDE. Meanwhile, simply close and check that the tools are globally visible from the command prompt (DOS):
>
cygcheck -c cygwin
> gcc --version
> g++ --version
> make -h
> gdb --version
If each of these command return a good version, restart NetBeans again at it shouldn't have trouble finding your tools. The only pain so far in using the IDE for C/C++ development has been the need to always set the includes directory every time (with every new project) - and having to restart the IDE for changes to take effect. I think the IDE could improve in this area as well.

Perhaps some day the C/C++ development pack will already include the minimal Cygwin utilities required and offer an option to install them when the pack is installed. I mean, they are required for the pack to work, so why not! Otherwise, it's an exciting tool and would recommend Java and C/C++ developers to consider it - yes, even Eclipse diehards (which I also still use). We love options.

Monday, March 19, 2007

Volleyball Sundays

Sunday evenings at 6:30pm, some of us are meeting to play volleyball. We meet at Woodmen Valley Chapel's Rockrimmon Community Center gym, and the games are free with a goal to form league-quality teams. You can sign up anytime to join any of the league teams forming for the Spring-Summer season.
For now (and the next three weeks), teams are formed on the spot, depending on who's available. Games are rally, and no matter who wins, each teams plays two consecutive games. This way, everyone has an opportunity to play.
I've attended only twice, and all skill levels are represented here - though most are competitively good players. If you are looking for a good game Sunday evening, this is a place for you. Everyone is friendly and not judgemental.
The games run from 6:30pm - 9:30pm. Invite friends - everyone is welcome. Unlike when I used to host volleyball, there's no music or slurpees - bring your own if you need that inspiration.
[Image courtesy of stock.xchng].

Thursday, March 15, 2007

Soccer Wednesdays

There's soccer every Wednesday night at 8:30pm for those that like kicking things around. It's indoor soccer (until May 16 when it'll be moved outside) and is being held at First Presbyterian Church's gym (3rd floor main building) downtown Colorado Springs.
The cost is $2/person whenever you show up to play, and teams are made based on whoever is available. Each team plays two consecutive matches, each match lasting 8 minutes. That way, with 4-6 teams usually available, everyone gets to play sooner.
Some teams have been playing together for a while, so don't get offended if you can't join their team. Most skill levels are welcome - though there are good ball handlers amongst people that show up. The players are a pretty diverse group - among them Europeans, Asians, Latin Americans, and Africans - plus Americans of course. Bottomline is that everyone seems to have a passion for the game.
Last night was my first night back to soccer after a long while. I got my ass whooped - so tired after the first 8-minute match I felt like my chest was burning and I couldn't breathe. You quickly adjust though. I played 5 matches and was too tired to continue, evidence that I'm too out out shape both physically and skillwise. The games here can be competitive, but no one keeps score. When your 8 minutes are over, you get out and another team hits the floor.
In the fall, there are plans to play in local leagues and this is a good place to brush up on those skills. There are several places around town offering indoor soccer and some leagues already setting up for outdoor soccer (at the USAFA for example). I'm avoiding those because you have to pay some membership fee and stick with your team only. For a start on the game, First-Pres is the place to go.

Tuesday, March 13, 2007

Losing Sleep Over A Compiler

If you are an overachiever like I think I am, you probably lose sleep over petty things; except that this isn't that simple. I am charged with maintaining and improving an application at work that was developed using Borland's C++Builder 6 a few years ago. I've sought to move the code to more modern compilers such as Microsoft Visual C++ 6.0 or Bloodshed DevC++ without success because Borland's compiler institutes a lot of dependencies on proprietary libraries. That particular IDE is no longer supported by Borland Corporation as of Dec 2006. Even DLLs developed in C++Builder are incompatible with Microsoft's or Bloodshed's IDE, defeating the whole idea of dynamic libraries in development. You can deploy DLLs built in either to an OS and they'll work fine - just if you wish to debug the DLLs, you better find the original compiler/debugger for that job.
Further demonstrating why the compiler you choose matters to the bit, there's something curious happening when I build versions of the application. At some point, the application is supposed to attempt to corrupt data on a hard drive (we test some features by creating error conditions and ensuring our chips handle them correctly - exception testing). The older version performs the task as expected, but the newer one doesn't. The problem is that the same exact command that accomplishes the task in the old version is used in the new one, but the OS responds differently. Not only that, it doesn't report any errors - the response message is the same whether it did the task or not! I spent a whole day analyzing memory dumps and data structures and I find no differences between these two applications (code changes are in an unrelated module). Walk the code in a debugger all you want, there's no difference as far as I can see.
This leaves one arena to blame - the compiler. Could there be build options that are causing this difference in behavior? I don't see any! Compiler options? Data alignment issues? If I had Windows source code, I could figure it out. My application calls the same win32 API function DeviceIoControl() - which is a pain to work with in its own right - and get the same status and error messages whether it did the task or not! There is some sense data I haven't looked at, but it shouldn't matter because it is the same in both cases. I don't know what the hell is going on, short of analyzing the assembly produced at compile time. Who knew that my assembly language class at school would come in handy like this (well, except this is an Intel assembly as opposed to what we use at school - MIPS). But it's made it vivid in my mind that in the end, the compiler choice does matter.
My tool set includes Microsoft Visual C++ 6.0, Microsoft Visual Studio C++ 2005 Express, Borland C++Builder 6, and Bloodshed DevC++ for C/C++ development. Choose your compilers wisely - it could make or break you. I find Microsoft's Visual C++ 6.0 IDE most flexible for big projects, unpolluted by the .Net stuff they've bundled in succeeding IDEs in Visual Studio.