Skip to content

Instantly share code, notes, and snippets.

View ivanjimenez's full-sized avatar

Iván Jiménez ivanjimenez

View GitHub Profile
        public enum RotSeq { zyx, zyz, zxy, zxz, yxz, yxy, yzx, yzy, xyz, xyx, xzy, xzx };
        private static void twoaxisrot(double r11, double r12, double r21, double r31, double r32, ref double[] res)
        {
            res[0] = Math.Atan2(r11, r12);
            res[1] = Math.Acos(r21);
            res[2] = Math.Atan2(r31, r32);
        }
        private static void threeaxisrot(double r11, double r12, double r21, double r31, double r32, ref double[] res)
        {
Device handler 1: Right insole
Device handler 0: Left Insole
Device handler: 1 r-heel: 4090 l-heel 4087 arch 4088
Device handler: 0 r-heel: 4095 l-heel 4095 arch 4095
Device handler: 1 r-heel: 4095 l-heel 4087 arch 4087
Device handler: 0 r-heel: 4095 l-heel 4095 arch 4095
Device handler: 1 r-heel: 4093 l-heel 4092 arch 4090
Device handler: 0 r-heel: 4095 l-heel 4095 arch 4095
Device handler: 1 r-heel: 4093 l-heel 4094 arch 4091
Device handler 1: Right Insole
Device handler 0: Left Insole
Device handler: 0 r-heel: 0 l-heel 0 arch 0
Device handler: 1 r-heel: 5 l-heel 5 arch 9
Device handler: 0 r-heel: 0 l-heel 0 arch 0
Device handler: 1 r-heel: 9 l-heel 4 arch 10
Device handler: 0 r-heel: 0 l-heel 0 arch 0
Device handler: 1 r-heel: 4 l-heel 8 arch 5
Device handler: 0 r-heel: 0 l-heel 0 arch 0
Device handler: 0 r-heel: 9 l-heel 8 arch 10
Device handler: 1 r-heel: 0 l-heel 0 arch 0
Device handler: 0 r-heel: 7 l-heel 2 arch 9
Device handler: 1 r-heel: 0 l-heel 0 arch 0
Device handler: 0 r-heel: 8 l-heel 1 arch 12
Device handler: 1 r-heel: 0 l-heel 0 arch 0
Device handler: 0 r-heel: 3 l-heel 9 arch 6
Device handler: 1 r-heel: 0 l-heel 0 arch 0
Device handler: 0 r-heel: 6 l-heel 9 arch 7
Device handler: 1 r-heel: 0 l-heel 0 arch 0
@ivanjimenez
ivanjimenez / bleak_multiple_device.py
Last active February 15, 2022 11:49
Bleak Multiple Device
import asyncio
from bleak import BleakClient
from functools import partial
CHAR_UUID = "00000080-0001-11e1-ac36-0002a5d5c51b".format(0xFFE1)
def callback(client: BleakClient, sender: int, data: bytearray):
hex_string = data.hex()
print(f"{client.address}", "".join([hex_string[x:x + 2] for x in range(0, len(hex_string), 2)]))
import java.util.Scanner;
public class CifradoCesar2 {
static String abecedariomin = "abcdefghijklmnopqrstuvwxyz ";
static String abecedariomax = "ABCDEFGHIJKLMNOPQRSTUVWXYZ ";
static int posicion;
public static String obtenerTexto(String texto) {
Scanner entrada = new Scanner(System.in);
>>> import netifaces
>>> netifaces.interfaces()
['lo', 'enp5s0', 'wlp4s0', 'docker0', 'br-88dd0cf36a87', 'vmnet8', 'vmnet1']
>>> netifaces.ifaddresses('wlp4s0')
{17: [{'broadcast': 'ff:ff:ff:ff:ff:ff', 'addr': '6c:71:d9:bf:7f:87'}], 2: [{'broadcast': '192.168.0.255', 'netmask': '255.255.255.0', 'addr': '192.168.0.13'}, {'broadcast': '192.168.2.255', 'netmask': '255.255.255.0', 'addr': '192.168.2.101'}], 10: [{'netmask': 'ffff:ffff:ffff:ffff::', 'addr': 'fe80::731d:a76d:4533:5abe%wlp4s0'}]}
>>> addrs = netifaces.ifaddresses('wlp4s0')
>>> addrs
{17: [{'broadcast': 'ff:ff:ff:ff:ff:ff', 'addr': '6c:71:d9:bf:7f:87'}], 2: [{'broadcast': '192.168.0.255', 'netmask': '255.255.255.0', 'addr': '192.168.0.13'}, {'broadcast': '192.168.2.255', 'netmask': '255.255.255.0', 'addr': '192.168.2.101'}], 10: [{'netmask': 'ffff:ffff:ffff:ffff::', 'addr': 'fe80::731d:a76d:4533:5abe%wlp4s0'}]}
>>> addrs[netifaces.AF_INET]
[{'broadcast': '192.168.0.255', 'netmask': '255.255.255.0', 'addr': '192.168.0.13'}, {'broadcast': '192.168.2.25