# General Usage

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

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

**Page:** 322

---

## [What is the package that keeps the threads open in the pool for future call?](https://discourse.julialang.org/t/what-is-the-package-that-keeps-the-threads-open-in-the-pool-for-future-call/95406)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 4\
**Last updated:** [March 2, 2023, 12:09pm UTC](https://discourse.julialang.org/t/what-is-the-package-that-keeps-the-threads-open-in-the-pool-for-future-call/95406 "2023-03-02T12:09:15Z")

</div>

I know that $OMP in OpenMP open the specified threads and assign tasks for them as demanded. However, after finishing the threads stay open in the pool. So, any future call to the threads will call them from the pool (as…

---

## [Bug in RootsAndPoles.jl Package?](https://discourse.julialang.org/t/bug-in-rootsandpoles-jl-package/95437)

<div class="topic-metadata">

**Author:** [@bjs](https://discourse.julialang.org/u/bjs)\
**Replies:** 0\
**Last updated:** [March 2, 2023, 12:04pm UTC](https://discourse.julialang.org/t/bug-in-rootsandpoles-jl-package/95437 "2023-03-02T12:04:03Z")

</div>

Recently, I tried the package RootsAndPoles.jl (v2.0.0) with standard parameters as described on github’s readme and tested it with the simple complex f(z)=Log(z) function with the attached result. The root at z=1 is cl…

---

## [Julia 1.8.5 not working on Rock Pi 4](https://discourse.julialang.org/t/julia-1-8-5-not-working-on-rock-pi-4/95425)

<div class="topic-metadata">

**Author:** [@minetest2048](https://discourse.julialang.org/u/minetest2048)\
**Replies:** 5\
**Last updated:** [March 2, 2023, 10:35am UTC](https://discourse.julialang.org/t/julia-1-8-5-not-working-on-rock-pi-4/95425 "2023-03-02T10:35:22Z")

</div>

I’ve downloaded Julia 1.8.5 aarch64 to my Rock Pi 4 running Ubuntu 18.04.1 LTS (GNU/Linux 4.4.154-95-rockchip-gd2ab1f26e1b3 aarch64) When I tried to run the REPL it just get stuck trying to write the exception rock@har…

---

## [Why are unions of concrete types not concrete?](https://discourse.julialang.org/t/why-are-unions-of-concrete-types-not-concrete/95423)

<div class="topic-metadata">

**Author:** [@amansawhney](https://discourse.julialang.org/u/amansawhney)\
**Replies:** 6\
**Last updated:** [March 2, 2023, 8:21am UTC](https://discourse.julialang.org/t/why-are-unions-of-concrete-types-not-concrete/95423 "2023-03-02T08:21:20Z")

</div>

I am looking to use Julia for a high performance application where I need to iterate through many items. The items can be of various types, but those types are all concrete. I can make a union of those types. It appears …

---

## [Rodas4 (crashes) versus Tsit5 (works)](https://discourse.julialang.org/t/rodas4-crashes-versus-tsit5-works/95415)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 10\
**Last updated:** [March 2, 2023, 7:56am UTC](https://discourse.julialang.org/t/rodas4-crashes-versus-tsit5-works/95415 "2023-03-02T07:56:23Z")

</div>

@ChrisRackauckas, Here is a minimum working example of solving a 3x3 system using the StaticArrays.jl module. The solver runs fine with Tsit5 but crashes with Rodas. Not clear how that is possible since Rodas4 is a stif…

---

## [Like a list comprehension but with several lines](https://discourse.julialang.org/t/like-a-list-comprehension-but-with-several-lines/95365)

<div class="topic-metadata">

**Author:** [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Replies:** 8\
**Last updated:** [March 2, 2023, 3:35am UTC](https://discourse.julialang.org/t/like-a-list-comprehension-but-with-several-lines/95365 "2023-03-02T03:35:21Z")

</div>

It frequently happens that I have a loop with ~10 lines. I’d like to return some value at the end of each iteration, collect that in an array, and then plot it. I can pre-allocate some array, or append to an array as th…

---

## [Multi language help/documentation](https://discourse.julialang.org/t/multi-language-help-documentation/95395)

<div class="topic-metadata">

**Author:** [@dgagnon](https://discourse.julialang.org/u/dgagnon)\
**Replies:** 2\
**Last updated:** [March 2, 2023, 1:43am UTC](https://discourse.julialang.org/t/multi-language-help-documentation/95395 "2023-03-02T01:43:13Z")

</div>

Hello We are working on a not yet published package and producing the documentation as we go. All this is done in English given that is the most understood language in the IT world. However, there is a requirement for a…

---

## [How to modify plot on click?](https://discourse.julialang.org/t/how-to-modify-plot-on-click/95419)

<div class="topic-metadata">

**Author:** [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Replies:** 0\
**Last updated:** [March 2, 2023, 12:34am UTC](https://discourse.julialang.org/t/how-to-modify-plot-on-click/95419 "2023-03-02T00:34:16Z")

</div>

The other day, I saw a research presenting a graph where he added points where he clicked and did arbitrary logic on them upon adding them (to be precise, it was a Poincaré section, and adding a point computed and showed…

---

## [Where I can find the "C" source codes of the solver in my computer after adding the KLU package,?](https://discourse.julialang.org/t/where-i-can-find-the-c-source-codes-of-the-solver-in-my-computer-after-adding-the-klu-package/95409)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 8\
**Last updated:** [March 1, 2023, 11:07pm UTC](https://discourse.julialang.org/t/where-i-can-find-the-c-source-codes-of-the-solver-in-my-computer-after-adding-the-klu-package/95409 "2023-03-01T23:07:47Z")

</div>

I have added KLU.jl package and it is installed in C:\\Users\\path\\.julia\\packages\\KLU. However, I could not find in the folder the original C source codes of the solver, for instance klu\_analyze.c as in KLU

---

## [Unsure how to develop a package in v1.8](https://discourse.julialang.org/t/unsure-how-to-develop-a-package-in-v1-8/95408)

<div class="topic-metadata">

**Author:** [@jsbryan4](https://discourse.julialang.org/u/jsbryan4)\
**Replies:** 3\
**Last updated:** [March 1, 2023, 10:53pm UTC](https://discourse.julialang.org/t/unsure-how-to-develop-a-package-in-v1-8/95408 "2023-03-01T22:53:36Z")

</div>

I am trying to create a module called BindingInference that ultimately I would like to use as a Package. I store all the files in a directory structured like BindingInference/ Project.toml license, readme, and g…

---

## [2D static array](https://discourse.julialang.org/t/2d-static-array/95414)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 1\
**Last updated:** [March 1, 2023, 10:35pm UTC](https://discourse.julialang.org/t/2d-static-array/95414 "2023-03-01T22:35:21Z")

</div>

I have an issue regarding StaticArray dimensionality when using DifferentialEquations.jl. If I solve a matrix equation using 3x3 StaticArrays, my solver returns a 3x3 array. Will that create a problem in the solve func…

---

## [Switching two elements in array, vcat getting flagged as runtime-dispatch?](https://discourse.julialang.org/t/switching-two-elements-in-array-vcat-getting-flagged-as-runtime-dispatch/95407)

<div class="topic-metadata">

**Author:** [@hshackle](https://discourse.julialang.org/u/hshackle)\
**Replies:** 2\
**Last updated:** [March 1, 2023, 10:25pm UTC](https://discourse.julialang.org/t/switching-two-elements-in-array-vcat-getting-flagged-as-runtime-dispatch/95407 "2023-03-01T22:25:41Z")

</div>

I currently have the following line of code in a simulation: function exchangeBits(n::BitVector, i::Int, j::Int) # Returns a copy of n with the ith and jth bits exchanged if i \< j m = n\[vcat(1:(i - 1), j…

---

## [Keyword arguments preventing eliding boundscheck](https://discourse.julialang.org/t/keyword-arguments-preventing-eliding-boundscheck/95405)

<div class="topic-metadata">

**Author:** [@OmarElrefaei](https://discourse.julialang.org/u/OmarElrefaei)\
**Replies:** 2\
**Last updated:** [March 1, 2023, 8:59pm UTC](https://discourse.julialang.org/t/keyword-arguments-preventing-eliding-boundscheck/95405 "2023-03-01T20:59:42Z")

</div>

So I’ve got a MWE here with a weird behavior. Note: this seems to be actually fixed in v1.9. But I couldn’t track any relevant issues to PR. I’m trying to elide some checking code with @boundscheck. (yes, the real use …

---

## [Does anybody use \`--track-allocations\`](https://discourse.julialang.org/t/does-anybody-use-track-allocations/92570)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 12\
**Last updated:** [March 1, 2023, 8:53pm UTC](https://discourse.julialang.org/t/does-anybody-use-track-allocations/92570 "2023-03-01T20:53:36Z")

</div>

Would anyone mind if we removed support for julia --track-allocations in favor of the more reliable allocation profiler @allocations and @allocated macros? (RFC: Remove \`--track-allocation\` by vchuravy · Pull Request #4…

---

## [Datatype when save matrices in HDF5 file](https://discourse.julialang.org/t/datatype-when-save-matrices-in-hdf5-file/95364)

<div class="topic-metadata">

**Author:** [@jisutich](https://discourse.julialang.org/u/jisutich)\
**Replies:** 2\
**Last updated:** [March 1, 2023, 8:18pm UTC](https://discourse.julialang.org/t/datatype-when-save-matrices-in-hdf5-file/95364 "2023-03-01T20:18:28Z")

</div>

Hi, I am trying to write a HDF5 file in Julia. Now suppose I want to create a dataset mydataset which contains a matrix A in the group mygroup, what datatype should I use in the function create\_dataset? (In the documen…

---

## [Create interpolation function from file data during module initialization](https://discourse.julialang.org/t/create-interpolation-function-from-file-data-during-module-initialization/95326)

<div class="topic-metadata">

**Author:** [@tom-plaa](https://discourse.julialang.org/u/tom-plaa)\
**Replies:** 5\
**Last updated:** [March 1, 2023, 8:03pm UTC](https://discourse.julialang.org/t/create-interpolation-function-from-file-data-during-module-initialization/95326 "2023-03-01T20:03:38Z")

</div>

I have a module that is supposed to perform some numerical tasks, including random sampling. These tasks, in particular the sampling, depend on using functions for which there is no closed-form expression, so I brute-for…

---

## [Static Array and optimization](https://discourse.julialang.org/t/static-array-and-optimization/95399)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 6\
**Last updated:** [March 1, 2023, 7:19pm UTC](https://discourse.julialang.org/t/static-array-and-optimization/95399 "2023-03-01T19:19:57Z")

</div>

I am working on optimizing a 3x3 solver in Rheology. Here is my function. My question relates to the amount of memory allocation necessary to store a function in a dictionary. Here is a MWE: using DifferentialEquations …

---

## [LU factorisation of dense and sparse matrix](https://discourse.julialang.org/t/lu-factorisation-of-dense-and-sparse-matrix/95393)

<div class="topic-metadata">

**Author:** [@cvikas](https://discourse.julialang.org/u/cvikas)\
**Replies:** 2\
**Last updated:** [March 1, 2023, 5:06pm UTC](https://discourse.julialang.org/t/lu-factorisation-of-dense-and-sparse-matrix/95393 "2023-03-01T17:06:54Z")

</div>

Hi guys, I’ve been trying convert MATLAB code to Julia, and I observed LU factorization for sparse and dense matrix of the same matrix give different number of non-zero fill-ins. Consider the following example: using …

---

## [@code\_warntype not found](https://discourse.julialang.org/t/code-warntype-not-found/95392)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [March 1, 2023, 4:17pm UTC](https://discourse.julialang.org/t/code-warntype-not-found/95392 "2023-03-01T16:17:10Z")

</div>

When I use @code\_warntype from the command line, it is found. However, when I insert it into my script and run the script from the commandline via julia script.jl then, @code\_warntype is not found. What am I missing? …

---

## [LoadError: MethodError: no method matching](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching/95361)

<div class="topic-metadata">

**Author:** [@WekawTirso](https://discourse.julialang.org/u/WekawTirso)\
**Replies:** 5\
**Last updated:** [March 1, 2023, 3:49pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching/95361 "2023-03-01T15:49:53Z")

</div>

Hello, Given two distinct points Start =\[xS,yS\] and End = \[xE,yE\] in 2d, my aim is to find a simple way to generate N evenly-spaced points along the shortest path between Start and End. That is, I want a generalization…

---

## [Multi-threaded testing](https://discourse.julialang.org/t/multi-threaded-testing/95372)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 2\
**Last updated:** [March 1, 2023, 2:57pm UTC](https://discourse.julialang.org/t/multi-threaded-testing/95372 "2023-03-01T14:57:05Z")

</div>

I want to use multithreading to speed up my test suite, but it seems to “hide” the tests from the test set. Any idea why? julia\> using Base.Threads julia\> using Test julia\> @testset "Sequential" begin for i…

---

## [Callback at saveat times](https://discourse.julialang.org/t/callback-at-saveat-times/95331)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 4\
**Last updated:** [March 1, 2023, 2:34pm UTC](https://discourse.julialang.org/t/callback-at-saveat-times/95331 "2023-03-01T14:34:41Z")

</div>

I have read most of the documentation on Callbacks, but I still have an issue, that does not appear to be covered. Here is a fragment of a longer section from an UODE: λ8 = (T8\_11 + T8\_22 + T8\_33)/2 # λ9 = tr(…

---

## [Why is \`UniformScaling\` not a subtype of \`AbstractArray\`?](https://discourse.julialang.org/t/why-is-uniformscaling-not-a-subtype-of-abstractarray/3412)

<div class="topic-metadata">

**Author:** [@Pbellive](https://discourse.julialang.org/u/Pbellive)\
**Replies:** 10\
**Last updated:** [March 1, 2023, 2:14pm UTC](https://discourse.julialang.org/t/why-is-uniformscaling-not-a-subtype-of-abstractarray/3412 "2023-03-01T14:14:24Z")

</div>

Say I have the following line of code in Julia C = A\*B where A and B are matrices, i.e. typeof(A) == typeof(B) \<: AbstractMatrix If A is a multiple of the appropriately sized identity matrix then it is convenient to …

---

## [Different return types in map vs comprehension for empty vectors](https://discourse.julialang.org/t/different-return-types-in-map-vs-comprehension-for-empty-vectors/95371)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [March 1, 2023, 1:51pm UTC](https://discourse.julialang.org/t/different-return-types-in-map-vs-comprehension-for-empty-vectors/95371 "2023-03-01T13:51:42Z")

</div>

julia\> map(Base.OneTo, Int\[\]) Any\[\] julia\> \[Base.OneTo(x) for x in Int\[\]\] Base.OneTo{Int64}\[\] julia\> VERSION v"1.9.0-beta4" Why this difference?

---

## [Plotting surface without interpolating at discontinuity](https://discourse.julialang.org/t/plotting-surface-without-interpolating-at-discontinuity/95279)

<div class="topic-metadata">

**Author:** [@NoFishLikeIan](https://discourse.julialang.org/u/NoFishLikeIan)\
**Replies:** 5\
**Last updated:** [March 1, 2023, 10:15am UTC](https://discourse.julialang.org/t/plotting-surface-without-interpolating-at-discontinuity/95279 "2023-03-01T10:15:26Z")

</div>

I am attempting to plot a function that has a discontinuity, consider for example, function f(x, y) if x^2 + y^2 ≤ 1/2 return 1. else return 0. end end If I use the surface function from Plo…

---

## [CSV dependency not building](https://discourse.julialang.org/t/csv-dependency-not-building/95370)

<div class="topic-metadata">

**Author:** [@EffSugna](https://discourse.julialang.org/u/EffSugna)\
**Replies:** 1\
**Last updated:** [March 1, 2023, 9:54am UTC](https://discourse.julialang.org/t/csv-dependency-not-building/95370 "2023-03-01T09:54:34Z")

</div>

Hi all, New to Julia, relatively beginner programmer. Unable to get CSV dependency installed. Have tried as many work arounds as I can find on internet, older solutions to this problem with earlier versions of Julia …

---

## [Combinatorics -- what has changed?](https://discourse.julialang.org/t/combinatorics-what-has-changed/95355)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 5\
**Last updated:** [March 1, 2023, 8:58am UTC](https://discourse.julialang.org/t/combinatorics-what-has-changed/95355 "2023-03-01T08:58:50Z")

</div>

The following code used to work (some 1 year ago…) collect(Iterators.flatten((prod(u) for u in with\_replacement\_combinations(x,i)) for i in 0:3)) Now, the code works if I change the i range to 1:3, but then I miss valu…

---

## [Iterate out of range](https://discourse.julialang.org/t/iterate-out-of-range/95360)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 3\
**Last updated:** [February 28, 2023, 10:50pm UTC](https://discourse.julialang.org/t/iterate-out-of-range/95360 "2023-02-28T22:50:35Z")

</div>

Are these results expected? julia\> iterate(3:7, 9) (10, 10) julia\> iterate(3:7, 9) (10, 10) julia\> iterate(3:1:7, 9) (10, 10) julia\> iterate('c':'l','n') ('o', 'o') julia\> iterate('c':'l',15) ('\\x10', '\\x10')

---

## [Replace missing values based on column data type](https://discourse.julialang.org/t/replace-missing-values-based-on-column-data-type/94186)

<div class="topic-metadata">

**Author:** [@Sandy45](https://discourse.julialang.org/u/Sandy45)\
**Replies:** 7\
**Last updated:** [February 10, 2023, 2:23am UTC](https://discourse.julialang.org/t/replace-missing-values-based-on-column-data-type/94186 "2023-02-10T02:23:18Z")

</div>

Hello, Question 1: I have df with multiple columns say a,b,c,d… so on and i would like to replace all missing values dynamically in each columns with 0(if column data type is int) and with “xyz” if column data type is …

---

## [SIMD gather result in slow down](https://discourse.julialang.org/t/simd-gather-result-in-slow-down/95161)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 6\
**Last updated:** [February 28, 2023, 7:33pm UTC](https://discourse.julialang.org/t/simd-gather-result-in-slow-down/95161 "2023-02-28T19:33:56Z")

</div>

using SIMD function Unpack(dst::Vector{UInt8}, src::Vector{UInt8}, count::Int) int32SplitArray = src int64Array = reinterpret(Int32, dst) v1 = Int32\[0\] v2 = reinterpret(UInt8, v1) @inbounds for i = 1…

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

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