Friday, January 30, 2009

Log4j explanation

This article helped me get around a problem at work. It was so simple and so helpful all at once.

Thank you sir!

Specifically what I was trying to do was to find out what logging was being done by some classes I was trying to test with JUnit Testing with an Eclipse plugin. I didn't know how the server I was interacting with was trying to find the log4j properties (what file name at what path) and I was having no luck seeing the log messages for the classes I was trying to test because there was no category set for them.

I would receive warning like this:
log4j:WARN No appenders could be found for logger(somePackageName.someClassName).
log4j:WARN Please initialize the log4j system properly.

In order to add a specific appenders to DEBUG and ERROR level messages from my class I need to find the log4j configuration.

In the Eclipse Debug Configurations on my JUnit test configuration, click on the Arguments tab. For VM Arguments I had the following:
-ea -Xmx256m -Dlog4j.debug

That did the trick, I was able to see in the console a message stating the xxx.properties was not found.
With that information I updated the properties file in the path it was looking for to add a category for the packages under test, and to change the appenders to point to new log files in my Eclipse project.

Monday, January 26, 2009

The Orientalists

Fischer - An Arab Caravan at DuskThe Orientalists by Kristian Davies published in 2005. The book is filled with great art, apparently from Davies descriptions most of it little known and much maligned by the general art "establishment" since the 20th century.

Most of the artists were Europeans who traveled to North Africa, the Middle East and South Asia in search of some escapist inspiration. They painted in a generally traditional, even academic style. The criticism is mainly that they were either cultural elitists, imperialists, racist, sexist or otherwise revisionist. They played up the mystique and lure of the Orient or portrayed the local people and cultures as backward or primitive.

The brief biographies of some of the painters and other adventurers was interesting. I've always had an interest in the grand and fantastic paintings I would occasionally see in museums but never had read, much less been taught, about them in any detail. Of course why else would I go through the trouble of finding this book in a library otherwise?

I found about 20 artists I really liked out of the bunch and made my first foray into true fine art knowledge by writing down their info and finding images of prints of their best paintings from google. In the process, I found a lot of good stuff from wikimedia commons and the internet archive. I had no idea that these sites had such a rich library of content, and in fact had better search results than the crap shoot of google image search.


World Wind Release Mode

After bringing up the issue with the current state of the code in SVN, the bad commit was reverted and now everything compiles and builds without error.

At the same time, Bull from the World Wind Central forums posted a blog about how to build in 'Release' mode.

Building World Wind in Release Mode

Wednesday, January 21, 2009

WW: Progress Update:

After a slow start I got a few answers to my questions:

For WorldWind, the standard for development is Visual Studio 2005. Any changes I made to the project files (say adding a new class file) would need to be checked in by someone else using 2005 for backwards compatibility to all the other 2005 developers.

I was able to download Visual C# 2005 Express for free from Microsoft's site (link while it lasts: http://www.microsoft.com/express/2005/download/default.aspx ). I downloaded it as a CD image and created the installer on a CD I burned with the image.

I finally got around on Monday to uninstalling Visual C# 2008 Express and all its tangled mess of subcomponents. Once I did that I tried to install 2005 version. It complained at first because I already had a version of the .NET Framework 2.0 SDK installed from earlier. As a result I had to uninstall that in order to install 2005, apparently it includes the 2.0 .NET SDK already.

Using Visual Studio 2005 I opened up the World Wind solution and rebuilt it. I did not get any build errors but this has nothing to do with the version of Visual Studio.

It was confirmed that some other developer had checked in a bad version of the code including the wrong gdal_csharp.dll bindings. I had figured this out by looking at the SVN revision history for those dlls and comparing with the classes that actually referenced them. It took a while for people on the forum to respond, and other than one user nobody seemed to care that the build was broken.

Another disappointment was that I found from some posts that the World Wind SVN repository does not allow commits except for a select few users. I guess that makes sense, but I've never worked on an OpenSource project, so I assumed it was something like Wikipedia's model, where anyone can contribute, but moderators/admins could revert harmful changes to the code. I suppose Software is more tricky than encyclopedia articles.

Anyway, in the mean time to get back up to speed on C# and .NET I revisited some of my old .NET projects, including a Tetris game I wrote in 2003 using GDI+ graphics. I also downloaded a tutorial for creating a simple project that uses Managed DirectX to paint the background of a window different colors.

V-day

For the first time in my life we have a President in Office that I have actually voted for.

I feel as if a great weight has been lifted from our backs.

Enough with the pomp and ceremony, time to roll up our sleeves and get to work.

Update:
Can we stop getting emails constantly from the "The Obama-Biden Presidential Transition Project" (info@change.gov)"

I got three emails in 1 day from them. Do I really need an update telling me about Obama's Inaugural Address, the day after it was all over international media from 6:30 am when I woke up until I went to sleep that night?

Monday, January 12, 2009

Wind in my sails

This year as part of one of my 2009 goals, I recently got interested in trying to contribute to World Wind development after downloading a version a couple of years ago. I am primarily a Java developer but I have done C# .NET development on the 1.1 Framework around 2003-2004. In any case I have a goal of being able to contribute here as well as pick up some more knowledge around .NET. Maybe for now I can turn some of my questions or any tips into more detailed documentation for new contributors in the future (more documentation can never hurt right? )

Getting Started


I have the professional version of Visual Studio .NET 2003 (not sure if it can be used with .NET 2.0+ Frameworks).

1)So I started out with installing Visual C# 2008 Express(http://www.microsoft.com/express/product/)

2)Following the wiki
-I downloaded the .NET 2.0 Framework SDK just in case (I am not sure if this necessary: http://www.microsoft.com/downloads/d...displaylang=en)
-Next I got the Nov 2007 DirectX SDK (http://www.microsoft.com/downloads/d...displaylang=en)


3) With tortoiseSVN I checked out the latest code from SVN repo ( https://nasa-exp.svn.sourceforge.net...runk/WorldWind)

4) I opened the solutions file in C# 2008, and had it convert the projects after making a backup.

5) Under Build > Build Configuration I changed the Active Solution Configuration to 'Debug' from 'Debug MSRS' (I don't know if this is needed)

5) I tried to Run the app with Debug > Start Debug. It said there were build errors (more on that later), but I could run last successful build, which I did. So WorldWind started and I pointed its Cache file to my existing installed WorldWind 1.4 cache directory.

Success!

Questions:
My first question is, did I miss anything or do anything i shouldn't have?

Second, I see that the conversion done by VS 2008, changes all the .csproj files in the source. Assuming at some point, I wanted to make some contributions what is the policy on checking in projects? Would a 2008 .csproj be backwards-compatible with VS 2005 developers?

When I right-click on any project in the WorldWind solution in VS and view the Properties window, under Targeted Framework: is shows '.NET Framework 3.5'
- Is this part of the "conversion"?
- In all the documentation I have read, WW 1.4(.1) is on .NET 2.0. Are any changes I make for potential contributions possibly not backwards compatible as a result? Should I manually change each projects' Targeted Framework to 2.0? Is there a way to do this for the entire solution at once and not manually changing it in every single project? What is this setting specifically doing? More research will be needed on my part for this one I think.

Finally the build errors
If I build the project I get about 14 Errors, all in the DstileGUI project.

Errors look like:
Code:
Error 1 The type or namespace name 'GDAL' could not be found
(are you missing a using directive or an assembly reference?)
D:\coding\WorldWind\svn\DstilePlugin\GDALImageStore.cs 37 9 DstileGUI
In the project references are references to gdal_csharp.dll and gdalconst_csharp.dll. There is a using GDAL; statement in these classes.

I tried a few things, which I can elaborate on, but it seems as if there may be some mismatch between the gdal version and the DstileGUI code? This page seems to point out that there new Namespace conventions being used with GDAL for C# in version 1.4.0 and 1.5.0 of GDal.

I wonder if they included the right version of the .dll with the source code?


Still waiting for responses from the World Wind Central forums. The Developers Corner there seem pretty quiet but there are a few other recent threads.