I hereby claim:
- I am dvdfreitag on github.
- I am dvdfreitag (https://keybase.io/dvdfreitag) on keybase.
- I have a public key ASAReb9Fd6Gx_OfrBTSMLfsvgT9_Jjem-NQM8KEtpH4jrQo
To claim this, I am signing this object:
#define _HARDWARE_TWI_ | |
#include "MCP4728.h" | |
#define TWI_BAUD 0x3B // (F_CPU / (2 * TWI_SPEED)) - 5 (truncated to byte) | |
int main(void) | |
{ | |
// Configure TWIE | |
// Clear Bit 6 corresponding to TWIE |
void init(void) | |
{ | |
// Configure internal 1V VREF, enable temperature readings | |
ADCA.REFCTRL = ADC_REFSEL_INT1V_gc | ADC_TEMPREF_bm; | |
// 12bit resolution in high current mode | |
ADCA.CTRLB = ADC_RESOLUTION_12BIT_gc | ADC_CURRLIMIT_HIGH_gc; | |
// ADC clock must be 62.5kHz, 32MHz / 512 = 62.5kHz | |
ADCA.PRESCALER = ADC_PRESCALER_DIV512_gc; | |
// 1:1 gain with internal positive reading | |
ADCA.CH0.CTRL = ADC_CH_GAIN_1X_gc | ADC_CH_INPUTMODE_INTERNAL_gc; |
// The XMEGA E-series is different from all the other chips in the line, specifically the temperature sensor. | |
// It needs to be read in signed mode with a 125kHz clock. Everything else is the same. | |
void init(void) | |
{ | |
// Configure signed conversions, internal 1V VREF, and enable temperature readings | |
ADCA.REFCTRL = ADC_CONMODE_bm | ADC_REFSEL_INT1V_gc | ADC_TEMPREF_bm; | |
// 12bit resolution in high current mode | |
ADCA.CTRLB = ADC_RESOLUTION_12BIT_gc | ADC_CURRLIMIT_HIGH_gc; | |
// ADC clock must be 125kHz, 32MHz / 256 = 125kHz |
<# This will attempt to remove all installed packages. | |
# Note: This will spit out a larage number of exception messages, this is due to unremovable apps, such as Cortana. | |
#> | |
foreach ($package in Get-AppxPackage -AllUsers) { Remove-AppxPackage $package.PackageFullName } |
# It should go without saying that this requires root. This can be run either on a host PC with | |
# the Android Debug Bridge (adb), or on the device itself in a terminal emulator (such as Termux). | |
# More information on the Zero Hosts file: http://someonewhocares.org/hosts/zero/ | |
# Uncomment if you're using adb | |
# adb shell | |
su # switch to root | |
cd /storage/emulated/0 # change directory to the internal storage | |
wget http://someonewhocares.org/hosts/hosts # download the zero hosts file |
# Chrome statistics | |
$chrome = Get-Process -ea silentlycontinue chrome | |
# Print statistics | |
Write-Host "$($chrome.count) instances, $(($chrome | Measure-Object PM -Sum).Sum / 1GB)GB" |
#include <errno.h> | |
#include <sys/stat.h> | |
#include <stdio.h> | |
#include <string.h> | |
void print_usage(void) | |
{ | |
printf("Usage: blksize DIRECTORY\n"); | |
printf("Attempts to determine the optimal block size using stat\n"); | |
} |
ITEM=0 | |
FILE=<filename> | |
BASENAME=${FILE%.*} | |
EXTENSION=${FILE##*.} | |
while read server; do | |
<scp $FILE from $server> | |
mv $FILE $BASENAME$ITEM.$EXTENSION | |
let ITEM=ITEM+1 |
I hereby claim:
To claim this, I am signing this object:
from math import * | |
steps = 8 | |
values = [[[0, 0] * steps for j in range(steps)] * 4 for i in range(4)] | |
for i in range(0, steps): | |
if i == 0: | |
x = 0 | |
else: | |
x = pi / (2.0 * (steps / i)) |