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
let mapObjectSource = GeometryMapObjectSourceBuilder(context: self.sdk.context) | |
let mapObject = GeometryMapObjectBuilder() | |
.setGeometry( | |
geometry: PointGeometry( | |
point: GeoPoint(latitude: Arcdegree(value: 54), longitude: Arcdegree(value: 37)) | |
) | |
) | |
.setObjectAttribute(name: "db_sublayer", value: .string("s_dvg_pin_regular_ini")) | |
.createObject() |
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
val asyncResult = searchManager.suggest(query).wait() | |
val suggests = asyncResult.suggests | |
// тут мы получили коллекцию саджестов | |
// и должы показать список этих подсказок пользователю | |
suggests.forEach { suggest -> | |
suggest.title // это то что должно быть в основном тексте подсказки | |
suggest.subtitle // это вторая строка саджеста(она обычно менее яркая и шрифт меньше) | |
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
func addMarkers() { | |
let source = self.sdk.sourceFactory.createGeometryMapObjectSource() | |
self.sdk.map.addSource(source: source) | |
struct Marker { | |
let svg: Data | |
let latitude: Double | |
let longitude: Double | |
let anchor: CGPoint = CGPoint(x: 0.5, y: 0.5) |
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
val searchManager = SearchManager.createOnlineManager(sdkContext)!! | |
val query = SuggestQueryBuilder | |
.fromQueryText("Домодедово") | |
.build()!! | |
searchManager.suggest(query).onResult { | |
val result = it ?: return@onResult | |
result.suggests().filterNotNull().forEach { | |
val ptr = it.handler() |
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
fun printMapCorners(mapView: MapView, map: Map) { | |
val projection = map.camera.projection() | |
projection.screenToMap(ViewportPoint(0F, 0F))?.let { geoPoint -> | |
Log.i("", "top left corner $geoPoint") | |
} | |
projection.screenToMap(ViewportPoint(mapView.width.toFloat(), 0F))?.let { geoPoint -> | |
Log.i("", "top right corner $geoPoint") | |
} |
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
#!/usr/bin/env groovy | |
images = 'docker images -a'.execute().text | |
images.tokenize('\n').eachWithIndex { line, 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
// Returns the value at a given percentile in a sorted numeric array. | |
// "Linear interpolation between closest ranks" method | |
function percentile(arr, p) { | |
if (arr.length === 0) return 0; | |
if (typeof p !== 'number') throw new TypeError('p must be a number'); | |
if (p <= 0) return arr[0]; | |
if (p >= 1) return arr[arr.length - 1]; | |
var index = arr.length * p, | |
lower = Math.floor(index), |
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
#ifndef UNIQUE_H | |
#define UNIQUE_H | |
#include <stdexcept> | |
#include <utility> | |
template<class T> | |
class unique { | |
public: | |
unique() noexcept : buffer_{0}, instance_(nullptr) { |