Skip to content

Instantly share code, notes, and snippets.

View dev-zzo's full-sized avatar

DJ Sunshine dev-zzo

View GitHub Profile
@dev-zzo
dev-zzo / ann.c
Created April 10, 2016 21:53
N-layer ANN
#include <stdio.h>
#include <malloc.h>
#include <math.h>
#include <stdlib.h>
//
// Generic N-layer neuron network code (using unipolar sigmoid activation function)
//
// Data type to operate on; typically double.
@dev-zzo
dev-zzo / github.py
Created May 11, 2016 12:41
GitHub API wrapper
"""
GitHub API v3 Wrapper
Ref: https://developer.github.com/v3/git/
"""
import base64
import json
import requests
#include <stdio.h>
#include <malloc.h>
struct _perceptron_t {
size_t weights_count;
float thfunc_param;
float weights[1];
};
typedef struct _perceptron_t perceptron_t;
@dev-zzo
dev-zzo / mp.c
Last active June 1, 2016 21:38
void matrix_multiply(const data_t *M, const data_t *x, data_t *y, size_t width, size_t height)
{
// assert(height > 0);
// assert(width >= 4);
// assert((width & 3) == 0);
IACA_START;
#if 1
if (height >= 4) {
@dev-zzo
dev-zzo / _notes.md
Last active September 26, 2016 22:25
Air band receiver

Air band receiver

The main reuiqrements are:

  • Simultaneous reception and demodulation of multiple channels
  • Coverage of the VHF aircraft band, 118.000 through 136.975 MHz (19 MHz bandwidth), channel spacing 25 kHz
  • Demodulation of voice AM, ACARS, and VDL mode 2

Design

@dev-zzo
dev-zzo / bum.py
Last active August 18, 2016 14:54
MAGNETO!!!!
import socket
import time
import sys
import http
import magneto
def run_test(target, id):
print
print "* * * * * Starting next test"
"""A simple test for presence of a WCF net.tcp handler on a port"""
import sys
import socket
import struct
def hexdump(data):
"""Pretty print a hex dump of data, similar to xxd"""
lines = []
offset = 0
@dev-zzo
dev-zzo / dsp.py
Last active June 4, 2017 19:44
Python vs DSP
"""
A set of simple DSP utilities with abysmal performance
"""
import math
import cmath
import struct
import util
#
@dev-zzo
dev-zzo / tutorial.md
Last active February 9, 2023 00:08
ChameleonMini fun

Getting it to work

The device is shipped with test firmware installed. To burn a proper firmware, you will need:

The instructions on the blog page are incorrect because Rev G hardware uses ATxmega128A4U instead of ATxmega32A4U. Why? Probably an outdated version of hardware.

@dev-zzo
dev-zzo / card1.txt
Last active October 23, 2016 13:56
DESFire traces
UID : 39 66 b0 1f
ATQA : 00 04
SAK : 20 [1]
TYPE : NXP MIFARE DESFire 4k | DESFire EV1 2k/4k/8k | Plus 2k/4k SL3 | JCOP 31/41
ATS : 13 78 80 72 02 80 31 80 66 b1 84 0c 01 6e 01 83 00 90 00 11 d8
- TL : length is 19 bytes
- T0 : TA1 is present, TB1 is present, TC1 is present, FSCI is 8 (FSC = 256)
- TA1 : different divisors are NOT supported, DR: [], DS: []
- TB1 : SFGI = 2 (SFGT = 16384/fc), FWI = 7 (FWT = 524288/fc)
- TC1 : NAD is NOT supported, CID is supported