CARVIEW |
Select Language
HTTP/2 200
date: Sun, 27 Jul 2025 23:29:49 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
etag: W/"98d5399e4bce7a067c5a529bc656c3a6"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=JbzI6jQAa7s%2Bqdni3d2HbMWVm8Q4xz7UWmJ75Ld0fRuLEb1BTT2TSD1LX7gPY0QJBRIy%2Fjvop6wBmq2EexaKJBUO%2F18FBcfVdU%2BIIXqTR8lSYMG%2FjA2cG0jRYZb0SOHTbJSVr%2FG5cPHCvFJWi%2FN%2Bwiblw6C5pfO3smGVOhZOwvlv4XnXWYlhwM2Vl450CHD41MAaOz3C2F5RtDMaj5uYvkdluAVoNfKPL5wkBIB%2BZMu0Rvld0r%2F%2BRG083COuIXv83yyoqHBODbqcxi1OPMDCKg%3D%3D--jWTtymz3tTpzIzW1--Tn8z056f4uZy6xWhOUGPAQ%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1642055373.1753658987; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 23:29:47 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Mon, 27 Jul 2026 23:29:47 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: DE84:37D5F1:1208AD5:17D616F:6886B66B
hanslovsky’s gists · GitHub
View GitHub Profile
{{ message }}
Instantly share code, notes, and snippets.
-
Capital One
- United States
- https://hanslovsky.github.io/
- @hanslovsky
hanslovsky
/ test.jpg
Last active
June 6, 2024 07:14

hanslovsky
/ recompress.kts
Last active
February 21, 2023 03:57
Recompress zarr array inplace using n5-zarr. Untested, use at own risk. Does not deal with non-existing blocks. Not multi-threaded. Run with kscript: https://github.com/kscripting/kscript
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
@file:Repository("https://maven.scijava.org/content/groups/public") | |
@file:DependsOn("org.janelia.saalfeldlab:n5-zarr:0.0.8") | |
import kotlin.math.ceil | |
import org.janelia.saalfeldlab.n5.zarr.N5ZarrWriter | |
import org.janelia.saalfeldlab.n5.zarr.ZArrayAttributes | |
import org.janelia.saalfeldlab.n5.zarr.ZarrCompressor | |
require(args.size == 2) { "Two arguments required, zarr group and dataset"} |
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
[packages] | |
numba = "~=0.55" | |
matplotlib = "~=3.5" | |
[requires] | |
python_version = "3.9" |
hanslovsky
/ ConcordeLib.kt
Last active
July 2, 2022 21:33
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
package me.hanslovsky.konkorde | |
import com.sun.jna.Library | |
import com.sun.jna.Memory | |
import com.sun.jna.Native | |
import com.sun.jna.Pointer | |
import com.sun.jna.Structure | |
interface ConcordeLib : Library { |
hanslovsky
/ extension-func-resolution.kt
Created
March 30, 2022 20:10
Exploring how kotlin extension functions are resolved
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
interface Base<T: Base<T>> | |
interface Derived<T: Derived<T>> : Base<T> | |
class Impl: Derived<Impl> | |
data class Container<T>(val t: T) | |
@JvmName("f1") | |
fun <T: Base<T>> Container<T>.someFunc(c: Container<T>) = | |
println("generic: $c") | |
@JvmName("f2") | |
fun Container<out Derived<*>>.someFunc(c: Container<out Derived<*>>) = |
hanslovsky
/ Pipfile
Created
November 2, 2021 13:19
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
[[source]] | |
url = "https://pypi.org/simple" | |
verify_ssl = true | |
name = "pypi" | |
[packages] | |
imglyb = "~=2.0" | |
jupyter = "~=1.0" | |
matplotlib = "~=3.4" | |
pillow = "~=8.4" |
hanslovsky
/ numpy-cacheloader.kts
Last active
June 9, 2021 03:01
Example use case for using Jep to generate numpy arrays in CacheLoader
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 kscript | |
// requires kscript: https://github.com/holgerbrandl/kscript | |
// install jep native libraries with | |
// python -m pip install jep | |
// When using Python interpreter in a a non-standard location, set PYTHONHOME appropriately. | |
@file:MavenRepository("scijava", "https://maven.scijava.org/content/groups/public") | |
@file:DependsOn("net.imglib2:imglib2-cache:1.0.0-beta-16") | |
@file:DependsOn("net.imglib2:imglib2:5.12.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
import java.lang.Class | |
import java.lang.Thread | |
import java.util.concurrent.Callable | |
import java.util.concurrent.ExecutorService | |
import java.util.concurrent.Executors | |
import jep.Interpreter | |
import jep.SharedInterpreter | |
class ThreadsafeInterpreter2( |
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 python3.9 | |
from functools import reduce | |
from pathlib import Path | |
from subprocess import check_output | |
import re | |
m2_repo = Path.home() / '.m2' / 'repository' |
hanslovsky
/ example-kotlin-repl.kts
Last active
March 15, 2021 02:46
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 net.imglib2.imklib.* | |
import net.imglib2.type.volatiles.* | |
import net.imglib2.type.numeric.integer.* | |
// pick any data here | |
val rawData = imklib.io.n5.openUntypedHDF5("/home/zottel/Downloads/sample_A_20160501.hdf", "volumes/raw").asUnsignedBytes() | |
val rawDataExtended = rawData.extendBorder().asInts() | |
val gradientMagnitudeData = (0..2) | |
.map { d -> LongArray(3) { if (it == d) 1 else 0 } } | |
.map { rawDataExtended[rawData + it].zeroMin - rawDataExtended[rawData - it].zeroMin } |
NewerOlder
You can’t perform that action at this time.