# General Usage

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

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

**Page:** 598

---

## [Functions from different modules with the same name](https://discourse.julialang.org/t/functions-from-different-modules-with-the-same-name/61505)

<div class="topic-metadata">

**Author:** [@pg261](https://discourse.julialang.org/u/pg261)\
**Replies:** 16\
**Last updated:** [May 20, 2021, 1:03pm UTC](https://discourse.julialang.org/t/functions-from-different-modules-with-the-same-name/61505 "2021-05-20T13:03:32Z")

</div>

Hi ! I have a problem which I thought should never happen with Julia. The result is even worse when using Pluto. I use two modules, which have a function with the same name, but taking parameters of different types. I …

---

## [Optimizing matrix-valued parameters of an ODE](https://discourse.julialang.org/t/optimizing-matrix-valued-parameters-of-an-ode/61161)

<div class="topic-metadata">

**Author:** [@iqopi](https://discourse.julialang.org/u/iqopi)\
**Replies:** 1\
**Last updated:** [May 20, 2021, 11:49am UTC](https://discourse.julialang.org/t/optimizing-matrix-valued-parameters-of-an-ode/61161 "2021-05-20T11:49:50Z")

</div>

Basically, i want to fit the matrix of an ODE of the form \\dot{u}(t) = p\\cdot u(t), \\quad p \\in Mat\_{n\\times n}(\\mathbb{R}), u \\in \\mathbb{R}^n I start by defining the matrxi: using Plots, Flux, Zygote, Flux, DiffEqF…

---

## [Broadcast into variables](https://discourse.julialang.org/t/broadcast-into-variables/61353)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 2\
**Last updated:** [May 20, 2021, 10:40am UTC](https://discourse.julialang.org/t/broadcast-into-variables/61353 "2021-05-20T10:40:39Z")

</div>

Hello, I am a little bit confused, is this supposed to work some how? When a function returns a tuple, can I somehow add each element of this tuple to a separate variable without temp allocations? Something like this: f…

---

## [Using multiprocessors for faster compilation](https://discourse.julialang.org/t/using-multiprocessors-for-faster-compilation/61504)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 0\
**Last updated:** [May 20, 2021, 10:18am UTC](https://discourse.julialang.org/t/using-multiprocessors-for-faster-compilation/61504 "2021-05-20T10:18:01Z")

</div>

Hi, I haven’t find anything about using multiple processors for compiling code faster during the first run. Is it even possible? Maybe something like MAKEFLAGS=-j4 in C? I have tried to use JULIA\_NUM\_THREADS but I bel…

---

## [Error precompiling MATLAB.jl](https://discourse.julialang.org/t/error-precompiling-matlab-jl/61399)

<div class="topic-metadata">

**Author:** [@PaoloVarraso](https://discourse.julialang.org/u/PaoloVarraso)\
**Replies:** 2\
**Last updated:** [May 20, 2021, 10:09am UTC](https://discourse.julialang.org/t/error-precompiling-matlab-jl/61399 "2021-05-20T10:09:06Z")

</div>

Hi, I am trying to use the MATLAB.jl package on my Mac. The installation seems successful but when I try to use the package I get the following error julia\> using MATLAB \[ Info: Precompiling MATLAB \[10e44e05-a98a-55b3…

---

## [A confusing problem of pipe](https://discourse.julialang.org/t/a-confusing-problem-of-pipe/61438)

<div class="topic-metadata">

**Author:** [@314](https://discourse.julialang.org/u/314)\
**Replies:** 10\
**Last updated:** [May 20, 2021, 8:55am UTC](https://discourse.julialang.org/t/a-confusing-problem-of-pipe/61438 "2021-05-20T08:55:20Z")

</div>

This is my code split("hello-world julia", \[' ', '-'\]) .|\> x -\> filter(isletter, x) .|\> first .|\> uppercase |\> join I want to get the result "HWJ", but I get a 3-element Vector{String}: "H" "W" …

---

## [\[SOLVED\] 37x performance hit when wrapping Refs. Any solution?](https://discourse.julialang.org/t/solved-37x-performance-hit-when-wrapping-refs-any-solution/61499)

<div class="topic-metadata">

**Author:** [@fverdugo](https://discourse.julialang.org/u/fverdugo)\
**Replies:** 2\
**Last updated:** [May 20, 2021, 8:39am UTC](https://discourse.julialang.org/t/solved-37x-performance-hit-when-wrapping-refs-any-solution/61499 "2021-05-20T08:39:08Z")

</div>

Problem I have found that wrapping Ref instances in a struct leads to a sizable performance hit. Here a MWE: using BenchmarkTools struct Foo ref::Ref{Int} Foo(a::Int) = new(Ref(a)) end work(i,ref::Ref) = sqrt(i\*re…

---

## [NetworkDynamics.jl Kuramoto oscillators tutorial example: definition sum\_coupling!()](https://discourse.julialang.org/t/networkdynamics-jl-kuramoto-oscillators-tutorial-example-definition-sum-coupling/61129)

<div class="topic-metadata">

**Author:** [@ziolai](https://discourse.julialang.org/u/ziolai)\
**Replies:** 5\
**Last updated:** [May 20, 2021, 7:54am UTC](https://discourse.julialang.org/t/networkdynamics-jl-kuramoto-oscillators-tutorial-example-definition-sum-coupling/61129 "2021-05-20T07:54:06Z")

</div>

How is the function sum\_couling!() on the page https://pik-icon.github.io/NetworkDynamics.jl/dev/heterogeneous\_system/ defined? Thx! Domenico.

---

## [How to allowscalar(false) in Pluto envrionment?](https://discourse.julialang.org/t/how-to-allowscalar-false-in-pluto-envrionment/61422)

<div class="topic-metadata">

**Author:** [@ChunXi\_Zhang](https://discourse.julialang.org/u/ChunXi_Zhang)\
**Replies:** 5\
**Last updated:** [May 20, 2021, 4:36am UTC](https://discourse.julialang.org/t/how-to-allowscalar-false-in-pluto-envrionment/61422 "2021-05-20T04:36:04Z")

</div>

I’m writing a package and using it in a pluto notebook, even though I write allowscalar(false) in my package and in my pluto notebook, it seems not effecting. It still shows ┌ Warning: Performing scalar operations on G…

---

## [Mutithreading of 3-nested loops for solving integral equations](https://discourse.julialang.org/t/mutithreading-of-3-nested-loops-for-solving-integral-equations/61485)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 0\
**Last updated:** [May 20, 2021, 12:03am UTC](https://discourse.julialang.org/t/mutithreading-of-3-nested-loops-for-solving-integral-equations/61485 "2021-05-20T00:03:12Z")

</div>

Continuing the discussion from Multithreading for nested loops:

---

## [Solving two very simple first differential equations](https://discourse.julialang.org/t/solving-two-very-simple-first-differential-equations/61472)

<div class="topic-metadata">

**Author:** [@sajad\_ghassemi](https://discourse.julialang.org/u/sajad_ghassemi)\
**Replies:** 2\
**Last updated:** [May 19, 2021, 10:57pm UTC](https://discourse.julialang.org/t/solving-two-very-simple-first-differential-equations/61472 "2021-05-19T22:57:04Z")

</div>

Hi dear. I am a newbie in Julia. I wanted to solve two first differential equations as di/dt=-(R/L)i-(1/L)\*v+(1/L)a dv/dt=(1/C)i with Julia which R,L, C is constant and the variable is i(t) and v(t). I used the funct…

---

## [Can I do the opposite of what a view does?](https://discourse.julialang.org/t/can-i-do-the-opposite-of-what-a-view-does/61470)

<div class="topic-metadata">

**Author:** [@alisdairmckay](https://discourse.julialang.org/u/alisdairmckay)\
**Replies:** 7\
**Last updated:** [May 19, 2021, 10:51pm UTC](https://discourse.julialang.org/t/can-i-do-the-opposite-of-what-a-view-does/61470 "2021-05-19T22:51:44Z")

</div>

Suppose I have a 1-d array named A. I would like to create a “view” of A called B such that B\[i,j\] = A\[i\] for any j. Is there a simple way of doing that? This is the opposite of how I understand a view refers to a sli…

---

## [Vcat multiple DataFrames](https://discourse.julialang.org/t/vcat-multiple-dataframes/61455)

<div class="topic-metadata">

**Author:** [@AlexisRenchon](https://discourse.julialang.org/u/AlexisRenchon)\
**Replies:** 1\
**Last updated:** [May 19, 2021, 3:46pm UTC](https://discourse.julialang.org/t/vcat-multiple-dataframes/61455 "2021-05-19T15:46:24Z")

</div>

I have a bunch of DataFrameRow in a Dict that I want to convert to a DataFrame julia\> RSM\_df\[:RSM\_77\] 13-element Vector{Any}: DataFrameRow Row │ datetime RSM\_Date\_IV RSM\_Exp\_Flux RSM\_Exp\_FluxCV …

---

## [The Julia REPL: How clean environment variables. VSCODE](https://discourse.julialang.org/t/the-julia-repl-how-clean-environment-variables-vscode/59940)

<div class="topic-metadata">

**Author:** [@Hermes](https://discourse.julialang.org/u/Hermes)\
**Replies:** 5\
**Last updated:** [May 19, 2021, 1:38pm UTC](https://discourse.julialang.org/t/the-julia-repl-how-clean-environment-variables-vscode/59940 "2021-05-19T13:38:52Z")

</div>

How to clean, delete the environment variables initialized during the running of a script in REPL; to avoid conflicts when running another script with variables with the same names but different types. How would it be i…

---

## [Complex number sort](https://discourse.julialang.org/t/complex-number-sort/61417)

<div class="topic-metadata">

**Author:** [@cepheid](https://discourse.julialang.org/u/cepheid)\
**Replies:** 3\
**Last updated:** [May 19, 2021, 1:30pm UTC](https://discourse.julialang.org/t/complex-number-sort/61417 "2021-05-19T13:30:22Z")

</div>

I want to sort the complex vector as the lexicographically order, that is first the real part from large to small, the same real part, image part from small to large. julia\> a = ComplexF64\[-0.05050274530206651 + 0.60138…

---

## [Why does Zygote Gradient not work on Polynomials.jl?](https://discourse.julialang.org/t/why-does-zygote-gradient-not-work-on-polynomials-jl/57031)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 2\
**Last updated:** [May 19, 2021, 12:10pm UTC](https://discourse.julialang.org/t/why-does-zygote-gradient-not-work-on-polynomials-jl/57031 "2021-05-19T12:10:55Z")

</div>

What am I missing. Why does Zygote’s gradient not work on Polynomials.jl polynomial. That module even has a derivative function. New to this Zygote stuff. module testZygote using Zygote using Polynomials p=Polynomi…

---

## [Convert tuple to array](https://discourse.julialang.org/t/convert-tuple-to-array/2147)

<div class="topic-metadata">

**Author:** [@holocronweaver](https://discourse.julialang.org/u/holocronweaver)\
**Replies:** 14\
**Last updated:** [May 19, 2021, 11:12am UTC](https://discourse.julialang.org/t/convert-tuple-to-array/2147 "2021-05-19T11:12:46Z")

</div>

Is there a way to quickly convert a tuple to an array? A common use case is when I want to perform calculations on size(my\_array), say dividing the size by half or other more complex array operations. Currently I expan…

---

## [Debugging Threads.@spawn applied to Expr data](https://discourse.julialang.org/t/debugging-threads-spawn-applied-to-expr-data/61359)

<div class="topic-metadata">

**Author:** [@ericsfraga](https://discourse.julialang.org/u/ericsfraga)\
**Replies:** 2\
**Last updated:** [May 19, 2021, 10:39am UTC](https://discourse.julialang.org/t/debugging-threads-spawn-applied-to-expr-data/61359 "2021-05-19T10:39:10Z")

</div>

I am using meta-programming combined with multi-threading. I am trying to @spawn an Expr expression which is evaluated, i.e. e = quote \[...\] end tmp = Threads.@spawn eval(e) If I @show tmp, sometimes it says Task (runn…

---

## [Fma's and poly eval](https://discourse.julialang.org/t/fmas-and-poly-eval/61421)

<div class="topic-metadata">

**Author:** [@jarl](https://discourse.julialang.org/u/jarl)\
**Replies:** 4\
**Last updated:** [May 19, 2021, 9:42am UTC](https://discourse.julialang.org/t/fmas-and-poly-eval/61421 "2021-05-19T09:42:33Z")

</div>

I want to evaluate a polynomial of degree 8. Two ways of doing this: @inline function standard\_eval(x) p = evalpoly(x, (0.16666666666666632, 0.04166666666666556, 0.008333333333401227, 0.00138888…

---

## [Converting Julia arrays, views to NumPy arrays via PyCall](https://discourse.julialang.org/t/converting-julia-arrays-views-to-numpy-arrays-via-pycall/61186)

<div class="topic-metadata">

**Author:** [@SCKnight](https://discourse.julialang.org/u/SCKnight)\
**Replies:** 7\
**Last updated:** [May 19, 2021, 7:08am UTC](https://discourse.julialang.org/t/converting-julia-arrays-views-to-numpy-arrays-via-pycall/61186 "2021-05-19T07:08:36Z")

</div>

I am trying to make some Julia code work with Python, and I am having some trouble understanding why certain kind of Julia arrays are able to translate to NumPy arrays. A regular Julia Array seems to get translated just …

---

## [Types of threads](https://discourse.julialang.org/t/types-of-threads/61382)

<div class="topic-metadata">

**Author:** [@blake1024](https://discourse.julialang.org/u/blake1024)\
**Replies:** 2\
**Last updated:** [May 19, 2021, 4:21am UTC](https://discourse.julialang.org/t/types-of-threads/61382 "2021-05-19T04:21:06Z")

</div>

Related to your user manual. Many systems say they have threads but when you look into it you find it’s just cooperative threads (a single OS thread). Your manual states that you support threads but it doesn’t make it …

---

## [Methods for vectors of sparse vs dense matrices](https://discourse.julialang.org/t/methods-for-vectors-of-sparse-vs-dense-matrices/61404)

<div class="topic-metadata">

**Author:** [@gvdr](https://discourse.julialang.org/u/gvdr)\
**Replies:** 7\
**Last updated:** [May 19, 2021, 3:02am UTC](https://discourse.julialang.org/t/methods-for-vectors-of-sparse-vs-dense-matrices/61404 "2021-05-19T03:02:07Z")

</div>

I’m writing a function which should have two methods, one for vectors of sparse matrices (SparseMatrixCSC) and one for vectors of dense matrices. I don’t want to pre/dicate about the nature of those matrices beyond the …

---

## [Inverse with destination?](https://discourse.julialang.org/t/inverse-with-destination/2267)

<div class="topic-metadata">

**Author:** [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Replies:** 35\
**Last updated:** [May 19, 2021, 12:03am UTC](https://discourse.julialang.org/t/inverse-with-destination/2267 "2021-05-19T00:03:34Z")

</div>

Dear all, I might be wrong, but in the plethora of BLAS and LAPACK functions, I was not able to find a function of the type inv(dest, X) where X is the matrix to invert and dest is the destination. Any suggestion…

---

## [No method matching getindex() using ODEProblem](https://discourse.julialang.org/t/no-method-matching-getindex-using-odeproblem/61361)

<div class="topic-metadata">

**Author:** [@Fabio](https://discourse.julialang.org/u/Fabio)\
**Replies:** 6\
**Last updated:** [May 18, 2021, 8:18pm UTC](https://discourse.julialang.org/t/no-method-matching-getindex-using-odeproblem/61361 "2021-05-18T20:18:44Z")

</div>

Hey there, I am very new to Julia and I am working on an ODE Problem. Basically this is my set-up: etaspan = (0.0, 1.0) F0 = \[1, -1e+10, q\_, 0\] function eventfcn(vcondition, value, eta, integrator) out\[1\] = (qma…

---

## [Interact - favorite button](https://discourse.julialang.org/t/interact-favorite-button/61386)

<div class="topic-metadata">

**Author:** [@saraflgarcia](https://discourse.julialang.org/u/saraflgarcia)\
**Replies:** 0\
**Last updated:** [May 18, 2021, 6:15pm UTC](https://discourse.julialang.org/t/interact-favorite-button/61386 "2021-05-18T18:15:56Z")

</div>

Dear all, Using Interact.jl, how can I manipulate the style of a checkbox (e.g., to change the marker)? My goal is to have a favorite button (with a grey heart if false and a black heart if true). Thanks!

---

## [Add types/functions to existing module (that I don't own)](https://discourse.julialang.org/t/add-types-functions-to-existing-module-that-i-dont-own/61280)

<div class="topic-metadata">

**Author:** [@urusan](https://discourse.julialang.org/u/urusan)\
**Replies:** 4\
**Last updated:** [May 18, 2021, 2:03pm UTC](https://discourse.julialang.org/t/add-types-functions-to-existing-module-that-i-dont-own/61280 "2021-05-18T14:03:03Z")

</div>

Hey there, I’ve been using Julia for a while but am new to the forum. I’ve been thinking about how to write more flexible code, and I haven’t been able to figure this one out (or prove it’s impossible), so I thought I’d…

---

## [Julia 1.6 corporate firewall \`could not download https://pkg.julialang.org/registries\`](https://discourse.julialang.org/t/julia-1-6-corporate-firewall-could-not-download-https-pkg-julialang-org-registries/60665)

<div class="topic-metadata">

**Author:** [@jjstickel](https://discourse.julialang.org/u/jjstickel)\
**Replies:** 3\
**Last updated:** [May 18, 2021, 1:15pm UTC](https://discourse.julialang.org/t/julia-1-6-corporate-firewall-could-not-download-https-pkg-julialang-org-registries/60665 "2021-05-18T13:15:53Z")

</div>

I’m having trouble with a corporate MITM firewall and Julia-1.6.x, just with fetching https://pkg.julialang.org/registries. (testing) pkg\> up Updating registry at \`~/.julia/registries/General\` ┌ Warning: could not d…

---

## [Multiple \`async\` sources for a \`sync\` \`Rocket.jl\` actor](https://discourse.julialang.org/t/multiple-async-sources-for-a-sync-rocket-jl-actor/61107)

<div class="topic-metadata">

**Author:** [@gasagna](https://discourse.julialang.org/u/gasagna)\
**Replies:** 10\
**Last updated:** [May 18, 2021, 1:07pm UTC](https://discourse.julialang.org/t/multiple-async-sources-for-a-sync-rocket-jl-actor/61107 "2021-05-18T13:07:44Z")

</div>

Hi, I am learning reactive programming with the great package Rocket.jl and have a question (pinging the lead dev @bvdmitri). A MWE of my use case to make my question explicit is shown below. import Rocket struct MyAc…

---

## [Timeseries Optimization : Reducing allocations](https://discourse.julialang.org/t/timeseries-optimization-reducing-allocations/61251)

<div class="topic-metadata">

**Author:** [@EdgarHR](https://discourse.julialang.org/u/EdgarHR)\
**Replies:** 10\
**Last updated:** [May 18, 2021, 6:25am UTC](https://discourse.julialang.org/t/timeseries-optimization-reducing-allocations/61251 "2021-05-18T06:25:55Z")

</div>

Hello everyone! I was working on a project and wanted to start reformatting the code to make it faster. As part of this process I am working on reducing the amount of allocations as much as possible. Currently I have a …

---

## [CUDA.jl and svd getting automatic casting to Array{Float32,2}](https://discourse.julialang.org/t/cuda-jl-and-svd-getting-automatic-casting-to-array-float32-2/56190)

<div class="topic-metadata">

**Author:** [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Replies:** 1\
**Last updated:** [May 18, 2021, 3:35am UTC](https://discourse.julialang.org/t/cuda-jl-and-svd-getting-automatic-casting-to-array-float32-2/56190 "2021-05-18T03:35:36Z")

</div>

Hello, I am using CUDA.jl package for svd calculation. But I get automatic casting to Array{Float32,2}. Could anyone help please ? Below, I share m.w.e. using CUDA A = CUDA.rand(10, 20) ; # getting float32 on GPU # th…

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

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