Cruise Through the Cradle of Liberty

September 2nd, 2007 by A R Baboon

I acquired a new machine to work with at work so now I can do the fly through movies I have been wanting to do. First I will give you Philadelphia. Which is the closest city for me. Some of the models done by Google/AMA like City Hall are truly excellent. Enjoy:

Model Blogging

August 20th, 2007 by A R Baboon

So my posts fizzled a bit but I am continuing to model local buildings. About one every day or two even if they are a little rough. I figured I would start with the largest buildings in Marlton first and then branch outwards. I think it is easier to constrain oneself to an area so I decided that I would stay in Marlton/Evesham for a bit. Actually Evesham is the largest town in the largest county (Burlington) in New Jersey. What I am wondering now is whether I need to create lower level-of-detail (LOD) models for the same in order to improve the performance of GE when the models are turned on. Maybe some one in the GEarth community would care to answer.

The Promenade
Evesham Municipal Complex
Marlton Elementary School
Indian Spring Country Club
Cherokee High School

After Burned Out, Engineering Positions Available

August 19th, 2007 by A R Baboon

They have had me on after burners so long at work I often cannot remember simple things when asked. That being said we are hiring. And I am seeing to it personally that I get decent help. If you think you have the right stuff for cutting edge aerospace software engineering (CS or CompE) bring it on. Honestly the work we do is really Advanced Technology stuff. You need many years of experience, you just need to be someone who eats, breaths, and shee this stuff and then come back for seconds. That being said don’t bother if you are not a solid C programmer.

BF Racing Passes to Urban Challenge Qualifying Round

August 9th, 2007 by A R Baboon

Ben Franklin Racing Team

Congratulations are in order to the Ben Franklin Racing Team for being selected to go to the qualifying round (and beyond) for the DARPA Urban Challenge in October. This thing was put together in a year and it seams safe enough to drive itself effectively now and at relatively high speeds. It can distinguish lanes and intersection markings, differentiate and circumnavigate obstacles, and make k-turns. If you have time, check out the videos on their website. I understand the next phase will include turbo boost and super pursuit mode :)

Bullet-Proofing C and C++ Without Draconian Verbosity

August 7th, 2007 by A R Baboon

Many, many bugs can be found through static analysis, however, the present state of analysis tools is pretty poor. Often we have two options. Either we shut off many of the warnings or we add so much verbosity to the code that readability suffers. The verbosity is ok when you are working small projects but as soon as you pass the 15 k SLOC mark you need to consider a different strategy. Blanket safety netting is common but again it tends to obscure the semantics of the code. Also things like over zealous casting can be very very dangerous. I have developed over a long period of time a set of techniques that allow static checking while still minimizing the added verbosity. I will list a few here.

The most well known and perhaps oldest (by heritage) static checker is probably SPLint. SPLint really does find quite a few issues and I recommend using it. The problem is that it is also a fire hose of false positives. I have found a number of options to make the false positives more manageable:

splint +unixlib -D__USE_POSIX -exportlocal -nullassign \
  -fcn-macros -onlytrans -boolops +ptrnegate -paramuse -retvalint \
  +boolint +floatdouble -macroredef -nullret -elseif-complete \
  -aliasunique -allimponly -predboolptr -retvalother -globstate \
  +matchanyintegral -nullpass

The other method to appease SPLint is to insert tags in your code attributing symbols in statements. For example /*@fallthrough@*/ tells splint you did indeed intend to let a case statement fall through. This kind of annotation is great for communicating to your teammates as well. However an abundance of these annotations will quickly pollute your code and there is no way to customize (i.e. #define) these annotations. Check out the following example of the prototype of free from the SPLint manual:

void free( /*@only@*/ /*@out@*/ /*@null@*/ void *ptr );

So SPLint is asking that you attribute everything at the expense of readability. Fortunately, there is another way that has many additional benefits. I have found that GCC can work effectively hand and hand with SPLint.

The good folks at GCC have provided the ability to add functional attributions to declarations. The syntax is __attribute__(( attribute_info )) where “attribute_info” is replaced by the attribute name and potentially an argument list. These attributes are used by GCC for its own static analysis but also to optimize your code. Much like const and volitile these attributes tell GCC that your code will be constrained such that the optimizer can be more or less aggressive. SPLint seems to respect these attributes even though I have found no such language in the documentation. The following are some convenience macros I frequently use:

#ifdef __GNUC__
#define UNUSED __attribute__ ((unused))
#define DEPRECATED __attribute__ ((deprecated))
#ifndef PURE // means - produces no side effects (by modifying shared globals)
#define PURE __attribute__ ((pure))
#endif
#ifndef NORETURN // means - exit is always called from this function
#define NORETURN __attribute__ ((noreturn))
#endif
// 'archetype' is one of printf, scanf, strftime or strfmon
#define FMT_FUNC( archetype, fmt_str_idx, first_varg_idx ) \
  __attribute__ ((format( archetype, fmt_str_idx, first_varg_idx )))
#define NONNULL_ARGS(arg_indexes...) __attribute__((nonnull( ##arg_indexes )));
#else
#define UNUSED
#define DEPRECATED
#define PURE
#define NORETURN
#define FMT_FUNC( archetype, fmt_str_idx, first_varg_idx )
#define NONNULL_ARGS(arg_indexes...)
#endif

GCC actually is capable of a great deal of static analysis if you enable the right options. The warnings are a lot more reasonable, so I have gotten into the practice of disabling a check in SPLint if it is enabled in GCC (see listing above). The following is a list of GCC arguments that enable full analysis and checking.

-g -Wall -Wdeclaration-after-statement -Wnested-externs -Wextra -O2

The O2 (optimization level 2) is not a mistake. Level 2 needs to be on in order to enable flow analysis within GCC. The “declaration-after-statement” restriction is because SPLint chokes hard on any declarations after the beginning of a block body code (even though it is in C99).

Ok I think this post is long enough. There are more techniques but they will have to come in subsequent posts.

Post Jam - Lid Open

August 6th, 2007 by A R Baboon

Every once in a while a post does not get picked up by feed readers. I don’t understand why but I am hoping this will flush the last post through.

Thats Not a Google Street View Car, Thats Ben

August 6th, 2007 by A R Baboon

Ben The Urban Challenger

I really should have posted on this sooner. Work is participating in the DARPA Urban Challenge together with UPenn and Lehigh, my alma mater, as part of the Ben Franklin Racing Team. It makes me very sad I could not participate but I will just have to live vicariously for the moment. I understand our team is doing really well. All four missions completed at the recent site visit with bonus exhibition time to spare.

The original video submission gives the actual specs. Linux inside, what else really. At the teams website you will also find a few other videos of cool stuff.

Grand Challenge 04 Fixes
I was at DARPA Tech 2004 expo, which ran concurrently with the the first Grand Challenge. Tony Tether came out and announced that only a handful of submissions out of hundreds actually qualified. Many would not even start up. Grand Challenge 04 Pushing There were many heart broken engineers and technologists in the room. Personally I blame programming language tower of babel for much of it. Perhaps it was an effective wake-up call because the following year several vehicles actually completed and this years submissions are something to be proud of.


Shell Tricks #3 - Disk Usage Alarm

August 4th, 2007 by A R Baboon

This is a one-liner to “alarm” if the disk usage of a filesystem has exceeded a certain threshold. I put the directory to monitor as “~” (home) and the threshold as 40%.

test `df -h ~ | grep -o '[0-9]*%' | grep -o '[0-9]*'` -ge 40 && echo high

Want To Show Up 007 Style?

August 3rd, 2007 by A R Baboon

Tank Limo Prom Ride
Pegasus with General Statue

Large break-away brick wall, Pegasus statue, and Pierce Brosnan not included. I’m sure you could rig it for theme song though. Tanks-a-lot has been around for a while I think. I seem to vaguely remember them being some sort of scandal when a criminal had bought one of their tanks and was wreaking havoc years ago.

[via ::Tank Limo via ::Treehugger]

Modeling in Kabul

August 1st, 2007 by A R Baboon

Kabul in 3D

I have been following the Sketchup Buildings Blog for a little while now and I can’t help but notice that almost every day a new model of a building in Kabul is modeled. I can’t find a site for this development and I am not sure the motivation but it seems to be related to a German Computer Science/Mathematics professor. I imagine this may be part of reconstruction projects and planning. What I don’t get is why they were nice enough to make it public. In any case here are some more shots. I will make a fly through video when I get a chance.

Kabul in 3D closer
Kabul in 3D Vista
Kabul in 3D Garden


Bad Behavior has blocked 149 access attempts in the last 7 days.