Discover the power of algorithms

Complexities of algorithm, thier applicability. Optimization techniques associated with diffrent algos.

Discover Power of Blogging

What is Blogging , is it a Dream or Passion or Award or Making Money ?

Think Diffrent, be creative

Let's see how much conclusion one can draw from it. This will help testing your creativity.

Discover the power of technology

Technolgy, Programming, Optimization , Gadgets and more...

Discover the power of Blogging

Google widgets and gadgets.

Nov 22, 2011

How to start , stop perfmon from the command line in Windows ?

Logman command is the solution for it.
let's have a look at the command syntax

Syntax Verbs
Logman [create {counter | trace} collection_name ] [start collection_name] [stop collection_name] [delete collection_name] [query {collection_name|providers}] [update collection_name]

Parameter details:-

create {counter | trace} collection_name : Creates collection queries for either counter or trace collections. You can use command line options to specify settings.
start collection_name : Starts the data collection query collection_name. Use this option to change from scheduled collections to manual ones. Use the update parameter in the command line with begin-time (-b), end-time (-e), or repeat-time (-rt) to reschedule collections.
stop collection_name : Stops the data collection query collection_name. Use this option to change from scheduled collections to manual ones. Use the update parameter in the command line with begin-time (-b), end-time (-e), or repeat-time (-rt) to reschedule collections.
delete collection_name : Deletes the data collection query collection_name. If the collection_name does not exist, you will receive an error.
query {collection_name|providers} : If no collection_name or providers are given, the status of all existing collection queries are displayed. Use collection_name to display the properties of a specific collection. To display the properties on remote computers, use the -s remote computer option in the command line. Use providers as your keyword in place of collection_name to display the registered providers installed on your local system. To list registered providers installed on the remote system, use the -soption in the command line.
update collection_name : Updates collection queries for counter and trace collections. For counter collections, modifications to the query will stop, and then restart the collections. For trace collections, use the following parameters in the command line to query without stopping the collection: -p provider [(flags[,flags ...])] Level, - max n, - o PathName, -ft mm:ss, or -fd.


This command is very helpful in performance automation scenario.
If performance monitoring counter name is test_perf_log
then start command will go as :-
    logman start test_perf_log
on similar line stop command will go as:-
    logman stop test_perf_log


For more detail jump to page :- http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/nt_command_typeperf.mspx?mfr=true



Nov 1, 2011

Google MAP APIs to charge for usage, heavy traffic cost more

Google MAP server with their increased traffic has given a new dimension of earning to Google. With its success now Google is planning to charge for its usage.
Now one has to pay according to their usage.

Following is the cost estimation as per BBC
"The BBC is reporting that from 1 January 2012, Google will charge for the Google Maps API service when more than the limit of 25,000 map "hits" are made in a day. Google is rumoured to be charging $4 per 1,000 views in excess of the limit. Google maintains the high limit of 25,000 free hits before charging 'will only affect 0.35% of users.'"


In the Google announcement: "We understand that the introduction of these limits may be concerning. However with the continued growth in adoption of the Maps API we need to secure its long term future by ensuring that even when used by the highest volume for-profit sites, the service remains viable. By introducing these limits we are ensuring that Google can continue to offer the Maps API for free to the vast majority of developers for many years to come."

About Google Maps API

The Maps API is a free service, available for any web site that is free to consumers. Please see the terms of service for more information.
Businesses that charge fees for access, track assets or build internal applications must use Google Maps API Premier, which provides enhanced features, technical support and a service-level agreement.




indiana pacers ticketsTicketamerica.com has all of you're basketball NBA ticketing needs for teams like the indiana pacers and the milwaukee bucks as well as the atlanta hawks games, maps and seating charts.Links to follow :-  Disclosure :Pay Per Post Ad 



Oct 20, 2011

How to stop function inlining ?


__declspec(noinline) tells the compiler to never inline a particular member function (function in a class).
It may be worthwhile to not inline a function if it is small and not critical to the performance of your code.

 That is, if the function is small and not likely to be called often, such as a function that handles an error condition.

Keep in mind that if a function is marked noinline, the calling function will be smaller and thus, itself a candidate for compiler inlining.

More about inlining :-





Oct 16, 2011

Distance Calculation from Latitude/Longitude using Google MAP APIs between two locations

Here is a sample application which i have developed to get the direction, distance and duration between two location/places using Latitude/Longitude with the help of Google MAP APIs.
This application will also reveals that how can we retrieve place/city name from the Latitude/Longitude.

Let's look at the input of application :-
Just input Lat/Lng and press "get Directions with Distance/Duration!" and get the updated direction MAP with Distance and Duration.
Place A and Place B will displays the Lat/Lng resolved location.

Check out its demo :-



Google Maps API Sample, Distance from Latitude and Longitude between two locations

Maps API Directions Illustrated with Latitude and Longitude

From:    To: 
Place A:   Place B: 
Distance KM  Duration Minutes  
Language: 



Formatted DirectionsMap
​



Oct 14, 2011

Google's new web programming language, Dart

Google recently came up with new programming language for web application named as Dart.
Let's look at its technical specification :-

Dart is a new class-based programming language for creating structured web applications. Developed with the goals of simplicity, efficiency, and scalability, the Dart language combines powerful new language features with familiar language constructs into a clear, readable syntax.

In 2009, Google launched Go, a language designed for writing server software and handling other chores often handled today by C or C++. Dart, though, is "a new programming language for structured Web programming," according to the schedule for the Goto conference where Googlers plan to describe it next month.









Some Key feature mentioned by google about Dart.


Key features of the Dart language include:

Classes
Classes and interfaces provide a well understood mechanism for efficiently defining APIs. These constructs enable encapsulation and reuse of methods and data.
Optional types
Dart programmers can optionally add static types to their code. Depending on programmer preference and stage of application development, the code can migrate from a simple, untyped experimental prototype to a complex, modular application with typing. Because types state programmer intent, less documentation is required to explain what is happening in the code, and type-checking tools can be used for debugging.
Libraries
Developers can create and use libraries that are guaranteed not to change during runtime. Independently developed pieces of code can therefore rely on shared libraries.
Tooling
Dart will include a rich set of execution environments, libraries, and development tools built to support the language. These tools will enable productive and dynamic development, including edit-and-continue debugging and beyond—up to a style where you program an application outline, run it, and fill in the blanks as you run.

More information about Dart can be found at :- http://www.dartlang.org/

Sample "Hello World" program :-
  main() {
  var name = 'World';
  print('Hello, ${name}!');
}
Tutorial for Dart language :- http://www.dartlang.org/docs/getting-started/

How to use Dart with HTML ?
Like JavaScript, Dart programs can be directly embedded on HTML pages served to the browser.
Here is the example for it :-


simple Hello World in HTML using Dart. The main() method is the entry point.

<html>
  <body>
    <script type='application/dart'>
      void main() {
        HTMLElement element = document.getElementById('message');
        element.innerHTML = 'Hello from Dart';
      }
    </script>
    <div id='message'></div>
  </body>
</html>

The div element above is guaranteed to exist by the time the Dart code starts running.


Let's see now whether in future DART will hit its target or not.



Oct 12, 2011

How to write HTML code inside blogger blog post ?

Most of the time it become very messy when we try to write HTML code inside blog post.
It does not appear in the same way as we want when we publish it.










Following are some tricks which one can follow to simplify this process :-


1) Using existing HTML editor for writing complete content, and then copy paste entire content in post HTML mode.
2) Encode specific code with HTML encoder :-
                     shared one link here for you : http://centricle.com/tools/html-entities/
      a) Write your html code or any other code in the above site
      b) Press encode button. This will change all html tags with relevant encoded symbols ( e.g. < with < )
      c) Copy and paste encoded content into your compose post window.
here is the demo of embedded code:-


void CLogicalTimeMarker::RegisteringFlag(int nModuleID, char* pszName)
{
if(NULL != pszName && nModuleID <= g_nMaxModuleSupported)
{
m_stArrTimeAccounterStats[nModuleID].strName =  pszName;
}
}
Here is one more site doing same html code encode:-
            http://www.eblogtemplates.com/blogger-ad-code-converter/
Though one can embed any type of code like c/c++ , javascript , html with discussed approach.












Distance between two locations with the help of Latitude and Longitude

Finding Distance between two locations with Latitude and Longitude.

Lets see how can we find out the distance and duration between two diffrent locations,
if you have the latitude and longitude of two places.


Here is the pic of the application :-








Steps for finding distance with latitude/longitude.
1) Lets say we have latitude and longitude set P1 and P2.
    Google MAP comes up with the class GLatLng. This class helps to encapsulate Latitude
    and Longitude.
   
GLatLng is a point in geographical coordinates longitude and latitude. Notice that although usual map projections associate longitude with the x-coordinate of the map, and latitude with the y-coordinate, the latitude cooridnate is always written first, followed by the longitude, as it is custom in cartography.  

2) From this GLatLng points we need to get place name first.
   
class GClientGeocoder will help us to get the place name from LatLng.
  
This class is used to communicate directly with Google servers to obtain geocodes for user specified addresses. In addition, a geocoder maintains its own cache of addresses, which allows repeated queries to be answered without a round trip to the server. As a general best practice, it is not recommended to use GClientGeocoder functions in a loop. Developers that have multiple addresses to geocode should probably use our HTTP Geocoder instead.

Method :-
getLocations(latlng:GLatLng, callback:function)

This method performs reverse-geocoding, the conversion of a latitude/longitude pair into human-readable addresses. getLocations() sends a request to the Google geocoding service, asking it to return the address for the given latlng and pass the response in the given callback. As this method requires a call to a Google server, you must also pass a callback method to handle the response. This response will contain a Status code, and if successful, one or more Placemark objects. Note that this method may instead pass an addressable String, as indicated above; in that case, the service will do a standard geocode. If however, the first argument contains a GLatLng, the service will do a reverse-geocode.

Here is the example of function :-
function showAddress(response) {
  map.clearOverlays();
  if (!response || response.Status.code != 200) {
    alert("Status Code:" + response.Status.code);
  } else {
    place = response.Placemark[0];
    point = new GLatLng(place.Point.coordinates[1],place.Point.coordinates[0]);
    marker = new GMarker(point);
    map.addOverlay(marker);
    marker.openInfoWindowHtml(
        'orig latlng:' + response.name + ' ' + 
        'latlng:' + place.Point.coordinates[1] + "," + place.Point.coordinates[0] + ' ' +
        'Status Code:' + response.Status.code + ' ' +
        'Status Request:' + response.Status.request + ' ' +
        'Address:' + place.address + ' ' +
        'Accuracy:' + place.AddressDetails.Accuracy + ' ' +
        'Country code: ' + place.AddressDetails.Country.CountryNameCode);
  }
}


3) With the help of place name, we will query map for getting the distance and duration.
 
A sample code snippet for displaying location with map :-   
// Create a directions object and register a map and DIV to hold the 
// resulting computed directions

var map;
var directionsPanel;
var directions;

function initialize() {
  map = new GMap2(document.getElementById("map_canvas"));
  directionsPanel = document.getElementById("my_textual_div");
  directions = new GDirections(map, directionsPanel);
  directions.load("from:"+ fromAddress + "to: " + toAddress);
}

  fromAddress and toAddress is the same which we can retrieve easily with as we have discussed in step 2.

Let's see the demo in a sample application

 








From:    To: 
Place A:   Place B: 
Language: 

Formatted DirectionsMap