mardi 18 juin 2013

Category tree, left node, right node.


Given a Category lambda, left node, right node., I want to know the parent node.

"""
node* get_parent(node* N)
{
    //define parent of nullptr to be nullptr
    if (!N)
        return nullptr;
    while (true)
    {
        if (N->left)
        {
            //N->left is either the previous sibling or the parent
            if (N->left->child == N) //N->left is the parent
                return N->left;
            else //N->left is the previous sibling
                N = N->left;
        }
        else //a node with left==nullptr is the root, so its parent is nullptr
        {
            return nullptr;
        }
    }
}
"""

samedi 15 juin 2013

Financisto Cash Management Software port to Google Map API V2

  • How to display my location on Google Maps for Android API v2 ?
  • How to directly move camera to current location in Google Maps Android API v2 ?
  • How to reverse Geocode in Google Maps API 2 Android ?

Google Maps Android API v1 VS Google Maps Android API v2

When you browse the web looking for solution you will find a lot of reference to the V1 but any new key delivered by the Google API Console will not work and you'll get:

  • get android google maps Service unavailable (code=1), 
  • Google Maps Android API v2 crashes with NoClassDefFound Error
  • Couldn't get connection factory client

Remember not not mix the both  imports for example GeoPoint vs LatLng !

The Google API Console deliver keys only working for V2

You 'll need two keys:

  1. one signed with the debug key (under eclipse do Window > Preference > Android > Build)
  2. one signed with the certificate you sign the app for example on of the best finance software of the Play Store. - replace with your , the one you use for sign and secure your app under Play.
With the SHA1 footprint generate two api key with the  Google API Console .
  1. Service > Google Maps Android API v2 > On
  2. Api Access >  Simple API Access > Create new Android key ...

Automatically geotagged transaction, building the project

As described Here:

  1. Select File > Import > Android > Existing Android Code Into Workspace and click Next.
  2. Select Browse..., enter /extras/google/google_play_services/libproject/google-play-services_lib, and click Finish.

Alternatively in order to compile I had to double check that android-support-v4.jar is in financisto/libs/.

And check this is checked in Project > Properties > Android. - in the bottom section library -

The sources are here : Read the source Luke

Backed with a strong privacy,  Flowzr is the best Financial Software of the Play Store!
Suited for Personal and small business. It doesn't send you this mail: 2 days left - Exclusive offer - Save 20% on Mvelopes Annual Membership or that one this is an automated email from LessAccounting.com Money Snapshot In the past 7 days $0.00 Income $0.00 Expenses $0.00 Net Profit!