# General Usage

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

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

**Page:** 192

---

## [Why do I get the same parameter after the OptimizationProblem](https://discourse.julialang.org/t/why-do-i-get-the-same-parameter-after-the-optimizationproblem/110243)

<div class="topic-metadata">

**Author:** [@whucsu](https://discourse.julialang.org/u/whucsu)\
**Replies:** 23\
**Last updated:** [March 7, 2024, 1:29am UTC](https://discourse.julialang.org/t/why-do-i-get-the-same-parameter-after-the-optimizationproblem/110243 "2024-03-07T01:29:43Z")

</div>

Dear All, I got some questions when using the DiffEqParamEstim.jl my goal is to get the estimated parameter accroding to the Synthetic Data. but I got the same parameter as to the firtst “guess” parameter. the core …

---

## [Error when using DQCType](https://discourse.julialang.org/t/error-when-using-dqctype/111272)

<div class="topic-metadata">

**Author:** [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)\
**Replies:** 0\
**Last updated:** [March 7, 2024, 1:08am UTC](https://discourse.julialang.org/t/error-when-using-dqctype/111272 "2024-03-07T01:08:53Z")

</div>

I tried to solve the example of the package as follows: using DifferentialEquations, Yao, QuantumNLDiffEq # Making the ODEProblem function f(u, p, t) λ, κ = p return -1\*λ\*u\*(κ + tan(λ\*t)) end prob = ODEProblem(f, \[1.0…

---

## [Periodic convolution, equivalent to convolution2d from scipy](https://discourse.julialang.org/t/periodic-convolution-equivalent-to-convolution2d-from-scipy/110191)

<div class="topic-metadata">

**Author:** [@modifiedbear](https://discourse.julialang.org/u/modifiedbear)\
**Replies:** 2\
**Last updated:** [March 6, 2024, 11:43pm UTC](https://discourse.julialang.org/t/periodic-convolution-equivalent-to-convolution2d-from-scipy/110191 "2024-03-06T23:43:16Z")

</div>

Hi! I am new to convolutions. I am looking to implement a convolution with wrapped/toroidal boundaries (i.e. for CircularArrays). # matrix = N x M matrix # smaller\_matrix = some sort of kernel convolve2d(matrix, smaller…

---

## [Slow code with Union and Box](https://discourse.julialang.org/t/slow-code-with-union-and-box/111221)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 17\
**Last updated:** [March 6, 2024, 11:29pm UTC](https://discourse.julialang.org/t/slow-code-with-union-and-box/111221 "2024-03-06T23:29:24Z")

</div>

How can I improve this? I want to keep the Union{A,B,C,D} but make it faster. JET says c is captured and also there is runtime dispatch. abstract type T end struct A \<: T x::Int end struct B \<: T x::Int end struct C \<: …

---

## [Question about range operator (":")](https://discourse.julialang.org/t/question-about-range-operator/111247)

<div class="topic-metadata">

**Author:** [@opera\_malenky](https://discourse.julialang.org/u/opera_malenky)\
**Replies:** 7\
**Last updated:** [March 6, 2024, 8:20pm UTC](https://discourse.julialang.org/t/question-about-range-operator/111247 "2024-03-06T20:20:10Z")

</div>

I was testing some code and noticed something that seemed odd to me when trying to use the range operator (“:”). julia\> 1:5 1:5 but julia\> 5:1 5:4 I don’t see anything in the help for : that suggests different behavi…

---

## [Sending nicely formatted DataFrames by email from linux](https://discourse.julialang.org/t/sending-nicely-formatted-dataframes-by-email-from-linux/111254)

<div class="topic-metadata">

**Author:** [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Replies:** 3\
**Last updated:** [March 6, 2024, 7:59pm UTC](https://discourse.julialang.org/t/sending-nicely-formatted-dataframes-by-email-from-linux/111254 "2024-03-06T19:59:03Z")

</div>

Hello I would like to be able to send an email with a nicely formatted table in linux. from what I can see, it looks like I need to generate my own HTML to create a table out of a DataFrame. Is there a better way to d…

---

## [How to plot a gridworld policy in Makie](https://discourse.julialang.org/t/how-to-plot-a-gridworld-policy-in-makie/111217)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 2\
**Last updated:** [March 6, 2024, 6:16pm UTC](https://discourse.julialang.org/t/how-to-plot-a-gridworld-policy-in-makie/111217 "2024-03-06T18:16:08Z")

</div>

Hey folks. I was looking at a notebook created by the POMDP folks for plotting the Value Iteration policy for a simple Gridworld. I have a copy of the picture below. I was wondering how would I plot something like this …

---

## [Plotting a histogram of multiple independent univariate dataseries in a 2d heatmap](https://discourse.julialang.org/t/plotting-a-histogram-of-multiple-independent-univariate-dataseries-in-a-2d-heatmap/109840)

<div class="topic-metadata">

**Author:** [@JBH\_84](https://discourse.julialang.org/u/JBH_84)\
**Replies:** 2\
**Last updated:** [March 6, 2024, 2:44pm UTC](https://discourse.julialang.org/t/plotting-a-histogram-of-multiple-independent-univariate-dataseries-in-a-2d-heatmap/109840 "2024-03-06T14:44:52Z")

</div>

I would like to do something similar to the example xs = \[string("x", i) for i = 1:10\] ys = \[string("y", i) for i = 1:4\] z = float((1:4) \* reshape(1:10, 1, :)) \* u"km" heatmap(xs, ys, z, aspect\_ratio=1) however, in my …

---

## [Evaluation of function gives NaN](https://discourse.julialang.org/t/evaluation-of-function-gives-nan/111240)

<div class="topic-metadata">

**Author:** [@Sushrut\_Deshpande](https://discourse.julialang.org/u/Sushrut_Deshpande)\
**Replies:** 10\
**Last updated:** [March 6, 2024, 2:21pm UTC](https://discourse.julialang.org/t/evaluation-of-function-gives-nan/111240 "2024-03-06T14:21:53Z")

</div>

Hello, The division of two functions gives NaN when it is not simplified. Here is an example code using ForwardDiff f(x) = (x-1)^2 df(x) = ForwardDiff.derivative(f,x) val = f(1)/df(1) Mathematically this should be 0 …

---

## [Error "Missing source file" when precompiling using Julia 1.10.2](https://discourse.julialang.org/t/error-missing-source-file-when-precompiling-using-julia-1-10-2/111234)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 3\
**Last updated:** [March 6, 2024, 11:51am UTC](https://discourse.julialang.org/t/error-missing-source-file-when-precompiling-using-julia-1-10-2/111234 "2024-03-06T11:51:45Z")

</div>

I did the following: git clone https://github.com/aenarete/KitePodModels.jl cd KitePodModels.jl julia --project and get the following error message: julia\> using KitePodModels Updating registry at \`~/.julia/regist…

---

## [Should an in-place FunctionOperator be totally allocation free?](https://discourse.julialang.org/t/should-an-in-place-functionoperator-be-totally-allocation-free/111219)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 2\
**Last updated:** [March 6, 2024, 11:54am UTC](https://discourse.julialang.org/t/should-an-in-place-functionoperator-be-totally-allocation-free/111219 "2024-03-06T11:54:18Z")

</div>

The code fop = FunctionOperator((v, u, p, t) -\> mul!(v, K\_ff, u), F\_f, zeros(length(F\_f))) prob = LinearProblem(fop, F\_f) @time sol = solve(prob, ALG(), Pl=PRECOND, verbose=verbose) reports allocations: …

---

## [How do I play sound in a notebook (preferably Pluto)?](https://discourse.julialang.org/t/how-do-i-play-sound-in-a-notebook-preferably-pluto/49403)

<div class="topic-metadata">

**Author:** [@minetest2048](https://discourse.julialang.org/u/minetest2048)\
**Replies:** 7\
**Last updated:** [March 6, 2024, 3:59am UTC](https://discourse.julialang.org/t/how-do-i-play-sound-in-a-notebook-preferably-pluto/49403 "2024-03-06T03:59:34Z")

</div>

I want to build a synthesizer in Julia, and I want to play the output inside the notebook, like this example for Jupyter+Python: IPython Cookbook - 11.7. Creating a sound synthesizer in the Notebook I have searched how …

---

## [Using/workaround for unsupported/EOLd operating systems, e.g. CentOS 6. Was: Test julia basic functionality](https://discourse.julialang.org/t/using-workaround-for-unsupported-eold-operating-systems-e-g-centos-6-was-test-julia-basic-functionality/107787)

<div class="topic-metadata">

**Author:** [@kerim](https://discourse.julialang.org/u/kerim)\
**Replies:** 25\
**Last updated:** [March 6, 2024, 1:41am UTC](https://discourse.julialang.org/t/using-workaround-for-unsupported-eold-operating-systems-e-g-centos-6-was-test-julia-basic-functionality/107787 "2024-03-06T01:41:39Z")

</div>

Hi, I work on CentOS 6 and it is known that it ships with GLIBC 2.12 but some packages requires higher version of it (and julia 1.9.4 itself requires at least GLIBC 2.14). I updated GLIBC in custom dir (I can’t risque …

---

## [Hidden allocations when parallelizing with @batch](https://discourse.julialang.org/t/hidden-allocations-when-parallelizing-with-batch/111051)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 13\
**Last updated:** [March 5, 2024, 10:35pm UTC](https://discourse.julialang.org/t/hidden-allocations-when-parallelizing-with-batch/111051 "2024-03-05T22:35:18Z")

</div>

Hello guys! I’ve hit a bit of a roadblock and need a bit of help to overcome it. I’ve made a parallelized reduction function in which I am using Polyester.@batch. It works very well for 1 dimensional arrays, but now I a…

---

## [IterativeSolvers.jl not working as expected with mutating and allocation](https://discourse.julialang.org/t/iterativesolvers-jl-not-working-as-expected-with-mutating-and-allocation/110277)

<div class="topic-metadata">

**Author:** [@erny123](https://discourse.julialang.org/u/erny123)\
**Replies:** 9\
**Last updated:** [March 5, 2024, 9:49pm UTC](https://discourse.julialang.org/t/iterativesolvers-jl-not-working-as-expected-with-mutating-and-allocation/110277 "2024-03-05T21:49:00Z")

</div>

I’m trying to solve a simple linear system. However, it seems like the preallocated versions of any IterativeSolvers.jl functions are either much slower or allocating more memory. Here’s the example: using IterativeSol…

---

## [Help me understand juliaup](https://discourse.julialang.org/t/help-me-understand-juliaup/111218)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 2\
**Last updated:** [March 5, 2024, 10:16pm UTC](https://discourse.julialang.org/t/help-me-understand-juliaup/111218 "2024-03-05T22:16:46Z")

</div>

I have a Mac and I use julia I install julia on my mac manually I wish to use juliaup However I failed to find documentation about juliaup (especially about how it stores various version of julia internally) This is …

---

## [How to add tab to module with JuliaFormatter](https://discourse.julialang.org/t/how-to-add-tab-to-module-with-juliaformatter/111121)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 1\
**Last updated:** [March 5, 2024, 7:48pm UTC](https://discourse.julialang.org/t/how-to-add-tab-to-module-with-juliaformatter/111121 "2024-03-05T19:48:52Z")

</div>

Hi all, I would like to modify the default behavior of JuliaFormatter so that it produces module MyModule using ... ... end instead of left alignment: module MyModule using ... ... end Thanks!

---

## [Latex in GLMakie, no spaces](https://discourse.julialang.org/t/latex-in-glmakie-no-spaces/111192)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 7\
**Last updated:** [March 5, 2024, 6:26pm UTC](https://discourse.julialang.org/t/latex-in-glmakie-no-spaces/111192 "2024-03-05T18:26:18Z")

</div>

When trying to use Latex with GLMakie in this code: using GLMakie f = Figure(backgroundcolor = "#f5f0f5") ax = Axis(f\[1, 1\], title = L"A Makie Axis", xlabel = L"The x label", ylabel = L"The y label \\omega"…

---

## [Error spawning threads: possible timing issue as some not starting in 1.10.2](https://discourse.julialang.org/t/error-spawning-threads-possible-timing-issue-as-some-not-starting-in-1-10-2/111206)

<div class="topic-metadata">

**Author:** [@ericsfraga](https://discourse.julialang.org/u/ericsfraga)\
**Replies:** 0\
**Last updated:** [March 5, 2024, 4:38pm UTC](https://discourse.julialang.org/t/error-spawning-threads-possible-timing-issue-as-some-not-starting-in-1-10-2/111206 "2024-03-05T16:38:15Z")

</div>

I have a multi-threaded application (multi-agent system with autonomous agents) which has generally been working fine. I upgraded to 1.10.2 yesterday and since then I noticed that some of the agents were not actually sta…

---

## ["waiting for IO to finish" (1.10 beta2)](https://discourse.julialang.org/t/waiting-for-io-to-finish-1-10-beta2/103240)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 3\
**Last updated:** [March 5, 2024, 4:04pm UTC](https://discourse.julialang.org/t/waiting-for-io-to-finish-1-10-beta2/103240 "2024-03-05T16:04:12Z")

</div>

Trying out the latest beta for v 1.10 on MS-Windows, the package manager gives a bunch of warnings as shown in the title. They displayed while the update was running, and then in the summary at the end. Do they indica…

---

## [Doing a plot recipe that plots a varying number of meshes](https://discourse.julialang.org/t/doing-a-plot-recipe-that-plots-a-varying-number-of-meshes/111201)

<div class="topic-metadata">

**Author:** [@Larbino1](https://discourse.julialang.org/u/Larbino1)\
**Replies:** 1\
**Last updated:** [March 5, 2024, 3:37pm UTC](https://discourse.julialang.org/t/doing-a-plot-recipe-that-plots-a-varying-number-of-meshes/111201 "2024-03-05T15:37:40Z")

</div>

I would like to create a recipe that can plot a variable number of meshes, supposing I have a list of GeometryBasics objects and a list of positions/quaternions. I’m struggling to get it to work: this is my best attempt…

---

## [Iterating over types in Union](https://discourse.julialang.org/t/iterating-over-types-in-union/111172)

<div class="topic-metadata">

**Author:** [@screw\_dog](https://discourse.julialang.org/u/screw_dog)\
**Replies:** 4\
**Last updated:** [March 5, 2024, 1:07pm UTC](https://discourse.julialang.org/t/iterating-over-types-in-union/111172 "2024-03-05T13:07:22Z")

</div>

Is there a way (that doesn’t involve reaching into private details of Base/Core) to iterate over the types in a Union? In my case I know that it’ll only ever be a small union of concrete types, if that helps. I’m writin…

---

## [40 seconds to view a simple plot with no data in Makie](https://discourse.julialang.org/t/40-seconds-to-view-a-simple-plot-with-no-data-in-makie/111189)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 6\
**Last updated:** [March 5, 2024, 12:34pm UTC](https://discourse.julialang.org/t/40-seconds-to-view-a-simple-plot-with-no-data-in-makie/111189 "2024-03-05T12:34:49Z")

</div>

I attach a “screen recording” with my phone, as I still need to find a suitable screen recording software. My computer is pretty fast, so no spec issue. Laptop which runs on i7, has NVIDIA built in gpu, plenty of cache …

---

## [Color defined externally Makie](https://discourse.julialang.org/t/color-defined-externally-makie/111187)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 1\
**Last updated:** [March 5, 2024, 11:55am UTC](https://discourse.julialang.org/t/color-defined-externally-makie/111187 "2024-03-05T11:55:12Z")

</div>

I want to put the color from a defined string flag grey\_flag = 1 fig\_color = "white" if grey\_flag == 1 fig\_color = "#f5f0f5" end f = Figure(backgroundcolor = :fig\_color) It throws an error as it attempts to see …

---

## [Output doesn't show plots](https://discourse.julialang.org/t/output-doesnt-show-plots/111092)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 23\
**Last updated:** [March 5, 2024, 11:04am UTC](https://discourse.julialang.org/t/output-doesnt-show-plots/111092 "2024-03-05T11:04:17Z")

</div>

I followed the documentation: https://docs.juliaplots.org/latest/output/ and tried to write show=true and using Plots arr = \[1.2, 1.4, 1.5, 1.1\] x = \[1, 2, 3, 4\] p = scatter(x, arr) display(p) But no new window with …

---

## [Upgrading to Julia 1.10.2](https://discourse.julialang.org/t/upgrading-to-julia-1-10-2/111185)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 2\
**Last updated:** [March 5, 2024, 10:59am UTC](https://discourse.julialang.org/t/upgrading-to-julia-1-10-2/111185 "2024-03-05T10:59:47Z")

</div>

At command prompt: Microsoft Windows \[Version 10.0.22631.3155\] (c) Microsoft Corporation. All rights reserved. C:\\Users\\TGebbels\>winget install julia -s msstore Found an existing package already installed. Trying to up…

---

## [Stdout buffering](https://discourse.julialang.org/t/stdout-buffering/111182)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 2\
**Last updated:** [March 5, 2024, 10:50am UTC](https://discourse.julialang.org/t/stdout-buffering/111182 "2024-03-05T10:50:16Z")

</div>

I seem to fail to RTFM with stream buffering. My problem is the following (under linux): $ strace -o trace stdbuf -o 1MB julia -e "for i=1:100000 write(stdout,\\"something\\") end"| cat \>/dev/null $ wc -l trace 301126 t…

---

## [Abstract Plotting install errors](https://discourse.julialang.org/t/abstract-plotting-install-errors/111179)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 4\
**Last updated:** [March 5, 2024, 9:29am UTC](https://discourse.julialang.org/t/abstract-plotting-install-errors/111179 "2024-03-05T09:29:03Z")

</div>

This is the error I got from installing AbstractPlotting 182 dependencies successfully precompiled in 309 seconds. 91 already precompiled. 5 dependencies had output during precompilation: ┌ Formatting │ ┌ Warning: DE…

---

## [How to determine if the repl is running?](https://discourse.julialang.org/t/how-to-determine-if-the-repl-is-running/111151)

<div class="topic-metadata">

**Author:** [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Replies:** 1\
**Last updated:** [March 5, 2024, 3:26am UTC](https://discourse.julialang.org/t/how-to-determine-if-the-repl-is-running/111151 "2024-03-05T03:26:09Z")

</div>

I would like to know if the REPL has been started, the best answer that I could find is read eval print loop - Julia: find out if run from REPL or command line - Stack Overflow which suggests isinteractive(), but this on…

---

## [JLD2: How to update existing dataset array on disk?](https://discourse.julialang.org/t/jld2-how-to-update-existing-dataset-array-on-disk/111103)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 5\
**Last updated:** [March 5, 2024, 2:27am UTC](https://discourse.julialang.org/t/jld2-how-to-update-existing-dataset-array-on-disk/111103 "2024-03-05T02:27:21Z")

</div>

I am trying to update parts of an array stored inside a .jld2 file. However, all the changes that I make are not actually stored to disk. As an MWP, imagine doing using JLD2 a = zeros(100,100) jldsave("test.jld2"; a=a…

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

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