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
# NAD T754 # | |
PWR_ON = E13EA45B | |
PWR_OFF = E13E13EC | |
VOL_UP = E13E11EE | |
VOL_DOWN = E13E31CE | |
SET_INPUT_DVD = E13E43BC | |
SET_INPUT_SAT = E13E03FC | |
SET_INPUT_VCR = E13E837C | |
SET_INPUT_VID4 = E13E0CF3 |
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
#Reference: | |
#https://help.ubuntu.com/community/AppleKeyboard#Correcting_swapped_keys_and_wrong_keymaps_for_international_.28non-US.29_keyboards | |
echo options hid_apple iso_layout=0 | sudo tee -a /etc/modprobe.d/hid_apple.conf | |
sudo update-initramfs -u -k all | |
sudo reboot |
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
CC=gcc | |
CCFLAGS=-Wall | |
LDFLAGS= | |
SOURCES=$(wildcard *.c) | |
OBJECTS=$(SOURCES:.c=.o) | |
TARGET=des | |
all: $(TARGET) | |
$(TARGET): $(OBJECTS) |
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
function factorial(op) { | |
// Lanczos Approximation of the Gamma Function | |
// As described in Numerical Recipes in C (2nd ed. Cambridge University Press, 1992) | |
var z = op + 1; | |
var p = [1.000000000190015, 76.18009172947146, -86.50532032941677, 24.01409824083091, -1.231739572450155, 1.208650973866179E-3, -5.395239384953E-6]; | |
var d1 = Math.sqrt(2 * Math.PI) / z; | |
var d2 = p[0]; | |
for (var i = 1; i <= 6; ++i) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 logging | |
import time | |
from logging.handlers import TimedRotatingFileHandler | |
#---------------------------------------------------------------------- | |
def create_timed_rotating_log(path): | |
"""""" | |
logger = logging.getLogger("Rotating Log") | |
logger.setLevel(logging.INFO) |
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
#include <Sodaq_RN2483.h> | |
#include <Sodaq_wdt.h> | |
#include <StringLiterals.h> | |
#include <Switchable_Device.h> | |
#include <Utils.h> | |
/* Docs | |
Commands reference RN2483 - http://ww1.microchip.com/downloads/en/DeviceDoc/40001784B.pdf | |
RN2483 in general - http://www.microchip.com/wwwproducts/en/RN2483 | |
*/ |
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 xlsxwriter | |
import sys | |
#### Kvicksundspokalen parser | |
#Parse file | |
#Extract fields | |
#Sort by date? | |
#Format xml output | |
#Add to sheet | |
#Create an new Excel file and add a worksheet. |
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 twosComplement(val, nbits): | |
n = (2**nbits) | |
if(val > (n/2-1)): | |
return val-n | |
else: | |
return val | |
print twosComplement(64123,16) |
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 socket | |
import struct | |
import time | |
client = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
data = '\x1b' + 47 * '\0' | |
client.sendto(data, ("0.se.pool.ntp.org",123)) | |
data, address = client.recvfrom( 1024 ) | |
if data: |