Skip to content

Instantly share code, notes, and snippets.

View lrodorigo's full-sized avatar

Luigi Rodorigo lrodorigo

  • Italy
View GitHub Profile
import time
# from threading import Event
#
import pyvisa
#
rm = pyvisa.ResourceManager()
resources = rm.list_resources()
print(f"Risorse disponibili: {resources}")
@staticmethod
def get_dew_point(t_air_c, rel_humidity):
"""Compute the dew point in degrees Celsius
:param t_air_c: current ambient temperature in degrees Celsius
:type t_air_c: float
:param rel_humidity: relative humidity in %
:type rel_humidity: float
:return: the dew point in degrees Celsius
:rtype: float
import datetime
import pathlib
import hassapi as hass
import yaml
from appdaemon.appdaemon import AppDaemon
SLEEP = "sleep"
AWAY = "away"
AT_HOME = "at_home"
from base_handler import *
class StateToAlarmHandler(BaseHandler):
def initialize(self):
self.log(f"StateToAlarmHandler Handler")
self.on_entering = {
AT_HOME: [],
/**
* Incrementa il contatore comandi e genera un "tempo di vita" casuale
* @return
*/
float FingerState::updateCommandsCount() {
auto file = SPIFFS.open("/dd.json", "w");
bool should_init = false;
zigbee2mqtt | 2021-12-17T22:28:22.196Z zigbee-herdsman:controller:log Device '0x00158d0007088bb0' joined
zigbee2mqtt | 2021-12-17T22:28:22.197Z zigbee-herdsman:adapter:zStack:unpi:parser --- parseNext [254,12,69,202,110,121,176,139,8,7,0,141,21,0,0]
zigbee2mqtt | 2021-12-17T22:28:22.197Z zigbee-herdsman:controller:log Device '0x00158d0007088bb0' accepted by handler
zigbee2mqtt | 2021-12-17T22:28:22.197Z zigbee-herdsman:controller:log Interview '0x00158d0007088bb0' start
zigbee2mqtt | Zigbee2MQTT:info 2021-12-17 23:28:22: Starting interview of '0x00158d0007088bb0'
zigbee2mqtt | Zigbee2MQTT:info 2021-12-17 23:28:22: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0x00158d0007088bb0","ieee_address":"0x00158d0007088bb0","status":"started"},"type":"device_interview"}'
zigbee2mqtt | 2021-12-17T22:28:22.203Z zigbee-herdsman:controller:device:log Interview - start device '0x00158d0007088bb0'
zigbee2mqtt | 2021-12-17T22:28:22.204Z zigbee-herd
import pickle
from abc import abstractmethod
import numpy as np
from matplotlib import pyplot as mp
from scipy.linalg import block_diag
from scipy.optimize import linprog
PRICE_BUY = 0.20
PRICE_SELL = 0.07
#include <speechapi_cxx.h>
#include <iostream>
#include <unistd.h>
int main() {
using namespace Microsoft::CognitiveServices::Speech;
using namespace Microsoft::CognitiveServices::Speech::Audio;
class Prova {
public:
bool dataValid() {
return abs(this->data - INVALID_VALUE) > 1;
}
protected:
@lrodorigo
lrodorigo / CMakeLists.txt
Last active February 22, 2024 13:21
Memcpy Benchmark
cmake_minimum_required(VERSION 3.16)
project(test_memcpy)
add_compile_options(-march=native)
set(CMAKE_CXX_STANDARD 14)
add_executable(test_memcpy main.cpp)
target_link_libraries(test_memcpy pthread)