# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=102

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 103

---

## [Enzyme strange output for hessian](https://discourse.julialang.org/t/enzyme-strange-output-for-hessian/123899)

<div class="topic-metadata">

**Author:** [@c\_sell](https://discourse.julialang.org/u/c_sell)\
**Replies:** 0\
**Last updated:** [December 16, 2024, 7:31pm UTC](https://discourse.julialang.org/t/enzyme-strange-output-for-hessian/123899 "2024-12-16T19:31:25Z")

</div>

Hello, I get for the following small example the strage output: freeing without malloc %53 = call noalias nonnull dereferenceable(32) dereferenceable\_or\_null(32) i8\* @malloc(i64 noundef 32) #20, !enzyme\_cache\_alloc !5…

---

## [How to speed up re-running tests?](https://discourse.julialang.org/t/how-to-speed-up-re-running-tests/123894)

<div class="topic-metadata">

**Author:** [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)\
**Replies:** 1\
**Last updated:** [December 16, 2024, 5:26pm UTC](https://discourse.julialang.org/t/how-to-speed-up-re-running-tests/123894 "2024-12-16T17:26:39Z")

</div>

Is there a way to trigger precompile for the test without running the test? Something I could put in setup.jl script so that tests are ready for quick running in test files?

---

## [Why using \`\`\] test package\`\` recompiles the package again?](https://discourse.julialang.org/t/why-using-test-package-recompiles-the-package-again/96393)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 11\
**Last updated:** [March 21, 2023, 8:30pm UTC](https://discourse.julialang.org/t/why-using-test-package-recompiles-the-package-again/96393 "2023-03-21T20:30:27Z")

</div>

I’ve had this experience many times but now just installed a package from scratch. All worked as expected (maybe except the very long time), packaged installed and and compiled. Next I run the tests and … recompiled the …

---

## [Benchmark AutoDiff on simple 1D diffusion operator](https://discourse.julialang.org/t/benchmark-autodiff-on-simple-1d-diffusion-operator/123885)

<div class="topic-metadata">

**Author:** [@yolhan\_mannes](https://discourse.julialang.org/u/yolhan_mannes)\
**Replies:** 3\
**Last updated:** [December 16, 2024, 5:24pm UTC](https://discourse.julialang.org/t/benchmark-autodiff-on-simple-1d-diffusion-operator/123885 "2024-12-16T17:24:21Z")

</div>

Just sharing a small benchmark in case someone finds it useful in the future—it’s about evaluating the Jacobian of a simple diffusion operator. uin() = 0.0 uout() = 0.0 function Diffusion(u) du = zero(u) for i i…

---

## [Speeding up Zygote autodiff for numerical loop](https://discourse.julialang.org/t/speeding-up-zygote-autodiff-for-numerical-loop/123515)

<div class="topic-metadata">

**Author:** [@dameka](https://discourse.julialang.org/u/dameka)\
**Replies:** 13\
**Last updated:** [December 16, 2024, 4:27pm UTC](https://discourse.julialang.org/t/speeding-up-zygote-autodiff-for-numerical-loop/123515 "2024-12-16T16:27:43Z")

</div>

I’m using Zygote to auto-differentiate the (small) output of a numerical loop. It is quite slow, probably due to the naive way I’ve implemented it. I’m interested in advice on (a) vectorizing the loop to get better perfo…

---

## [Why Base.summarysize show pointers twice?](https://discourse.julialang.org/t/why-base-summarysize-show-pointers-twice/123887)

<div class="topic-metadata">

**Author:** [@garazha-ilya](https://discourse.julialang.org/u/garazha-ilya)\
**Replies:** 1\
**Last updated:** [December 16, 2024, 4:23pm UTC](https://discourse.julialang.org/t/why-base-summarysize-show-pointers-twice/123887 "2024-12-16T16:23:21Z")

</div>

Suppose I have string “Moscow”: julia\> Moscow = "Moscow" "Moscow" julia\> sizeof(Moscow) 6 julia\> Base.summarysize(Moscow) 14 I suppose, that 14 = (Pointer to Array of Chars (8 bytes)) + (6 data bytes). However, when I…

---

## [LinearSolve.jl for many values of b?](https://discourse.julialang.org/t/linearsolve-jl-for-many-values-of-b/94980)

<div class="topic-metadata">

**Author:** [@moble](https://discourse.julialang.org/u/moble)\
**Replies:** 2\
**Last updated:** [December 16, 2024, 2:20pm UTC](https://discourse.julialang.org/t/linearsolve-jl-for-many-values-of-b/94980 "2024-12-16T14:20:47Z")

</div>

I’m writing a package and I really like the idea of LinearSolve.jl, because I want my code to perform well and be flexible: work on CPU or GPU, be differentiable, not allocate, etc. But one of my most important use case…

---

## [A fast sum. Any downsides?](https://discourse.julialang.org/t/a-fast-sum-any-downsides/123723)

<div class="topic-metadata">

**Author:** [@nicolas](https://discourse.julialang.org/u/nicolas)\
**Replies:** 18\
**Last updated:** [December 16, 2024, 3:04pm UTC](https://discourse.julialang.org/t/a-fast-sum-any-downsides/123723 "2024-12-16T15:04:12Z")

</div>

I wrote a simple function to perform sums using indices. function sumi(f, s, range) @simd for i in range s += f(i) end return s end I was curious to measure the performance hit of using sumi for arrays instead of s…

---

## [When is 1.11.3 planned to be released?](https://discourse.julialang.org/t/when-is-1-11-3-planned-to-be-released/123881)

<div class="topic-metadata">

**Author:** [@Lior\_Assouline](https://discourse.julialang.org/u/Lior_Assouline)\
**Replies:** 1\
**Last updated:** [December 16, 2024, 12:35pm UTC](https://discourse.julialang.org/t/when-is-1-11-3-planned-to-be-released/123881 "2024-12-16T12:35:50Z")

</div>

I couldnt find an planned release with dates … Thanks!

---

## [Debugging segfaults/running out of memory, maybe a memory leak?](https://discourse.julialang.org/t/debugging-segfaults-running-out-of-memory-maybe-a-memory-leak/123701)

<div class="topic-metadata">

**Author:** [@kockahonza](https://discourse.julialang.org/u/kockahonza)\
**Replies:** 5\
**Last updated:** [December 16, 2024, 11:30am UTC](https://discourse.julialang.org/t/debugging-segfaults-running-out-of-memory-maybe-a-memory-leak/123701 "2024-12-16T11:30:49Z")

</div>

Hello everyone! So I am using julia for a bunch of things in my project including a pretty simple simulation code which saves data using HDF5.jl. In addition, my simulation can be started in a range of starting condition…

---

## [How to Efficiently Work with Floats Across a Wide Range of Precision?](https://discourse.julialang.org/t/how-to-efficiently-work-with-floats-across-a-wide-range-of-precision/123833)

<div class="topic-metadata">

**Author:** [@Hugin-Hilbert](https://discourse.julialang.org/u/Hugin-Hilbert)\
**Replies:** 4\
**Last updated:** [December 16, 2024, 10:11am UTC](https://discourse.julialang.org/t/how-to-efficiently-work-with-floats-across-a-wide-range-of-precision/123833 "2024-12-16T10:11:20Z")

</div>

I’m currently developing a divide and conquer algorithm in Julia that requires multiple precision arithmetic at different levels of the computation: Leaf Nodes: Operations are performed with approximately 256-bit preci…

---

## [Pattern matching in Matrix](https://discourse.julialang.org/t/pattern-matching-in-matrix/123831)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 3\
**Last updated:** [December 16, 2024, 8:34am UTC](https://discourse.julialang.org/t/pattern-matching-in-matrix/123831 "2024-12-16T08:34:11Z")

</div>

Find each instance of the smaller matrix in the larger and create a NamedTuple (;a,b) \[ :X a \_ b \_ :Y \] \[ 1 2 3 :X 1 2 3 4 :Y :X 1 2 4 5 :Y 10 11 12 :X …

---

## [Looking for Clarification on Genie.jl and WebSockets](https://discourse.julialang.org/t/looking-for-clarification-on-genie-jl-and-websockets/121596)

<div class="topic-metadata">

**Author:** [@g-gundam](https://discourse.julialang.org/u/g-gundam)\
**Replies:** 1\
**Last updated:** [December 16, 2024, 2:59am UTC](https://discourse.julialang.org/t/looking-for-clarification-on-genie-jl-and-websockets/121596 "2024-12-16T02:59:09Z")

</div>

I’ve read through the docs and tried the examples, and so far so good. Everything worked as advertised. However, when I tried to experiment further, I got really confused. How do I use /\_\_\_\_/subscribe and /\_\_\_\_/unsubs…

---

## [Julia vs. Python Performance on package catch22: Why is Julia slower in this case and how can I improve it?](https://discourse.julialang.org/t/julia-vs-python-performance-on-package-catch22-why-is-julia-slower-in-this-case-and-how-can-i-improve-it/117936)

<div class="topic-metadata">

**Author:** [@arturdaraujo](https://discourse.julialang.org/u/arturdaraujo)\
**Replies:** 11\
**Last updated:** [December 16, 2024, 4:29am UTC](https://discourse.julialang.org/t/julia-vs-python-performance-on-package-catch22-why-is-julia-slower-in-this-case-and-how-can-i-improve-it/117936 "2024-12-16T04:29:24Z")

</div>

Hello, I’m comparing the performance of Julia and Python for a specific task involving time series data and feature extraction. I’ve implemented a parallel computation in both languages and noticed that Python is signif…

---

## [What is the use of ScopedValues beyond web authorization?](https://discourse.julialang.org/t/what-is-the-use-of-scopedvalues-beyond-web-authorization/116162)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 14\
**Last updated:** [December 16, 2024, 2:40am UTC](https://discourse.julialang.org/t/what-is-the-use-of-scopedvalues-beyond-web-authorization/116162 "2024-12-16T02:40:42Z")

</div>

ScopedValues are coming to Julia v1.11 (I think?). After reading a few examples, I think of them as resettable Refs. Apparently they behave like constants even though you can temporarily change their values. They are use…

---

## [Power system modeling](https://discourse.julialang.org/t/power-system-modeling/123823)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 11\
**Last updated:** [December 15, 2024, 11:34pm UTC](https://discourse.julialang.org/t/power-system-modeling/123823 "2024-12-15T23:34:05Z")

</div>

I saw a job position with the requirement: “Proficiency in open-source power system tools (e.g. PyPSA, Dispa-SET, or Calliope) and other dispatch-related software.” Is there anything similar in Julia?

---

## [How to make Julia package that uses external (non Julia) code?](https://discourse.julialang.org/t/how-to-make-julia-package-that-uses-external-non-julia-code/123570)

<div class="topic-metadata">

**Author:** [@KSepetanc](https://discourse.julialang.org/u/KSepetanc)\
**Replies:** 13\
**Last updated:** [December 15, 2024, 10:58pm UTC](https://discourse.julialang.org/t/how-to-make-julia-package-that-uses-external-non-julia-code/123570 "2024-12-15T22:58:55Z")

</div>

I want to convert my project code (structured like package, i.e. has /src, /test, Project.toml, Manifest.toml…) to real package. The issue is that in /src it has also ampl code so it is not full Julia. The Julia code has…

---

## [Does BitArraysX.jl or similar exist?](https://discourse.julialang.org/t/does-bitarraysx-jl-or-similar-exist/123869)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 2\
**Last updated:** [December 15, 2024, 8:07pm UTC](https://discourse.julialang.org/t/does-bitarraysx-jl-or-similar-exist/123869 "2024-12-15T20:07:46Z")

</div>

There have been a few posts over the years discussing constructing a BitArray from bits in an existing Vector{\<:Unsigned}. Does a package that does some version of this exist? I’ve cobbled something together for my own…

---

## [ClassicCiphers.jl - A Julia Package for Classical Cryptography](https://discourse.julialang.org/t/classicciphers-jl-a-julia-package-for-classical-cryptography/123564)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 3\
**Last updated:** [December 8, 2024, 7:32am UTC](https://discourse.julialang.org/t/classicciphers-jl-a-julia-package-for-classical-cryptography/123564 "2024-12-08T07:32:08Z")

</div>

Hi Julia community! I’m excited to share a new package I’ve been working on: ClassicCiphers.jl. This package was inspired by my experience solving some introduction cryptography challenges on Hackropole, a French CTF pl…

---

## [Retrieve all variables appearing in a symbolic expression](https://discourse.julialang.org/t/retrieve-all-variables-appearing-in-a-symbolic-expression/123846)

<div class="topic-metadata">

**Author:** [@elvispy](https://discourse.julialang.org/u/elvispy)\
**Replies:** 2\
**Last updated:** [December 15, 2024, 5:35pm UTC](https://discourse.julialang.org/t/retrieve-all-variables-appearing-in-a-symbolic-expression/123846 "2024-12-15T17:35:52Z")

</div>

I would like to get all the variables involved in an expression, even the implicit ones. For example, if you do using Symbolics @variables x y u(x, y) println(Symbolics.get\_variables(u)) You get 1-element Vector{Symbol…

---

## [Using KernelAbstractions.jl in a package extension](https://discourse.julialang.org/t/using-kernelabstractions-jl-in-a-package-extension/123815)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 6\
**Last updated:** [December 15, 2024, 10:02am UTC](https://discourse.julialang.org/t/using-kernelabstractions-jl-in-a-package-extension/123815 "2024-12-15T10:02:06Z")

</div>

Hello, I have a Julia package with an extension triggered by CUDA.jl. Now, I would like to define a custom kernel as a method extension of the package. In principle, I could use the CUDA kernel handling, but I understoo…

---

## [How to convert the python code to Julia](https://discourse.julialang.org/t/how-to-convert-the-python-code-to-julia/123689)

<div class="topic-metadata">

**Author:** [@govindanupam](https://discourse.julialang.org/u/govindanupam)\
**Replies:** 4\
**Last updated:** [December 15, 2024, 4:55am UTC](https://discourse.julialang.org/t/how-to-convert-the-python-code-to-julia/123689 "2024-12-15T04:55:32Z")

</div>

Dear team, How to convert below mentioned code to Julia only without using Pycall module or any Python modules. Please help import os import vtk import numpy as np def process\_jaw\_stl(input\_file, output\_file, jaw\_type…

---

## [Running A Julia Script Through SLURM](https://discourse.julialang.org/t/running-a-julia-script-through-slurm/123268)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 4\
**Last updated:** [December 15, 2024, 3:26am UTC](https://discourse.julialang.org/t/running-a-julia-script-through-slurm/123268 "2024-12-15T03:26:46Z")

</div>

I have a julia script that run a physics simulation. The physics simulation takes around 8 hours, and I want to run it with many random initial conditions, so I planned to run the script multiple times using a SLURM job …

---

## [Two structs with same fields - how?](https://discourse.julialang.org/t/two-structs-with-same-fields-how/123787)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 7\
**Last updated:** [December 15, 2024, 1:07am UTC](https://discourse.julialang.org/t/two-structs-with-same-fields-how/123787 "2024-12-15T01:07:23Z")

</div>

The user interface for my package is as follows. There is a mutable struct called UserProblemDescription. It has ~30 fields, all of which are defined as unions with Missing: Base.@kwdef mutable struct UserProblemDescr…

---

## [Using code\_typed to generate docstring templates](https://discourse.julialang.org/t/using-code-typed-to-generate-docstring-templates/123725)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 7\
**Last updated:** [December 14, 2024, 11:35pm UTC](https://discourse.julialang.org/t/using-code-typed-to-generate-docstring-templates/123725 "2024-12-14T23:35:47Z")

</div>

I came up with the following idea: function doctemplate(f, args) x = @code\_typed f(args...) src = x\[1\] sig = split(string(src.parent.def), " @")\[1\] args = string.(src.slotnames)\[2:en…

---

## [Redirect the error output of an AppleScript called through Cmd](https://discourse.julialang.org/t/redirect-the-error-output-of-an-applescript-called-through-cmd/123825)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 1\
**Last updated:** [December 13, 2024, 11:45pm UTC](https://discourse.julialang.org/t/redirect-the-error-output-of-an-applescript-called-through-cmd/123825 "2024-12-13T23:45:03Z")

</div>

The next question (for background see Interpolate into an AppleScript called through Cmd). When calling AppleScript from the shell, the redirection works as expected: eben60@Macmini ~ % osascript -e 'POSIX path of (cho…

---

## [Sample StaticVectors with Distributions.jl](https://discourse.julialang.org/t/sample-staticvectors-with-distributions-jl/123792)

<div class="topic-metadata">

**Author:** [@Joaquin\_Rodriguez](https://discourse.julialang.org/u/Joaquin_Rodriguez)\
**Replies:** 2\
**Last updated:** [December 13, 2024, 10:03pm UTC](https://discourse.julialang.org/t/sample-staticvectors-with-distributions-jl/123792 "2024-12-13T22:03:04Z")

</div>

I need to generate some random vectors with a custom distribution, and I would like to use the Distributions.jl API. However, my vectors are small StaticVectors and sampling from a distribution returns plain Vectors. As…

---

## [Switching from x86 Mac to Apple Silicon](https://discourse.julialang.org/t/switching-from-x86-mac-to-apple-silicon/123798)

<div class="topic-metadata">

**Author:** [@rmfritz](https://discourse.julialang.org/u/rmfritz)\
**Replies:** 2\
**Last updated:** [December 13, 2024, 9:15pm UTC](https://discourse.julialang.org/t/switching-from-x86-mac-to-apple-silicon/123798 "2024-12-13T21:15:30Z")

</div>

Is there a procedure? Juliaup doesn’t seem to do it and I’m hesitant to run juliaup self uninstall; it looks like I might lose my current packages.

---

## [Interpolate into an AppleScript called through Cmd](https://discourse.julialang.org/t/interpolate-into-an-applescript-called-through-cmd/123824)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 1\
**Last updated:** [December 13, 2024, 8:57pm UTC](https://discourse.julialang.org/t/interpolate-into-an-applescript-called-through-cmd/123824 "2024-12-13T20:57:08Z")

</div>

The background: the NativeFileDialog.jl unfortunately makes problems on MacOS 15 (i.e. current version). I’m trying to put together a workaround. This one actually works: cmd1 = \`osascript -e 'POSIX path of (choose fi…

---

## [Finding all applicable Methods for Signature](https://discourse.julialang.org/t/finding-all-applicable-methods-for-signature/74008)

<div class="topic-metadata">

**Author:** [@arik](https://discourse.julialang.org/u/arik)\
**Replies:** 1\
**Last updated:** [December 13, 2024, 8:53pm UTC](https://discourse.julialang.org/t/finding-all-applicable-methods-for-signature/74008 "2024-12-13T20:53:53Z")

</div>

Hi there. Im looking to programmatically create a list of all Methods of a given function f whose signature is compatible with a given argument list args, that is, a list of all methods that could be triggered by invoke…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=101)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=103)
