# Latest

**URL:** https://discourse.julialang.org/latest.md?page=737

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

**Page:** 738

---

## [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…

---

## [Iterating through JuMP variables](https://discourse.julialang.org/t/iterating-through-jump-variables/96816)

<div class="topic-metadata">

**Author:** [@math\_opt](https://discourse.julialang.org/u/math_opt)\
**Replies:** 5\
**Last updated:** [March 31, 2023, 8:33pm UTC](https://discourse.julialang.org/t/iterating-through-jump-variables/96816 "2023-03-31T20:33:01Z")

</div>

I am doing some trivial checks on the variable values output by my optimization model, and I was wondering what is the correct way to iterate through a JuMP variable. For example, if my model has a variable x\[2:9, 10:15\],…

---

## [ParallelStencil + ImplicitGlobalGrid with multiple GPUs](https://discourse.julialang.org/t/parallelstencil-implicitglobalgrid-with-multiple-gpus/96585)

<div class="topic-metadata">

**Author:** [@Teerthal](https://discourse.julialang.org/u/Teerthal)\
**Replies:** 8\
**Last updated:** [March 31, 2023, 7:39pm UTC](https://discourse.julialang.org/t/parallelstencil-implicitglobalgrid-with-multiple-gpus/96585 "2023-03-31T19:39:24Z")

</div>

Hello, I am currently starting out with GPU programming and working out a multiple GPU implementation of my Electroweak field theory simulation code. I have followed the examples on the ParallelStencil git for multi-GP…

---

## [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?

---

## [Indexing in GPU kernel](https://discourse.julialang.org/t/indexing-in-gpu-kernel/96902)

<div class="topic-metadata">

**Author:** [@shakedregev](https://discourse.julialang.org/u/shakedregev)\
**Replies:** 2\
**Last updated:** [March 31, 2023, 7:07pm UTC](https://discourse.julialang.org/t/indexing-in-gpu-kernel/96902 "2023-03-31T19:07:11Z")

</div>

I’m building a custom GPU kernel and am having trouble indexing into a GPU vector. Q is a matrix stored in CSR format qrows - row pointers qcols - nonzero column indices qvals - nonzero values Here is a code snippet: …

---

## [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…

---

## [How to use locally built LLVM to build Julia?](https://discourse.julialang.org/t/how-to-use-locally-built-llvm-to-build-julia/96660)

<div class="topic-metadata">

**Author:** [@ahsan](https://discourse.julialang.org/u/ahsan)\
**Replies:** 1\
**Last updated:** [March 31, 2023, 5:08pm UTC](https://discourse.julialang.org/t/how-to-use-locally-built-llvm-to-build-julia/96660 "2023-03-31T17:08:07Z")

</div>

I was wondering how could one use a locally built LLVM (with some bug fixes) to build Julia? Is there some document that outlines this. Thanks!

---

## [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…

---

## [Approximate inverse of a definite integral](https://discourse.julialang.org/t/approximate-inverse-of-a-definite-integral/83181)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 8\
**Last updated:** [March 31, 2023, 3:09pm UTC](https://discourse.julialang.org/t/approximate-inverse-of-a-definite-integral/83181 "2023-03-31T15:09:41Z")

</div>

For a given (fixed) function f: \[0,1\] \\to \[0, \\infty), let g(x) = \\int\_0^x f(x) dx and h(x) = \\frac{g(x)}{g(1)} h is then, by construction, \[0,1\] \\to \[0,1\]. I need a fast approximation of its inverse: I am OK with …

---

## [Nested Sum in NLObjective -](https://discourse.julialang.org/t/nested-sum-in-nlobjective/96890)

<div class="topic-metadata">

**Author:** [@Gregoryo](https://discourse.julialang.org/u/Gregoryo)\
**Replies:** 2\
**Last updated:** [March 31, 2023, 3:06pm UTC](https://discourse.julialang.org/t/nested-sum-in-nlobjective/96890 "2023-03-31T15:06:00Z")

</div>

Hi, I am totally new to both Julia and Optimization and I am trying to define a non linear objective that requires nested sums. I found some examples that I am trying to replicate, but I get an error. This is how I set m…

---

## [MTK -- removing parameters from model?](https://discourse.julialang.org/t/mtk-removing-parameters-from-model/96887)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 2\
**Last updated:** [March 31, 2023, 2:56pm UTC](https://discourse.julialang.org/t/mtk-removing-parameters-from-model/96887 "2023-03-31T14:56:44Z")

</div>

My MTK implementation of a DAE for doing Monte Carlo study of parameter uncertainty doesn’t work. I think it has to do with how MTK removes parameters that do not show up explicitly in the model equations. Here is some …

---

## [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…

---

## [Are Unions thread-safe in Agents.jl?](https://discourse.julialang.org/t/are-unions-thread-safe-in-agents-jl/96876)

<div class="topic-metadata">

**Author:** [@stockholm](https://discourse.julialang.org/u/stockholm)\
**Replies:** 8\
**Last updated:** [March 31, 2023, 1:10pm UTC](https://discourse.julialang.org/t/are-unions-thread-safe-in-agents-jl/96876 "2023-03-31T13:10:22Z")

</div>

Yesterday I asked a very similar question, and my code turned out to have had a race condition. That was this Multithreading agents.jl with @threads for all agents question. That was a simplified example. My actual code…

---

## [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…

---

## [Add method with different arguments to existing function?](https://discourse.julialang.org/t/add-method-with-different-arguments-to-existing-function/96190)

<div class="topic-metadata">

**Author:** [@abehersan](https://discourse.julialang.org/u/abehersan)\
**Replies:** 6\
**Last updated:** [March 31, 2023, 7:45am UTC](https://discourse.julialang.org/t/add-method-with-different-arguments-to-existing-function/96190 "2023-03-31T07:45:23Z")

</div>

Hi! Suppose I have a function f(a::Number, b::Number; c=1, d=2.0, e="hello") and I want to add a method to it with different kwargs, but with the same positional arguments, say for example f(a::Number, b::Number; f="bye…

---

## [Apple M1 GPU from Julia?](https://discourse.julialang.org/t/apple-m1-gpu-from-julia/69563)

<div class="topic-metadata">

**Author:** [@Per](https://discourse.julialang.org/u/Per)\
**Replies:** 20\
**Last updated:** [March 31, 2023, 8:49am UTC](https://discourse.julialang.org/t/apple-m1-gpu-from-julia/69563 "2023-03-31T08:49:13Z")

</div>

Does anyone know if it is possible to access the GPU of the Apple M1 chip from Julia? I really just need Float32 matrix-matrix multiplication (SGEMM). Anything else would be a bonus.

---

## [A simple MCMC code for beginners for learning](https://discourse.julialang.org/t/a-simple-mcmc-code-for-beginners-for-learning/31641)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 14\
**Last updated:** [March 31, 2023, 8:48am UTC](https://discourse.julialang.org/t/a-simple-mcmc-code-for-beginners-for-learning/31641 "2023-03-31T08:48:00Z")

</div>

If you try to understand how Metropolis-Hastings MCMC works in producing a posterior for a parameter. You can read various website like this But unless you understand R very well, it would make your head spin. But you…

---

## [Flatten nested tuples to a tuple](https://discourse.julialang.org/t/flatten-nested-tuples-to-a-tuple/96880)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 2\
**Last updated:** [March 31, 2023, 8:07am UTC](https://discourse.julialang.org/t/flatten-nested-tuples-to-a-tuple/96880 "2023-03-31T08:07:27Z")

</div>

I thought I would find a straightforward answer but haven’t been able to locate one. Sorry if this is a stupid question: What’s the simplest way to flatten a nested tuple? The problems is, I call a function which return…

---

## [\`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…

---

## [How to do a PCA with Flux](https://discourse.julialang.org/t/how-to-do-a-pca-with-flux/96836)

<div class="topic-metadata">

**Author:** [@sbacelar](https://discourse.julialang.org/u/sbacelar)\
**Replies:** 1\
**Last updated:** [March 31, 2023, 6:18am UTC](https://discourse.julialang.org/t/how-to-do-a-pca-with-flux/96836 "2023-03-31T06:18:22Z")

</div>

I am trying to use Flux to do a Principal Component Analysis of a simple database (íris) but I am having some problems with Flux.train!\` which gives me the following error: ERROR: MethodError: no method matching loss(::…

---

## [More Extreme Moves in a Downtrending Market?](https://discourse.julialang.org/t/more-extreme-moves-in-a-downtrending-market/96875)

<div class="topic-metadata">

**Author:** [@dm13450](https://discourse.julialang.org/u/dm13450)\
**Replies:** 0\
**Last updated:** [March 31, 2023, 5:26am UTC](https://discourse.julialang.org/t/more-extreme-moves-in-a-downtrending-market/96875 "2023-03-31T05:26:28Z")

</div>

I’ve written a blog post about that explores whether there are more extreme moves in a down trending market: More Extreme Moves in a Downtrending Market? | Dean Markwick

---

## [Problem with Precompilation of Makie](https://discourse.julialang.org/t/problem-with-precompilation-of-makie/96846)

<div class="topic-metadata">

**Author:** [@Lias23](https://discourse.julialang.org/u/Lias23)\
**Replies:** 3\
**Last updated:** [March 31, 2023, 4:34am UTC](https://discourse.julialang.org/t/problem-with-precompilation-of-makie/96846 "2023-03-31T04:34:11Z")

</div>

Hello, I have faced a problem with installing Makie, I get this error using Makie \[ Info: Precompiling Makie \[ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a\] ERROR: LoadError: Could not load font file “C:\\Users\\ΗΛΙΑΣ ΤΣΑΚΩΝΑΣ…

---

## [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/latest.md?page=736)

[Next page](https://discourse.julialang.org/latest.md?page=738)
