# General Usage

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

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

**Page:** 321

---

## [WGLMakie in Pluto firefox overuse of CPU resources](https://discourse.julialang.org/t/wglmakie-in-pluto-firefox-overuse-of-cpu-resources/95494)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 1\
**Last updated:** [March 4, 2023, 9:09am UTC](https://discourse.julialang.org/t/wglmakie-in-pluto-firefox-overuse-of-cpu-resources/95494 "2023-03-04T09:09:15Z")

</div>

I am using WGLMakie to make some interactive plots in Pluto. After making some, my % CPU resources spike like following: starting with no WGLMakie figure and ca. 30% CPU usage 1 figure ca. 150 % CPU usage 2 figure ca…

---

## [\[Resolved\] Julia, Cantera, PyCall](https://discourse.julialang.org/t/resolved-julia-cantera-pycall/95510)

<div class="topic-metadata">

**Author:** [@aquarelleX332](https://discourse.julialang.org/u/aquarelleX332)\
**Replies:** 11\
**Last updated:** [March 3, 2023, 9:35pm UTC](https://discourse.julialang.org/t/resolved-julia-cantera-pycall/95510 "2023-03-03T21:35:00Z")

</div>

Hello, This is a bit of a stupid question because I don’t know the Python language. How to convert these instructions to Julia? \>\>\> II = \[i for i,r in enumerate(g.reactions()) ... if 'CO' in r.reactants and 'CO2…

---

## [Agents.jl : Rabbit Fox Hawk Example only Plot 1 Red and 1 Blue Creature](https://discourse.julialang.org/t/agents-jl-rabbit-fox-hawk-example-only-plot-1-red-and-1-blue-creature/95514)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 0\
**Last updated:** [March 3, 2023, 9:08pm UTC](https://discourse.julialang.org/t/agents-jl-rabbit-fox-hawk-example-only-plot-1-red-and-1-blue-creature/95514 "2023-03-03T21:08:46Z")

</div>

Hi all, why my video / animation of Rabbit Fox Hawk only plot 1 red and then become 1 blue till the end of step? from: https://juliadynamics.github.io/Agents.jl/stable/examples/rabbit\_fox\_hawk/ (it is a very great pa…

---

## [Simple performance test of threaded execution](https://discourse.julialang.org/t/simple-performance-test-of-threaded-execution/95473)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 3\
**Last updated:** [March 3, 2023, 8:33pm UTC](https://discourse.julialang.org/t/simple-performance-test-of-threaded-execution/95473 "2023-03-03T20:33:04Z")

</div>

Is there a (ideally, standard) test of threaded performance? I am looking at a puzzle, where two Linux systems give very different scaling of parallel computations with threads. It would be great to figure out which o…

---

## [Is this supposed to happen?](https://discourse.julialang.org/t/is-this-supposed-to-happen/95421)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 7\
**Last updated:** [March 3, 2023, 4:05pm UTC](https://discourse.julialang.org/t/is-this-supposed-to-happen/95421 "2023-03-03T16:05:19Z")

</div>

The code bellow produces this weird message: julia\> include("C:\\\\Users\\\\pkonl\\\\Desktop\\\\weird.jl") Threads.nthreads() = 4 …

---

## [Automatic update of the values of a structure](https://discourse.julialang.org/t/automatic-update-of-the-values-of-a-structure/95500)

<div class="topic-metadata">

**Author:** [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Replies:** 3\
**Last updated:** [March 3, 2023, 3:16pm UTC](https://discourse.julialang.org/t/automatic-update-of-the-values-of-a-structure/95500 "2023-03-03T15:16:27Z")

</div>

Hello :grin:, I would like to know if it is possible to automatically update the parameters of a strcutre when it is modified. For example, in the following example, the value of b is not updated when a changes: julia\> …

---

## [Best packages to use to recreate a boxplot](https://discourse.julialang.org/t/best-packages-to-use-to-recreate-a-boxplot/95499)

<div class="topic-metadata">

**Author:** [@rakshith95](https://discourse.julialang.org/u/rakshith95)\
**Replies:** 1\
**Last updated:** [March 3, 2023, 2:56pm UTC](https://discourse.julialang.org/t/best-packages-to-use-to-recreate-a-boxplot/95499 "2023-03-03T14:56:31Z")

</div>

Hello, For a paper, I’d like to recreate a boxplot similar to the one below, where, for discrete values of ‘x’, I have ‘y’ data from multiple different sources So far, I see that Makie, StatsPlots, and PlotlyJS, hav…

---

## [GMT Question: Choropleth Map Does not Show Color](https://discourse.julialang.org/t/gmt-question-choropleth-map-does-not-show-color/95481)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 3\
**Last updated:** [March 3, 2023, 2:14pm UTC](https://discourse.julialang.org/t/gmt-question-choropleth-map-does-not-show-color/95481 "2023-03-03T14:14:41Z")

</div>

Hi all, I am trying tutorial from this: https://www.generic-mapping-tools.org/GMT.jl/dev/gallery/choropleths/choropleth\_cv19/ First of all, it actually needs to have .shx file besides .shp files, but when I try to plo…

---

## [LoopVectorization for sparse matrix operation : @turbo, LoopVectorization.check\_args](https://discourse.julialang.org/t/loopvectorization-for-sparse-matrix-operation-turbo-loopvectorization-check-args/95497)

<div class="topic-metadata">

**Author:** [@whn](https://discourse.julialang.org/u/whn)\
**Replies:** 1\
**Last updated:** [March 3, 2023, 1:38pm UTC](https://discourse.julialang.org/t/loopvectorization-for-sparse-matrix-operation-turbo-loopvectorization-check-args/95497 "2023-03-03T13:38:43Z")

</div>

I’m beginning programming in julia. I’m trying to vectorize a loop that generate V, a vector that describes data of a sparse matrix which support indices are defined by Vector{Int64} I and J. u, K, v are contiguous f64 …

---

## [Split vector into N (potentially unequal length) subvectors?](https://discourse.julialang.org/t/split-vector-into-n-potentially-unequal-length-subvectors/73548)

<div class="topic-metadata">

**Author:** [@markmbaum](https://discourse.julialang.org/u/markmbaum)\
**Replies:** 9\
**Last updated:** [March 3, 2023, 9:58am UTC](https://discourse.julialang.org/t/split-vector-into-n-potentially-unequal-length-subvectors/73548 "2023-03-03T09:58:34Z")

</div>

Is there a convenience function for splitting a vector into N subvectors? For example, if you had a length-10 vector and called the function to split it into 3 parts, you would get three vectors back, two with length 3 a…

---

## [SymPy Simplify Problem with a lot of symbols](https://discourse.julialang.org/t/sympy-simplify-problem-with-a-lot-of-symbols/95486)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [March 3, 2023, 11:06am UTC](https://discourse.julialang.org/t/sympy-simplify-problem-with-a-lot-of-symbols/95486 "2023-03-03T11:06:10Z")

</div>

Hi all, I just want to know why simplify((a\*x - b)\*(a\*x + b)) can’t become a^{2}x^{2} -b^{2} in Julia? using SymPy @syms x, a, b, c, t, u c = (a^2 - b^2)/(2\*a\*b) d = ((a\*x -b)/(a\*x+b))^c f1(x) = log(d) u = log(x^2 + …

---

## [Saving Primes Number in a range to CSV](https://discourse.julialang.org/t/saving-primes-number-in-a-range-to-csv/95480)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 4\
**Last updated:** [March 3, 2023, 10:55am UTC](https://discourse.julialang.org/t/saving-primes-number-in-a-range-to-csv/95480 "2023-03-03T10:55:13Z")

</div>

Hi all, I want to save all prime numbers in certain range into CSV. But why it does not saved? I am following this forum: using Primes, CSV CSV.write("./out.csv", (p = primes(1,1000000)))

---

## [Package to work with piecewise functions?](https://discourse.julialang.org/t/package-to-work-with-piecewise-functions/95091)

<div class="topic-metadata">

**Author:** [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Replies:** 2\
**Last updated:** [March 2, 2023, 4:48pm UTC](https://discourse.julialang.org/t/package-to-work-with-piecewise-functions/95091 "2023-03-02T16:48:22Z")

</div>

Hi, @aerappa and I are looking for a package that would allow us to easily represent and work with (mathematical) functions that are defined in a piecewise manner. To be a bit more specific, assuming we are working with…

---

## [How to make app using PackageCompiler fully offline](https://discourse.julialang.org/t/how-to-make-app-using-packagecompiler-fully-offline/95482)

<div class="topic-metadata">

**Author:** [@minetest2048](https://discourse.julialang.org/u/minetest2048)\
**Replies:** 2\
**Last updated:** [March 3, 2023, 9:35am UTC](https://discourse.julialang.org/t/how-to-make-app-using-packagecompiler-fully-offline/95482 "2023-03-03T09:35:44Z")

</div>

When I run an app using PackageCompiler it somehow downloaded MKL at first startup: byakuya@ifrit-hpc ~/a/bin\> ./acq\_prod Downloaded artifact: MKL Downloaded artifact: MKL My project.toml is this: name = "acq\_pro…

---

## [Returs the value of a variable](https://discourse.julialang.org/t/returs-the-value-of-a-variable/95487)

<div class="topic-metadata">

**Author:** [@Amine](https://discourse.julialang.org/u/Amine)\
**Replies:** 1\
**Last updated:** [March 3, 2023, 9:24am UTC](https://discourse.julialang.org/t/returs-the-value-of-a-variable/95487 "2023-03-03T09:24:12Z")

</div>

Hey guys, I am havijg small trouble with my script if you can help, I have a function that calculates angles and i want to use one of these angles “θtT” as an argument of this same function in the second par of my code …

---

## [Julia and kitty terminal integration](https://discourse.julialang.org/t/julia-and-kitty-terminal-integration/95368)

<div class="topic-metadata">

**Author:** [@HanD](https://discourse.julialang.org/u/HanD)\
**Replies:** 4\
**Last updated:** [March 3, 2023, 8:26am UTC](https://discourse.julialang.org/t/julia-and-kitty-terminal-integration/95368 "2023-03-03T08:26:39Z")

</div>

Hello all! This is not a question, rather sharing a solution I couldn’t find readily available. I recently started using the kitty terminal, and I like it a lot (this is not an official endorsement). One of the many gr…

---

## [User/Console Input (read, readline, input)](https://discourse.julialang.org/t/user-console-input-read-readline-input/15031)

<div class="topic-metadata">

**Author:** [@Debianista](https://discourse.julialang.org/u/Debianista)\
**Replies:** 26\
**Last updated:** [March 3, 2023, 8:13am UTC](https://discourse.julialang.org/t/user-console-input-read-readline-input/15031 "2023-03-03T08:13:08Z")

</div>

Apologies for the newbie question. I’m not a coder, but trying to get a little familiar with Julia. I’ve installed it on my MacBook, along with Juno and Atom. From what I’ve been able to find, I should be able to get i…

---

## [Julia multithreading is running slower than serial, can someone please explain why...?](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why/95430)

<div class="topic-metadata">

**Author:** [@nethaji8](https://discourse.julialang.org/u/nethaji8)\
**Replies:** 15\
**Last updated:** [March 3, 2023, 8:07am UTC](https://discourse.julialang.org/t/julia-multithreading-is-running-slower-than-serial-can-someone-please-explain-why/95430 "2023-03-03T08:07:32Z")

</div>

I am trying to parallelize an algorithm which looks like this I initialized a vector of vectors(50000\*1000), in the loop I shifted a random element from an odd-numbered vector into an adjacent even vector at a random pl…

---

## [Fastest Julia startup challenge/smallest sysimage](https://discourse.julialang.org/t/fastest-julia-startup-challenge-smallest-sysimage/95389)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 8\
**Last updated:** [March 3, 2023, 6:34am UTC](https://discourse.julialang.org/t/fastest-julia-startup-challenge-smallest-sysimage/95389 "2023-03-03T06:34:44Z")

</div>

@vchuravy or anyone who would like to help in the challenge. sys.so shrinks from 173M to 96M With julia --startup-file=no startup time improves to 77ms from 127ms on my machine That’s 39% faster startup, with a 44…

---

## [div(::UnitRange{Int64}... error](https://discourse.julialang.org/t/div-unitrange-int64-error/95475)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 4\
**Last updated:** [March 3, 2023, 1:31am UTC](https://discourse.julialang.org/t/div-unitrange-int64-error/95475 "2023-03-03T01:31:48Z")

</div>

@ChrisRackauckas I get the error: ERROR: LoadError: MethodError: no method matching div(::UnitRange{Int64}, ::Int64, ::RoundingMode{:ToZero}) that I cannot figure out. This occurred while I was producing a MWE related…

---

## [Profiler: how to understand time spent in functions](https://discourse.julialang.org/t/profiler-how-to-understand-time-spent-in-functions/95467)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 6\
**Last updated:** [March 3, 2023, 12:22am UTC](https://discourse.julialang.org/t/profiler-how-to-understand-time-spent-in-functions/95467 "2023-03-03T00:22:46Z")

</div>

I am optimizing a bubble sort function which also returns -1^(number of permutations). using BenchmarkTools, Profile, StatProfilerHTML function sort\_signature!(state::Vector{T}) where T \<: Integer signature = 1 …

---

## [Function forwarding for clashing function names](https://discourse.julialang.org/t/function-forwarding-for-clashing-function-names/95318)

<div class="topic-metadata">

**Author:** [@PaterPen](https://discourse.julialang.org/u/PaterPen)\
**Replies:** 3\
**Last updated:** [March 2, 2023, 9:39pm UTC](https://discourse.julialang.org/t/function-forwarding-for-clashing-function-names/95318 "2023-03-02T21:39:52Z")

</div>

I have general question regarding composition and function forwarding. Let’s assume we have a struct car which is composed of a motor and a horn: struct car m::Motor h::Horn end Both of it’s components implemen…

---

## [Memory overwrite](https://discourse.julialang.org/t/memory-overwrite/95446)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 5\
**Last updated:** [March 2, 2023, 8:24pm UTC](https://discourse.julialang.org/t/memory-overwrite/95446 "2023-03-02T20:24:32Z")

</div>

I am working towards creating an MWE of a UODE problem based on systems of equations. In the course of whittling down my problem, I came across the following: println("++\> trajectories: ", trajectories) # Train …

---

## [How to parallelize animations](https://discourse.julialang.org/t/how-to-parallelize-animations/95461)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 0\
**Last updated:** [March 2, 2023, 6:23pm UTC](https://discourse.julialang.org/t/how-to-parallelize-animations/95461 "2023-03-02T18:23:40Z")

</div>

I have been using the @animate macro in the Plots.jl package. I have noticed that the animation is always built using one thread. So for example, in the following toy example : N=1000; anim = @animate for t in 1:N …

---

## [Accessing docstring of a field](https://discourse.julialang.org/t/accessing-docstring-of-a-field/4830)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [March 2, 2023, 5:35pm UTC](https://discourse.julialang.org/t/accessing-docstring-of-a-field/4830 "2023-03-02T17:35:36Z")

</div>

Fields of a struct can be documented, but how does one retrieve the docstrings? Is it possible via ? in the REPL? MWE: struct Foo "I want this docstring" x end

---

## [Any way to populate a grid from input vectors?](https://discourse.julialang.org/t/any-way-to-populate-a-grid-from-input-vectors/95410)

<div class="topic-metadata">

**Author:** [@albrightand](https://discourse.julialang.org/u/albrightand)\
**Replies:** 3\
**Last updated:** [March 2, 2023, 3:42pm UTC](https://discourse.julialang.org/t/any-way-to-populate-a-grid-from-input-vectors/95410 "2023-03-02T15:42:31Z")

</div>

Is there any existing package to take two input vectors and create a grid (similar to meshgrid) and then output a raster based on a third dimension? Something that recreates roundgridfun.m in Matlab.

---

## [Looking for ways to debug mathematical algorithms](https://discourse.julialang.org/t/looking-for-ways-to-debug-mathematical-algorithms/95435)

<div class="topic-metadata">

**Author:** [@stepanzh](https://discourse.julialang.org/u/stepanzh)\
**Replies:** 5\
**Last updated:** [March 2, 2023, 2:55pm UTC](https://discourse.julialang.org/t/looking-for-ways-to-debug-mathematical-algorithms/95435 "2023-03-02T14:55:28Z")

</div>

My research involves developing of thermodynamical solvers. They need equation solvers, minimization, automatic differentiation, etc. When I develop a new solver for a physical problem or face a bug in an existing one, I…

---

## [PackageCompiler does not compile included Julia-files!](https://discourse.julialang.org/t/packagecompiler-does-not-compile-included-julia-files/95443)

<div class="topic-metadata">

**Author:** [@Miroslav-Stimac](https://discourse.julialang.org/u/Miroslav-Stimac)\
**Replies:** 0\
**Last updated:** [March 2, 2023, 12:58pm UTC](https://discourse.julialang.org/t/packagecompiler-does-not-compile-included-julia-files/95443 "2023-03-02T12:58:30Z")

</div>

Hello, I developed a program with Julia that consists of a main file called MyProgram.jl and an additional file called MyAdditionalCode.jl. In MyProgram.jl I have this content: … # Some libraries imported via import or…

---

## [How to switch between dev and normal version of the same package](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396)

<div class="topic-metadata">

**Author:** [@JianghuiDu](https://discourse.julialang.org/u/JianghuiDu)\
**Replies:** 11\
**Last updated:** [March 2, 2023, 12:28pm UTC](https://discourse.julialang.org/t/how-to-switch-between-dev-and-normal-version-of-the-same-package/95396 "2023-03-02T12:28:03Z")

</div>

I’m developing a package which is stored in my Github rep but not registered with Julia. I have the dev version in the .julia/dev directory, and I also install the normal version from Github in the .julia/packages direct…

---

## [Mixture of Float32 and Float64](https://discourse.julialang.org/t/mixture-of-float32-and-float64/95439)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 1\
**Last updated:** [March 2, 2023, 12:26pm UTC](https://discourse.julialang.org/t/mixture-of-float32-and-float64/95439 "2023-03-02T12:26:19Z")

</div>

If a computational graph is a mixture of Float32 and Float64, will Zygote have issues? Or must one be careful about types? Are there any stated rules, best practices, etc? Clearly adding a Float32 and a Float64 should n…

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

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