I hereby claim:
- I am bcr on github.
- I am blake (https://keybase.io/blake) on keybase.
- I have a public key whose fingerprint is EAF8 5937 D351 EF6D 4780 A3A8 BD9A A265 8023 E9CD
To claim this, I am signing this object:
using System.Net; | |
using System.Net.Sockets; | |
// https://stackoverflow.com/questions/1193955/how-to-query-an-ntp-server-using-c | |
static DateTime GetNetworkTime() | |
{ | |
const string ntpServer = "pool.ntp.org"; | |
var ntpData = new byte[48]; | |
ntpData[0] = 0x1B; //LeapIndicator = 0 (no warning), VersionNum = 3 (IPv4 only), Mode = 3 (Client Mode) |
#!/usr/bin/env python3 | |
pin = input("Please enter a five digit numeric PIN > ") | |
integer_pin = int(pin) | |
print(f"{integer_pin:021_b}") |
class StatusBar: | |
def __init__(self, max_value, max_width): | |
self.max_value = max_value | |
self.max_width = max_width | |
self.update(0) | |
def update(self, new_value): | |
number_markers = new_value * (self.max_width - 2) // self.max_value | |
marker_string = "#" * number_markers | |
print("\r[" + marker_string + (" " * (self.max_width - len(marker_string) - 2)) + "]", end='') |
let current_x = 0 | |
let turning_right = 0 | |
let turning_left = 0 | |
let threshold_changed = 0 | |
let threshold_increment = 0 | |
let turning_threshold = 0 | |
input.buttonA.onEvent(ButtonEvent.Click, function () { | |
turning_threshold += threshold_increment | |
turning_threshold = Math.constrain(turning_threshold, 0, 1023) | |
threshold_changed = 1 |
import board | |
import busio | |
import digitalio | |
import ili9341 | |
spi = busio.SPI(clock=board.SCK,MOSI=board.MOSI,MISO=board.MISO) | |
spi.configure(baudrate=23000000) | |
cs = digitalio.DigitalInOut(board.D9) | |
dc = digitalio.DigitalInOut(board.D10) | |
display = ili9341.ILI9341(spi, cs=cs, dc=dc) | |
display.fill(ili9341.color565(255, 0, 0)) |
#https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_gui/py_image_display/py_image_display.html#display-image | |
#http://docs.opencv.org/3.0-beta/modules/imgproc/doc/miscellaneous_transformations.html | |
#http://docs.opencv.org/2.4/doc/tutorials/imgproc/threshold/threshold.html | |
import cv2 | |
# Original image for annotation | |
img = cv2.imread('CSH-drink-4k.jpg') | |
# Grayscale image |
I hereby claim:
To claim this, I am signing this object:
private static Stream GetFileOrUrlStream(string filenameOrUrl) | |
{ | |
// This function should accept the following formats: | |
// | |
// http://example.com/downloads/mybitstream.bit | |
// mybitstream.bin | |
// ..\..\mybitstream.bin | |
// C:\dir\mybitstream.bin | |
// If there is no colon, then it must be a file reference. Make it |
// mcs -reference:nunit.framework ReadableRegex.cs && nunit-console ReadableRegex.exe | |
using NUnit.Framework; | |
using System.Collections.Specialized; | |
using System.Text.RegularExpressions; | |
[TestFixture] | |
public class ReadableRegex | |
{ |
#include <iostream> | |
class A | |
{ | |
public: | |
A() : m_member(42) | |
{ | |
std::cout << "A::A" << std::endl; | |
} |