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 <complex.h> | |
#include <stdint.h> | |
#include <assert.h> | |
#include <stddef.h> | |
#include <stdlib.h> | |
#include <limits.h> | |
#include <tgmath.h> | |
#include <stdio.h> | |
#include <stdbool.h> |
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
// | |
// Created by alec on 11/25/24. | |
// | |
#include <stddef.h> | |
#include <assert.h> | |
#include <limits.h> | |
#include <string.h> | |
#include <math.h> | |
#include <stdlib.h> |
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
`timescale 1ns / 1ps | |
module reservation_station | |
#(parameter int RS_ID, int DATA_WIDTH) | |
( | |
input logic clk, | |
input logic rst, | |
register_file register_file, | |
issue_bus issue, |
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
#!/usr/bin/java --source 21 | |
import java.io.*; | |
import java.net.*; | |
import java.nio.file.*; | |
import com.sun.net.httpserver.*; | |
public class FileUploadServer implements HttpHandler { | |
public static void main(String[] args) throws IOException { |
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
[bits 16] | |
load: | |
mov ah, 0x02 ; read disk sectors | |
mov al, 0x01 ; 1 sector (probably should statically calculate this somehow, or use linker script) | |
mov ch, 0x00 ; track | |
mov cl, 0x02 ; sector | |
mov dh, 0x00; head | |
; mov dl, 0x00 | |
mov bx, 0 |
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
package ax.xz.census.proxy; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import java.io.Closeable; | |
import java.io.IOException; | |
import java.net.InetAddress; | |
import java.net.InetSocketAddress; | |
import java.net.SocketAddress; |
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 java.io.IOException; | |
import java.net.InetAddress; | |
import java.net.InetSocketAddress; | |
import java.net.SocketAddress; | |
import java.nio.ByteBuffer; | |
import java.nio.channels.SelectionKey; | |
import java.nio.channels.Selector; | |
import java.nio.channels.ServerSocketChannel; | |
import java.nio.channels.SocketChannel; | |
import java.nio.charset.StandardCharsets; |
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 numpy as np | |
import scipy as sp | |
def tcp_siggen(samp_rate, freq, amp, noise_var, N): | |
t = np.arange(start=0, stop=N / samp_rate, step=1 / samp_rate, dtype=np.complex64) | |
# Create the phase of the sin wave at each samples | |
phase = 2 * np.pi * freq * t | |
# create a complex sin wave | |
carrier = amp * np.exp(phase * 1j) | |
# generate complex white(ish) gaussian noise with the right variance |
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 numpy as np | |
import scipy as sp | |
def finite_difference_coefficients(k, xbar, x): | |
""" | |
based on the maths in Finite Difference Methods for Ordinary and Partial Differential Equations | |
:param k: the order of the derivative | |
:param xbar: the point at which the derivative is to be evaluated | |
:param x: the set of points at which the function is known | |
:return: the coefficients of the finite difference approximation |
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
@nb.njit | |
def z(theta): # funny bromwich contour | |
return ( | |
.1446 + 3.0232 * theta ** 2 / (theta ** 2 - 3.0767 * np.pi ** 2) | |
+ 0.2339 * 1j * theta | |
) | |
@nb.njit | |
def z_dash(theta, h=.001): |
NewerOlder