# General Usage

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

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

**Page:** 309

---

## [How to access NamedTuple from JuliaCall?](https://discourse.julialang.org/t/how-to-access-namedtuple-from-juliacall/61043)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 1\
**Last updated:** [April 2, 2023, 8:18pm UTC](https://discourse.julialang.org/t/how-to-access-namedtuple-from-juliacall/61043 "2023-04-02T20:18:42Z")

</div>

background: Suppose myFunction is a julia function that returns a named tuple. I’ve been invoking julia\_call() on myFunction as follows: output\_list = julia\_call("\<julia module\>.\<myFunction\>",\<myFunction args\>,need\_ret…

---

## [Julia on SmartNIC](https://discourse.julialang.org/t/julia-on-smartnic/87637)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 1\
**Last updated:** [April 2, 2023, 5:50pm UTC](https://discourse.julialang.org/t/julia-on-smartnic/87637 "2023-04-02T17:50:40Z")

</div>

I saw a thread on reading sensor data using Julia What Is a DPU? | NVIDIA Blog It leads me to ask if anyone has successfully used Julia with SmartNICs / DPUs https://developer.nvidia.com/blog/ushering-in-a-new-era-of-…

---

## [Error while using DynamicalSystems.jl to solve for a complex nonlinear system](https://discourse.julialang.org/t/error-while-using-dynamicalsystems-jl-to-solve-for-a-complex-nonlinear-system/96976)

<div class="topic-metadata">

**Author:** [@Sh\_166](https://discourse.julialang.org/u/Sh_166)\
**Replies:** 0\
**Last updated:** [April 2, 2023, 5:38pm UTC](https://discourse.julialang.org/t/error-while-using-dynamicalsystems-jl-to-solve-for-a-complex-nonlinear-system/96976 "2023-04-02T17:38:21Z")

</div>

Hi, I was having quite a bit of trouble with DynamicalSystems.jl. In particular, I would like to implement an elastic double pendulum (so, 3 degrees of freedoms). The problem with this system is that it is nonlinear, se…

---

## [Cleaner way of passing many arguments between functions](https://discourse.julialang.org/t/cleaner-way-of-passing-many-arguments-between-functions/96771)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 10\
**Last updated:** [April 2, 2023, 5:18pm UTC](https://discourse.julialang.org/t/cleaner-way-of-passing-many-arguments-between-functions/96771 "2023-04-02T17:18:14Z")

</div>

I have a function where I pass a lot of arguments for performance. These generally come from other structs and are Ref’s or vectors. I have to pass these arguments around which is slightly bothersome. I thought I’d be cl…

---

## [Where possible and sensible, allow \`zip\` to pass \`getindex\` through to its underlying iterables](https://discourse.julialang.org/t/where-possible-and-sensible-allow-zip-to-pass-getindex-through-to-its-underlying-iterables/61312)

<div class="topic-metadata">

**Author:** [@bert](https://discourse.julialang.org/u/bert)\
**Replies:** 2\
**Last updated:** [April 2, 2023, 4:18pm UTC](https://discourse.julialang.org/t/where-possible-and-sensible-allow-zip-to-pass-getindex-through-to-its-underlying-iterables/61312 "2023-04-02T16:18:38Z")

</div>

zip is a useful function, but it can be frustrating because it does not behave like a “real” array even when its underlying iterables are. For instance, I would expect that if all underlying iterables passed to zip suppo…

---

## [Read and save Voxel data for paraview](https://discourse.julialang.org/t/read-and-save-voxel-data-for-paraview/96596)

<div class="topic-metadata">

**Author:** [@bohm](https://discourse.julialang.org/u/bohm)\
**Replies:** 2\
**Last updated:** [April 2, 2023, 12:00pm UTC](https://discourse.julialang.org/t/read-and-save-voxel-data-for-paraview/96596 "2023-04-02T12:00:38Z")

</div>

Hello everyone, I am currently trying to find a solution for the following: I do calculations on a square VoxelMesh, which is simply represented by an array. However, this also contains material data for multiple phase…

---

## [PackageCompiler.jl ERROR: ArgumentError: Package MyPackage not found in current path, maybe you meant \`import/using .MyPackage\`](https://discourse.julialang.org/t/packagecompiler-jl-error-argumenterror-package-mypackage-not-found-in-current-path-maybe-you-meant-import-using-mypackage/94966)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 0\
**Last updated:** [February 21, 2023, 2:51pm UTC](https://discourse.julialang.org/t/packagecompiler-jl-error-argumenterror-package-mypackage-not-found-in-current-path-maybe-you-meant-import-using-mypackage/94966 "2023-02-21T14:51:04Z")

</div>

Hi there, I am really lost, trying to let PackageCompiler.jl create a sysimage within a docker, but somehow all packages don’t get added normally, but I need to access them from local modules with a prefixed dot using .…

---

## [How to derivative quassi likelihood function using ForwardDiff](https://discourse.julialang.org/t/how-to-derivative-quassi-likelihood-function-using-forwarddiff/96928)

<div class="topic-metadata">

**Author:** [@KotaAihara](https://discourse.julialang.org/u/KotaAihara)\
**Replies:** 3\
**Last updated:** [April 2, 2023, 7:58am UTC](https://discourse.julialang.org/t/how-to-derivative-quassi-likelihood-function-using-forwarddiff/96928 "2023-04-02T07:58:44Z")

</div>

Continuing the discussion from How to derivative using ForwardDiff: I want some help. I want to make more complicated function including more parameters Please teach me how to apply ForwardDiff.gradient() and Forwar…

---

## [Why so few methods defined for \`Atomic\` types?](https://discourse.julialang.org/t/why-so-few-methods-defined-for-atomic-types/96960)

<div class="topic-metadata">

**Author:** [@adienes](https://discourse.julialang.org/u/adienes)\
**Replies:** 0\
**Last updated:** [April 2, 2023, 1:51am UTC](https://discourse.julialang.org/t/why-so-few-methods-defined-for-atomic-types/96960 "2023-04-02T01:51:10Z")

</div>

I am trying to use Atomic wrapped types, but I find there are very few methods defined; I assuming this is intentional, but I’d be curious to hear more about the limitations that prevent these from being included! A lis…

---

## [What does Dates.hour(now(Dates.UTC)) return? Time in UTC?](https://discourse.julialang.org/t/what-does-dates-hour-now-dates-utc-return-time-in-utc/96858)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 13\
**Last updated:** [April 1, 2023, 11:50pm UTC](https://discourse.julialang.org/t/what-does-dates-hour-now-dates-utc-return-time-in-utc/96858 "2023-04-01T23:50:13Z")

</div>

Can I use it to get an estimate of the Time Zone (less the day light saving shift)? My intention is to get an approximate longitude of users location.

---

## [Problem upgrading GR package](https://discourse.julialang.org/t/problem-upgrading-gr-package/68290)

<div class="topic-metadata">

**Author:** [@trg818](https://discourse.julialang.org/u/trg818)\
**Replies:** 11\
**Last updated:** [April 1, 2023, 11:00pm UTC](https://discourse.julialang.org/t/problem-upgrading-gr-package/68290 "2023-04-01T23:00:13Z")

</div>

Thanks for providing a bugfix. Unfortunately I can’t test it, because after upgrading QuadGK, I find that something in my Julia installation is broken. When running the program I was working on, I get this error: Your G…

---

## [Multivariate equivalent to Measurement.jl?](https://discourse.julialang.org/t/multivariate-equivalent-to-measurement-jl/96956)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 0\
**Last updated:** [April 1, 2023, 8:28pm UTC](https://discourse.julialang.org/t/multivariate-equivalent-to-measurement-jl/96956 "2023-04-01T20:28:00Z")

</div>

Hey, I would like to propagate a second order moment around a value, a lot like what Measurements.jl does, but multivariate. n = 10 x = ones(n) gamma = randn(n,n) V = gamma'gamma # this should now be a variance covaria…

---

## [Better way to improve a function with splat operator used in the input](https://discourse.julialang.org/t/better-way-to-improve-a-function-with-splat-operator-used-in-the-input/96744)

<div class="topic-metadata">

**Author:** [@linwaytin](https://discourse.julialang.org/u/linwaytin)\
**Replies:** 15\
**Last updated:** [April 1, 2023, 8:34pm UTC](https://discourse.julialang.org/t/better-way-to-improve-a-function-with-splat-operator-used-in-the-input/96744 "2023-04-01T20:34:11Z")

</div>

I have a multi-variate function like function f(input::Vararg{Int, N}) where {N} # some stuff end I need to call it using the form f(x1..., xi, xn...), where x1 and xn are vectors determined in the runtime. The splat …

---

## [Task affinity to threads](https://discourse.julialang.org/t/task-affinity-to-threads/33938)

<div class="topic-metadata">

**Author:** [@orenbenkiki](https://discourse.julialang.org/u/orenbenkiki)\
**Replies:** 10\
**Last updated:** [April 1, 2023, 5:33pm UTC](https://discourse.julialang.org/t/task-affinity-to-threads/33938 "2023-04-01T17:33:03Z")

</div>

If I use multi threading - for example, using @spawn top() - and the body of top() also invokes either @async or even @spawn of some nested() work, and uses @sync() to wait for this work; Then I assume that the Julia sc…

---

## [Checking ambiguities in Aqua.jl](https://discourse.julialang.org/t/checking-ambiguities-in-aqua-jl/96908)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 4\
**Last updated:** [April 1, 2023, 12:48pm UTC](https://discourse.julialang.org/t/checking-ambiguities-in-aqua-jl/96908 "2023-04-01T12:48:05Z")

</div>

First of all, I love GitHub - JuliaTesting/Aqua.jl: Auto QUality Assurance for Julia packages But every time I use it, it spits out a lot of warnings for method ambiguities in my dependencies, so I generally end up disa…

---

## [Solving linear problem Ax = b, using function handle that computes Ax](https://discourse.julialang.org/t/solving-linear-problem-ax-b-using-function-handle-that-computes-ax/96917)

<div class="topic-metadata">

**Author:** [@sanjeev](https://discourse.julialang.org/u/sanjeev)\
**Replies:** 2\
**Last updated:** [March 31, 2023, 10:58pm UTC](https://discourse.julialang.org/t/solving-linear-problem-ax-b-using-function-handle-that-computes-ax/96917 "2023-03-31T22:58:45Z")

</div>

I want to solve Ax = b, using some iterative solvers. I don’t have matrix A available at hand (too expensive to compute), but I can readily calculate A \* x for any given x. I tried looking at options that are exposed in…

---

## [Incorrect output in unicodeplots()](https://discourse.julialang.org/t/incorrect-output-in-unicodeplots/96907)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 1\
**Last updated:** [March 31, 2023, 7:19pm UTC](https://discourse.julialang.org/t/incorrect-output-in-unicodeplots/96907 "2023-03-31T19:19:55Z")

</div>

My code is using Plots unicodeplots() plt = Plots.histogram(randn(1000) .\* 0.1, nbins = 15, closed = :left) And I got But I expect the output should look like Is there anyway to get the second output plot?

---

## [Question about new "package extensions"?](https://discourse.julialang.org/t/question-about-new-package-extensions/92794)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 6\
**Last updated:** [March 31, 2023, 6:42pm UTC](https://discourse.julialang.org/t/question-about-new-package-extensions/92794 "2023-03-31T18:42:23Z")

</div>

I realize some of the docs may still be getting filled in prior to 1.9 release, but couldn’t resist asking about this potentially really nice new feature. Two questions: Say my package Foo has an optional dependency o…

---

## [Error using UnicodePlots](https://discourse.julialang.org/t/error-using-unicodeplots/96751)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 8\
**Last updated:** [March 31, 2023, 6:34pm UTC](https://discourse.julialang.org/t/error-using-unicodeplots/96751 "2023-03-31T18:34:40Z")

</div>

I got this warning message from “using UnicodePlots” : WARNING: using UnicodePlots.xlabel! in module Main conflicts with an existing identifier. And when I do the following code, what can I get is not a real plot: …

---

## [Getting a subdecomposition (LU) of a submatrix](https://discourse.julialang.org/t/getting-a-subdecomposition-lu-of-a-submatrix/96906)

<div class="topic-metadata">

**Author:** [@fgerick](https://discourse.julialang.org/u/fgerick)\
**Replies:** 1\
**Last updated:** [March 31, 2023, 6:34pm UTC](https://discourse.julialang.org/t/getting-a-subdecomposition-lu-of-a-submatrix/96906 "2023-03-31T18:34:24Z")

</div>

Assuming that a LU decomposition exists for all desired submatrices of a matrix a, is there an easy way to extract the decomposition for the submatrix from the decomposition of a? It is easy in this example: julia\> usin…

---

## [Train flux struct with list of models](https://discourse.julialang.org/t/train-flux-struct-with-list-of-models/96874)

<div class="topic-metadata">

**Author:** [@CarlosContrerasQ12](https://discourse.julialang.org/u/CarlosContrerasQ12)\
**Replies:** 8\
**Last updated:** [March 31, 2023, 4:00pm UTC](https://discourse.julialang.org/t/train-flux-struct-with-list-of-models/96874 "2023-03-31T16:00:33Z")

</div>

Hi, I am trying to train a custom model with a list of Flux models as follows using Flux,Random,Optimisers,Statistics mutable struct GlobalModel subnets function GlobalModel() model1=Chain(Dense(3=\>3,bi…

---

## [Alias doesn't show up in subtypes](https://discourse.julialang.org/t/alias-doesnt-show-up-in-subtypes/96900)

<div class="topic-metadata">

**Author:** [@Ethan-Russell](https://discourse.julialang.org/u/Ethan-Russell)\
**Replies:** 0\
**Last updated:** [March 31, 2023, 3:56pm UTC](https://discourse.julialang.org/t/alias-doesnt-show-up-in-subtypes/96900 "2023-03-31T15:56:37Z")

</div>

I am attempting to make a function that compiles a list of all the subtypes of an abstract type defined in my module, including the names of all the aliases defined within my module, and from outside the module. module …

---

## [Plotting a spectrogram using DSP.jl](https://discourse.julialang.org/t/plotting-a-spectrogram-using-dsp-jl/58013)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 12\
**Last updated:** [March 31, 2023, 3:25pm UTC](https://discourse.julialang.org/t/plotting-a-spectrogram-using-dsp-jl/58013 "2023-03-31T15:25:03Z")

</div>

I am looking to plot a spectrogram of a signal, but I am running into some issues. I have created a minimal working example, and will walk through it. What follows is a bit messy, but I think that I clear question emerge…

---

## [Reading binary file containing mixed data types](https://discourse.julialang.org/t/reading-binary-file-containing-mixed-data-types/96886)

<div class="topic-metadata">

**Author:** [@devanshu](https://discourse.julialang.org/u/devanshu)\
**Replies:** 5\
**Last updated:** [March 31, 2023, 2:17pm UTC](https://discourse.julialang.org/t/reading-binary-file-containing-mixed-data-types/96886 "2023-03-31T14:17:48Z")

</div>

Hi, I am trying to read a binary file generated from eigenpair computation using the SLEPc library in C. I am using the following command: PetscViewerBinaryOpen(PETSC\_COMM\_WORLD, fvalname, FILE\_MODE\_WRITE, &viewer); EPS…

---

## [Package to calculate permanent of a matrix?](https://discourse.julialang.org/t/package-to-calculate-permanent-of-a-matrix/96844)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 4\
**Last updated:** [March 31, 2023, 12:42pm UTC](https://discourse.julialang.org/t/package-to-calculate-permanent-of-a-matrix/96844 "2023-03-31T12:42:09Z")

</div>

I looked around and didn’t see any Julia tools for calculating the permanent of a matrix. Does anyone know of anything? I’m particularly interested in the permanent of binary matrices for counting applications. I did fi…

---

## [Sort StaticVector?](https://discourse.julialang.org/t/sort-staticvector/96591)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 7\
**Last updated:** [March 31, 2023, 10:43am UTC](https://discourse.julialang.org/t/sort-staticvector/96591 "2023-03-31T10:43:12Z")

</div>

Hi, I wonder if there is specific sorting functions for StaticArrays (e.g. sorting network) ?

---

## [Julia multithreading is running slower than serial, can someone please explain why…? General Usage Performance multithreading floops](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why-general-usage-performance-multithreading-floops/96657)

<div class="topic-metadata">

**Author:** [@nethaji8](https://discourse.julialang.org/u/nethaji8)\
**Replies:** 17\
**Last updated:** [March 31, 2023, 10:30am UTC](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why-general-usage-performance-multithreading-floops/96657 "2023-03-31T10:30:46Z")

</div>

Dear Julia community this is my third post after my previous post1, post2. I was unable to replicate my problem in my previous posts. Here, I am going to share my entire algorithm. Please let me know what the problem is…

---

## [This code kills Julia 1.9 RC1](https://discourse.julialang.org/t/this-code-kills-julia-1-9-rc1/96885)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 6\
**Last updated:** [March 31, 2023, 9:26am UTC](https://discourse.julialang.org/t/this-code-kills-julia-1-9-rc1/96885 "2023-03-31T09:26:52Z")

</div>

abstract type VgtkNum end struct VgtkInt{T \<: Integer} \<: VgtkNum int::T end VgtkInt(::Val{N}) where N \<: Integer = VgtkInt(N) VgtkInt(x::AbstractFloat) = VgtkInt(trunc(Int, x)) struct VgtkFloat{T \<: AbstractFloat…

---

## [\`Base.@show\` macro breaks operator precedence](https://discourse.julialang.org/t/base-show-macro-breaks-operator-precedence/96879)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 2\
**Last updated:** [March 31, 2023, 7:27am UTC](https://discourse.julialang.org/t/base-show-macro-breaks-operator-precedence/96879 "2023-03-31T07:27:05Z")

</div>

I just stumbled over the following problem using @show: julia\> @show a=4/2+1; a = 4 / 2 + 1 = 3.0 julia\> @show a=4/2 +1; a = 4 / 2 = 2.0 1 = 1 julia\> a 2.0 julia\> @show a=(4/2 +1); a = 4 / 2 + 1 = 3.0 julia\> a 3.0 I…

---

## [What's the usefulness of Flux.testmode!](https://discourse.julialang.org/t/whats-the-usefulness-of-flux-testmode/96871)

<div class="topic-metadata">

**Author:** [@Xuekui\_wang](https://discourse.julialang.org/u/Xuekui_wang)\
**Replies:** 1\
**Last updated:** [March 31, 2023, 3:56am UTC](https://discourse.julialang.org/t/whats-the-usefulness-of-flux-testmode/96871 "2023-03-31T03:56:41Z")

</div>

I cannot understand Flux.testmode!and Flux.trainmode! well. When I use Flux.testmode(), I found trainloss is lower exactly, For example as follows: if using Flux.testmode() train\_pro\_loss is lower much than valid\_pr…

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

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