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
private val gattCallback = object : BluetoothGattCallback() { | |
override fun onConnectionStateChange(gatt: BluetoothGatt, status: Int, newState: Int) { | |
super.onConnectionStateChange(gatt, status, newState) | |
if (newState == BluetoothProfile.STATE_CONNECTED) { | |
gatt.discoverServices() // Discover services when connected | |
} else if (newState == BluetoothProfile.STATE_DISCONNECTED) { | |
// Handle disconnection | |
} | |
} |
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 asyncio | |
async def task_1(): | |
print("Task 1 started") | |
await asyncio.sleep(1) | |
print("Task 1 completed") | |
return "Task 1 result" | |
async def task_2(): | |
print("Task 2 started") |
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 asyncio | |
import threading | |
import tkinter as tk | |
class App(tk.Tk): | |
def __init__(self): | |
super().__init__() | |
self.label = tk.Label(self, text="Click the button to start the task.") | |
self.label.pack() |
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.meditivern.meditivemodule | |
import android.util.Log | |
import com.facebook.react.bridge.Arguments | |
import com.facebook.react.bridge.WritableArray | |
import com.facebook.react.bridge.WritableMap | |
import org.json.JSONArray | |
import org.json.JSONException | |
import org.json.JSONObject |
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
// Full Double Metaphone in pure JavaScript | |
function doubleMetaphone(word) { | |
word = word.toUpperCase().trim(); | |
if (!word) return ["", ""]; | |
let primary = ""; | |
let alternate = ""; | |
let index = 0; | |
function isVowel(ch) { |