Skip to content

Instantly share code, notes, and snippets.

View tbeason's full-sized avatar
📌
Stay sharp

Tyler Beason tbeason

📌
Stay sharp
View GitHub Profile
@tbeason
tbeason / duckdb-oom.md
Created May 30, 2023 15:10
oom error stack

See issue filed here duckdb/duckdb#7665

[beasont@tc-hm003 algos]$ duckdb testing.db
v0.8.0 e8e4cea
Enter ".help" for usage hints.
D .timer onET th
reads TO 8;
D .maxrows 100
D SET threads TO 8;
Run Time (s): real 0.002 user 0.000990 sys 0.005505
@tbeason
tbeason / Makefile
Created August 13, 2021 22:33 — forked from kristopherjohnson/Makefile
Makefile that uses Pandoc to generate HTML, PDF, DOCX, etc. from Markdown source files
# Makefile
#
# Converts Markdown to other formats (HTML, PDF, DOCX, RTF, ODT, EPUB) using Pandoc
# <http://johnmacfarlane.net/pandoc/>
#
# Run "make" (or "make all") to convert to all other formats
#
# Run "make clean" to delete converted files
# Convert all files in this directory that have a .md suffix
@tbeason
tbeason / mirror_remote_directory_to_local_directory
Created April 9, 2020 05:30 — forked from pixeline/mirror_remote_directory_to_local_directory
Bash script using lftp to mirror remote directory to local directory, thus keeping the local directory synchronized with the remote one.
#!/bin/sh
# @author: Alexandre Plennevaux
# @description: MIRROR DISTANT FOLDER TO LOCAL FOLDER VIA FTP
#
# FTP LOGIN
HOST='sftp://ftp.domain.com'
USER='ftpusername'
PASSWORD='ftppassword'
# DISTANT DIRECTORY
@tbeason
tbeason / newjuliaversion.txt
Created January 22, 2019 14:55
I always forget how to update Julia
# first save new julia version to Downloads folder
# now unpack to proper spot
# I store my julia versions in /usr/local/julia
cd Downloads
sudo tar xvzf julia-1.1.0-linux-x86_64.tar.gz -C /usr/local/julia
# remove the old link, make the new one
sudo rm /usr/local/bin/julia
sudo ln -s /usr/local/julia/julia-1.1.0/bin/julia /usr/local/bin/julia
@tbeason
tbeason / cgm_egm.jl
Created March 9, 2018 22:35
EGM version of the CGM (2005) model in Julia
# This code is a simple Endogenous Grid Method (EGM) port in Julia of the CGM code.
# I tried to make it as similar as possible.
# No optimizations for speed are introduced in this version (but it is still quite fast compared to VFI).
# In particular, this is a terrible way to write Julia code (should introduce function barriers and proper scoping).
# Tyler Beason 2018
using Interpolations
# utility functions and related
@tbeason
tbeason / fulltabular.jl
Created January 22, 2018 17:02
a more-featured LaTeX table printing function
using LatexPrint
function fulltabular(A::AbstractArray{T,2}; placement::String="htb",rounding::Int=0, colnames::Vector{String}=Vector{String}(), frontmatter::String="" , caption::String="", title::String="", label::String="", strfirstcol::Bool=false,arraystretch=1) where {T<:Any}
(r,c) = size(A)
println("\\begin{table}[", placement, "] \\centering")
println("\\renewcommand{\\arraystretch}{",arraystretch ,"}")
println(frontmatter)
if !isempty(title)
println("\\caption{", title, "}")
using BenchmarkTools
struct MyType
x::Vector{Float64}
y::Vector{Float64}
_n::UInt16
delta::Vector{Float64}
function (::Type{MyType})(x::Vector{Float64}, y::Vector{Float64})