One of the things I've learned about the download code is that it uses Asynchronous calls to handle the downloading of the image files from the server in the background.
I found a good article on doing these calls in .NET which explains a lot of the World Wind .NET download code and what it is doing.
http://www.codeproject.com/KB/dotnet/async_pattern.aspx
I need to understand this in order to really implement the more robust queuing method.
Tuesday, March 3, 2009
Sunday, March 1, 2009
Download code
So I have struggled with the infamous "download code" for the past week or more. It was really difficult to untangle what connects to what and where. I found myself resorting to drawing my own class diagrams to keep the pieces straight from what I could tell.
What was interesting is that there looks like two separate and independent "download code" implementations that do almost the same thing for different areas of the application.
The first component, if you will, was in the project called WebDownload, this was the first one I was able to step my way through. Unfortunately, it was not the component that could solve the problem I was tasked with fixing.

The next set of classes was in another project, PluginSDK. Here was where I eventually made some quick changes to actually stop the repeating downloads from happening.

The QuadTileSet is the center of action here, it has the queue of download requests that it services. I changed this class to have a Hashtable where it would store the download requests for tiles where the server responded with a 404 response. Then it wouldn't re-add these items to the download queue if they were in this Hashtable already.
All in all I had to make some slight changes to three classes here:
You may notice the snazzy UML class diagrams I used above. I am not really big on UML, though I used to do class diagrams a lot for a previous company. I went looking for some free, preferably Open Source UML Editors, just to let me crank out the class diagrams above (which I had already hand-drawn on paper).
I tried out two, both were basically Eclipse plugins. One did not work and the other I felt was too complex and buggy for the simple diagrams I want to do.
Papyrus UML - this actually worked but was difficult to use
acceleo - I installed this in my Eclipse environment as a plugin as per directions. I didn't allow me to create any diagrams after about 10 minutes of trying so I uninstalled it.
What was interesting is that there looks like two separate and independent "download code" implementations that do almost the same thing for different areas of the application.
The first component, if you will, was in the project called WebDownload, this was the first one I was able to step my way through. Unfortunately, it was not the component that could solve the problem I was tasked with fixing.

The next set of classes was in another project, PluginSDK. Here was where I eventually made some quick changes to actually stop the repeating downloads from happening.

The QuadTileSet is the center of action here, it has the queue of download requests that it services. I changed this class to have a Hashtable where it would store the download requests for tiles where the server responded with a 404 response. Then it wouldn't re-add these items to the download queue if they were in this Hashtable already.
All in all I had to make some slight changes to three classes here:
- QuadTileSet
- GeoSpatialDownloadRequest
- WebDownload
You may notice the snazzy UML class diagrams I used above. I am not really big on UML, though I used to do class diagrams a lot for a previous company. I went looking for some free, preferably Open Source UML Editors, just to let me crank out the class diagrams above (which I had already hand-drawn on paper).
I tried out two, both were basically Eclipse plugins. One did not work and the other I felt was too complex and buggy for the simple diagrams I want to do.
Papyrus UML - this actually worked but was difficult to use
acceleo - I installed this in my Eclipse environment as a plugin as per directions. I didn't allow me to create any diagrams after about 10 minutes of trying so I uninstalled it.
Sunday, February 22, 2009
Back into the fray
I have been on a hiatus from any of my leisurely coding pursuits. I had some deadlines on my current project for my real job, and spent the majority of the past two weeks and weekends working on finishing up some of those items. I completed most of those items on Friday so I am able to catch my breath and look into WorldWind .NET again.
Since I've been gone there has been discussions of setting up a Jira site for .NET that was apparently taken down right around when I signed up for world wind (yet another sign that I've jumped into an active healthy open-source community ;-)). So latest word is that they will probably shortly set up a new Jira instance on a WorldWind central server, then they will need to get the old Jira data from NASA.
In addition it looks like I've started to receive the emails from SourceForge with logs of everything checked in to SVN. Which is cool. Looks like a couple of members are starting to make modifications and updates. There is also an thread now of open 1.4.1 issues.
There are some issues with the download code for WW it seems. And when it was stated that no developers were around to fix it I stuck my head out again to let them know I was going to be helping soon. Some members wise-cracked that whomever works on the download code disappears in 7 days...
I'll try to spend some time this week, I have a couple of issues going on at work still that might take up my time. But I'm not giving up yet.
Since I've been gone there has been discussions of setting up a Jira site for .NET that was apparently taken down right around when I signed up for world wind (yet another sign that I've jumped into an active healthy open-source community ;-)). So latest word is that they will probably shortly set up a new Jira instance on a WorldWind central server, then they will need to get the old Jira data from NASA.
In addition it looks like I've started to receive the emails from SourceForge with logs of everything checked in to SVN. Which is cool. Looks like a couple of members are starting to make modifications and updates. There is also an thread now of open 1.4.1 issues.
There are some issues with the download code for WW it seems. And when it was stated that no developers were around to fix it I stuck my head out again to let them know I was going to be helping soon. Some members wise-cracked that whomever works on the download code disappears in 7 days...
I'll try to spend some time this week, I have a couple of issues going on at work still that might take up my time. But I'm not giving up yet.
Labels:
WorldWind
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:
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.
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
The 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.
Labels:
books,
orientalism
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
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
Labels:
WorldWind
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.
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.
Subscribe to:
Posts (Atom)