Skip to content

Instantly share code, notes, and snippets.

@esromneb
esromneb / file.c
Created September 14, 2022 10:34
ffo_lut as a function not a LUT
// https://stackoverflow.com/questions/25585066/removing-slow-int64-division-from-fixed-point-atan2-approximation
uint8_t ffo_lut(const int i) {
if(i <= 1) {
return i;
}
if( i <= 3) {
return 2;
}
if( i < 8) {
return 3;
@esromneb
esromneb / Dockerfile
Created August 27, 2022 23:39
Dockerfile to install the travis-cli util
FROM ubuntu:focal-20220531
MAINTAINER ben
ENV DEBIAN_FRONTEND noninteractive
ENV DISPLAY :0
ENV LC_ALL=C
RUN apt-get update && \
apt-get install -y \
@esromneb
esromneb / grc-Dockerfile
Created February 13, 2022 03:28
Dockerfile for gnuradio on ubuntu
FROM ubuntu:focal-20210827
MAINTAINER esromneb
ENV DEBIAN_FRONTEND noninteractive
ENV DISPLAY :0
ENV LC_ALL=C
RUN apt-get update && \
apt-get install -y \
lattice/makefile under linux
verilator project and folder structure
kernel / send signals to specific threads + export issue
signal to userspace with fifo
simple vma kernel module
git for companies under 10 people
how to work on powerpoint with an older person (josef)
circleci for vivado
jenkins for lattice
//Recursive ray tracer
void RayEngine::trace(
const Ray& r,
const int depthIn,
const double effect,
Vec3 &color,
const bool click,
bool &bSphere, // fixme should be const, needs to be copied below
Vec3 &objectNum,
@esromneb
esromneb / ld_standard_no_vmem
Created January 7, 2020 05:24
partial ld file without vmem
START_LOC = 0x0000;
IMEM_LEN = 0x6400;
DMEM_LEN = 0x1800;
BOOT_LEN = 0x03f8;
PASS_FAIL_LEN = 0x0008;
MEMORY {
imem (R) : ORIGIN = START_LOC , LENGTH = IMEM_LEN
dmem (RW) : ORIGIN = IMEM_LEN , LENGTH = DMEM_LEN
bootloader (RW): ORIGIN = IMEM_LEN + DMEM_LEN , LENGTH = BOOT_LEN
dashtie
shannon fifo
libevent pipe (under node)
napi helper
static hash
typed arrays in javascript( see https://www.npmjs.com/package/operator-overloading https://github.com/charlieroberts/jsdsp )
@esromneb
esromneb / slope.py
Created October 22, 2018 04:03
simple way to find the slope from two points
if 1:
x1 = -659
y1 = -10000.0
x2 = 45
y2 = -40000.0
m = (y2-y1)/(x2-x1)
print "slope ", m
b = y2-(m*x2)
@esromneb
esromneb / haikulists.py
Created April 24, 2018 02:58
required file for homework
haiku1 = ['A', 'fat', 'bee', 'stings', 'me', 'It', 'hurts', 'very', 'badly', 'but', 'I', 'do', 'not', 'cry', 'though']
list1 = [9, 11, 6, 14, 1, 10, 12, 0, 3, 4, 8, 5, 7, 13, 2]
haiku2 = [(8, 'feathers'), (2, 'evening'), (5, 'together'), (1, 'peaceful'), (6, 'with'), (0, 'A'), (4, 'singing'), (7, 'pretty'), (3, 'Sparrows')]
haiku3 = 'High and smooth it flew. Into the sky, soaring straight. Flying planes with you.'
@esromneb
esromneb / lossysocket.py
Last active December 1, 2015 03:17
lossy socket for python allows you to tune how many packets are dropped
# This class wraps socket, and will maybe send your packet
# tune tx_drop_rate and rx_drop_rate, 0 means transmit everything, 1 means drop everything
# This class works best for UDP, as it doesn't allow you to drop TCP control messages
import socket
import random
class LossySocket(object):
def __init__(self, *p):
self._sock = socket.socket(*p)