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 'dart:math'; | |
import 'package:flutter/material.dart'; | |
class MyCustomRadialGauge extends StatefulWidget { | |
@override | |
_MyCustomRadialGaugeState createState() => _MyCustomRadialGaugeState(); | |
} | |
class _MyCustomRadialGaugeState extends State<MyCustomRadialGauge> |
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
// Since this can compromise privacy, the position is not available unless the user approves it. | |
function get_location() { | |
try { | |
navigator.geolocation.watchPosition((pos) => { | |
try { | |
var coords = pos.coords; | |
} catch { | |
var coords = false; | |
} | |
if (!coords) { |
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
/* | |
The goal of this is to show you how to abstract the action of tapping a button, | |
such that it can be triggered from some other code. In this case we trigger one | |
button's action from tapping another button... but the principle should carry | |
over if you are triggering it from somewhere else in the code as well, possibly | |
not related to a user button tap (maybe after a certain amount of time, or when | |
another state updates elsewhere in the code). | |
*/ | |
// this package provides the state management utilities we need for this magic to happen |
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 info.benjaminhill.basicbot2 | |
import java.util.concurrent.ThreadLocalRandom | |
/** | |
* From https://geekprompt.github.io/Java-implementation-for-Double-Exponential-Smoothing-for-time-series-with-linear-trend/ | |
* | |
* Performs double exponential smoothing for given time series. | |
* |
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 'package:flutter/material.dart'; | |
import 'package:csv/csv.dart'; | |
import 'dart:async' show Future; | |
import 'package:flutter/services.dart' show rootBundle; | |
class TableLayout extends StatefulWidget { | |
@override | |
_TableLayoutState createState() => _TableLayoutState(); | |
} |
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
const AWS = require('aws-sdk'); | |
const s3 = new AWS.S3({ apiVersion: '2006-03-01', region: 'us-east-1' }); | |
/** | |
Recursive method to list all the objects in an S3 bucket which may be paginated. | |
**/ | |
const listObjects = ( | |
resultList, // This is the list of combined results from all calls. | |
NextContinuationToken // Tells S3 to get the next page of results. |
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.sam016.vsflatomation.service.ble; | |
import java.util.HashMap; | |
import java.util.UUID; | |
public class AllGattCharacteristics { | |
private static HashMap<String, String> attributes = new HashMap(); | |
static { | |
attributes.put("00002a00-0000-1000-8000-00805f9b34fb", "Device Name"); |
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 fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
setContentView(R.layout.activity_splash_screen) | |
//make Activity fullscreen /*hide Status bar*/ | |
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN) | |
val button=findViewById<Button>(R.id.button) | |
button.setOnClickListener { | |
//Back Activity to normal screen /*Show Status bar*/ | |
window.clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN) |
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.annotation.SuppressLint | |
import okhttp3.OkHttpClient | |
import java.security.cert.CertificateException | |
import javax.net.ssl.SSLContext | |
import javax.net.ssl.TrustManager | |
import javax.net.ssl.X509TrustManager | |
object UnsafeOkHttpClient { | |
fun Builder(): OkHttpClient.Builder { | |
try { |
NewerOlder