This file contains 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
#include <bc_common.h> | |
#include <bc_usb_cdc.h> | |
#include <bc_button.h> | |
static bc_button_t button; | |
void button_event_handler(bc_button_t *self, bc_button_event_t event, void *event_param) | |
{ | |
if (event == BC_BUTTON_EVENT_PRESS) | |
{ |
This file contains 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
#include <bc_common.h> | |
#include <bc_scheduler.h> | |
#include <bc_usb_cdc.h> | |
void application_on_tick(void *event_param) | |
{ | |
// Send 'Hello world!' string to USB | |
char buffer[] = "Hello world!\r\n"; | |
bc_usb_cdc_write(buffer, strlen(buffer)); |
This file contains 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 Foundation | |
func asn1_int_to_bytes(length: UInt) -> Data { | |
var l = length | |
var d = Data() | |
while (l > 0) { | |
let b: UInt8 = UInt8(l & 0xFF) | |
d.append(contentsOf: [b]) | |
l = length >> 8 | |
} |
This file contains 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
// | |
// mini_asn1_der.swift | |
// miniasn1 | |
// | |
// Created by Ales Teska on 18.2.19. | |
// Copyright © 2019 TeskaLabs. All rights reserved. | |
// | |
import Foundation |
This file contains 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
// | |
// mini_asn1_der.swift | |
// miniasn1 | |
// | |
// Created by Ales Teska on 18.2.19. | |
// Copyright © 2019 TeskaLabs. All rights reserved. | |
// | |
import Foundation |
This file contains 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 unittest | |
import bspump | |
import bspump.common | |
import bspump.trigger | |
### | |
class MyProcessor(bspump.Processor): |
This file contains 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 bspump import BSPumpApplication, Pipeline | |
import bspump.trigger | |
import bspump.random | |
import bspump.common | |
import bspump.analyzer | |
import time | |
import numpy as np | |
import random | |
import logging |
This file contains 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 bspump.trigger | |
import bspump.random | |
import bspump.common | |
import bspump.analyzer | |
import time | |
import random | |
class MyApplication(bspump.BSPumpApplication): | |
def __init__(self): |
This file contains 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 sys | |
from llvmlite import ir | |
import llvmlite.binding as llvm | |
import ctypes | |
# All these initializations are required for code generation! | |
llvm.initialize() | |
llvm.initialize_native_target() | |
llvm.initialize_native_asmprinter() # yes, even this one |
This file contains 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 run(): | |
proc = await asyncio.create_subprocess_exec( | |
'/bin/ls', '/etc', '/not-exists', | |
stdout=asyncio.subprocess.PIPE, | |
stderr=asyncio.subprocess.PIPE | |
) | |
# Prepare set of asynchronous readline() tasks for `stdout` and `stderr` streams |
OlderNewer