How to convert a DTED (Elevation) File to a Raster

Developer Income Report #4

1. January 2012 22:55 by Scott in Developer Income Report  //  Tags:   //   Comments (11)

The Intro:

Merry Christmas and Happy New Year to all my readers!

This month was even better and I think it has something to do with these reports.  So what should I do except keep writing them.

This month, I made made more bug fixes on UtopiaPimp.  While the site is huge and collects a lot of data, the data is becoming much more manageable.   Other than that, I have been working hard on my new idea sort of discussed in the last paragraph from the last income report.  Its coming along nicely. The project it self will be ongoing for a while, but this part of it looks great and actually fully functional.  I probably will be able to finish it up for version 1.0 by the end of this coming month.

I also merged one of my other blogs with this one.  The other blog was getting spammed way too much, so some of my most popular posts have been moved to this blog.

Show Me The Money:

This month was still great in advertising and actually still getting better.  To tell you the truth, this month was probably one of the best in the year.

  1. Project Wonderful - $240.23 (+$154.71) – It was a huge jump in the increase of cash here.  The money came from my seven advertising spots on the site.  I think what helped this month was an advertiser paid more than $30.00 a day to show ads on UtopiaPimp.  I also earned another +$1.00 through their affiliate network.  While its nothing in the grand scheme of things, I am now going to make money forever and ever from the people I have referred to Project Wonderful.
  2. AdSense - $78.99 (+$17.53) – It was another small jump from last month.  I think what especially helped this month, was I started rotating ads on UtopiaPimp.  Every other ad shown was a Google Ad along with Project Wonderful and thanks to my users clicking, I made a little more on Pimp than what I expected.
  3. MobFox - $8.10 (+$4.14) – This is all thanks to my Roller Derby Penalty Timer.  It hit 1,000 downloads yesterday.  Happily, its a very niche app in a very niche category, but I got enough downloads to hit the 1,000 mark!
  4. PostSecretCollection - $58.23 (+$26.71) – Again surprised this month.  The numbers just keep going up for selling PostSecret post cards.  This site I made a while back allows people to print the postcards and have them mailed to them.  I sell each card for $1.97. I made the price as cheap as possible.  Paypal eats .40 cents and Postal Methods eats $1.46.  That leaves just .11 cents per postcard I can donate towards Suicide Prevention.
  5.$110.00 (-$25.00) – Sadly, with all efforts of making money, I must spend money as well.  So this month I spent this cash on hosting costs, up from $85.00 last month.  The reason for the jump was a server upgrade.  My partner and I will be ramping up another project very soon and well we need the extra speed to keep up with the new project.  Thankfully, Pimp and my other sites still pays for all these costs still.  So we are still breaking even.

So in all I made $385.55 this month!  Thats up from just $182.46 last month.

Subtracting the costs to print, buy, mail, and host these projects, I made a profit of $217.32 this month!  While it doesn’t pay my rent, it does pay for an extra week of day care for my little baby girl!

Whats Next?

I am still going to keep working on my project with my friend.  Hopefully we can start testing it with some alpha testers in the next couple months.  Its a slow moving project, but we hope to make a real business out of it.

I hope to also fix just a few bugs that pop up with UtopiaPimp this month and maybe even get some time to update its User Interface.  This will most definitely make my users extremely happy along with allowing me to grow UtopiaPimp even more. Ive been using the same UI since the start of Pimp in 2002.  Its about time for an update.

Programming Quote of the Month

14. December 2011 19:35 by Scott in   //  Tags:   //   Comments (24)

Coding Standards:

Any code written in any language written in any project should all be written like one developer sat down and wrote it all.

That should be your standard.

I Use Bing to Search, Google to Search Hard

7. December 2011 12:39 by Scott in Development  //  Tags: ,   //   Comments (103)

There comes a point in my life where I just love free stuff.  Bills are hard, employment sucks at times, but free stuff is always great.

I am a coder by day and a coder by night.  I run into hard problems that just can’t be answered without a reference to some other place in the world. 

Right now, I am picking up PHP because of a side project my work wants me to investigate.  While PHP is nice and all, there are just some things that can’t be done.  So we have to add the extra layer of JavaScript on top of it.  Yay, JavaScript!  But then again, I consider my self a decent JavaScript developer, but not an awesome one.  For the past few days I have been learning JavaScript's parsing engine for XML.  Its pretty cool and gets the job done when I need it.  When I run into a problem, I just go to my browser and start searching.  My default search engine in BING.  Please don’t chastise me as a developer.  Hear me out. 

BING has these points, if you accrue enough, you get free stuff. The Xbox points do it for me.  So Im an avid BING searcher.  Because of this, Ive been able to buy several arcade games on Xbox, and even get free HULU subscriptions.  So as you can see, there is a big reason why to use BING.  Free stuff.  Swag as many of us software folks call it.

So here is the big problem.  Bing is good for those average every day searches.  The easy ones.  Flights, Weather, Directions etc…, but for those hard to find searches and mostly in my realm, those programming questions, BING is spammed.  You can’t search in Bing for any type of developer question without hitting some type of spam.  Mostly that damn e-freedom crap.  I can’t stand it.  So when I go searching for those hard to find results, I will use Google. 

Google always shows the best answers up top.  The spam is always below the original thoughts.  If only Bing knew to sort duplicate results by Date and Time. What ever the crawler “craws” over first should be higher than those results it “craws” over second.  Things would probably go a lot easier and I would use Bing more often for those free points.

So Bing, you might have me using you for those easy searches, but until you clean up your spam, I won’t be using you much more than that.

In Looking for a public Web Processing Service (WPS)

6. December 2011 12:18 by Scott in ESRI, GIS  //  Tags: , ,   //   Comments (0)

I was looking for some public WPS’s to run some tests against.  Well, my searches didn’t pull up much in Google or Bing until I got more detailed, so for all the world to see here are some that I found.

I found a good list here at least to start testing with.






DEPHA">map demo




GRID/GENEVA GEO">directory -





GRID-Sioux Falls">here











Developer Income Report #3

The Intro:

Its been a better month than usual for a few reasons.  While its nothing to write home about, my income over time has been getting better. I think these reports tend to help as well because they do bring in a few more hits on my site.

Ive made a few changes to my applications this month, but no real development on my past apps except for fixing bugs on UtopiaPimp and PostSecretCollection. I had a bad bug on UtopiaPimp this month which halted other development efforts and actually halted most users on UtopiaPimp. It was fixed over a few late nights and my conclusion to it was here.

Show Me The Money:

This month in advertising picked up a lot.  There is one main reason for this.  I made the move from showing just Project Wonderful Ads to showing both Project Wonderful and Google Ads.  This has made a significant uptick in money.

Project Wonderful brought in +$85.52 from all my websites listed here. Down from the $118.00 it brought in last month.

Google Ads brought in +$61.46 from UtopiaPimp.

My Android Application for Roller Derby brought in just +$3.96 from MobFox, which is my Android advertising company.  I received another 100 downloads for the free application this month.  YAY!

I was surprised, but this month was also extremely good for PostSecretCollection, which brought in +$31.52 from selling the postcards to visitors of the site. While I made a commitment to never make a profit from this site, its good to see the postcards are selling.  I sell each postcard for a $1.97.  The bulk of the costs don’t even touch me.  Paypal takes .40 cents and Postal Methods takes $1.46 on each postcard to print and send it.  That leaves me with just a .11 cent profit on each card sold.  This was the most popular card sold this month.  I actually have this one sitting in my cube at work.  It bring inspiration at times when I need it.

This month, I paid out -$85.00 for server costs through  While their support is lacking at times, they are by far the cheapest hosting company I could find without going through Amazon Web Services.  I also upgraded my server to the new Hyper-V server they offer.  Nothing like Dedicated Ram!  I use this server to host all 11 of my websites.

So in all, I made +$182.46 from my sites.  Up from +$118.00 from last month.

Subtracting the costs to print, buy, mail and host these projects, I brought in a profit of +$67.70 this month!  Thats up from just +$39.09 last month.

Whats Next?

I have a project I am working on with a friend of mine.  We are both working on it pretty hard.  I am working on a desktop part right now, while he is working on the web based interface for it.  We hope it will actually change the way people document and watch a specific thing.  We have some extremely exciting news, but can’t really talk about it for now.  We want to release the “prototype of it first and get people to start using it before we go with big hype.  We personally think it has the ability to make big money.  On top of that, I will keep working on bugs for UtopiaPimp especially, since that is what pays the vast majority of the server costs.

ESRI WKID (Well Known ID) List of Units

23. November 2011 11:54 by Scott in   //  Tags:   //   Comments (0)

I looked long and hard for the Well known Ids from ESRI for Geospatial Units.  So I decided to post them here incase I need them again.




Centimeters.   WKID = 109006.  


Decimal Degrees.  WKID = 9102.


Decimeters.  WKID = 109005.


Feet. WKID = 9003.


Inches.  WKID = 109008.


Kilometers.  WKID = 9036.


Meters.  WKID = 9001.


Miles.  WKID = 9035.


Millimeters.  WKID = 109007.


Nautical Miles.  WKID = 9030.


Points.  1/72 inch.  No WKID, strictly a printing canvas measure.


Unknown units.  No WKID.


Yards.  WKID = 109002.

The available units of measure.

esriSRUnit_Meter 9001 International meter.
esriSRUnit_GermanMeter 9031 German legal meter.
esriSRUnit_Foot 9002 International foot.
esriSRUnit_SurveyFoot 9003 US survey foot.
esriSRUnit_ClarkeFoot 9005 Clarke's foot.
esriSRUnit_Fathom 9014 Fathom.
esriSRUnit_NauticalMile 9030 International nautical mile.
esriSRUnit_SurveyChain 9033 US survey chain.
esriSRUnit_SurveyLink 9034 US survey link.
esriSRUnit_SurveyMile 9035 US survey mile.
esriSRUnit_Kilometer 9036 Kilometer.
esriSRUnit_ClarkeYard 9037 Yard (Clarke's ratio).
esriSRUnit_ClarkeChain 9038 Chain (Clarke's ratio).
esriSRUnit_ClarkeLink 9039 Link (Clarke's ratio).
esriSRUnit_SearsYard 9040 Yard (Sears).
esriSRUnit_SearsFoot 9041 Sears' foot.
esriSRUnit_SearsChain 9042 Chain (Sears).
esriSRUnit_SearsLink 9043 Link (Sears).
esriSRUnit_Benoit1895A_Yard 9050 Yard (Benoit 1895 A).
esriSRUnit_Benoit1895A_Foot 9051 Foot (Benoit 1895 A).
esriSRUnit_Benoit1895A_Chain 9052 Chain (Benoit 1895 A).
esriSRUnit_Benoit1895A_Link 9053 Link (Benoit 1895 A).
esriSRUnit_Benoit1895B_Yard 9060 Yard (Benoit 1895 B).
esriSRUnit_Benoit1895B_Foot 9061 Foot (Benoit 1895 B).
esriSRUnit_Benoit1895B_Chain 9062 Chain (Benoit 1895 B).
esriSRUnit_Benoit1895B_Link 9063 Link (Benoit 1895 B).
esriSRUnit_IndianFoot 9080 Indian geodetic foot.
esriSRUnit_Indian1937Foot 9081 Indian foot (1937).
esriSRUnit_Indian1962Foot 9082 Indian foot (1962).
esriSRUnit_Indian1975Foot 9083 Indian foot (1975).
esriSRUnit_IndianYard 9084 Indian yard.
esriSRUnit_Indian1937Yard 9085 Indian yard (1937).
esriSRUnit_Indian1962Yard 9086 Indian yard (1962).
esriSRUnit_Indian1975Yard 9087 Indian yard (1975).
esriSRUnit_Foot1865 9070 Foot (1865).
esriSRUnit_Radian 9101 Radian.
esriSRUnit_Degree 9102 Degree.
esriSRUnit_ArcMinute 9103 Arc-minute.
esriSRUnit_ArcSecond 9104 Arc-second.
esriSRUnit_Grad 9105 Grad.
esriSRUnit_Gon 9106 Gon.
esriSRUnit_Microradian 9109 Microradian.
esriSRUnit_ArcMinuteCentesimal 9112 Centesimal arc-minute.
esriSRUnit_ArcSecondCentesimal 9113 Centesimal arc-second.
esriSRUnit_Mil6400 9114 Mil.

Multi-Threading with C# and a Website

23. November 2011 00:40 by Scott in Development, C#  //  Tags: , , ,   //   Comments (6)

Let me tell you my experience.

I have a website at that gets hit well over 1 Million times a day.  Thats 11 hits every Second.  Utopiapimp works on being a Live Stock Ticker for a online game called Utopia.  My users need live feeds 24/7 of whats happening in the game and thats what my application does for it.  Live feeds 24/7 for all users.  Its extremely dynamic as well.  Always changing, always updating.

My server that hosts my website is a VPS located with the company Ultima Hosts.  I have a middle tiered plan that costs a bit to host.  The advertising on Pimp pays for the hosting fees, but it doesn’t cover any more than that.  I have 4 GBs of Ram and 1 CPU.  I store so much in the caching system, that I take and use up at times almost all 4 GBs of Ram.  The problem mainly is the CPU.  At times the CPU hits 80% used and other times it coasts around 15% used.  So I was hoping to bring in some multi threading into Pimp to make the inserts into the DB much faster and a much faster response time for the users.

I started with just one thread, the new type of tasking in C# introduced in .Net 4.0.

Task.Factory.StartNew(() => DoSomeWork());

The Problem with this I think, is I only have one CPU.  When I implemented this method, I sadly and immediately saw a block.  The application started to hang.  I spent the next few weeks to try and stop the hang.  Yes, sadly, I introduced a bug so bad, I immediately started getting user connections loss.  I introduced a ton of code when I introduced this bug, so I was completely lost on the topic.  I thought well, it had to be something else.  Not until I wrapped the task around my error handling code to insert errors into the DB, did I realize what was going on. So I tried threading instead.

System.Threading.Thread newThread = new System.Threading.Thread(anObject.AMethod);

This didn’t work either.  I then realized, well maybe threads just don’t work on .Net Web apps.  I then thought, well maybe its just my 1 CPU.  Well, I haven’t yet upgraded to the second CPU, to test this out.

But believe me, when I get the chance, I will.


How To Count Lines of Code in Visual Studio

22. November 2011 02:00 by Scott in Visual Studio, Tricks  //  Tags: , , ,   //   Comments (0)

Measuring programming progress by lines of code is like measuring aircraft building progress by weight. - Bill Gates


If your like me, then you want to know at times how many lines of code you have written over the years.  I have this one web site that I thought would be roughly 200,000 lines of code.  Its over at  I questioned today how many lines of code I have when I was in discussion with one of my coworkers.  He didn’t think that my website offered that much and well, I had to prove him wrong.  So in figuring out how many lines of code I wrote, I had two different ways.  Here are the ways.

When using Visual Studio Team System:

Analyze -> Calculate Code Metrics has the ability to count projects of code, but not actually web forms applications.  The problem with this, is that I actually have a website and not an actual C# project, So I used the second method.

Visual Studio Trick:

This method will will match every line that are not comments (//), a compiler directive (starts with #), a single opening or closing brace, or blank lines. So these are true lines of code.

  • Select Edit -> Find & Replace -> Find in files… or just press CTRL+SHIFT+F
  • Check Use and select Regular expressions.
  • Top Left Drop down using the Find in Files Selection
  • Type the following as the text to find:

for C#


for VB.NET (thanks Steve for the info!)



  • If you select Current project or Entire solution, you also need to specify the file types that will be included in the search.

Proceed with the “search” and at the bottom of the Find results window you will see the total line count.

Draw a Circle Graphic with ESRI Android SDK

14. November 2011 12:56 by Scott in Development, ESRI  //  Tags: , , ,   //   Comments (3)

I wrote this code a while back.  The requirement was to have a user draw a circle with the ESRI Android SDK.  Well, their Android SDK doesn't currently support drawing circles.  It draws all other types of polygons except for the circle.  So what does a Software Engineer do, we come up with our own implementation.

So for the world to see, here it is:

First we capture the OnMotionEvent and the comments are in line.

Hope this helps someone.

    public boolean onDragPointerMove(MotionEvent from, MotionEvent to) {

        if (tempCircleGraphic != null)

        // creates a new polygon to be drawn.
        _circleTemp = new Polygon();

        Point point = _map.toMapPoint(to.getX(), to.getY());

        // If the starting point is null, create a polyline and start a
        // path.
        if (_startPoint == null) {
            _startPoint = _map.toMapPoint(from.getX(), from.getY());
            // creates a polyline so we can measure the radius of the
            // person
            // drawing the circle.
            _polylineTemp = new Polyline();
            // starts the poly line
            _polylineTemp.startPath(_startPoint.getX(), _startPoint.getY());
        // continues the draw of the poly line
        _polylineTemp.lineTo((float) point.getX(), (float) point.getY());

        // calculates the circle when getting ready to be drawn.
        int pointsAroundCircle = 50; // N
        double radius = _polylineTemp.calculateLength2D(); // radius
        for (int i = 0; i < pointsAroundCircle; i++) {
            double fi = 2 * Math.PI * i / pointsAroundCircle;
            double x = radius * Math.sin(fi + Math.PI) + _startPoint.getX();
            double y = radius * Math.cos(fi + Math.PI) + _startPoint.getY();
            if (i == 0) // starts the drawing of the circle. if
                        // beginning
                        // the for loop
                _circleTemp.startPath(x, y);
            else if (i == pointsAroundCircle - 1) // ends the circle
                                                    // when at
                                                    // the end of the
                // for loop.
                // continues drawing the cirlce while it iterates
                _circleTemp.lineTo(x, y);
        // creates a new graphic and sets the geometry to a polygon.
        Graphic graphic = new Graphic();

        int drawColor = getDrawColor();
        int transparentColor = Color.argb(POLYGON_ALPHA,,
        SimpleFillSymbol fillSymbol = new SimpleFillSymbol(transparentColor);
        tempCircleGraphic = graphic;
        // add the updated graphic to graphics layer

        // Refresh the graphics layer
        return true;


java.lang.RuntimeException: Stub! On With JUnit and Android

2. November 2011 10:35 by Scott in Development, Android  //  Tags: , , ,   //   Comments (34)

Running into another Error I figured I would blog about.

So im getting a Stub Error while trying to JUnit test a library I built with some Android code inside of it.  The Error is as follows:

java.lang.RuntimeException: Stub!
    at com.irad.conversion.gml.GmlConverter.GetAttributesFromGml(
    at com.irad.conversion.gml.GmlConverter.ConvertGmlPolygonToGraphic(
    at com.irad.conversion.gml.GmlConverter.ConvertGmlToEsriGraphic(
    at com.irad.conversion.gml.test.GmlConverterTest.ConvertGmlToEsriPolygonRingsGraphicTest(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
    at org.junit.runners.model.FrameworkMethod.invokeExplosively(
    at org.junit.internal.runners.statements.InvokeMethod.evaluate(
    at org.junit.internal.runners.statements.RunBefores.evaluate(
    at org.junit.internal.runners.statements.RunAfters.evaluate(
    at org.junit.runners.ParentRunner.runLeaf(
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(
    at org.junit.runners.BlockJUnit4ClassRunner.runChild(
    at org.junit.runners.ParentRunner$
    at org.junit.runners.ParentRunner$1.schedule(
    at org.junit.runners.ParentRunner.runChildren(
    at org.junit.runners.ParentRunner.access$000(
    at org.junit.runners.ParentRunner$2.evaluate(
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

While, I couldn't figure out what was going on, I kept getting a message of Stub while running some Android API code.  Keep in mind I was testing with JUnit outside of the official Android Test Project.  And in that lies the problem.


In order to run Android API code, you MUST run it on the emulator.  Which to me stinks and for something as easy as converting colors like I was feels needless, but I guess I must now convert all my JUnit tests to the Android JUnit Project Sadly.