Extracted from simple-statistics.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var arr = [{id:3,title:"Ali"},{id:3,title:"Veli"},{id:3,title:"Vehbi"}]; | |
arr.sort(turkcesiralama); | |
function turkcesiralama(a, b){ | |
var atitle = a.title; | |
var btitle = b.title; | |
var alfabe = "AaBbCcÇçDdEeFfGgĞğHhIıİiJjKkLlMmNnOoÖöPpQqRrSsŞşTtUuÜüVvWwXxYyZz0123456789"; | |
if (atitle.length === 0 || btitle.length === 0) { | |
return atitle.length - btitle.length; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################### | |
## CartoDB 2.0 Install [Working] ## | |
## Tested on Ubuntu 12.04 ## | |
################################### | |
sudo apt-get update | |
sudo apt-get safe-upgrade -y | |
# Install miscellaneous dependencies packages | |
sudo apt-get install -y git-core python-software-properties openmpi-bin libopenmpi-dev build-essential libxslt-dev zlib1g-dev ruby gems unzip |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
GlobalMercator.cs | |
Copyright (c) 2014 Bill Dollins. All rights reserved. | |
http://blog.geomusings.com | |
************************************************************* | |
Based on GlobalMapTiles.js - part of Aggregate Map Tools | |
Version 1.0 | |
Copyright (c) 2009 The Bivings Group | |
All rights reserved. | |
Author: John Bafford |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Calculate Km2 of a polygon stores in GCS WGS84 | |
-- by default ST_Area returns the calculation in meters so the appropriate conversion was applied | |
-- fir_area_20131205 was the example table used | |
-- the spatial data was in a geom field so geom::geography was added | |
SELECT ST_Area(geom::geography)/1000000 as sqKM from fir_area_20131205 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* | |
* Aaron K. Saunders | |
* twitter: @aaronksaunders | |
* last updated may 23, 2014 | |
* | |
* See more Appcelerator Information on Clearly Innovative Blog | |
* | |
* www.clearlyinnovative.com | |
* blog.clearlyinnovative.com |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void onMapClicked(double x, double y, boolean longClick) { | |
// your activity should have getter for the MapView | |
MapView map = ((TesterMap3DActivity) mapActivity).getMapView(); | |
float zoom = map.getZoom(); | |
double worldSize = 360.0; // for EPSG3857: Math.PI * 6378137.0f * 2.0f; | |
double tileSizeHalf = worldSize / Math.pow(2,zoom) / 2.0; | |
double wgsX = (new EPSG3857()).toWgs84(x, y).x; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint vars: true */ | |
// adapted from http://wiki.openstreetmap.org/wiki/Mercator#JavaScript | |
(function () { | |
var project = {}; | |
if (typeof exports === "object") { | |
module.exports = project; | |
} else { | |
this.project = project; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// this file located in /Library/Application Support/Titanium/mobilesdk/osx/{version_number} | |
// add the following methods to GeolocationModule.mm | |
- (void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region | |
{ | |
NSDictionary *event = [NSDictionary dictionaryWithObjectsAndKeys:NUMBOOL(YES),@"success",[NSDictionary dictionaryWithObjectsAndKeys:NUMDOUBLE(region.center.latitude),@"lat",NUMDOUBLE(region.center.longitude),@"lng",NUMDOUBLE(region.radius),@"radius",region.identifier,@"identifier",nil],@"region",nil]; | |
if ([self _hasListeners:@"enteredRegion"]) | |
{ | |
[self fireEvent:@"enteredRegion" withObject:event]; |