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 matplotlib.pyplot as plt | |
from matplotlib.backends.backend_pdf import PdfPages | |
import pandas as pd | |
# Sample DataFrame | |
data = {'Name': ['Alice', 'Bob', 'Charlie'], | |
'Age': [25, 30, 35], | |
'City': ['New York', 'Los Angeles', 'Chicago']} | |
df = pd.DataFrame(data) |
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 screenWidth = LocalConfiguration.current.screenWidthDp.dp.value | |
val naTextSp = when { | |
screenWidth < 390 -> 44.sp | |
else -> 48.sp | |
} | |
val uACRValTextSp = when { | |
screenWidth < 390 -> 20.sp | |
else -> 22.sp |
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
static uint32_t measure_value_char_add(ble_mus_t * p_mus, const ble_mus_init_t * p_mus_init) | |
{ | |
uint32_t err_code; | |
ble_gatts_char_md_t char_md; | |
ble_gatts_attr_md_t cccd_md; | |
ble_gatts_attr_t attr_char_value; | |
ble_uuid_t ble_uuid; | |
ble_gatts_attr_md_t attr_md; | |
// Add Measure Value characteristic |
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
BluetoothLEDevice bluetoothLeDevice = await BluetoothLEDevice.FromIdAsync(id); | |
GattDeviceServicesResult result = await bluetoothLeDevice.GetGattServicesAsync(); | |
if (result.Status == GattCommunicationStatus.Success) { | |
LogEvent("DEBUG: Services discovered successfully"); | |
foreach (GattDeviceService service in result.Services) { | |
// Discover characteristics for each service | |
GattCharacteristicsResult characteristicsResult = await service.GetCharacteristicsAsync(); |
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
BluetoothLEDevice bluetoothLeDevice = await BluetoothLEDevice.FromIdAsync(id); | |
GattDeviceServicesResult result = await bluetoothLeDevice.GetGattServicesAsync(); | |
if (result.Status == GattCommunicationStatus.Success) { | |
LogEvent("DEBUG: Services discovered successfully"); | |
foreach (GattDeviceService service in result.Services) { | |
// Discover characteristics for each service | |
GattCharacteristicsResult characteristicsResult = await service.GetCharacteristicsAsync(); |
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 class ReportGrievanceRequest { | |
// Initialize the objects | |
Context context; | |
ReportGrievanceCallback reportGrievanceCallback; | |
// Call Constructor to fetch objects | |
public ReportGrievanceRequest(Context context, ReportGrievanceCallback reportGrievanceCallback) { | |
this.context = context; | |
this.reportGrievanceCallback = reportGrievanceCallback; |
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
@signal_blueprint.route('/all-stats',) | |
async def signal_stats(): | |
tasks = [] | |
titles = [] | |
tasks.append(asyncio.gather(signal_actions.get_total_count())) | |
titles.append("signal_count") | |
tasks.append(asyncio.gather(spir_actions.get_total_signal_count())) | |
titles.append("spir_signal_count") | |
tasks.append(asyncio.gather(spir_actions.get_total_unseg_features_count())) |
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
def append_parent_path(): | |
import sys | |
import os | |
# getting the name of the directory | |
# where the this file is present. | |
current = os.path.dirname(os.path.realpath(__file__)) | |
# Getting the parent directory name | |
# where the current directory is present. | |
parent = os.path.dirname(current) |
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
from Crypto.Cipher import AES | |
# Hex prints from debug console from segger | |
nrf_plain_hex = "45 78 61 6D 70 6C 65 20 73 74 72 69 6E 67 20 74 6F 20 64 65 6D 6F 6E 73 74 72 61 74 65 20 62 61 73 69 63 20 75 73 61 67 65 20 6F 66 20 41 45 53 20 43 54 52 20 6D 6F 64 65 2E" | |
nrf_cipher = "12 DD C3 EE DF 6E 7E 04 C7 3B DD 0D A3 F5 8E 7E CF 6D A0 A6 76 60 8A 63 01 87 A5 F6 F6 26 B6 86 3A 07 B3 C0 FE D3 E5 3E 94 95 D5 05 EA 62 E7 23 4A F8 9A 20 4C 68 B2 2C D6 E5" | |
# Initiat vector for aes_ctr project | |
iv = "00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00" | |
# Method for converton of of hex string from NRF to bytes in python | |
def nrf_hex_str_to_bytes(m_hex_str): |
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 path = require('path'); | |
const { exec } = require('child_process'); | |
const fs = require('fs'); | |
const rimraf = require('rimraf'); | |
function renameOutputFolder(buildFolderPath, outputFolderPath) { | |
return new Promise((resolve, reject) => { | |
fs.rename(buildFolderPath, outputFolderPath, (err) => { | |
if (err) { | |
reject(err); |
NewerOlder