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
| class MainActivity: AppCompatActivity() { | |
| override fun onCreate(savedInstanceState: Bundle?) { | |
| super.onCreate(savedInstanceState) | |
| val view = View(this) | |
| setContentView(view) | |
| val connectivityManager = getSystemService(Context.CONNECTIVITY_SERVICE) as ConnectivityManager |
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
| class MapBitmapGenerator(private val cacheManager: CacheManager, private val tileSource: OnlineTileSourceBase, private val cache: IFilesystemCache) { | |
| fun createBitmap(rect: BoundingBox, zoom: Int): Bitmap { | |
| var tilesCoverage = CacheManager.getTilesCoverage(rect, zoom) | |
| tilesCoverage.forEach { | |
| if (cacheManager.downloadingAction.tileAction(it)) { | |
| throw IllegalStateException("Failed to load tile") | |
| } | |
| } | |
| tilesCoverage = tilesCoverage.sortedWith(compareBy({ MapTileIndex.getX(it) }, { MapTileIndex.getY(it) })) |
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
| buildscript { | |
| repositories { | |
| jcenter() | |
| } | |
| dependencies { | |
| classpath 'com.xlson.groovycsv:groovycsv:1.1' | |
| } | |
| } | |
| import static com.xlson.groovycsv.CsvParser.parseCsv |
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
| package com.devindi.tree; | |
| import java.util.ArrayList; | |
| import java.util.Collections; | |
| import java.util.List; | |
| @SuppressWarnings("ALL") | |
| public class Tree<T extends Comparable> { | |
| private Node<T> root; |
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
| package eu.mihin.sample; | |
| import android.app.Application; | |
| import android.os.AsyncTask; | |
| import android.util.Log; | |
| import org.xmlpull.v1.XmlPullParser; | |
| import org.xmlpull.v1.XmlPullParserException; | |
| import org.xmlpull.v1.XmlPullParserFactory; |
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
| public static String getCroreFormat(long value) { | |
| if (value > TEN_MILLION){ | |
| String suffix = String.format(".%02.0f Cr", 1000*value/TEN_MILLION % 1000 / 10d); | |
| value = value / TEN_MILLION; | |
| return formatToIndian(value) + suffix; | |
| } else { | |
| return formatToIndian(value); | |
| } | |
| } |
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
| #!/bin/bash | |
| # | |
| # An example hook script to check the commit log message. | |
| # Called by "git commit" with one argument, the name of the file | |
| # that has the commit message. The hook should exit with non-zero | |
| # status after issuing an appropriate message if it wants to stop the | |
| # commit. The hook is allowed to edit the commit message file. | |
| # | |
| # To enable this hook, rename this file to "commit-msg". |
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
| import android.content.res.Resources; | |
| import android.graphics.Bitmap; | |
| import android.graphics.NinePatch; | |
| import android.graphics.Rect; | |
| import android.graphics.drawable.NinePatchDrawable; | |
| import java.nio.ByteBuffer; | |
| import java.nio.ByteOrder; | |
| /** |