# General Usage

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

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

**Page:** 408

---

## [\[Avoid cfunction closure\] GSL root finding problem with function passed as argument](https://discourse.julialang.org/t/avoid-cfunction-closure-gsl-root-finding-problem-with-function-passed-as-argument/85955)

<div class="topic-metadata">

**Author:** [@Norman](https://discourse.julialang.org/u/Norman)\
**Replies:** 1\
**Last updated:** [August 19, 2022, 7:30am UTC](https://discourse.julialang.org/t/avoid-cfunction-closure-gsl-root-finding-problem-with-function-passed-as-argument/85955 "2022-08-19T07:30:25Z")

</div>

I have a usage scenario in which the functions that represent the equations for the multidimentional root-finding problem are generated in run time. I use GSL.jl to solve the root-finding problem, which requires wrapping…

---

## [Julia fails to handle properly the Git meta credential helper](https://discourse.julialang.org/t/julia-fails-to-handle-properly-the-git-meta-credential-helper/85928)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 7\
**Last updated:** [August 19, 2022, 2:32am UTC](https://discourse.julialang.org/t/julia-fails-to-handle-properly-the-git-meta-credential-helper/85928 "2022-08-19T02:32:13Z")

</div>

Julia 1.8 on Windows fails to handle properly the Git meta credential helper. In .gitconfig: \[credential "helperselector"\] selected = \<no helper\> Introduced in Git for Windows v2.23.0. I wonder if Julia is being tes…

---

## [Check whether a macro is defined](https://discourse.julialang.org/t/check-whether-a-macro-is-defined/85961)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 1\
**Last updated:** [August 19, 2022, 2:41am UTC](https://discourse.julialang.org/t/check-whether-a-macro-is-defined/85961 "2022-08-19T02:41:10Z")

</div>

I want a function (or macro) macro\_is\_defined which will return true if and only if the macro SomeModule.@some\_macro is defined.

---

## [Looping over structure elements by their names](https://discourse.julialang.org/t/looping-over-structure-elements-by-their-names/85946)

<div class="topic-metadata">

**Author:** [@tradler](https://discourse.julialang.org/u/tradler)\
**Replies:** 12\
**Last updated:** [August 18, 2022, 11:17pm UTC](https://discourse.julialang.org/t/looping-over-structure-elements-by-their-names/85946 "2022-08-18T23:17:47Z")

</div>

I am wondering how to loop over the elements of a structure by their names? Big-picture, I have a structure which contains the parameters of an economic model, some of which are functions of other parameters. I would li…

---

## [Use of nohup inside the run() command](https://discourse.julialang.org/t/use-of-nohup-inside-the-run-command/85945)

<div class="topic-metadata">

**Author:** [@marllos](https://discourse.julialang.org/u/marllos)\
**Replies:** 2\
**Last updated:** [August 18, 2022, 10:52pm UTC](https://discourse.julialang.org/t/use-of-nohup-inside-the-run-command/85945 "2022-08-18T22:52:24Z")

</div>

Hello everyone! Congratulations on the release of version 1.8 of Julia, it just keeps getting better and better! I would like to ask the following question: What is the correct form of the command? run(\`nohup julia test…

---

## [Performance of collections with Functions as abstract type](https://discourse.julialang.org/t/performance-of-collections-with-functions-as-abstract-type/85929)

<div class="topic-metadata">

**Author:** [@RGon](https://discourse.julialang.org/u/RGon)\
**Replies:** 6\
**Last updated:** [August 18, 2022, 9:48pm UTC](https://discourse.julialang.org/t/performance-of-collections-with-functions-as-abstract-type/85929 "2022-08-18T21:48:11Z")

</div>

I know from the docs I should avoid containers with abstract types, however I am running into a couple of use cases where I have tag calculation objects with arbitrary functions. Base.@kwdef struct TagCalculation{T\<:Fun…

---

## [Nonlinear state-space models in ControlSystems.jl?](https://discourse.julialang.org/t/nonlinear-state-space-models-in-controlsystems-jl/85892)

<div class="topic-metadata">

**Author:** [@knttnk](https://discourse.julialang.org/u/knttnk)\
**Replies:** 2\
**Last updated:** [August 18, 2022, 8:18pm UTC](https://discourse.julialang.org/t/nonlinear-state-space-models-in-controlsystems-jl/85892 "2022-08-18T20:18:14Z")

</div>

Will nonlinear state-space models be implemented in ControlSystems.jl? Nonlinear state-space model here is a system with equations like \\begin{cases} \\begin{aligned} \\dot{\\boldsymbol{x}} &= f(t, \\boldsymbol{x}, \\boldsy…

---

## [Splitting and Summing Sparse Arrays](https://discourse.julialang.org/t/splitting-and-summing-sparse-arrays/85903)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 5\
**Last updated:** [August 18, 2022, 7:29pm UTC](https://discourse.julialang.org/t/splitting-and-summing-sparse-arrays/85903 "2022-08-18T19:29:16Z")

</div>

In my application I need to split a sparse array into columns then pass each column to a separate function and sum them independently. x = sprand(1000, 1000, 0.01) cols = eachcol(x) function foo(x) s = sum(x) #…

---

## [Processus stop for large array of images](https://discourse.julialang.org/t/processus-stop-for-large-array-of-images/85921)

<div class="topic-metadata">

**Author:** [@musard0](https://discourse.julialang.org/u/musard0)\
**Replies:** 2\
**Last updated:** [August 18, 2022, 5:29pm UTC](https://discourse.julialang.org/t/processus-stop-for-large-array-of-images/85921 "2022-08-18T17:29:14Z")

</div>

Hello, here is my code : using Images function listOfImg(img::Array{Gray{Normed{UInt8,8}},2}) lengthImgSplit = 1000 nbImgToSave = 3000 imgSplit = similar(img, size(img, 1), lengthImgSplit) listOfImg = Array{typeof(i…

---

## [libnetcdf not defined on M1](https://discourse.julialang.org/t/libnetcdf-not-defined-on-m1/75366)

<div class="topic-metadata">

**Author:** [@razoumov515](https://discourse.julialang.org/u/razoumov515)\
**Replies:** 18\
**Last updated:** [August 18, 2022, 2:40pm UTC](https://discourse.julialang.org/t/libnetcdf-not-defined-on-m1/75366 "2022-08-18T14:40:06Z")

</div>

On a M1 Macbook I get errors trying to use NetCDF from Julia. Any idea which libnetcdf it is looking for? Isn’t NetCDF in Julia self-sufficient? https://github.com/JuliaGeo/NetCDF.jl does not mention any external system …

---

## [Conversion in typed globals (Julia 1.8)](https://discourse.julialang.org/t/conversion-in-typed-globals-julia-1-8/85926)

<div class="topic-metadata">

**Author:** [@aerdely](https://discourse.julialang.org/u/aerdely)\
**Replies:** 4\
**Last updated:** [August 18, 2022, 2:01pm UTC](https://discourse.julialang.org/t/conversion-in-typed-globals-julia-1-8/85926 "2022-08-18T14:01:28Z")

</div>

I just want to understand this new feature in Julia 1.8 f(x::Int64) = x^2 + 1 f(3.0 + 0.0im) # ERROR: no method matching f(::ComplexF64), as expected # But: x::Int64 = 3.0 + 0.0im # no problem, conversion applied! If I…

---

## [Is it Possible to Draw object in 4-Dimension with Julia?](https://discourse.julialang.org/t/is-it-possible-to-draw-object-in-4-dimension-with-julia/85911)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [August 18, 2022, 1:16pm UTC](https://discourse.julialang.org/t/is-it-possible-to-draw-object-in-4-dimension-with-julia/85911 "2022-08-18T13:16:49Z")

</div>

What backend or plotting package in Julia is able to create a 4-dimensional space and objects? I saw this yesterday, there is w after x,y,z axis. I think if we have maximum of 3 dimension, we can just add another axis w…

---

## [Reinterpret Int64 as 2xInt32 struct](https://discourse.julialang.org/t/reinterpret-int64-as-2xint32-struct/85910)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 9\
**Last updated:** [August 18, 2022, 10:08am UTC](https://discourse.julialang.org/t/reinterpret-int64-as-2xint32-struct/85910 "2022-08-18T10:08:13Z")

</div>

Hey all :slight\_smile: It seems easier to work with native types when writing to a file (that is later MMapped) compared to writing structs. Since my struct has two Int32 I thought of merging them to an Int64 (by bitshi…

---

## [Seemingly nondeterministic behavior despite setting Random.seed!()?](https://discourse.julialang.org/t/seemingly-nondeterministic-behavior-despite-setting-random-seed/85880)

<div class="topic-metadata">

**Author:** [@johnabs](https://discourse.julialang.org/u/johnabs)\
**Replies:** 7\
**Last updated:** [August 18, 2022, 5:33am UTC](https://discourse.julialang.org/t/seemingly-nondeterministic-behavior-despite-setting-random-seed/85880 "2022-08-18T05:33:11Z")

</div>

Hi all, I’m working on an optimization problem on graphs using some code I ported from R to Julia. What’s strange, is that when I run the code which uses stochastic processes to sample a solution space in a search for …

---

## [Intercepting error messages - HOW?](https://discourse.julialang.org/t/intercepting-error-messages-how/77189)

<div class="topic-metadata">

**Author:** [@FedeClaudi](https://discourse.julialang.org/u/FedeClaudi)\
**Replies:** 11\
**Last updated:** [August 18, 2022, 5:03am UTC](https://discourse.julialang.org/t/intercepting-error-messages-how/77189 "2022-08-18T05:03:29Z")

</div>

In my Term.jl project I aim to provide functionality to print nicely formatted, pretty, error messages. A preview: This is inspired by Rich in python that prints error stacks like: In python you can define an exce…

---

## [Parallelization of several independent loops](https://discourse.julialang.org/t/parallelization-of-several-independent-loops/85803)

<div class="topic-metadata">

**Author:** [@iangilan](https://discourse.julialang.org/u/iangilan)\
**Replies:** 10\
**Last updated:** [August 18, 2022, 3:16am UTC](https://discourse.julialang.org/t/parallelization-of-several-independent-loops/85803 "2022-08-18T03:16:43Z")

</div>

Hello all, How could I parallelize the following independent loops? for i=1:N x1=A1\\b1 end for i=N+1:2\*N x2=A2\\b2 end for i=2\*N+1:3\*N x3=A3\\b3 end for i=3\*N+1:4\*N x4=A4\\b4 end

---

## [Julia M2 support](https://discourse.julialang.org/t/julia-m2-support/85895)

<div class="topic-metadata">

**Author:** [@jj-404](https://discourse.julialang.org/u/jj-404)\
**Replies:** 4\
**Last updated:** [August 17, 2022, 9:57pm UTC](https://discourse.julialang.org/t/julia-m2-support/85895 "2022-08-17T21:57:40Z")

</div>

Hi, Just wanted to know what’s the current status of support for the M2 processor?

---

## [Geometric Median](https://discourse.julialang.org/t/geometric-median/85886)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 1\
**Last updated:** [August 17, 2022, 7:40pm UTC](https://discourse.julialang.org/t/geometric-median/85886 "2022-08-17T19:40:37Z")

</div>

Is there a package to compute the geometric median of a multivariate dataset?

---

## [Using C struct in Julia without creating same struct in Julia again](https://discourse.julialang.org/t/using-c-struct-in-julia-without-creating-same-struct-in-julia-again/66639)

<div class="topic-metadata">

**Author:** [@m\_yasinhan](https://discourse.julialang.org/u/m_yasinhan)\
**Replies:** 11\
**Last updated:** [August 17, 2022, 7:00pm UTC](https://discourse.julialang.org/t/using-c-struct-in-julia-without-creating-same-struct-in-julia-again/66639 "2022-08-17T19:00:39Z")

</div>

Hi, we have ccall to call any c function. But, if the function we want to call has a parameter which is non-primitive type such as a struct, do we always have to create same struct in Julia? For example, I have this c co…

---

## [Overloading a function specifically for symbolics](https://discourse.julialang.org/t/overloading-a-function-specifically-for-symbolics/85726)

<div class="topic-metadata">

**Author:** [@user664303](https://discourse.julialang.org/u/user664303)\
**Replies:** 5\
**Last updated:** [August 15, 2022, 9:07am UTC](https://discourse.julialang.org/t/overloading-a-function-specifically-for-symbolics/85726 "2022-08-15T09:07:05Z")

</div>

The type of a symbolic is Num: julia\> using Symbolics julia\> @variables x julia\> typeof(x) Num How can I write a function specifically for symbolics? Let’s say there is already a genericfun(x::Num, y::Num) defined in B…

---

## [Kernel crash when converting pngs to gif on julia 1.7.3](https://discourse.julialang.org/t/kernel-crash-when-converting-pngs-to-gif-on-julia-1-7-3/85864)

<div class="topic-metadata">

**Author:** [@Ludovic\_Dumoulin](https://discourse.julialang.org/u/Ludovic_Dumoulin)\
**Replies:** 0\
**Last updated:** [August 17, 2022, 8:37am UTC](https://discourse.julialang.org/t/kernel-crash-when-converting-pngs-to-gif-on-julia-1-7-3/85864 "2022-08-17T08:37:27Z")

</div>

Hello, I just updated my Julia version from 1.6.1 to 1.7.3 and my previous function (stolen on a forum) to convert pngs to gif, doen’t work anymore for a large number of pngs (1000) but works fine for a small amount of …

---

## [Makie Observable subtlety with contourf using vectors](https://discourse.julialang.org/t/makie-observable-subtlety-with-contourf-using-vectors/85845)

<div class="topic-metadata">

**Author:** [@cmarcotte](https://discourse.julialang.org/u/cmarcotte)\
**Replies:** 6\
**Last updated:** [August 17, 2022, 12:48pm UTC](https://discourse.julialang.org/t/makie-observable-subtlety-with-contourf-using-vectors/85845 "2022-08-17T12:48:03Z")

</div>

I have a dataset which is a 4xN array of numbers corresponding to field values at (z,y,x)-positions, sampled sparsely in z. I am trying to use contourf! in Makie to make a video of the evolution of these fields, which re…

---

## [\`@inbounds\` behaving strangely for varargs functions](https://discourse.julialang.org/t/inbounds-behaving-strangely-for-varargs-functions/85752)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 3\
**Last updated:** [August 17, 2022, 12:15pm UTC](https://discourse.julialang.org/t/inbounds-behaving-strangely-for-varargs-functions/85752 "2022-08-17T12:15:52Z")

</div>

I am puzzled by the behavior of @inbounds for functions with a variable number of arguments. My understanding is that calling the following function g should avoid a bounds check inside f. @inline function f(x...) @…

---

## [Stipple runs in cli but not in cron?](https://discourse.julialang.org/t/stipple-runs-in-cli-but-not-in-cron/85818)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 5\
**Last updated:** [August 17, 2022, 11:22am UTC](https://discourse.julialang.org/t/stipple-runs-in-cli-but-not-in-cron/85818 "2022-08-17T11:22:02Z")

</div>

Hi there this is a GENERAL question so I didn’t include any code. I also am aware of julia packages that allow cronlike behavior but I would prefer to keep this simple. I’m running a stipple julia script to build a web…

---

## [Question on LazySets and Plots: translate not defined](https://discourse.julialang.org/t/question-on-lazysets-and-plots-translate-not-defined/85859)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 15\
**Last updated:** [August 17, 2022, 10:22am UTC](https://discourse.julialang.org/t/question-on-lazysets-and-plots-translate-not-defined/85859 "2022-08-17T10:22:34Z")

</div>

Hi all, after following It’s all Set tutorial on JuliaCon2021 I have found a speed bump when I try this: using Plots, LazySets, LaTeXStrings p(args...; kwargs...) = plot(xlims=(0,4), ylims=(0,4), ratio=1, lab="", …

---

## [Status of CompatHelperLocal](https://discourse.julialang.org/t/status-of-compathelperlocal/85792)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 11\
**Last updated:** [August 17, 2022, 7:31am UTC](https://discourse.julialang.org/t/status-of-compathelperlocal/85792 "2022-08-17T07:31:21Z")

</div>

What is the status of this package: Alexander Plavin / CompatHelperLocal.jl · GitLab I find it very useful, but it is not well maintained and I did not find a way to submit an issue. Anybody else able to submit issues o…

---

## [Poisson-Disc Sampling?](https://discourse.julialang.org/t/poisson-disc-sampling/85647)

<div class="topic-metadata">

**Author:** [@RobertGregg](https://discourse.julialang.org/u/RobertGregg)\
**Replies:** 14\
**Last updated:** [August 17, 2022, 6:53am UTC](https://discourse.julialang.org/t/poisson-disc-sampling/85647 "2022-08-17T06:53:53Z")

</div>

Has anyone implemented a Poisson-Disc Sampling algorithm in Julia? I didn’t see anything with a quick google search or by looking through previous discussions.

---

## [Numpy and PyCall issues](https://discourse.julialang.org/t/numpy-and-pycall-issues/85847)

<div class="topic-metadata">

**Author:** [@Derek\_Vetsch](https://discourse.julialang.org/u/Derek_Vetsch)\
**Replies:** 2\
**Last updated:** [August 17, 2022, 3:14am UTC](https://discourse.julialang.org/t/numpy-and-pycall-issues/85847 "2022-08-17T03:14:22Z")

</div>

I feel like I’ve gotten this to work before, but I can’t remember how. I am trying to stitch together a few different scripts, some in Julia and some in Python. The Python scripts rely on numpy but when I try to @pyinclu…

---

## [PyError when using PyCall](https://discourse.julialang.org/t/pyerror-when-using-pycall/85731)

<div class="topic-metadata">

**Author:** [@hdroms](https://discourse.julialang.org/u/hdroms)\
**Replies:** 2\
**Last updated:** [August 17, 2022, 1:39am UTC](https://discourse.julialang.org/t/pyerror-when-using-pycall/85731 "2022-08-17T01:39:41Z")

</div>

I have been attempting to do video analysis using python’s hnccorr algorithm. The particular script thats throwing this error use to work, though when it was handed off to me it started throwing this error which thus far…

---

## [Loop (i, j) without zip() stopped at the 2nd round](https://discourse.julialang.org/t/loop-i-j-without-zip-stopped-at-the-2nd-round/85810)

<div class="topic-metadata">

**Author:** [@JiuuJulia](https://discourse.julialang.org/u/JiuuJulia)\
**Replies:** 9\
**Last updated:** [August 17, 2022, 1:33am UTC](https://discourse.julialang.org/t/loop-i-j-without-zip-stopped-at-the-2nd-round/85810 "2022-08-17T01:33:34Z")

</div>

I’m trying to loop two DNA sequences: a = "AAAGCTAGCTAGCTAGACT" b = "ATAGCTAGCCAGCTAAACT" for (i, j) in (a,b) println(i, j) end It gives a result: AA AT Why does the loop stop at the 2nd iteration? I know I’d b…

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

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