# General Usage

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

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

**Page:** 238

---

## [Dev packages based on different versions of julia, what to do?](https://discourse.julialang.org/t/dev-packages-based-on-different-versions-of-julia-what-to-do/105157)

<div class="topic-metadata">

**Author:** [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Replies:** 1\
**Last updated:** [October 19, 2023, 8:18am UTC](https://discourse.julialang.org/t/dev-packages-based-on-different-versions-of-julia-what-to-do/105157 "2023-10-19T08:18:44Z")

</div>

In my project I have created various dev packages in the past. I’ve been working with mainly a couple packages lately (which depend on most older packages). As Julia get updated, these couple new packages get updated w…

---

## [How to convert a Matrix{Array{Int64, 0}} to a Matrix{Int64}](https://discourse.julialang.org/t/how-to-convert-a-matrix-array-int64-0-to-a-matrix-int64/105136)

<div class="topic-metadata">

**Author:** [@empet](https://discourse.julialang.org/u/empet)\
**Replies:** 11\
**Last updated:** [October 19, 2023, 6:01am UTC](https://discourse.julialang.org/t/how-to-convert-a-matrix-array-int64-0-to-a-matrix-int64/105136 "2023-10-19T06:01:23Z")

</div>

A function returns a matrix nr, like this: 3×3 Matrix{Array{Int64, 0}}: fill(4) fill(2) fill(1) fill(1) fill(2) fill(2) fill(2) fill(1) fill(1) fill(4)\[\] is displayed as 4. How to get from the matrix nr the …

---

## [Why doesn’t Julia fma automatically?](https://discourse.julialang.org/t/why-doesn-t-julia-fma-automatically/104982)

<div class="topic-metadata">

**Author:** [@mj2984](https://discourse.julialang.org/u/mj2984)\
**Replies:** 43\
**Last updated:** [October 18, 2023, 4:17pm UTC](https://discourse.julialang.org/t/why-doesn-t-julia-fma-automatically/104982 "2023-10-18T16:17:35Z")

</div>

Is there any reason why the compiler doesn’t optimize these? I feel like having to do this is a detriment to high level programming, and especially the math like syntax that I can write in Julia (same expression I use i…

---

## [Smoothing spline fit through a set of (x,y) points](https://discourse.julialang.org/t/smoothing-spline-fit-through-a-set-of-x-y-points/104873)

<div class="topic-metadata">

**Author:** [@hanshinlee77](https://discourse.julialang.org/u/hanshinlee77)\
**Replies:** 7\
**Last updated:** [October 18, 2023, 3:09pm UTC](https://discourse.julialang.org/t/smoothing-spline-fit-through-a-set-of-x-y-points/104873 "2023-10-18T15:09:38Z")

</div>

Hello, I have a set of (x,y) points (shown in the attached dpng) which I would like to create a smoothing spline through. Normally, I don’t have a problem doing a fit like this using Spline1D() from Dierckx.jl or inte…

---

## [Set the same colour for every \`@series\` in a loop of a plot recipe](https://discourse.julialang.org/t/set-the-same-colour-for-every-series-in-a-loop-of-a-plot-recipe/105117)

<div class="topic-metadata">

**Author:** [@giancarloantonucci](https://discourse.julialang.org/u/giancarloantonucci)\
**Replies:** 0\
**Last updated:** [October 18, 2023, 12:16pm UTC](https://discourse.julialang.org/t/set-the-same-colour-for-every-series-in-a-loop-of-a-plot-recipe/105117 "2023-10-18T12:16:36Z")

</div>

Take the following dummy plot-recipe: using Plots struct Example end @recipe function f(ex::Example) @series begin seriescolor --\> 1 \[1:10, 1:10\] end for n in 1:10 @series begin …

---

## [Conversion from string to matrix](https://discourse.julialang.org/t/conversion-from-string-to-matrix/105109)

<div class="topic-metadata">

**Author:** [@dnldlg](https://discourse.julialang.org/u/dnldlg)\
**Replies:** 3\
**Last updated:** [October 18, 2023, 12:15pm UTC](https://discourse.julialang.org/t/conversion-from-string-to-matrix/105109 "2023-10-18T12:15:33Z")

</div>

I saved a complex matrix to a text file, e.g. ComplexF64\[1.0 + 1.0im 1.0 + 0.0im; 5.0 + 0.0im 0.0 + 0.0im\] but struggle to read it again. Is there an easy way to parse this?

---

## [Relocation issue during create\_sysimage() of large libraries of code (Flux, FastAI, Cairo)](https://discourse.julialang.org/t/relocation-issue-during-create-sysimage-of-large-libraries-of-code-flux-fastai-cairo/105110)

<div class="topic-metadata">

**Author:** [@raph38130](https://discourse.julialang.org/u/raph38130)\
**Replies:** 0\
**Last updated:** [October 18, 2023, 10:09am UTC](https://discourse.julialang.org/t/relocation-issue-during-create-sysimage-of-large-libraries-of-code-flux-fastai-cairo/105110 "2023-10-18T10:09:38Z")

</div>

julia-1.9.3 on ibm power9 ppc64le I successfully created a sysimage with Flux, FastAI, … but can’t incrementally add CairoMakie due to relocation error. Working sysimage.so is 821MB large. Summary/tmp/jl\_uxK58XMbaX.o(t…

---

## [Avoid allocations on broadcasted getindex()](https://discourse.julialang.org/t/avoid-allocations-on-broadcasted-getindex/105098)

<div class="topic-metadata">

**Author:** [@ejmeitz](https://discourse.julialang.org/u/ejmeitz)\
**Replies:** 2\
**Last updated:** [October 18, 2023, 9:53am UTC](https://discourse.julialang.org/t/avoid-allocations-on-broadcasted-getindex/105098 "2023-10-18T09:53:36Z")

</div>

If I have the code below is there someway to do this without allocating intermediate arrays? It feels like it should be possible but I cant figure it out. I can do this without allocating if I was indexing with a range, …

---

## [Hanging when playing around with tasks](https://discourse.julialang.org/t/hanging-when-playing-around-with-tasks/105065)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 7\
**Last updated:** [October 18, 2023, 8:55am UTC](https://discourse.julialang.org/t/hanging-when-playing-around-with-tasks/105065 "2023-10-18T08:55:28Z")

</div>

I was playing around with tasks and gathering return values from tasks that are opened and closed at will by a user. I wrote the following and I’m experience hangs. mutable struct Process task::Union{Nothing, Task} …

---

## [Problems using QuickDraw](https://discourse.julialang.org/t/problems-using-quickdraw/105101)

<div class="topic-metadata">

**Author:** [@mpeters2](https://discourse.julialang.org/u/mpeters2)\
**Replies:** 0\
**Last updated:** [October 18, 2023, 2:15am UTC](https://discourse.julialang.org/t/problems-using-quickdraw/105101 "2023-10-18T02:15:36Z")

</div>

I saw this package/talk on how to make deployable stand-alone Julia Apps using Quickdraw\*: here: https://www.youtube.com/watch?v=ruxYAY5\_bfE and here: Quickdraw: The simplest Julia package deployment system :: JuliaCon…

---

## [I can't help but think debugging memory allocations shouldn't be this hard](https://discourse.julialang.org/t/i-cant-help-but-think-debugging-memory-allocations-shouldnt-be-this-hard/105042)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 18\
**Last updated:** [October 17, 2023, 11:29pm UTC](https://discourse.julialang.org/t/i-cant-help-but-think-debugging-memory-allocations-shouldnt-be-this-hard/105042 "2023-10-17T23:29:07Z")

</div>

I do julia --track-allocation=user b.jl The relevant report here is: and How does this make sense?

---

## [Wrong supertype for compiled sysimage](https://discourse.julialang.org/t/wrong-supertype-for-compiled-sysimage/105090)

<div class="topic-metadata">

**Author:** [@Kruxigt](https://discourse.julialang.org/u/Kruxigt)\
**Replies:** 3\
**Last updated:** [October 17, 2023, 10:18pm UTC](https://discourse.julialang.org/t/wrong-supertype-for-compiled-sysimage/105090 "2023-10-17T22:18:29Z")

</div>

I have the following two functions in my code function test\_supertype1(t::Type) return supertype(t) end function test\_supertype2(t::Type{T}) where T \<: AssetLayer return supertype(t) end Normally both work as …

---

## [Shade area under curve with pyplot backend](https://discourse.julialang.org/t/shade-area-under-curve-with-pyplot-backend/105092)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 2\
**Last updated:** [October 17, 2023, 9:46pm UTC](https://discourse.julialang.org/t/shade-area-under-curve-with-pyplot-backend/105092 "2023-10-17T21:46:37Z")

</div>

Hi, I would like to shade the area under a curve with the pyplot backend in Plots.jl. The code works for the GR backend, but not the pyplot backend. Is this a bug or does pyplot require different syntax? using Plots, …

---

## [Critique my workflow for small models in Julia](https://discourse.julialang.org/t/critique-my-workflow-for-small-models-in-julia/105089)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 4\
**Last updated:** [October 17, 2023, 7:28pm UTC](https://discourse.julialang.org/t/critique-my-workflow-for-small-models-in-julia/105089 "2023-10-17T19:28:03Z")

</div>

In the process of iterating through lots of toy economic models and writing small scripts to analyze them (make plots, etc.). I’ve gotten into the following workflow, and I’m wondering if (a) it’s reasonable (b) Other p…

---

## [Error with a system of coupled ODEs with complex coefficients](https://discourse.julialang.org/t/error-with-a-system-of-coupled-odes-with-complex-coefficients/105027)

<div class="topic-metadata">

**Author:** [@Sh\_166](https://discourse.julialang.org/u/Sh_166)\
**Replies:** 7\
**Last updated:** [October 17, 2023, 11:41am UTC](https://discourse.julialang.org/t/error-with-a-system-of-coupled-odes-with-complex-coefficients/105027 "2023-10-17T11:41:09Z")

</div>

I was trying to solve a system of coupled differential equations with imaginary coefficients and I ran into a weird trouble. MWE: using Symbolics, Plots, DifferentialEquations, ModelingToolkit, LaTeXStrings, Measures, …

---

## [Revise not triggering in Docker container with mounted volume](https://discourse.julialang.org/t/revise-not-triggering-in-docker-container-with-mounted-volume/27631)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 8\
**Last updated:** [October 17, 2023, 8:02am UTC](https://discourse.julialang.org/t/revise-not-triggering-in-docker-container-with-mounted-volume/27631 "2023-10-17T08:02:10Z")

</div>

I have a docker container based off julia:latest. The container is configured to run Julia apps and I mount the local app folder into the container. So Julia runs within the container while the files are edited on the ho…

---

## [Lazy virtually indexed version of vcat hcat cat?](https://discourse.julialang.org/t/lazy-virtually-indexed-version-of-vcat-hcat-cat/105045)

<div class="topic-metadata">

**Author:** [@pxshen](https://discourse.julialang.org/u/pxshen)\
**Replies:** 2\
**Last updated:** [October 17, 2023, 7:31am UTC](https://discourse.julialang.org/t/lazy-virtually-indexed-version-of-vcat-hcat-cat/105045 "2023-10-17T07:31:30Z")

</div>

Is there a lazy virtually indexed version of vcat hcat cat which doesn’t allocate new array?

---

## [Rename just one of imported names with "using"](https://discourse.julialang.org/t/rename-just-one-of-imported-names-with-using/105026)

<div class="topic-metadata">

**Author:** [@RaulDurand](https://discourse.julialang.org/u/RaulDurand)\
**Replies:** 12\
**Last updated:** [October 17, 2023, 12:33am UTC](https://discourse.julialang.org/t/rename-just-one-of-imported-names-with-using/105026 "2023-10-17T00:33:55Z")

</div>

I want to use Luxor in my package, which also has a Point structure. One alternative would be to rename the Point name from Luxor (e.g., as Pt) to avoid conflicts. Luxor exports hundreds of other symbols, but Point is …

---

## [Does Julia support any hardware developement?](https://discourse.julialang.org/t/does-julia-support-any-hardware-developement/105024)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 5\
**Last updated:** [October 17, 2023, 12:54am UTC](https://discourse.julialang.org/t/does-julia-support-any-hardware-developement/105024 "2023-10-17T00:54:58Z")

</div>

I mean, is Julia available as a programming language for some hardware development, such as microcontroller unit or single chip microcomputer?

---

## [Penalty for not defining mutable struct fields types](https://discourse.julialang.org/t/penalty-for-not-defining-mutable-struct-fields-types/105020)

<div class="topic-metadata">

**Author:** [@jondavis847](https://discourse.julialang.org/u/jondavis847)\
**Replies:** 10\
**Last updated:** [October 16, 2023, 8:20pm UTC](https://discourse.julialang.org/t/penalty-for-not-defining-mutable-struct-fields-types/105020 "2023-10-16T20:20:01Z")

</div>

Hello, I have a rather large and complicated mutable struct which I use to just house pre-allocated Vector{SArray} 's of a system. I can then pass this struct to my functions which get called many times without allocati…

---

## [Does \`@inbounds\` work for functions with keyword arguments?](https://discourse.julialang.org/t/does-inbounds-work-for-functions-with-keyword-arguments/105032)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 4\
**Last updated:** [October 16, 2023, 7:09pm UTC](https://discourse.julialang.org/t/does-inbounds-work-for-functions-with-keyword-arguments/105032 "2023-10-16T19:09:01Z")

</div>

Consider the following functions: @inline function f1(n) @boundscheck n == 0 && error("zero") n end @inline function f2(n; m = 0) @boundscheck n == 0 && error("zero") n+m end g1(n) = @inbounds f1(n) g2…

---

## [Trouble with PProf: no data?](https://discourse.julialang.org/t/trouble-with-pprof-no-data/105022)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 0\
**Last updated:** [October 16, 2023, 3:45pm UTC](https://discourse.julialang.org/t/trouble-with-pprof-no-data/105022 "2023-10-16T15:45:12Z")

</div>

I do Profile.Allocs.clear() Profile.Allocs.@profile K = conductivity(femm, geom, Temp) PProf.Allocs.pprof() I get but in the browser There is nothing there! When I click on View/Source I get the error m…

---

## [Why does THIS allocate? No hairs were harmed in this experiment ('cause I am bald...)](https://discourse.julialang.org/t/why-does-this-allocate-no-hairs-were-harmed-in-this-experiment-cause-i-am-bald/104989)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 16\
**Last updated:** [October 16, 2023, 3:48pm UTC](https://discourse.julialang.org/t/why-does-this-allocate-no-hairs-were-harmed-in-this-experiment-cause-i-am-bald/104989 "2023-10-16T15:48:53Z")

</div>

One more puzzle: julia\> function cross3!( …

---

## [Can I avoid inverting a matrix?](https://discourse.julialang.org/t/can-i-avoid-inverting-a-matrix/105011)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [October 16, 2023, 2:59pm UTC](https://discourse.julialang.org/t/can-i-avoid-inverting-a-matrix/105011 "2023-10-16T14:59:28Z")

</div>

I have the following code: M = s\*I-SS.A G = SS.C\*inv(M)\*SS.B + SS.D It calculates the transfer function of a linear system in state space form. Can I avoid inverting the matrix M? I heard that this can result in b…

---

## [Is there a version of "enumerate" in the reverse order?](https://discourse.julialang.org/t/is-there-a-version-of-enumerate-in-the-reverse-order/38374)

<div class="topic-metadata">

**Author:** [@HugoTrentesaux](https://discourse.julialang.org/u/HugoTrentesaux)\
**Replies:** 3\
**Last updated:** [October 16, 2023, 2:40pm UTC](https://discourse.julialang.org/t/is-there-a-version-of-enumerate-in-the-reverse-order/38374 "2023-10-16T14:40:49Z")

</div>

I would like to enumerate an iterator with known length in reverse order. Something like: julia\> for t in enumerate(\["a","b","c"\], reverse=true); println(t); end (3, "c") (2, "b") (1, "a") Is there something builtin? F…

---

## [Package incompatibility after upgrade](https://discourse.julialang.org/t/package-incompatibility-after-upgrade/99318)

<div class="topic-metadata">

**Author:** [@harven](https://discourse.julialang.org/u/harven)\
**Replies:** 1\
**Last updated:** [October 16, 2023, 1:13pm UTC](https://discourse.julialang.org/t/package-incompatibility-after-upgrade/99318 "2023-10-16T13:13:25Z")

</div>

I have just upgraded from julia 1.8 to 1.9 and there is now an incompatibility between the Winston (version 1.0.0) package and ImageView (version 0.11.5) package. julia\> import Winston julia\> import ImageView (julia:…

---

## [Neural ode usage](https://discourse.julialang.org/t/neural-ode-usage/105007)

<div class="topic-metadata">

**Author:** [@Mak](https://discourse.julialang.org/u/Mak)\
**Replies:** 6\
**Last updated:** [October 16, 2023, 12:07pm UTC](https://discourse.julialang.org/t/neural-ode-usage/105007 "2023-10-16T12:07:18Z")

</div>

How can I pre train the net? let me explain. Neural ode is very slow if I don’t give the network information. My ode and exogenous variables are the ones seen in the file. how can I incorporate them to my structure to sp…

---

## [How to download the full content of the dynamic web page?](https://discourse.julialang.org/t/how-to-download-the-full-content-of-the-dynamic-web-page/104998)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 1\
**Last updated:** [October 16, 2023, 11:11am UTC](https://discourse.julialang.org/t/how-to-download-the-full-content-of-the-dynamic-web-page/104998 "2023-10-16T11:11:57Z")

</div>

How to download the full content of the link path=("https://wybory.gov.pl/sejmsenat2023/pl/sejm/wynik/okr/1") ? The download(path,“file.html”) command generates just a fragment of the path page. Thx!

---

## [Root finding with zero lower bound](https://discourse.julialang.org/t/root-finding-with-zero-lower-bound/104970)

<div class="topic-metadata">

**Author:** [@JakeWren](https://discourse.julialang.org/u/JakeWren)\
**Replies:** 2\
**Last updated:** [October 16, 2023, 11:03am UTC](https://discourse.julialang.org/t/root-finding-with-zero-lower-bound/104970 "2023-10-16T11:03:23Z")

</div>

Hi, I want to use: find\_zero((f,fp), x\_{0}, Roots.Newton()) for root finding. However, my domain is non-negative. Is there a way to impose this? Thanks!

---

## [Modifying the element in the vector of vectors](https://discourse.julialang.org/t/modifying-the-element-in-the-vector-of-vectors/104994)

<div class="topic-metadata">

**Author:** [@MKY](https://discourse.julialang.org/u/MKY)\
**Replies:** 2\
**Last updated:** [October 16, 2023, 7:36am UTC](https://discourse.julialang.org/t/modifying-the-element-in-the-vector-of-vectors/104994 "2023-10-16T07:36:12Z")

</div>

What should I do if I just want to modify the fifth element in the third vector?

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

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