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
// create the control | |
var autoZoomCheckbox = L.control({position: 'topleft'}); | |
autoZoomCheckbox.onAdd = function (map) { | |
var div = L.DomUtil.create('div', 'command'); | |
div.innerHTML = '<form><input id="command" type="checkbox"/>Automatic fit to bounds</form>'; | |
return div; | |
}; | |
autoZoomCheckbox.addTo(map); |
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
//Add center result control button | |
L.easyButton({ | |
states: [{ | |
stateName: 'zoom-to-forest', | |
icon: 'glyphicon glyphicon-screenshot', | |
title: 'Center map to heat results', | |
onClick: function(btn, map) { | |
if (typeof $scope.heatLayer != 'undefined' | |
&& typeof $scope.maxGlobalHeat != 'undefined') { | |
map.setView($scope.maxGlobalHeat, 10); |
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
map.zoomControl.removeFrom(map); | |
// create the control | |
var autoZoomCheckbox = L.control({position: 'topleft'}); | |
autoZoomCheckbox.onAdd = function (map) { | |
var div = L.DomUtil.create('div', 'command'); | |
div.innerHTML = '<form><input id="command" type="checkbox"/>Auto fit bounds</form>'; | |
return div; | |
}; | |
autoZoomCheckbox.addTo(map); |
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 enum CardViewType { | |
SUBSCRIBED(1), | |
REJECTED(2), | |
NEW(3); | |
private int value; | |
private static Map<Integer, CardViewType> map = new HashMap<>(); | |
CardViewType(int value) { | |
this.value = 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
@After | |
public void teaddown() { | |
setting.clear(); | |
resetSingleton(ErgoSettings.class, "sInstance"); | |
} | |
public static void resetSingleton(Class clazz, String fieldName) { | |
Field instance; | |
try { |
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
DecimalFormat df = new DecimalFormat("#.####"); | |
df.setRoundingMode(RoundingMode.CEILING); | |
double newLat = Double.valueOf(df.format(coordinates.latitude)); | |
double newLong = Double.valueOf(df.format(coordinates.longitude)); |
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
@Test | |
public void testGzipSource() throws IOException { | |
String original = "Some super super long string.Some super super long string." + | |
"Some super super long string." + | |
"Some super super long string." + | |
"Some super super long string." + | |
"Some super super long string." + | |
"Some super super long string." + | |
"Some super super long string." + | |
"Some super super long string."; |
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
//Done in a MapFragment | |
@Override | |
public void onMapReady(GoogleMap googleMap) { | |
mMap = googleMap; | |
UiSettings mapUiSettings = mMap.getUiSettings(); | |
mapUiSettings.setCompassEnabled(false); | |
mapUiSettings.setZoomControlsEnabled(false); | |
mapUiSettings.setMapToolbarEnabled(false); | |
} |
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
*ptr = '\n'; | |
ptr++; | |
*ptr = '\n'; | |
ptr++; | |
base = (PacketHdrBase*)ptr; |
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
GPIO_InitTypeDef GPIO_I2CInitStructure; | |
/*Workaround p26 errata STM32F103*/ | |
__HAL_I2C_DISABLE(&hi2c1); | |
//OD HIGHG | |
GPIO_I2CInitStructure.Pin = I2C_SCL_PIN | I2C_SDA_PIN; | |
GPIO_I2CInitStructure.Mode = GPIO_MODE_OUTPUT_OD; | |
GPIO_I2CInitStructure.Pull = GPIO_PULLUP; | |
HAL_GPIO_Init(I2C_PORT, &GPIO_I2CInitStructure); | |
HAL_GPIO_WritePin(I2C_PORT, I2C_SCL_PIN, GPIO_PIN_SET); | |
HAL_GPIO_WritePin(I2C_PORT, I2C_SDA_PIN, GPIO_PIN_SET); |