The Mobile Galaxy The New Mobile Era Has Come | Mobile – A Time To Remember





Online Security Message Tools

This tools will generate a 256 Bit AES-128 symmetric key cipher text for given plain text. Keep your message safe and secure. Mobile devices friendly, try on your mobile.

English version:

Chinese Version:


Fetching tiles for Offline Map

BE WARE: If you are trying to cache the tiles that Google serves, that may be a violation of Google's Terms of Service.
Google Maps API Premier License Agreement

3.4 Cache Restrictions. Customer may not pre-fetch, retrieve, cache, index, or store any Content, or portion of the Services with the exception being Customer may store limited amounts of Content solely to improve the performance of the Customer Implementation due to network latency, and only if Customer does so temporarily, securely, and in a manner that (a) does not permit use of the Content outside of the Services; (b) is session-based only (once the browser is closed, any additional storage is prohibited); (c) does not manipulate or aggregate any Content or portion of the Services; (d) does not prevent Google from accurately tracking Page Views; and (e) does not modify or adjust attribution in any way.

using System.Collections.Generic;
using System.Text;
namespace MapTileURL
    class Program
        private static Dictionary<string, string> MapTypeURLs = new Dictionary<string, string>
            { "GoogleSatURL", "<a href="http://khm{GOOG_DIGIT}{X}&y={Y}&z={ZOOM}&s={GALILEO">http://khm{GOOG_DIGIT}{X}&y={Y}&z={ZOOM}&s={GALILEO</a>}" },
            { "GoogleMapURL", "<a href="http://mt{GOOG_DIGIT}{X}&y={Y}&z={ZOOM}&s={GALILEO">http://mt{GOOG_DIGIT}{X}&y={Y}&z={ZOOM}&s={GALILEO</a>}" },
            { "GoogleHybURL", "<a href="http://mt{GOOG_DIGIT}{X}&y={Y}&z={ZOOM}&s={GALILEO">http://mt{GOOG_DIGIT}{X}&y={Y}&z={ZOOM}&s={GALILEO</a>}" },
            { "GoogleTerURL", "<a href="http://mt{GOOG_DIGIT},r@121&hl=en&x={X}&y={Y}&z={ZOOM}&s={GALILEO">http://mt{GOOG_DIGIT},r@121&hl=en&x={X}&y={Y}&z={ZOOM}&s={GALILEO</a>}" },
            { "GoogleChinaURL", "<a href="http://mt{GOOG_DIGIT}{X}&y={Y}&z={ZOOM}&s={GALILEO">http://mt{GOOG_DIGIT}{X}&y={Y}&z={ZOOM}&s={GALILEO</a>}" },
            { "YahooMapURL", "<a href="http://maps{Y_DIGIT}{X}&y={YAHOO_Y}&z={YAHOO_ZOOM}&r=1">http://maps{Y_DIGIT}{X}&y={YAHOO_Y}&z={YAHOO_ZOOM}&r=1</a>" },
            { "YahooSatURL", "<a href="http://maps{Y_DIGIT}{X}&y={YAHOO_Y}&z={YAHOO_ZOOM}&r=1">http://maps{Y_DIGIT}{X}&y={YAHOO_Y}&z={YAHOO_ZOOM}&r=1</a>" },
            { "YahooInMapURL", "<a href="{X}&y={YAHOO_Y}&z={YAHOO_ZOOM_2">{X}&y={YAHOO_Y}&z={YAHOO_ZOOM_2</a>}" },
            { "YahooInHybURL", "<a href="{X}&y={YAHOO_Y}&z={YAHOO_ZOOM_2">{X}&y={YAHOO_Y}&z={YAHOO_ZOOM_2</a>}" },
            { "YahooHybURL", "<a href="http://maps{Y_DIGIT}{X}&y={YAHOO_Y}&z={YAHOO_ZOOM}&r=1">http://maps{Y_DIGIT}{X}&y={YAHOO_Y}&z={YAHOO_ZOOM}&r=1</a>" },
            { "MicrosoftBrMapURL", "<a href="http://imakm{MS_DIGITBR}{QUAD}|t&call=2.2.4">http://imakm{MS_DIGITBR}{QUAD}|t&call=2.2.4</a>" },
            { "MicrosoftHybURL", "<a href="http://ecn.t{MS_DIGIT}{QUAD}.png?g=441&mkt=en-us&n=z">http://ecn.t{MS_DIGIT}{QUAD}.png?g=441&mkt=en-us&n=z</a>" },
            { "MicrosoftSatURL", "<a href="http://ecn.t{MS_DIGIT}{QUAD}.png?g=441&mkt=en-us&n=z">http://ecn.t{MS_DIGIT}{QUAD}.png?g=441&mkt=en-us&n=z</a>" },
            { "MicrosoftMapURL", "<a href="http://ecn.t{MS_DIGIT}{QUAD}.png?g=441&mkt=en-us&n=z">http://ecn.t{MS_DIGIT}{QUAD}.png?g=441&mkt=en-us&n=z</a>" },
            { "MicrosoftTerURL", "<a href="http://ecn.t{MS_DIGIT}{QUAD}.png?g=441&mkt=en-us&shading=hill&n=z">http://ecn.t{MS_DIGIT}{QUAD}.png?g=441&mkt=en-us&shading=hill&n=z</a>" },
            { "OpenStreetMapURL", "<a href="{ZOOM}/{X}/{Y}.png">{ZOOM}/{X}/{Y}.png</a>" },
            { "OSMARenderURL", "<a href="{ZOOM}/{X}/{Y}.png">{ZOOM}/{X}/{Y}.png</a>" },
            { "OpenAerialMapURL", "<a href="{X}&y={Y}&zoom={OAM_ZOOM">{X}&y={Y}&zoom={OAM_ZOOM</a>}" },
            { "OpenCycleMapURL", "<a href="{ZOOM}/{X}/{Y}.png">{ZOOM}/{X}/{Y}.png</a>" }
        readonly static char[] Lookup = new[] { 'q', 't', 'r', 's' };
        public static string GetQuadtreeFromXYZoom(int x, int y, int zoom)
            var quad = new StringBuilder();
            for (int i = 0; i < zoom; i++)
                int rx = x % 2;
                int ry = y % 2;
                x /= 2;
                y /= 2;
                quad.Insert(0, Lookup[rx * 2 + ry]);
            quad.Insert(0, 't');
            return quad.ToString();
        public static string BuildUrl(string tileType, int x,int y,int zoom)

            string url = "";
            // Edited by Shustrik - compacted the switch statement
            switch (tileType)
                case "GoogleSat":
                case "GoogleSatH":
                    url = MapTypeURLs["GoogleSatURL"];
                case "GoogleMap":
                    url = MapTypeURLs["GoogleMapURL"];
                case "GoogleHyb":
                    url = MapTypeURLs["GoogleHybURL"];
                case "GoogleTer":
                    url = MapTypeURLs["GoogleTerURL"];
                case "GoogleChina":
                    url = MapTypeURLs["GoogleChinaURL"];
                case "MicrosoftMap":
                    url = MapTypeURLs["MicrosoftMapURL"];
                case "MicrosoftSat":
                    url = MapTypeURLs["MicrosoftSatURL"];
                case "MicrosoftHyb":
                    url = MapTypeURLs["MicrosoftHybURL"];
                case "MicrosoftTer":
                    url = MapTypeURLs["MicrosoftTerURL"];
                case "MicrosoftBrMap":
                    if (zoom <= 10)
                        url =  MapTypeURLs["MicrosoftMapURL"];
                        url = MapTypeURLs["MicrosoftBrMapURL"];
                case "YahooMap":
                    url = MapTypeURLs["YahooMapURL"];
                case "YahooSat":
                case "YahooSatH":
                case "YahooSatH2":
                    url = MapTypeURLs["YahooSatURL"];
                case "YahooHyb":
                    url = MapTypeURLs["YahooHybURL"];
                case "YahooInMap":
                    url = MapTypeURLs["YahooInMapURL"];
                case "YahooInHyb":
                    url = MapTypeURLs["YahooInHybURL"];
                case "OpenStreetMap":
                    url = MapTypeURLs["OpenStreetMapURL"];
                case "OSMARender":
                    url = MapTypeURLs["OSMARenderURL"];
                case "OpenAerialMap":
                    url = MapTypeURLs["OpenAerialMapURL"];
                case "OpenCycleMap":
                    url = MapTypeURLs["OpenCycleMapURL"];

            // Edited by Shustrik - added variables for configuration settings other than Google
            string quadcode = "";
            for (int i = (int)zoom - 1; i >= 0; i--)
                quadcode = quadcode + (((((y >> i) & 1) << 1) + ((x >> i) & 1)));
            url = url.Replace("{X}", x.ToString());
            url = url.Replace("{Y}", y.ToString());
            url = url.Replace("{Z}", ((int)zoom).ToString());
            url = url.Replace("{ZOOM}", ((int)zoom).ToString());
            url = url.Replace("{QUAD}", quadcode);
            url = url.Replace("{YAHOO_Y}", (((1 << ((int)zoom)) >> 1) - 1 - y).ToString());
            url = url.Replace("{YAHOO_ZOOM}", ((int)zoom + 1).ToString());
            url = url.Replace("{YAHOO_ZOOM_2}", (17 - (int)zoom + 1).ToString());
            url = url.Replace("{OAM_ZOOM}", (17 - (int)zoom).ToString());
            url = url.Replace("{GOOG_DIGIT}", ((x + y) & 3).ToString());
            url = url.Replace("{GOOG_QUAD}", GetQuadtreeFromXYZoom(x, y, zoom));
            url = url.Replace("{MS_DIGITBR}", ((((y & 1) << 1) + (x & 1)) + 1).ToString());
            url = url.Replace("{MS_DIGIT}", ((((y & 3) << 1) + (x & 1))).ToString());
            url = url.Replace("{Y_DIGIT}", ((x + y + zoom) % 3 +1).ToString());
            url = url.Replace("{GALILEO}", "Galileo".Substring(0, ((3 * x + y) & 7)));
            // support old style {} vars
            url = url.Replace("QQQQ", GetQuadtreeFromXYZoom(x,y,zoom));
            url = url.Replace("XXXX", x.ToString());
            url = url.Replace("YYYY", y.ToString());
            url = url.Replace("ZZZZ", (17 - (int)zoom).ToString());
            url = url.Replace("{OSM_ZOOM}", ((int)zoom).ToString());
            url = url.Replace("{MS_QUADCODE}", quadcode);
            url = url.Replace("*", ((x+y+zoom) %4).ToString());
            return url;
        static void Main(string[] args)
            string url = BuildUrl("GoogleMap", 1, 1, 1);
            //return <a href=""></a>
Tagged as: , , , No Comments

Today, InMotion Hosting was hacked

Today, My website was hacked. A message show all InMotion servers were hacked. I just moved to InMotion Hosting because of Rank #1,  before I had rent three different web hosting, all never occurred to be hacked. Sad.


index.php pages were replaced or added to folders. Simply restoring from a backup should fix the problem. If you don’t have a backup and if you have un-modified index.php from wordpress or oscommerce you can just overwrite download that version of software you’re running and overwrite the index.php they put in.

How to fix Inmotion Hosting hack by Tiger M@te




Servers of InMotion Hosting have been hacked. The home page of InMotion Hosting is showing hacked, though some of the internal website pages are working fine.

Update 25-Sept, 4.45 AM CST: I was able to get in touch with the support team of Inmotion Hosting, and got this info:

there appears to be a mass server hack that has replaced the index file in the public_html of several accounts, we are working to do a full server restore on all servers to get that back up and running, unfortunately as there is an investigation going on now my details given to me are limited

Update 25-Sept, 5.02 AM CST: Many customers of InMotion Hosting have mentioned in comments below that it is easy to get your hacked website back up. If you have some old Index.php file, just copy that to the existing Index.php, and your website will probably be back up. This is because hackers seem to have replaced Index.php files on many accounts (InMotion support team also confirmed that above). I am trying this right now.

Update 25-Sept, 5.15 AM CST: Home Page of InMotion Hosting has been restored. Still no word from management on when will they restored the affected websites of customers, and how did this large scale hack happened.

I have a couple of websites with InMotion Hosting, and they are also showing the same “Hacked” page.

There is no official word yet from InMotion Hosting on the extent of hack, and time it will take for websites to get back up.

What worries me most is that hackers might steal the credit card info that InMotion hosting would have stored. Also, I am really hoping that InMotion Hosting is able to get my websites back up, with all the data, and I don’t end up losing everything.

Tagged as: , 1 Comment

Coordinate and Address

Get current location coordinate:

@implementation CurrentLocation

@synthesize locationManager;
@synthesize target,callBack;

#pragma mark --
#pragma mark Public
-(void) startUpdatingLocation{
	[[self locationManager] startUpdatingLocation];
#pragma mark --
#pragma mark Memory management
-(void) dealloc{
	[super dealloc];
	[locationManager release];
#pragma mark --
#pragma mark Location manager
 Return a location manager -- create one if necessary.
- (CLLocationManager *)locationManager {
    if (locationManager != nil) {return locationManager;}
    locationManager = [[CLLocationManager alloc] init];
    [locationManager setDesiredAccuracy:kCLLocationAccuracyNearestTenMeters];
    [locationManager setDelegate:self];
    return locationManager;
#pragma mark --
#pragma mark CLLocationManagerDelegate methods
 Conditionally enable the Add button:
 If the location manager is generating updates, then enable the button;
 If the location manager is failing, then disable the button.
- (void)locationManager:(CLLocationManager *)manager
    didUpdateToLocation:(CLLocation *)newLocation
           fromLocation:(CLLocation *)oldLocation {
	NSLog(@"got the coordinate!");
- (void)locationManager:(CLLocationManager *)manager
       didFailWithError:(NSError *)error {

Get current location address:

@implementation AddressReverseGeoder

#pragma mark --
#pragma mark Public
- (void)startedReverseGeoderWithLatitude:(double)latitude longitude:(double)longitude{
	CLLocationCoordinate2D coordinate2D;
	coordinate2D.longitude = longitude;
	coordinate2D.latitude = latitude;
	MKReverseGeocoder *geoCoder = [[MKReverseGeocoder alloc] initWithCoordinate:coordinate2D];
	geoCoder.delegate = self;
	[geoCoder start];
#pragma mark --
#pragma mark MKReverseGeocoderDelegate methods
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFindPlacemark:(MKPlacemark *)placemark {
	NSString *address = [NSString stringWithFormat:@"%@ %@ %@ %@ %@%@", 
	NSLog(@"经纬度所对应的详细:%@", address);
	geocoder = nil;
- (void)reverseGeocoder:(MKReverseGeocoder *)geocoder didFailWithError:(NSError *)error {
	NSLog(@"error %@" , error);
#pragma mark --
#pragma mark Memory management
- (void)dealloc {
    [super dealloc];

Google API for coordinate to address

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<META content="text/html; charset=utf-8" http-equiv=content-type>
<html xmlns="" >
<script src=""
<script type="text/javascript">
var geocoder = null;
function addAddressToMap(response) {
   if (!response || response.Status.code != 200) {
   } else {

    var add="";
    for(var i=0;i<response.Placemark.length;i++)
    add+=response.Placemark[i].address+" | ";
    alert("您查找的位置是 : " + add);

function showLocation(address) {

   if (GBrowserIsCompatible()) {
    geocoder = new GClientGeocoder();
    geocoder.getLocations(address, addAddressToMap);


<a href="javascript:void(0)"
     onclick="showLocation('22.567610,113.864749');return false;">
     取得地址 </a>