# General Usage

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

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

**Page:** 303

---

## [Not able to define combinatorial and attributed schemas separetly](https://discourse.julialang.org/t/not-able-to-define-combinatorial-and-attributed-schemas-separetly/97630)

<div class="topic-metadata">

**Author:** [@Nobel\_Chowdary](https://discourse.julialang.org/u/Nobel_Chowdary)\
**Replies:** 0\
**Last updated:** [April 18, 2023, 8:33pm UTC](https://discourse.julialang.org/t/not-able-to-define-combinatorial-and-attributed-schemas-separetly/97630 "2023-04-18T20:33:48Z")

</div>

The following image shows the definition of schema separately. But when the combinatorial schema is inherited from an attributed schema, it is throwing an error. Can someone help me with this?

---

## [Using stiff solvers for a large system of ode](https://discourse.julialang.org/t/using-stiff-solvers-for-a-large-system-of-ode/97626)

<div class="topic-metadata">

**Author:** [@UgoMire](https://discourse.julialang.org/u/UgoMire)\
**Replies:** 3\
**Last updated:** [April 18, 2023, 7:25pm UTC](https://discourse.julialang.org/t/using-stiff-solvers-for-a-large-system-of-ode/97626 "2023-04-18T19:25:49Z")

</div>

Hi, I am trying to solve the following set of partial differential equation: \\begin{cases} \\partial\_t u(x, y, t) = \\partial\_x f(x, y, t, u, \\partial\_x u) \\\\ \\partial\_t v(x, y, t) = \\partial\_y f(x, y, t, u, \\partial\_x …

---

## [How can I benchmark DataFrames.leftjoin!? (Is this some kind of bug?)](https://discourse.julialang.org/t/how-can-i-benchmark-dataframes-leftjoin-is-this-some-kind-of-bug/97620)

<div class="topic-metadata">

**Author:** [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Replies:** 4\
**Last updated:** [April 18, 2023, 7:16pm UTC](https://discourse.julialang.org/t/how-can-i-benchmark-dataframes-leftjoin-is-this-some-kind-of-bug/97620 "2023-04-18T19:16:27Z")

</div>

I can’t get the setup argument of @benchmark to work correctly with DataFrames. I’ll use the example in the docs of DataFrames.leftjoin! as an MWE: julia\> using DataFrames, BenchmarkTools julia\> name = DataFrame(ID=\[1,…

---

## [Making 1.9 weak dependency work](https://discourse.julialang.org/t/making-1-9-weak-dependency-work/97600)

<div class="topic-metadata">

**Author:** [@bgctw](https://discourse.julialang.org/u/bgctw)\
**Replies:** 3\
**Last updated:** [April 18, 2023, 4:37pm UTC](https://discourse.julialang.org/t/making-1-9-weak-dependency-work/97600 "2023-04-18T16:37:13Z")

</div>

I try update from @require to julia 1.9 weak dependency by following the Pkg documentation at a branch of the DistributionFits package. It works with Require in Julia 1.8.4, but I do not get it to work with Julia 1.9.0-…

---

## [How does distribute clean up Distributed without shutting down parallel processes](https://discourse.julialang.org/t/how-does-distribute-clean-up-distributed-without-shutting-down-parallel-processes/97615)

<div class="topic-metadata">

**Author:** [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Replies:** 0\
**Last updated:** [April 18, 2023, 1:29pm UTC](https://discourse.julialang.org/t/how-does-distribute-clean-up-distributed-without-shutting-down-parallel-processes/97615 "2023-04-18T13:29:56Z")

</div>

How does distribute clean up Distributed without shutting down parallel processes Because it takes time to start the loop, and obviously the second run is faster than the first, I cycle through the parallel process and …

---

## [Multi-threading for nested loops with inner loop collection depending on outer loop](https://discourse.julialang.org/t/multi-threading-for-nested-loops-with-inner-loop-collection-depending-on-outer-loop/97569)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 7\
**Last updated:** [April 18, 2023, 12:25pm UTC](https://discourse.julialang.org/t/multi-threading-for-nested-loops-with-inner-loop-collection-depending-on-outer-loop/97569 "2023-04-18T12:25:25Z")

</div>

What is the most efficient way to parallelize an embarrassingly parallel problem with nested loops, while the inner loop’s collection depending on outer loop? MWE is using Base.Threads using ThreadsX using FLoops xs = …

---

## [Memory Allocation Increases with Iterations](https://discourse.julialang.org/t/memory-allocation-increases-with-iterations/97532)

<div class="topic-metadata">

**Author:** [@GeoKou](https://discourse.julialang.org/u/GeoKou)\
**Replies:** 15\
**Last updated:** [April 18, 2023, 12:18pm UTC](https://discourse.julialang.org/t/memory-allocation-increases-with-iterations/97532 "2023-04-18T12:18:38Z")

</div>

Hello, I have a function that generates a number of graphs to extract some features from each, in a for loop. Since the graph is created and the features are extracted, its information is not needed in the next iteratio…

---

## [How to install pyqt for PythonPlot](https://discourse.julialang.org/t/how-to-install-pyqt-for-pythonplot/97542)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 3\
**Last updated:** [April 18, 2023, 6:30am UTC](https://discourse.julialang.org/t/how-to-install-pyqt-for-pythonplot/97542 "2023-04-18T06:30:27Z")

</div>

I would like to use PythonPlot.jl with the QT backend. But how can I install it? I tried: using CondaPkg # press \] (Climate) pkg\> conda add pyqt5 which doesn’t work, it cannot find the package: error libmamba Could…

---

## [Code intermittently not being interruptible](https://discourse.julialang.org/t/code-intermittently-not-being-interruptible/88881)

<div class="topic-metadata">

**Author:** [@Nathaniel](https://discourse.julialang.org/u/Nathaniel)\
**Replies:** 5\
**Last updated:** [April 18, 2023, 5:53am UTC](https://discourse.julialang.org/t/code-intermittently-not-being-interruptible/88881 "2023-04-18T05:53:38Z")

</div>

I’ve found that I sometimes can’t interrupt my code using ctrl-C or CMD-dot. The following was working for me earlier today as a minimal example: using Plots function main() while true plt = plot(rand(100)…

---

## [Replace all NaN's with zeros in DataFrame](https://discourse.julialang.org/t/replace-all-nans-with-zeros-in-dataframe/10001)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 31\
**Last updated:** [April 18, 2023, 3:19am UTC](https://discourse.julialang.org/t/replace-all-nans-with-zeros-in-dataframe/10001 "2023-04-18T03:19:46Z")

</div>

What’s the best way to replace all NaN’s in a DataFrame with zero? I can write a nested for-loop and check every cell but I thought there may be a simpler way to do that…

---

## [Return the minimum size of an array needed for a function to work](https://discourse.julialang.org/t/return-the-minimum-size-of-an-array-needed-for-a-function-to-work/97591)

<div class="topic-metadata">

**Author:** [@jarroyoe](https://discourse.julialang.org/u/jarroyoe)\
**Replies:** 7\
**Last updated:** [April 17, 2023, 10:44pm UTC](https://discourse.julialang.org/t/return-the-minimum-size-of-an-array-needed-for-a-function-to-work/97591 "2023-04-17T22:44:34Z")

</div>

Hi everyone, I want to create a function that receives another function as an input and returns the size of the array this. As an example, let’s say I have a simple function that takes a vector as an input: f(x::Vector{…

---

## [Test for a zero-valued Tuple in where statement](https://discourse.julialang.org/t/test-for-a-zero-valued-tuple-in-where-statement/97579)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 15\
**Last updated:** [April 17, 2023, 9:52pm UTC](https://discourse.julialang.org/t/test-for-a-zero-valued-tuple-in-where-statement/97579 "2023-04-17T21:52:14Z")

</div>

I would like to have a special dispatch for the case that a Tuple{} in the type definition is zero (in all entries). For example: foo(a::AbstractArray{T, N}) where {N, T\<:Tuple{zeros(Int,N)...}} but get an error since N…

---

## [Spectral method for 1D heat equation OrdinaryDiffEq.jl](https://discourse.julialang.org/t/spectral-method-for-1d-heat-equation-ordinarydiffeq-jl/97586)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 0\
**Last updated:** [April 17, 2023, 7:25pm UTC](https://discourse.julialang.org/t/spectral-method-for-1d-heat-equation-ordinarydiffeq-jl/97586 "2023-04-17T19:25:29Z")

</div>

Hello, I would like to solve the heat equation \\frac{\\partial u(x,t)}{\\partial t} = \\alpha \\frac{\\partial^2 u}{\\partial x^2} on the periodic domain \[0, 1\] with initial condition u(x, t = 0) = u\_0(x) and periodic boundar…

---

## [Help me beat Lsoda](https://discourse.julialang.org/t/help-me-beat-lsoda/88236)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 26\
**Last updated:** [April 17, 2023, 4:54pm UTC](https://discourse.julialang.org/t/help-me-beat-lsoda/88236 "2023-04-17T16:54:29Z")

</div>

Hi, I want to simulate a Jump process for biological applications quite precisely and fast. I developped a package PiecewiseDeterministicMarkovProcesses.jl based on DifferentialEquations.jl to simulate these jump proces…

---

## [UUID in Project.toml](https://discourse.julialang.org/t/uuid-in-project-toml/97576)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 2\
**Last updated:** [April 17, 2023, 3:42pm UTC](https://discourse.julialang.org/t/uuid-in-project-toml/97576 "2023-04-17T15:42:59Z")

</div>

In a Project.toml files, the structure is a series of rows containing Module name and UUID. For example: \[deps\] ArgMacros = "dbc42088-9de8-42a0-8ec8-2cd114e1ea3e" BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0" BenchmarkT…

---

## [Passing args before/after jl\_init (from C or Lisp)](https://discourse.julialang.org/t/passing-args-before-after-jl-init-from-c-or-lisp/93322)

<div class="topic-metadata">

**Author:** [@gvanuxem](https://discourse.julialang.org/u/gvanuxem)\
**Replies:** 1\
**Last updated:** [April 17, 2023, 3:07pm UTC](https://discourse.julialang.org/t/passing-args-before-after-jl-init-from-c-or-lisp/93322 "2023-04-17T15:07:29Z")

</div>

Hello, I’m interfacing Julia for a CAS called FriCAS, which is built on top of a Common LISP environment, in my case SBCL. SBCL needs to catch signals for memory management and other things and I wonder how to use the …

---

## [How to "use" a Module in the C language ("using Module")](https://discourse.julialang.org/t/how-to-use-a-module-in-the-c-language-using-module/97578)

<div class="topic-metadata">

**Author:** [@gvanuxem](https://discourse.julialang.org/u/gvanuxem)\
**Replies:** 0\
**Last updated:** [April 17, 2023, 3:17pm UTC](https://discourse.julialang.org/t/how-to-use-a-module-in-the-c-language-using-module/97578 "2023-04-17T15:17:53Z")

</div>

Hello folks, My question is how to load a package in C à la “using Module”? My code for now does nothing. No warning, no error: void jl\_add\_module(char \*module){ jl\_module\_using(jl\_main\_module, jl\_new\_module(jl\_symbo…

---

## [Unpack NamedTuple into a function definition](https://discourse.julialang.org/t/unpack-namedtuple-into-a-function-definition/97500)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 3\
**Last updated:** [April 17, 2023, 1:36pm UTC](https://discourse.julialang.org/t/unpack-namedtuple-into-a-function-definition/97500 "2023-04-17T13:36:39Z")

</div>

I am writing a Julia package to implement a REST API, and I have the accepted parameters available as NamedTuple constants. I’d like to have these NamedTuple constants double as the default keyword arguments for a functi…

---

## [Viewing final Franklin website from \_\_site folder](https://discourse.julialang.org/t/viewing-final-franklin-website-from-site-folder/78345)

<div class="topic-metadata">

**Author:** [@jman87](https://discourse.julialang.org/u/jman87)\
**Replies:** 7\
**Last updated:** [April 17, 2023, 1:20pm UTC](https://discourse.julialang.org/t/viewing-final-franklin-website-from-site-folder/78345 "2023-04-17T13:20:51Z")

</div>

Noobie website development question. :blush: I’m experimenting with Franklin and when I do the following commands: julia\> using Franklin julia\> newsite("sandbox\_02", template="sandbox") julia\> serve() I see the follow…

---

## [Plots/GR: \`savefig\` adds transparency to my picture?](https://discourse.julialang.org/t/plots-gr-savefig-adds-transparency-to-my-picture/93511)

<div class="topic-metadata">

**Author:** [@sim](https://discourse.julialang.org/u/sim)\
**Replies:** 7\
**Last updated:** [April 17, 2023, 12:49pm UTC](https://discourse.julialang.org/t/plots-gr-savefig-adds-transparency-to-my-picture/93511 "2023-04-17T12:49:09Z")

</div>

Hi, I have a curious phenomenon here which seemingly appeared from nowhere. I am doing a simple plot (using Plots) and saving it to a file ; but the saved version seems to be transparent. The MWE is using Plots heatmap…

---

## [Svd accelerated with the MKL package, what about schur?](https://discourse.julialang.org/t/svd-accelerated-with-the-mkl-package-what-about-schur/97559)

<div class="topic-metadata">

**Author:** [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Replies:** 3\
**Last updated:** [April 17, 2023, 12:03pm UTC](https://discourse.julialang.org/t/svd-accelerated-with-the-mkl-package-what-about-schur/97559 "2023-04-17T12:03:44Z")

</div>

LinearAlgebra’s svd can be accelerated with the MKL package, what about schur? much slower than matlab In order to avoid the unstable performance of matlab alone, and schur is iterating, it has a better effect on symmet…

---

## [MKL Distributed slower！](https://discourse.julialang.org/t/mkl-distributed-slower/97561)

<div class="topic-metadata">

**Author:** [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Replies:** 2\
**Last updated:** [April 17, 2023, 10:21am UTC](https://discourse.julialang.org/t/mkl-distributed-slower/97561 "2023-04-17T10:21:06Z")

</div>

I am using MKL to accelerate svd, using MKL svd will be 5-10 times faster But it is far from enough in parallel: Add the original svd 1.3s using mkl will change to 0.15s Then parallel each time 0.6s If I declare i…

---

## [How to set parallel parameters very easily， use other packages](https://discourse.julialang.org/t/how-to-set-parallel-parameters-very-easily-use-other-packages/97567)

<div class="topic-metadata">

**Author:** [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Replies:** 0\
**Last updated:** [April 17, 2023, 9:09am UTC](https://discourse.julialang.org/t/how-to-set-parallel-parameters-very-easily-use-other-packages/97567 "2023-04-17T09:09:45Z")

</div>

How to set parallel parameters very easily, where the function needs to use other packages. Using LinearAlgebra as an example, I want to set an isparfor parameter and package it into a function: At present, if you want …

---

## [Create Brachistochrone Comparison Animation](https://discourse.julialang.org/t/create-brachistochrone-comparison-animation/97562)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [April 17, 2023, 7:20am UTC](https://discourse.julialang.org/t/create-brachistochrone-comparison-animation/97562 "2023-04-17T07:20:20Z")

</div>

Hi all, I want to know how to animate a moving scatter plot / circle form three different lines: Cycloid arc Straight line Steep curve we can plot three different lines. Then how to move the circles from point A to p…

---

## [Checking the Solutions for First Order Differential Equations](https://discourse.julialang.org/t/checking-the-solutions-for-first-order-differential-equations/97304)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 3\
**Last updated:** [April 17, 2023, 5:46am UTC](https://discourse.julialang.org/t/checking-the-solutions-for-first-order-differential-equations/97304 "2023-04-17T05:46:21Z")

</div>

Hi all, I just want to make sure, whether the solution of x(t) and y(t) are correct in t term. If the solutions are incorrect, it is SymPy fault. Because if I put t\>0 I get x(t) \< 0 and I think it should not be possib…

---

## [How to use the 'LsqFit.curve\_fit'?](https://discourse.julialang.org/t/how-to-use-the-lsqfit-curve-fit/97546)

<div class="topic-metadata">

**Author:** [@manu\_han](https://discourse.julialang.org/u/manu_han)\
**Replies:** 0\
**Last updated:** [April 16, 2023, 2:18pm UTC](https://discourse.julialang.org/t/how-to-use-the-lsqfit-curve-fit/97546 "2023-04-16T14:18:59Z")

</div>

To fit the non-linear function with other data, I am trying to use the ‘LsqFit.curve\_fit’ which was introduced by the following link: GitHub - JuliaNLSolvers/LsqFit.jl: Simple curve fitting in Julia here is toy example: …

---

## [Are hasmethod and applicable recommended for defining traits now?](https://discourse.julialang.org/t/are-hasmethod-and-applicable-recommended-for-defining-traits-now/97533)

<div class="topic-metadata">

**Author:** [@zsunberg](https://discourse.julialang.org/u/zsunberg)\
**Replies:** 2\
**Last updated:** [April 17, 2023, 12:21am UTC](https://discourse.julialang.org/t/are-hasmethod-and-applicable-recommended-for-defining-traits-now/97533 "2023-04-17T00:21:58Z")

</div>

If I understand correctly, as of Julia 1.10, according to this PR, it will be possible to statically infer the output of hasmethod and applicable. Previously, things like static\_hasmethod from Tricks.jl seemed to be not …

---

## [Can I (disable or) know somehow that precompilation will not happen at runtime?](https://discourse.julialang.org/t/can-i-disable-or-know-somehow-that-precompilation-will-not-happen-at-runtime/97515)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 2\
**Last updated:** [April 16, 2023, 9:16pm UTC](https://discourse.julialang.org/t/can-i-disable-or-know-somehow-that-precompilation-will-not-happen-at-runtime/97515 "2023-04-16T21:16:14Z")

</div>

I was running: pkg\> test Plots ad somehow my machine got unstable, with OOM, as sometimes hapens with the (parallel) precompilation. I wasn’t expecting at that point. What I had done before was I installed Plots, and …

---

## [Is there a faster way to do a matrix multiplication on a random subset of a matrix?](https://discourse.julialang.org/t/is-there-a-faster-way-to-do-a-matrix-multiplication-on-a-random-subset-of-a-matrix/97549)

<div class="topic-metadata">

**Author:** [@mkoculak](https://discourse.julialang.org/u/mkoculak)\
**Replies:** 5\
**Last updated:** [April 16, 2023, 9:03pm UTC](https://discourse.julialang.org/t/is-there-a-faster-way-to-do-a-matrix-multiplication-on-a-random-subset-of-a-matrix/97549 "2023-04-16T21:03:54Z")

</div>

I have an algorithm that spends almost 2/3 of its time in a function that draws a subset of a matrix and then multiplies that with some weights. Number of selected rows \<\< N rows. I have tried to optimize it by prealloc…

---

## [How to call a shadowed function](https://discourse.julialang.org/t/how-to-call-a-shadowed-function/97547)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 2\
**Last updated:** [April 16, 2023, 4:05pm UTC](https://discourse.julialang.org/t/how-to-call-a-shadowed-function/97547 "2023-04-16T16:05:54Z")

</div>

On the way of making a package CUDA.jl-compatible, the easiest way to get the Base.display function working without causing trouble, would be to enable @CUDA.allowscalar for just this function. So I thought to simply def…

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

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