Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
//rapidSquareROITool.ijm | |
//Creates six tools that allows you to quickly add either 64x64 or 32x32 square ROIs | |
// | |
// Mark Kittisopikul, September 11th, 2018 | |
// Goldman Lab | |
// Northwestern University | |
// | |
// Tools: | |
// 1. Create a 64x64 px square ROI at the location clicked and add to ROI manager | |
// 2. Create a 32x32 px square ROI at the location clicked and add to ROI manager |
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
module LargeSparseArrays | |
import Base: size, getindex, setindex! | |
export LargeSparseArray | |
struct LargeSparseArray{T,N} <: AbstractArray{T,N} | |
d::Dict{CartesianIndex{N},T} | |
dims::NTuple{N,AbstractUnitRange{Int}} | |
function LargeSparseArray{T}(dims::Int...) where T | |
dim_ranges = Base.OneTo.(dims) |
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
julia> a = 10 | |
10 | |
julia> @info "Macros are awesome" a | |
┌ Info: Macros are awesome | |
└ a = 10 | |
julia> @debug "How awesome?" a | |
julia> using Logging; global_logger( ConsoleLogger(stderr, Logging.Debug) ); |
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
# Via Fredrik Ekre | |
# https://julialang.zulipchat.com/#narrow/stream/274208-helpdesk-.28published.29/topic/String.20macro.20for.20rationals.3F | |
function rational_from_string(s) | |
x, y = split(s, '.') | |
a = parse(Int, x) | |
b = parse(Int, y) | |
return a + b // 10^length(y) | |
end | |
macro rational_str(s) |
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
module WinApi | |
const MAX_PATH = 260 | |
const FILE_ATTRIBUTE_DIRECTORY = 0x10 | |
const INVALID_HANDLE_VALUE = -1 | |
struct FileTime | |
dwLowDateTime::UInt32 | |
dwHighDateTime::UInt32 | |
FileTime() = new(0,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
module Downsampling | |
using TiledIteration, BenchmarkTools | |
I = rand(UInt16, 10000, 10000); | |
D = zeros(size(I).÷2...); | |
function avgNxN!(I, D, ::Val{N}) where N | |
for c = 1:size(D,2), bc = 1-N:0, r = 1:size(D,1), br = 1-N:0 | |
@inbounds D[r,c] += I[r*N+br, c*N+bc]/N/N | |
end |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# Implementing cell 6 of https://github.com/barbagroup/CFDPython/blob/master/lessons/06_Array_Operations_with_NumPy.ipynb | |
# Inspried during stream of https://www.twitch.tv/brainrpg | |
function main() | |
nx = 81 | |
ny = 81 | |
nt = 100 | |
c = 1 | |
dx = 2 / (nx - 1) | |
dy = 2 / (ny - 1) |