# General Usage

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

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

**Page:** 257

---

## [Writing for generality](https://discourse.julialang.org/t/writing-for-generality/102913)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 2\
**Last updated:** [August 17, 2023, 4:21pm UTC](https://discourse.julialang.org/t/writing-for-generality/102913 "2023-08-17T16:21:23Z")

</div>

I re-discovered this old thread, which I started well more than a year ago, when I was a complete newbie: I wanted to write a findall-like function that partitions the indices into two sets according to a criterion: f…

---

## [Plots not finishing in Julia 1.9.2](https://discourse.julialang.org/t/plots-not-finishing-in-julia-1-9-2/102909)

<div class="topic-metadata">

**Author:** [@morningglory05](https://discourse.julialang.org/u/morningglory05)\
**Replies:** 4\
**Last updated:** [August 17, 2023, 3:59pm UTC](https://discourse.julialang.org/t/plots-not-finishing-in-julia-1-9-2/102909 "2023-08-17T15:59:05Z")

</div>

I made the update from Julia 1.8.5 to Julia 1.9.2. Now, cells containing plots are no longer running. I was wondering if I just had to wait longer, so I ran the following code in a Julia 1.9.2 kernel as a test: using Pl…

---

## [Create custom units in Unitful](https://discourse.julialang.org/t/create-custom-units-in-unitful/102827)

<div class="topic-metadata">

**Author:** [@Tillmann\_Bosch](https://discourse.julialang.org/u/Tillmann_Bosch)\
**Replies:** 7\
**Last updated:** [August 17, 2023, 1:21pm UTC](https://discourse.julialang.org/t/create-custom-units-in-unitful/102827 "2023-08-17T13:21:32Z")

</div>

Hey together! Im creating custom units with Unitful and am stumbling across a difficulty for which I havent yet found a solution for. I created a little module in which I am able to define new unitful dimensions and cre…

---

## [Not able to understand why everything is Vector or Matrix types which are alias types of Array](https://discourse.julialang.org/t/not-able-to-understand-why-everything-is-vector-or-matrix-types-which-are-alias-types-of-array/102902)

<div class="topic-metadata">

**Author:** [@saampandit](https://discourse.julialang.org/u/saampandit)\
**Replies:** 5\
**Last updated:** [August 17, 2023, 2:58pm UTC](https://discourse.julialang.org/t/not-able-to-understand-why-everything-is-vector-or-matrix-types-which-are-alias-types-of-array/102902 "2023-08-17T14:58:38Z")

</div>

How we should create an object whose type is Array not Vector or Matrix which are aliases of Arrays For example if I can create an Array x = \["random", 1, "test", 3.1455\] y = \["Hello" 1 ; "test" "random"\] then typeof …

---

## [Gradient Computation Time of Neural ODE](https://discourse.julialang.org/t/gradient-computation-time-of-neural-ode/102724)

<div class="topic-metadata">

**Author:** [@George\_Stepaniants](https://discourse.julialang.org/u/George_Stepaniants)\
**Replies:** 5\
**Last updated:** [August 17, 2023, 12:56pm UTC](https://discourse.julialang.org/t/gradient-computation-time-of-neural-ode/102724 "2023-08-17T12:56:26Z")

</div>

I am training a neural ODE that simulates a neural ODE dy/dt = g(y) for Ns trajectories where each trajectory consists of Nt timepoints (y(t1), …, y(t\_Nt)). As the number of trajectory samples Ns and the time points save…

---

## [Composing a Neural ODE with another Neural Network](https://discourse.julialang.org/t/composing-a-neural-ode-with-another-neural-network/102682)

<div class="topic-metadata">

**Author:** [@George\_Stepaniants](https://discourse.julialang.org/u/George_Stepaniants)\
**Replies:** 2\
**Last updated:** [August 17, 2023, 12:52pm UTC](https://discourse.julialang.org/t/composing-a-neural-ode-with-another-neural-network/102682 "2023-08-17T12:52:17Z")

</div>

A problem I have been battling with for several weeks now. I am interested in fitting a model that simulates a neural ode ydot = g(y) and then passes this output y(t) pointwise in time through another neural network y(t)…

---

## [Why are the items in Julia's Sets mutable, but there is no immutable version of the latter?](https://discourse.julialang.org/t/why-are-the-items-in-julias-sets-mutable-but-there-is-no-immutable-version-of-the-latter/102898)

<div class="topic-metadata">

**Author:** [@ARCJ137442](https://discourse.julialang.org/u/ARCJ137442)\
**Replies:** 1\
**Last updated:** [August 17, 2023, 10:05am UTC](https://discourse.julialang.org/t/why-are-the-items-in-julias-sets-mutable-but-there-is-no-immutable-version-of-the-latter/102898 "2023-08-17T10:05:50Z")

</div>

Background First, clarify a point: a set in Julia is an “immutable type”, but in its definition (’ set.jl ‘), a set is represented as a “wrapper around a Dict”, and this “immutability” is represented as "you cannot chan…

---

## [Linux julia 1.8.2/1.8.3 GMT package /lib/julia/libcurl.so: version \`CURL\_OPENSSL\_4' not found error](https://discourse.julialang.org/t/linux-julia-1-8-2-1-8-3-gmt-package-lib-julia-libcurl-so-version-curl-openssl-4-not-found-error/90487)

<div class="topic-metadata">

**Author:** [@benibilme](https://discourse.julialang.org/u/benibilme)\
**Replies:** 14\
**Last updated:** [August 17, 2023, 9:13am UTC](https://discourse.julialang.org/t/linux-julia-1-8-2-1-8-3-gmt-package-lib-julia-libcurl-so-version-curl-openssl-4-not-found-error/90487 "2023-08-17T09:13:01Z")

</div>

Hello, I am using arch linux, I have manually downloaded and installed 64 bit linux version of julia from https://julialang-s3.julialang.org/bin/linux/x64/1.8/julia-1.8.3-linux-x86\_64.tar.gz. I have added many packages …

---

## [Curious about the internals of dynamic dispatch](https://discourse.julialang.org/t/curious-about-the-internals-of-dynamic-dispatch/102888)

<div class="topic-metadata">

**Author:** [@HashBrown](https://discourse.julialang.org/u/HashBrown)\
**Replies:** 12\
**Last updated:** [August 17, 2023, 3:34am UTC](https://discourse.julialang.org/t/curious-about-the-internals-of-dynamic-dispatch/102888 "2023-08-17T03:34:14Z")

</div>

My mental model of how Julia handles dynamic dispatch is by compiling code that looks like: for ele in vector\_of\_abstract\_type do\_something(ele) end to something that looks like this for ele in vector\_of\_abstract\_…

---

## [Multithreading for nested for loops](https://discourse.julialang.org/t/multithreading-for-nested-for-loops/102807)

<div class="topic-metadata">

**Author:** [@Rick](https://discourse.julialang.org/u/Rick)\
**Replies:** 13\
**Last updated:** [August 16, 2023, 10:35pm UTC](https://discourse.julialang.org/t/multithreading-for-nested-for-loops/102807 "2023-08-16T22:35:45Z")

</div>

Hi everyone, I am trying to understand the performance of @threads for nested for-loops. Suppose I have three layer of loops, and I have access to 100 threads for my computation. Each calculation depends on the specifi…

---

## [Is there a way to speed up this code?](https://discourse.julialang.org/t/is-there-a-way-to-speed-up-this-code/102878)

<div class="topic-metadata">

**Author:** [@Luis\_Manuel\_Espinoza](https://discourse.julialang.org/u/Luis_Manuel_Espinoza)\
**Replies:** 4\
**Last updated:** [August 16, 2023, 10:09pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-speed-up-this-code/102878 "2023-08-16T22:09:02Z")

</div>

function open\_xyz\_file(path::AbstractString) file = open(path) num\_atoms = parse(Int, readline(file)) comment = readline(file) symbols = Vector{String}(undef, num\_atoms) coords = zeros(num\_atoms,3) for i in 1:num\_a…

---

## [Running Code Everytime (Plots.jl) Package is Loaded?](https://discourse.julialang.org/t/running-code-everytime-plots-jl-package-is-loaded/102880)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 2\
**Last updated:** [August 16, 2023, 10:00pm UTC](https://discourse.julialang.org/t/running-code-everytime-plots-jl-package-is-loaded/102880 "2023-08-16T22:00:58Z")

</div>

I find that for certain packages there are things I do everytime I am using the package. For example, in Plots.jl I usually set the default linewidth to 2 via using Plots default(linewidth=2) Is there some way to set …

---

## [First steps with Weave.jl: looking for learning resources](https://discourse.julialang.org/t/first-steps-with-weave-jl-looking-for-learning-resources/102836)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 1\
**Last updated:** [August 16, 2023, 8:20pm UTC](https://discourse.julialang.org/t/first-steps-with-weave-jl-looking-for-learning-resources/102836 "2023-08-16T20:20:28Z")

</div>

After many attempts, I have given up using Quarto with Julia. At the moment, it’s simply not the tool for me. Having said that, I am have decided to give Weave.jl a go. In many aspects, it reminds me of R's Knitr. But I…

---

## [Space usage of nested tuples](https://discourse.julialang.org/t/space-usage-of-nested-tuples/102872)

<div class="topic-metadata">

**Author:** [@ilanggear](https://discourse.julialang.org/u/ilanggear)\
**Replies:** 3\
**Last updated:** [August 16, 2023, 6:38pm UTC](https://discourse.julialang.org/t/space-usage-of-nested-tuples/102872 "2023-08-16T18:38:19Z")

</div>

Are vector elements (eg tuples with three fields each) in a structure such as myList = Vector{Tuple{UInt32, UInt16, UInt16}} stored as pointers to tuples, or directly as three UInts? In other words, would myList and myM…

---

## [Saving FFTW plans for future use](https://discourse.julialang.org/t/saving-fftw-plans-for-future-use/102871)

<div class="topic-metadata">

**Author:** [@erny123](https://discourse.julialang.org/u/erny123)\
**Replies:** 2\
**Last updated:** [August 16, 2023, 5:47pm UTC](https://discourse.julialang.org/t/saving-fftw-plans-for-future-use/102871 "2023-08-16T17:47:31Z")

</div>

Is there anyway to save and load FFTW plans? For example: using FFTW sz = 2^13 ar = rand(ComplexF64,(sz,sz)); pthread =FFTW.plan\_fft!(ar,flags=FFTW.MEASURE); inv(pthread); pthreadpatient =FFTW.plan\_fft!(ar,flags=FFTW.…

---

## [Performance / Memory differences between constructors of BigInts](https://discourse.julialang.org/t/performance-memory-differences-between-constructors-of-bigints/102863)

<div class="topic-metadata">

**Author:** [@maxasauruswall](https://discourse.julialang.org/u/maxasauruswall)\
**Replies:** 5\
**Last updated:** [August 16, 2023, 4:07pm UTC](https://discourse.julialang.org/t/performance-memory-differences-between-constructors-of-bigints/102863 "2023-08-16T16:07:11Z")

</div>

Hi all, I’m playing around with arbitrary precision integers in a jupyter notebook (Macbook air, Julia v1.10.0-beta1). I noticed a difference between two constructors of BigInts: @btime BigInt(1234567890) # 45.294 ns…

---

## [How to define a function with argument dependent return](https://discourse.julialang.org/t/how-to-define-a-function-with-argument-dependent-return/102841)

<div class="topic-metadata">

**Author:** [@zxm403089989](https://discourse.julialang.org/u/zxm403089989)\
**Replies:** 7\
**Last updated:** [August 16, 2023, 3:47pm UTC](https://discourse.julialang.org/t/how-to-define-a-function-with-argument-dependent-return/102841 "2023-08-16T15:47:02Z")

</div>

I need to set a function with N dimensional array return. And the parameter N is dependent on the argument. However, Julia cannot recognize this before compile. Here is my approach: function DeltaTensor(total\_dimension:…

---

## [Have slightly modified function compiled without copying code](https://discourse.julialang.org/t/have-slightly-modified-function-compiled-without-copying-code/102864)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 3\
**Last updated:** [August 16, 2023, 3:11pm UTC](https://discourse.julialang.org/t/have-slightly-modified-function-compiled-without-copying-code/102864 "2023-08-16T15:11:45Z")

</div>

I keep running into cases where I have a function that has a base case, but sometimes I want to call it with an extra parameter so it behaves slightly differently. However, I don’t want to write two functions (lots of du…

---

## [PyCall not respecting class inheritance?](https://discourse.julialang.org/t/pycall-not-respecting-class-inheritance/102840)

<div class="topic-metadata">

**Author:** [@hatmatrix](https://discourse.julialang.org/u/hatmatrix)\
**Replies:** 7\
**Last updated:** [August 16, 2023, 2:38pm UTC](https://discourse.julialang.org/t/pycall-not-respecting-class-inheritance/102840 "2023-08-16T14:38:51Z")

</div>

I have a Python package that I’m importing but class inheritance information is lost, so child class methods are not accessible. I can reproduce this problem with this simpler example here that uses PyCall but does not i…

---

## [plotting a histogram in julia with as many bins as values](https://discourse.julialang.org/t/plotting-a-histogram-in-julia-with-as-many-bins-as-values/102861)

<div class="topic-metadata">

**Author:** [@Mark01](https://discourse.julialang.org/u/Mark01)\
**Replies:** 1\
**Last updated:** [August 16, 2023, 2:32pm UTC](https://discourse.julialang.org/t/plotting-a-histogram-in-julia-with-as-many-bins-as-values/102861 "2023-08-16T14:32:24Z")

</div>

How do I make Julia Plots with the Plotly backend give me a histogram with as many integer bins from to max value in the series while displaying all the x-axis tick marks for each bin? using Plots plotly() age = 100\*ran…

---

## [Generate Input for Tullio](https://discourse.julialang.org/t/generate-input-for-tullio/102859)

<div class="topic-metadata">

**Author:** [@AlexanderNenninger](https://discourse.julialang.org/u/AlexanderNenninger)\
**Replies:** 1\
**Last updated:** [August 16, 2023, 1:27pm UTC](https://discourse.julialang.org/t/generate-input-for-tullio/102859 "2023-08-16T13:27:48Z")

</div>

I’d like to benchmark my own code for working with N-dimensional arrays. As baseline, Tullio seems to be the fastest, significantly faster than sum. Given the setup using BenchmarkTools using Tullio const M = 3 const …

---

## [GR interactivity in Pluto](https://discourse.julialang.org/t/gr-interactivity-in-pluto/48906)

<div class="topic-metadata">

**Author:** [@Oto\_Brzobohaty](https://discourse.julialang.org/u/Oto_Brzobohaty)\
**Replies:** 14\
**Last updated:** [August 16, 2023, 6:04am UTC](https://discourse.julialang.org/t/gr-interactivity-in-pluto/48906 "2023-08-16T06:04:12Z")

</div>

I have found this post I have downloaded the example notebook pluto\_ex.jl But I got this error UndefVarError: init\_pluto not defined in this cell begin ENV\["GRDISPLAY"\] = "pluto" using GR GR.js.init\_pluto()…

---

## [Why is the ticks fontfamily not changing?](https://discourse.julialang.org/t/why-is-the-ticks-fontfamily-not-changing/102814)

<div class="topic-metadata">

**Author:** [@SYSYS33](https://discourse.julialang.org/u/SYSYS33)\
**Replies:** 4\
**Last updated:** [August 16, 2023, 5:42am UTC](https://discourse.julialang.org/t/why-is-the-ticks-fontfamily-not-changing/102814 "2023-08-16T05:42:50Z")

</div>

I am using Julia 1.9.2, Plots v1.38.17, PyPlot v2.11.1. When I plot, the font of the tick labels doesn’t change. Not working “fontfamily” and “tickfontfamily”. Is this a bug in the new version of Julia, or is there a …

---

## [Computer Algebra "factor" function](https://discourse.julialang.org/t/computer-algebra-factor-function/102837)

<div class="topic-metadata">

**Author:** [@maxasauruswall](https://discourse.julialang.org/u/maxasauruswall)\
**Replies:** 2\
**Last updated:** [August 16, 2023, 2:45am UTC](https://discourse.julialang.org/t/computer-algebra-factor-function/102837 "2023-08-16T02:45:07Z")

</div>

Hi All, I’m reading “Computer Algebra Concepts and Techniques” by Lamagna (I’m new to CAS systems, and fairly new to Julia as well). I was curious to see if I could follow along with some of the examples in Julia, rathe…

---

## [Assigning a user-defined function to RobotDynamics.dynamics()](https://discourse.julialang.org/t/assigning-a-user-defined-function-to-robotdynamics-dynamics/102842)

<div class="topic-metadata">

**Author:** [@shawn\_T](https://discourse.julialang.org/u/shawn_T)\
**Replies:** 3\
**Last updated:** [August 15, 2023, 10:27pm UTC](https://discourse.julialang.org/t/assigning-a-user-defined-function-to-robotdynamics-dynamics/102842 "2023-08-15T22:27:24Z")

</div>

Hi, I am using the RobotDynamics Julia interface to define an optimal control problem, specifically, I would like to dynamically create a function that matches the style of function that RobotDynamics.dynamics() support…

---

## [Julia Match.jl match error with Date - pattern expects 3 fields](https://discourse.julialang.org/t/julia-match-jl-match-error-with-date-pattern-expects-3-fields/102580)

<div class="topic-metadata">

**Author:** [@bryaan](https://discourse.julialang.org/u/bryaan)\
**Replies:** 3\
**Last updated:** [August 15, 2023, 8:55pm UTC](https://discourse.julialang.org/t/julia-match-jl-match-error-with-date-pattern-expects-3-fields/102580 "2023-08-15T20:55:45Z")

</div>

Just updated my project deps and am getting this really strange error with a Match.jl @match statement. ERROR: The type \`Dates.Date\` has 1 fields but the pattern expects 3 fields. @match date begin Date(2023, 4…

---

## [Populate a symmetric sparse matrix](https://discourse.julialang.org/t/populate-a-symmetric-sparse-matrix/102830)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 10\
**Last updated:** [August 15, 2023, 7:16pm UTC](https://discourse.julialang.org/t/populate-a-symmetric-sparse-matrix/102830 "2023-08-15T19:16:42Z")

</div>

Hello, I would like to populate a sparse matrix A with a function f:\\mathbb{N}\\times \\mathbb{N} \\to \\mathbb{R}, (i\_1, i\_2) \\mapsto f(i\_1, i\_2) which is symmetric, i.e. f(i\_1, i\_2) = f(i\_2, i\_1). We want to fill A such…

---

## [Q: Vector of vectors of variable lengths](https://discourse.julialang.org/t/q-vector-of-vectors-of-variable-lengths/102817)

<div class="topic-metadata">

**Author:** [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Replies:** 6\
**Last updated:** [August 15, 2023, 6:37pm UTC](https://discourse.julialang.org/t/q-vector-of-vectors-of-variable-lengths/102817 "2023-08-15T18:37:47Z")

</div>

Hello, What is the recommended/best Julia method to create a vector of vectors of variable lengths? Current method MWE: # test\_vector\_of\_vectors.jl begin vec\_of\_vecs = \[Float64\[\] for \_ in 1:3\] for i = 1:3 …

---

## [Using symbols from parent module without naming it](https://discourse.julialang.org/t/using-symbols-from-parent-module-without-naming-it/101833)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 21\
**Last updated:** [August 15, 2023, 11:36am UTC](https://discourse.julialang.org/t/using-symbols-from-parent-module-without-naming-it/101833 "2023-08-15T11:36:19Z")

</div>

Is it possible to import/using a symbol for a parent module without naming it? Eg module Foo const c = 1 module Bar using ..Foo:c # like this, but without referring to Foo f() = c end end

---

## [Stability of a system of delay differential equations](https://discourse.julialang.org/t/stability-of-a-system-of-delay-differential-equations/102829)

<div class="topic-metadata">

**Author:** [@Ananya\_Hazarika](https://discourse.julialang.org/u/Ananya_Hazarika)\
**Replies:** 1\
**Last updated:** [August 15, 2023, 3:48pm UTC](https://discourse.julialang.org/t/stability-of-a-system-of-delay-differential-equations/102829 "2023-08-15T15:48:12Z")

</div>

hello, How to check the stability of a system of delay differential equations? I only only need to see if the system is stable in what range of parameters /at a certain parameter value set. Please help:).

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

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