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
#!/usr/bin/env python | |
# https://discourse.julialang.org/t/accelerating-calling-a-julia-function-from-python-via-juliacall-and-ctypes/124143 | |
# mamba create -n juliacall_test python numpy ipython pyjuliacall | |
import ctypes | |
import numpy as np | |
import juliapkg | |
from juliacall import Main as jl | |
from timeit import timeit |
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
mamba create -n napari_cellpose -c conda-forge python=3.10 | |
mamba activate napari_cellpose | |
pip install "napari[all]" cellpose | |
mamba list | |
# packages in environment at /Users/kittisopikulm/miniforge3-arm64/envs/napari_cellpose: | |
# | |
# Name Version Build Channel | |
alabaster 0.7.16 pypi_0 pypi | |
annotated-types 0.6.0 pypi_0 pypi |
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
pub const __builtin_bswap16 = @import("std").zig.c_builtins.__builtin_bswap16; | |
pub const __builtin_bswap32 = @import("std").zig.c_builtins.__builtin_bswap32; | |
pub const __builtin_bswap64 = @import("std").zig.c_builtins.__builtin_bswap64; | |
pub const __builtin_signbit = @import("std").zig.c_builtins.__builtin_signbit; | |
pub const __builtin_signbitf = @import("std").zig.c_builtins.__builtin_signbitf; | |
pub const __builtin_popcount = @import("std").zig.c_builtins.__builtin_popcount; | |
pub const __builtin_ctz = @import("std").zig.c_builtins.__builtin_ctz; | |
pub const __builtin_clz = @import("std").zig.c_builtins.__builtin_clz; | |
pub const __builtin_sqrt = @import("std").zig.c_builtins.__builtin_sqrt; | |
pub const __builtin_sqrtf = @import("std").zig.c_builtins.__builtin_sqrtf; |
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
#!/bin/env julia | |
# Inspired by https://github.com/zenodo/zenodo/issues/1463 | |
module Zenodo | |
# Org/Repo, e.g. "JuliaMath/Interpolations.jl" | |
repo = "" | |
# This is a Zenodo API token that needs to be retrieved from Github webhooks | |
token = "" | |
# Setup environment |
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
<!DOCTYPE html><html lang="en"><head><meta name="viewport" content="width=device-width"><meta charset="utf-8"> | |
<meta name="pluto-insertion-spot-meta"> | |
<meta name="theme-color" media="(prefers-color-scheme: light)" content="white"><meta name="theme-color" media="(prefers-color-scheme: dark)" content="#2a2928"><meta name="color-scheme" content="light dark"><link rel="icon" type="image/png" sizes="16x16" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-16x16.347d2855.png" integrity="sha384-3qsGeVLdddzV9oIkj3PhXXQX2CZCjOD/CiyrPQOX6InOWw3HAHClrsQhPfX9uRAj" crossorigin="anonymous"><link rel="icon" type="image/png" sizes="32x32" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-32x32.8789add4.png" integrity="sha384-cOe5vSoBIgKNgkUL27p9RpsGVY0uBg9PejLccDy+fR8ZD1Iv5dF1MGHjIZAIZwm6" crossorigin="anonymous"><link rel="icon" type="image/png" sizes="96x96" href="https://cdn.jsdelivr.net/gh/fonsp/[email protected]/frontend-dist/favicon-96x96.48689391.png" integrity= |
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
import h5py | |
import hdf5plugin | |
import numcodecs | |
import numpy as np | |
# Create data | |
A = np.random.randint(1024, size=(1024, 1024, 128)) | |
print("Data as created:") | |
print(A[1, 1, :10]) |
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) |
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
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 |
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) |
NewerOlder