Skip to content

Instantly share code, notes, and snippets.

View lharri73's full-sized avatar

Landon Harris lharri73

  • University of Tennessee, Knoxville
  • Knoxville, Tennessee
  • 09:07 (UTC -04:00)
View GitHub Profile
@lharri73
lharri73 / compile_numpy64.sh
Last active May 1, 2023 14:41
Install numpy using openblas ilp64. This allows for operations on large matrices.
#!/bin/bash
set -x
# Must have gfortran, gcc, g++ installed of the same version
# sudo apt install gfortran-11 gcc-11 g++-11
pip uninstall numpy
git clone git@github.com:numpy/numpy.git
cd numpy
git submodule update --init
@lharri73
lharri73 / Makefile
Last active September 2, 2021 02:21
C++ Makefile template
SRC_DIR := src
OBJ_DIR := obj
BIN_DIR := bin
EXE := $(BIN_DIR)/aliceGame
SRC := $(wildcard $(SRC_DIR)/*.cpp) $(wildcard $(SRC_DIR)/*.c)
OBJ := $(SRC:$(SRC_DIR)/%.cpp=$(OBJ_DIR)/%.o)
CPPFLAGS := -Iinclude -std=c++98
CFLAGS := -Wall
@lharri73
lharri73 / ast1.py
Created January 9, 2021 23:36
Example Function For Abstract Syntax Tree
def something():
c = 1
return 1 + 2 * c
@lharri73
lharri73 / PythonReadableTokens.sh
Last active January 9, 2021 22:51
Translated Tokens
❯ python scripts/tokenToReadable.py "1+2*c"
['eval_input',
['testlist',
['test',
['or_test',
['and_test',
['not_test',
['comparison',
['expr',
['xor_expr',
@lharri73
lharri73 / PythonLexerExample.py
Last active January 9, 2021 22:51
Python Lexer Example
>>> from pprint import pprint
>>> import parser
>>> string = parser.expr("1+2*c")
>>> pprint(parser.st2list(string))
[258,
[332,
[306,
[310,
[311,
[312,
@lharri73
lharri73 / compile_assembly.s
Created December 22, 2020 04:06
Assembled preprocess example
.file "postproc.cpp"
.text
.globl main
.type main, @function
main:
.LFB0:
.cfi_startproc
endbr64
pushq %rbp
.cfi_def_cfa_offset 16
@lharri73
lharri73 / 1_before_preprocess.cpp
Last active December 22, 2020 03:51
C++ code before the preprocessor
#define retCode 0
#define condition
int main(int argc, char** argv){
// this is the top of main
#ifdef condition
int a;
#else
int b;
#endif
@lharri73
lharri73 / cloudSettings
Last active December 29, 2019 20:34
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-12-29T20:34:44.957Z","extensionVersion":"v3.4.3"}