This file contains 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
\documentclass{article} | |
\usepackage[utf8]{inputenc} | |
\usepackage{graphicx,url} | |
\title{Three black boxes} | |
\author{alek.frohlich } | |
\date{November 2019} | |
\begin{document} |
This file contains 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.util.List; | |
import java.util.ArrayList; | |
import java.math.BigDecimal; | |
import static java.lang.Character.*; | |
// non-reentrant lexer | |
public class Lexer { | |
public static enum TokenType { | |
BEGIN, |
This file contains 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 static java.lang.Math.*; | |
public class Geo { | |
private static final double a = 6378137.0; // WGS-84 semi-major axis | |
private static final double e2 = 6.6943799901377997e-3; // WGS-84 first eccentricity squared | |
/** | |
* Convert Lat, Lon, Altitude to Earth-Centered-Earth-Fixed (ECEF). | |
* Input is a three element array containing lat, lon (deg) and alt (m). |
This file contains 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
#!/bin/bash | |
GCC=gcc-7.3.0 | |
BINUTILS=binutils-2.30 | |
echo installing gcc dependencies | |
sudo apt install -y bison | |
sudo apt install -y flex | |
sudo apt install -y libgmp3-dev | |
sudo apt install -y libmpc-dev |
This file contains 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
//file: optm_vec.cc | |
#include <iostream> | |
#include <vector> | |
struct Vertex { | |
float x, y, z; | |
Vertex(float x, float y, float z) | |
: x(x), y(y), z(z) | |
{ |
This file contains 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
# Application. | |
APP_NAME := main | |
# Directories. | |
ROOT := $(abspath $(dir $(filter %Makedefs, $(MAKEFILE_LIST)))) | |
SRC := $(ROOT)/src | |
INCLUDE := $(ROOT)/include | |
BUILD := $(ROOT)/build | |
# C++ Compiler and Flags. |
This file contains 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
"""Greatest common divisor for gaussian integers.""" | |
def floor(x): | |
return x // 1 | |
def mult_gi(x, y): | |
a, b = x | |
c, d = y | |
return (a*c - b*d, a*d + b*c) |
This file contains 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
# Code for plotting predictive value and precision-recall curves along with their associated confidence bands. | |
import numpy as np | |
import pandas as pd | |
import matplotlib as mpl | |
import matplotlib.pyplot as plt | |
from xgboost import XGBClassifier | |
from sklearn.metrics import confusion_matrix | |
def estimator_bias(m: int, k: int) -> float: | |
'''Compute bias term appearing in Lemma X.''' |