This file contains 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
SwiftMessage parsedSwiftMsg = new SwiftMsgProcessor().ParseMsgStringToObject(msgText) |
This file contains 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
CREATE FUNCTION distance_between (from_lat DECIMAL(6, 3), from_lng DECIMAL(6, 3), to_lat DECIMAL(6, 3), to_lng DECIMAL(6, 3)) RETURNS DECIMAL(11, 3) | |
RETURN 6371 * 2 * ATAN2(SQRT(POW(SIN(RADIANS(to_lat - from_lat)/2), 2) + POW(SIN(RADIANS(to_lng - from_lng)/2), 2) * COS(RADIANS(from_lat)) * COS(RADIANS(to_lat))), SQRT(1 - POW(SIN(RADIANS(to_lat - from_lat)/2), 2) + POW(SIN(RADIANS(to_lng - from_lng)/2), 2) * COS(RADIANS(from_lat)) * COS(RADIANS(to_lat)))); |
This file contains 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
map = (MapView) findViewById(R.id.map); //get the map instance | |
TiledLayer DAY_LAYER = new OfflineTiledLayer(this, new File(Environment.getExternalStorageDirectory(), "services"), "/RoadMapsWebMercator101010/MapServer/", "index.html", "/Day/tile/"); //create a layer | |
map.addLayer(DAY_LAYER); //add this layer to the map |
This file contains 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
package com.aploon.map.esri; | |
import java.io.ByteArrayOutputStream; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import org.codehaus.jackson.JsonFactory; | |
import org.codehaus.jackson.JsonParser; | |
import android.content.Context; |
This file contains 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
protected void setAttributeInternal(int attributeNumber, Object attributeValue) { | |
if (attributeValue instanceof oracle.jbo.domain. Date) { | |
java.util.Date value = ((oracle.jbo.domain.Date)attributeValue).getValue(); | |
GregorianCalendar gc = new GregorianCalendar(); | |
java.util.Date inAHundreedYears = new java.util.Date(new GregorianCalendar(gc.get(Calendar.YEAR) + 100, gc.get(Calendar.MONTH), gc.get(Calendar.DAY_OF_MONTH)).getTimeInMillis()); | |
if (value.after(inAHundreedYears)) { | |
System.err.println("Invalid date provided (" + value + ")"); | |
} | |
else { | |
super.setAttributeInternal(attributeNumber, attributeValue); |
This file contains 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 onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
. | |
. | |
. | |
BlueLine blueLine = new BlueLine(Color.BLUE, this); | |
} | |
Location lastKnownLocation; |
This file contains 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
<application android:name=".App" | |
android:icon="@drawable/icon" | |
android:label="@string/app_name" | |
android:debuggable="true" | |
android:theme="@android:style/Theme.NoTitleBar"> | |
<meta-data android:name="CLOUDMADE_KEY" android:value="API key obtained from Cloudmade"/> | |
. | |
. | |
. | |
</application> |
This file contains 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
import java.io.BufferedReader; | |
import java.io.InputStreamReader; | |
import java.io.OutputStreamWriter; | |
import java.io.StringReader; | |
import java.net.URL; | |
import java.net.URLConnection; | |
import java.util.ArrayList; | |
import javax.xml.parsers.SAXParserFactory; |
This file contains 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
org.osmdroid.views.MapView mapView = (org.osmdroid.views.MapView) findViewById(R.id.map_view); //resolve the map view by id given in the layout | |
mapView.setTileSource(new OnlineTileSourceBase("Google Maps", ResourceProxy.string.unknown, 1, 20, 256, ".png", "http://mt3.google.com/vt/v=w2.97") { | |
@Override | |
public String getTileURLString(final MapTile aTile) { | |
/* | |
* GOOGLE MAPS URL looks like | |
* base url const x y zoom | |
* http://mt3.google.com/vt/v=w2.97&x=74327&y=50500&z=17 | |
*/ | |
return getBaseUrl() + "&x=" + aTile.getX() + "&y=" + aTile.getY() + "&z=" + aTile.getZoomLevel(); |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:orientation="vertical"> | |
<LinearLayout android:orientation="horizontal" | |
android:layout_height="wrap_content" | |
android:layout_width="fill_parent" | |
android:gravity="center_horizontal" | |
android:id="@+id/table_dialog_header"> |