Tuesday, July 14, 2009

Sending HTTP GET request in Flash Lite 3.0


To send HTTP GET request in Flash Lite you have two options depending on the type of data you are receiving

Case you want to receive normal plain text
Sample Code

===================================================

var requestHandler:LoadVars = new LoadVars();

requestHandler.load("http://www.google.com",requestHandler,"GET");

requestHandler.onData = function(str:String) {
trace("data reached");
if (str == undefined) {
trace("Error loading content.");
return;
} else
{
trace("can be read.");
//testTxt is a container where text can be displayed
testTxt.text = str;
}
}
===================================================

N.B:
If you tried to print the str in the output window, the str will not be printed, the only way to see that output is to set the content of a container with it.

Case you want to receive XML data

Sample Code

===================================================

var xmlData:XML = new XML();
xmlData.ignoreWhite = true;

xmlData.load("http://rss.news.yahoo.com/rss/entertainment");

xmlData.onLoad = function(sucesso:Boolean):Void {
if (sucesso) {
var firstlist:Array = xmlData.childNodes;
var secondList:Array = firstlist[0].childNodes;
//.......................
//.......................
//....................... so on
}
};

===================================================

Friday, July 10, 2009

Coordinate System Utility Library in Java

LatLongLib is a java library that provides the basic operations to be done on difference coordinate system
  • Latitude / longitude points
  • Degree, Minute, Second points
  • UTM points
To download LatLongLib library click here.
To find more details about the package (Javadoc, Testing Samples), click here.

The main Features provided by the package is
  1. Get Distance between two latitude/longitude points in meters using
    • getHaversineDistance
    • getVincentyDistance
    • getQuickEstimate
  2. Get slope between two latitude/longitude points using
    • getSlope
  3. Get point apart from certain point by certain distance and certain angle using
    • getPointAtDistance
  4. Convert latitude/longitude points to Degree Minute Second point using
    • calculateDMSFormat
  5. Convert Degree Minute Second point to latitude/longitude points using
    • calculateDDFormat
  6. Convert latitude/longitude points to UTM point using
    • LLtoUTM
  7. Convert UTM point to latitude/longitude points using
    • UTMtoLL

Friday, July 3, 2009

Tips for your graduate project documentation

In this post I will try to document what I have learned during the documentation phase of my graduate project.

Graduate project report comments:
  1. Written in Latex recommended, I personally suggest using MikTex and TexMaker.
  2. Introduction should goes like that
    • Overall All Idea.
    • Importance of that field "your thing".
    • Problem you are trying to solve.
    • Your contribution in solving that problem.
  3. Sections and subsections words should be capitalized.
  4. Avoid don't , isn't, use do not , is not.
  5. All axes in graphs should have the description and units.
  6. Make graphs black and white printable, show description line with different styles (solid, dotted) and not different colors.
  7. Add Related work sections for describing work done by others in the same field, don't forget adding references.