Skip to content

Instantly share code, notes, and snippets.

\documentclass[border=6pt]{standalone}
\usepackage{garamondx}
\usepackage{pgfplots}
\usepackage{tikz}
\usepgfplotslibrary{units}
\usepackage{xcolor}
\definecolor{redtea}{rgb}{0.6823529412,0.2792156863,0.2666666667}
\definecolor{darkolivegreen}{rgb}{0.33, 0.42, 0.18}
\definecolor{darkelectricblue}{rgb}{0.33, 0.41, 0.47}
\usepackage{siunitx}
@jakewilliami
jakewilliami / README.md
Last active May 27, 2020 05:25 — forked from albertbori/Installation.md
Automatically disable Wifi when an Ethernet connection (cable) is plugged in on a Mac

Overview

This is a bash script that will automatically turn your wifi off if you connect your computer to an ethernet connection and turn wifi back on when you unplug your ethernet cable/adapter. If you decide to turn wifi on for whatever reason, it will remember that choice. This was improvised from this mac hint to work with Yosemite, and without hard-coding the adapter names. It's supposed to support growl, but I didn't check that part. I did, however, add OSX notification center support. Feel free to fork and fix any issues you encounter.

Most the credit for these changes go to Dave Holland.

Minimal changes to the script itself and addition of an install script by Jake Ireland, with suggestions from the community and with help from ShellCheck.

Requirements

function rref!(A::Matrix{Int},
n::Integer;
colswap::Bool=false,
verbose::Bool=false)::Matrix{Int}
nrows, ncols = size(A)
i = j = 1
while i ≤ nrows && j ≤ ncols
# Ignore zero rows.
@jakewilliami
jakewilliami / mwe-fd-memory-efficient.jl
Created October 25, 2020 12:33
Memory efficient MWE for algorithm involving image IO (TIME INEFFICIENT)
using Images
using BenchmarkTools
import Base: size, getindex, LinearIndices
using Images: Images, coords_spatial
struct IntegralArray{T, N, A} <: AbstractArray{T, N}
data::A
end
@jakewilliami
jakewilliami / mwe-fd-time-efficient.jl
Created October 25, 2020 12:33
Time efficient MWE for algorithm involving image IO (MEMORY INEFFICIENT)
using Images
using BenchmarkTools
import Base: size, getindex, LinearIndices
using Images: Images, coords_spatial
struct IntegralArray{T, N, A} <: AbstractArray{T, N}
data::A
end
This file has been truncated, but you can view the full file.
julia> Profile.print()
Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
╎4505 @Base/client.jl:506; _start()
╎ 4505 @Base/client.jl:313; exec_options(::Base.JLOptions)
╎ 4505 @Base/client.jl:383; run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool)
╎ 4505 @Base/essentials.jl:709; invokelatest
╎ 4505 @Base/essentials.jl:710; #invokelatest#1
╎ 4505 @Base/client.jl:399; (::Base.var"#807#809"{Bool,Bool,Bool,Bool})(::Module)
╎ ╎ 4505 ...e/julia/stdlib/v1.5/REPL/src/REPL.jl:288; run_repl(::REPL.AbstractREPL, ::Any)
This file has been truncated, but you can view the full file.
julia> Profile.print()
Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
1╎1 @Base/char.jl:124; UInt32(::Char)
╎18097 @Base/client.jl:506; _start()
╎ 18097 @Base/client.jl:313; exec_options(::Base.JLOptions)
╎ 18097 @Base/client.jl:383; run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool)
╎ 18097 @Base/essentials.jl:709; invokelatest
╎ 18097 @Base/essentials.jl:710; #invokelatest#1
╎ 18097 @Base/client.jl:399; (::Base.var"#807#809"{Bool,Bool,Bool,Bool})(::Module)
This file has been truncated, but you can view the full file.
julia> Profile.print()
Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
2╎2 @Base/char.jl:124; UInt32(::Char)
╎6575 @Base/client.jl:506; _start()
╎ 6575 @Base/client.jl:313; exec_options(::Base.JLOptions)
╎ 6575 @Base/client.jl:383; run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool)
╎ 6575 @Base/essentials.jl:709; invokelatest
╎ 6575 @Base/essentials.jl:710; #invokelatest#1
╎ 6575 @Base/client.jl:399; (::Base.var"#807#809"{Bool,Bool,Bool,Bool})(::Module)
This file has been truncated, but you can view the full file.
julia> Profile.print()
Overhead ╎ [+additional indent] Count File:Line; Function
=========================================================
1╎1 @Base/char.jl:124; UInt32(::Char)
╎6094 @Base/client.jl:506; _start()
╎ 6094 @Base/client.jl:313; exec_options(::Base.JLOptions)
╎ 6094 @Base/client.jl:383; run_main_repl(::Bool, ::Bool, ::Bool, ::Bool, ::Bool)
╎ 6094 @Base/essentials.jl:709; invokelatest
╎ 6094 @Base/essentials.jl:710; #invokelatest#1
╎ 6094 @Base/client.jl:399; (::Base.var"#807#809"{Bool,Bool,Bool,Bool})(::Module)
@jakewilliami
jakewilliami / glm_submission.jl
Last active October 27, 2020 00:08
GLM submission for the Humans of Julia
#=
Motivation: I want to model psychometric data to some kind of sigmoid function, but the nature
of psychometric data is that it is forced choice. This means that the output is binary.
GLM doesn't support forced choice models yet——however, with a little bit of work and some
type piracy, the results are attractive.
=#
using GLM, DataFrames, CSV, FreqTables, StatsPlots, Distributions, Statistics
const Dist = Distributions
# imports for overloading