# General Usage

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

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

**Page:** 659

---

## [Contents of \`.julia/registries\` deleted upon Pkg operations or Pluto notebook use](https://discourse.julialang.org/t/contents-of-julia-registries-deleted-upon-pkg-operations-or-pluto-notebook-use/53111)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 9\
**Last updated:** [January 11, 2021, 11:45am UTC](https://discourse.julialang.org/t/contents-of-julia-registries-deleted-upon-pkg-operations-or-pluto-notebook-use/53111 "2021-01-11T11:45:03Z")

</div>

So after a few to many edits and updates, here is a cleaner and updated second rewrite of the post. The problem is that during what I have identified as “trigger events”, the contents of my .julia/registries folder is d…

---

## [Cannot find name corresponding to UUID](https://discourse.julialang.org/t/cannot-find-name-corresponding-to-uuid/53153)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 5\
**Last updated:** [January 11, 2021, 10:46am UTC](https://discourse.julialang.org/t/cannot-find-name-corresponding-to-uuid/53153 "2021-01-11T10:46:30Z")

</div>

When updating my packages I encountered the error: ERROR: cannot find name corresponding to UUID 4af54fe1-eca0-43a8-85a7-787d91b784e3 in a registry Searching online I found that uuid belongs to LazyArtifacts.jl (https:…

---

## [Using ToeplitzMatrices](https://discourse.julialang.org/t/using-toeplitzmatrices/53140)

<div class="topic-metadata">

**Author:** [@panditabupesh](https://discourse.julialang.org/u/panditabupesh)\
**Replies:** 1\
**Last updated:** [January 11, 2021, 10:32am UTC](https://discourse.julialang.org/t/using-toeplitzmatrices/53140 "2021-01-11T10:32:27Z")

</div>

using ToeplitzMatrices Hankel(\[1.,2.,3.\], 3:5) Hankel(\[1,2,3\], 3:5) The first example work, but the second fails with this message: ERROR: LoadError: TypeError: in new, expected Toeplitz{Int64,S} where S\<:Number, got …

---

## [Juno profiler results not showing up](https://discourse.julialang.org/t/juno-profiler-results-not-showing-up/53048)

<div class="topic-metadata">

**Author:** [@Johncowk](https://discourse.julialang.org/u/Johncowk)\
**Replies:** 3\
**Last updated:** [January 11, 2021, 10:16am UTC](https://discourse.julialang.org/t/juno-profiler-results-not-showing-up/53048 "2021-01-11T10:16:14Z")

</div>

I am trying to profile a function. For this I want to use the @profiler macro which seems to be the best option for me and also I am unable to install the other profilers available anyways (either GTK cannot be installed…

---

## [Error using PackageCompiler for Blink](https://discourse.julialang.org/t/error-using-packagecompiler-for-blink/40530)

<div class="topic-metadata">

**Author:** [@Charlie\_Ping](https://discourse.julialang.org/u/Charlie_Ping)\
**Replies:** 4\
**Last updated:** [January 11, 2021, 9:31am UTC](https://discourse.julialang.org/t/error-using-packagecompiler-for-blink/40530 "2021-01-11T09:31:14Z")

</div>

I’m on windows 10. Here is the error: ┌ Warning: Error requiring Mux from WebIO: │ LoadError: ArgumentError: Package WebIO does not have JSON in its dependencies: │ - If you have WebIO checked out for development and h…

---

## [Stack-allocated arrays without excessive compilation time](https://discourse.julialang.org/t/stack-allocated-arrays-without-excessive-compilation-time/52870)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 11\
**Last updated:** [January 11, 2021, 3:59am UTC](https://discourse.julialang.org/t/stack-allocated-arrays-without-excessive-compilation-time/52870 "2021-01-11T03:59:09Z")

</div>

I find SArray very useful because they are stack-allocated — this is important generally, but specifically for threaded code I find that minimizing allocations is a must. However, I also fine that excessive use of SArra…

---

## [How to find and add the right version of packages for Flux.jl](https://discourse.julialang.org/t/how-to-find-and-add-the-right-version-of-packages-for-flux-jl/30843)

<div class="topic-metadata">

**Author:** [@Michaela\_Maskova](https://discourse.julialang.org/u/Michaela_Maskova)\
**Replies:** 11\
**Last updated:** [January 11, 2021, 3:51am UTC](https://discourse.julialang.org/t/how-to-find-and-add-the-right-version-of-packages-for-flux-jl/30843 "2021-01-11T03:51:19Z")

</div>

Hi there, I’m trying to compile new Flux package in master version - as the Flux#master(0.9.0) is supposed to be quite better than the previous versions. I’ve been instructed to use Julia 1.3 but I don’t know how to mak…

---

## [Promote big duals in ForwardDiff](https://discourse.julialang.org/t/promote-big-duals-in-forwarddiff/53126)

<div class="topic-metadata">

**Author:** [@xzackli](https://discourse.julialang.org/u/xzackli)\
**Replies:** 0\
**Last updated:** [January 10, 2021, 10:30pm UTC](https://discourse.julialang.org/t/promote-big-duals-in-forwarddiff/53126 "2021-01-10T22:30:31Z")

</div>

I’m computing some derivatives of functions where the interior temporarily enters the realm of BigFloat, using ForwardDiff g(x) = float(log(exp(x\*1e6))) ForwardDiff.derivative(g, 1.0) NaN In this example, the exponent…

---

## [How to use a Latex package in Plots with GR backend?](https://discourse.julialang.org/t/how-to-use-a-latex-package-in-plots-with-gr-backend/53099)

<div class="topic-metadata">

**Author:** [@brianyjtai1994](https://discourse.julialang.org/u/brianyjtai1994)\
**Replies:** 0\
**Last updated:** [January 9, 2021, 11:25pm UTC](https://discourse.julialang.org/t/how-to-use-a-latex-package-in-plots-with-gr-backend/53099 "2021-01-09T23:25:22Z")

</div>

In PyPlot.jl, for example using PyPlot, LaTeXStrings rcParams = PyPlot.PyDict(PyPlot.matplotlib."rcParams") rcParams\["text.latex.preamble"\] = "\\\\usepackage{siunitx}" help me to directly use a Latex command from siunit…

---

## [Struct with Multiple Dispatch](https://discourse.julialang.org/t/struct-with-multiple-dispatch/53118)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 11\
**Last updated:** [January 10, 2021, 9:19pm UTC](https://discourse.julialang.org/t/struct-with-multiple-dispatch/53118 "2021-01-10T21:19:57Z")

</div>

Hello, I’m new to Julia and am watching the Juliacon 2020 video series. I have a question about the use of a mutable struct in this video here. From what I am seeing, I think he defines a mutable struct with some field…

---

## [Misunderstood scope rules?](https://discourse.julialang.org/t/misunderstood-scope-rules/53097)

<div class="topic-metadata">

**Author:** [@austinbean](https://discourse.julialang.org/u/austinbean)\
**Replies:** 3\
**Last updated:** [January 10, 2021, 8:14pm UTC](https://discourse.julialang.org/t/misunderstood-scope-rules/53097 "2021-01-10T20:14:02Z")

</div>

I think I’m misunderstanding something about variable scopes within functions and I would like some feedback. Here is a MWE: # this function modifies its argument # and the argument 'stays modified' outside of f1 func…

---

## [Stability of arithmetic expressions in Julia](https://discourse.julialang.org/t/stability-of-arithmetic-expressions-in-julia/53084)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 2\
**Last updated:** [January 9, 2021, 5:55pm UTC](https://discourse.julialang.org/t/stability-of-arithmetic-expressions-in-julia/53084 "2021-01-09T17:55:17Z")

</div>

I was thinking about numerical stability (with respect to floating point) of polynomial evaluation, and I had the following question: if I naively write a polynomial (or other) expression in Julia, is it evaluated in a w…

---

## [Design of N dimensional structure for Particle](https://discourse.julialang.org/t/design-of-n-dimensional-structure-for-particle/53033)

<div class="topic-metadata">

**Author:** [@ykkan](https://discourse.julialang.org/u/ykkan)\
**Replies:** 4\
**Last updated:** [January 9, 2021, 10:21am UTC](https://discourse.julialang.org/t/design-of-n-dimensional-structure-for-particle/53033 "2021-01-09T10:21:19Z")

</div>

Hello Everyone, I have a structure storing the position and velocity for a bunch of particles in N dimension space and functions for updating the position and velocity of particles: struct Particles{N,T} pos::Vector{…

---

## [Possible issue with \`unique\` when overloading \`isequal\`](https://discourse.julialang.org/t/possible-issue-with-unique-when-overloading-isequal/53079)

<div class="topic-metadata">

**Author:** [@maltezfaria](https://discourse.julialang.org/u/maltezfaria)\
**Replies:** 2\
**Last updated:** [January 9, 2021, 10:19am UTC](https://discourse.julialang.org/t/possible-issue-with-unique-when-overloading-isequal/53079 "2021-01-09T10:19:04Z")

</div>

I am trying to understand why calling unique in the following example returns a vector containing two elements which are equal as per isequal: struct Tag tag::Int end Base.:(==)(t1::Tag,t2::Tag) = abs(t1.tag) == ab…

---

## [What exactly does \`ENV\["LINES"\]\` control?](https://discourse.julialang.org/t/what-exactly-does-env-lines-control/53053)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 5\
**Last updated:** [January 9, 2021, 8:28am UTC](https://discourse.julialang.org/t/what-exactly-does-env-lines-control/53053 "2021-01-09T08:28:17Z")

</div>

I’m interested in adjusting the number of DataFrame rows which are automatically displayed in the REPL, and according to some posts I’ve read on SO, it seems that changing the value of ENV\["LINES"\] is one way to do this.…

---

## [Way to store what is normally printed in the REPL to a string or file?](https://discourse.julialang.org/t/way-to-store-what-is-normally-printed-in-the-repl-to-a-string-or-file/53068)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 2\
**Last updated:** [January 9, 2021, 8:24am UTC](https://discourse.julialang.org/t/way-to-store-what-is-normally-printed-in-the-repl-to-a-string-or-file/53068 "2021-01-09T08:24:35Z")

</div>

I specifically want to store the outputs of @code\_warntype to a string or file so I can read through it later, but I’m also interested in doing something similar for any expression that prints to the REPL.

---

## [Reading in non-consecutive columns using XLSX.gettable?](https://discourse.julialang.org/t/reading-in-non-consecutive-columns-using-xlsx-gettable/53060)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 1\
**Last updated:** [January 9, 2021, 8:17am UTC](https://discourse.julialang.org/t/reading-in-non-consecutive-columns-using-xlsx-gettable/53060 "2021-01-09T08:17:47Z")

</div>

Is there a way to read in a selection of non-consecutive columns of Excel data using XLSX.gettable? I’ve read the documentation here Tutorial-XLSX.jl , but it’s not clear whether it’s possible to do this. For example, d…

---

## [Idiomatic way to specify exclusive range?](https://discourse.julialang.org/t/idiomatic-way-to-specify-exclusive-range/53024)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 5\
**Last updated:** [January 8, 2021, 8:14pm UTC](https://discourse.julialang.org/t/idiomatic-way-to-specify-exclusive-range/53024 "2021-01-08T20:14:03Z")

</div>

The idiomatic way to specify a range from a to b inclusive is a:b. Is there an standard operator or idiom to express the range a to b in which b itself is excluded (something like range() in Python)? I’m planning to ma…

---

## [Sections of strings or arrays and concrete types](https://discourse.julialang.org/t/sections-of-strings-or-arrays-and-concrete-types/53041)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 9\
**Last updated:** [January 8, 2021, 8:42pm UTC](https://discourse.julialang.org/t/sections-of-strings-or-arrays-and-concrete-types/53041 "2021-01-08T20:42:12Z")

</div>

I’m starting to wade into the wonderful world of SnoopCompile and the many insights it gives (and realising along the way that my understanding of types, inference etc, is shallow to say the least). One thing I got from …

---

## [Slow performance for \`rand(ComplexF64, ...)\`](https://discourse.julialang.org/t/slow-performance-for-rand-complexf64/53032)

<div class="topic-metadata">

**Author:** [@DNF](https://discourse.julialang.org/u/DNF)\
**Replies:** 5\
**Last updated:** [January 8, 2021, 4:12pm UTC](https://discourse.julialang.org/t/slow-performance-for-rand-complexf64/53032 "2021-01-08T16:12:48Z")

</div>

I was quite surprised to see this performance difference: julia\> using BenchmarkTools julia\> N = 1000; julia\> @btime complex.(rand($N, $N), rand($N, $N)); 4.852 ms (6 allocations: 30.52 MiB) julia\> @btime rand(Comp…

---

## [Converting a PyObject to a Julia struct](https://discourse.julialang.org/t/converting-a-pyobject-to-a-julia-struct/53001)

<div class="topic-metadata">

**Author:** [@chkwon](https://discourse.julialang.org/u/chkwon)\
**Replies:** 8\
**Last updated:** [January 8, 2021, 2:50pm UTC](https://discourse.julialang.org/t/converting-a-pyobject-to-a-julia-struct/53001 "2021-01-08T14:50:22Z")

</div>

I’m trying to call Julia from Python vi PyJulia. In Julia, I have a struct like mutable struct Person age :: Int weight :: Float64 end function add\_age!(p::Person) p.age += 1 end using PyCall py\_add\_age = pyfu…

---

## [KeyError: key "\_\_div\_\_" not found, and IOError: unlink](https://discourse.julialang.org/t/keyerror-key-div-not-found-and-ioerror-unlink/53044)

<div class="topic-metadata">

**Author:** [@rumil](https://discourse.julialang.org/u/rumil)\
**Replies:** 0\
**Last updated:** [January 8, 2021, 2:42pm UTC](https://discourse.julialang.org/t/keyerror-key-div-not-found-and-ioerror-unlink/53044 "2021-01-08T14:42:44Z")

</div>

Hi, I’m quite new to Julia and currently have some trouble getting the Julia Pandas package to work. I’m using Julia 1.5.3, Python 3.7.9, and installed pandas 1.2.0 for Python. Using pandas via PyCall is no problem, bu…

---

## [Macro for plotting simple curves](https://discourse.julialang.org/t/macro-for-plotting-simple-curves/47623)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 21\
**Last updated:** [January 8, 2021, 1:44pm UTC](https://discourse.julialang.org/t/macro-for-plotting-simple-curves/47623 "2021-01-08T13:44:19Z")

</div>

Do any of the plotting packages have a macro for plotting simple curves? I’m looking for something like this: # plot the curve from x=-10 to x=10 @curve(x^3 - 6x^2 + 4x + 12, -10, 10) Basically, I’m looking for somethi…

---

## [Is there a way to modify captured variables in a closure?](https://discourse.julialang.org/t/is-there-a-way-to-modify-captured-variables-in-a-closure/31213)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 15\
**Last updated:** [January 8, 2021, 9:05am UTC](https://discourse.julialang.org/t/is-there-a-way-to-modify-captured-variables-in-a-closure/31213 "2021-01-08T09:05:59Z")

</div>

Suppose I have some closure like, f = let x = 2 () -\> x^2 end Is there some way to create a new closure from this where I modify the type and value of x? Something like, g = deepcopy(f) g.x = "2" g() # would give …

---

## [Loading functions defined in .jl file to jupyter notebook](https://discourse.julialang.org/t/loading-functions-defined-in-jl-file-to-jupyter-notebook/52444)

<div class="topic-metadata">

**Author:** [@tgautam03](https://discourse.julialang.org/u/tgautam03)\
**Replies:** 8\
**Last updated:** [January 8, 2021, 8:25am UTC](https://discourse.julialang.org/t/loading-functions-defined-in-jl-file-to-jupyter-notebook/52444 "2021-01-08T08:25:15Z")

</div>

Hi, I’ve defined a .jl file with several functions and I want to use them to do some calculations in jupyter notebook. I tried using include("../src/LinAL.jl") but it gives an error could not open file /home/tushar/dev/…

---

## [Union Type vs Inheritance from Abstract Type](https://discourse.julialang.org/t/union-type-vs-inheritance-from-abstract-type/53000)

<div class="topic-metadata">

**Author:** [@ykkan](https://discourse.julialang.org/u/ykkan)\
**Replies:** 9\
**Last updated:** [January 8, 2021, 6:26am UTC](https://discourse.julialang.org/t/union-type-vs-inheritance-from-abstract-type/53000 "2021-01-08T06:26:41Z")

</div>

If I have several structures: struct Child1{N,T} end struct Child2{T} end const Child1OrChild2{N,T} = Union{Child1{N,T}, Child2{T}} struct Mother{M,N,T} children::NTuple{M,Child1OrChild2{N,T}} end Would it be possi…

---

## [Why is deepcopy() -ing Sets slower than Arrays of the same size?](https://discourse.julialang.org/t/why-is-deepcopy-ing-sets-slower-than-arrays-of-the-same-size/53020)

<div class="topic-metadata">

**Author:** [@bsuwal](https://discourse.julialang.org/u/bsuwal)\
**Replies:** 4\
**Last updated:** [January 8, 2021, 3:23am UTC](https://discourse.julialang.org/t/why-is-deepcopy-ing-sets-slower-than-arrays-of-the-same-size/53020 "2021-01-08T03:23:39Z")

</div>

I have the following code: function deepcopy\_n\_times(obj::Set{Int}, n::Int) for i in 1:n deepcopy(obj) end end function deepcopy\_n\_times(obj::Array{Int, 1}, n::Int) for i in 1:n deepcopy(obj…

---

## [Function factories or callable structs?](https://discourse.julialang.org/t/function-factories-or-callable-structs/52987)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 10\
**Last updated:** [January 8, 2021, 12:16am UTC](https://discourse.julialang.org/t/function-factories-or-callable-structs/52987 "2021-01-08T00:16:33Z")

</div>

I want to create parametric functions and see two ways of doing that: Function factory method julia\> function createAdder(a) function adder(b) a+b end end julia\> plus4 = cre…

---

## [How can I project level curves onto the axis planes in 3d?](https://discourse.julialang.org/t/how-can-i-project-level-curves-onto-the-axis-planes-in-3d/53016)

<div class="topic-metadata">

**Author:** [@phdemetri](https://discourse.julialang.org/u/phdemetri)\
**Replies:** 0\
**Last updated:** [January 7, 2021, 11:51pm UTC](https://discourse.julialang.org/t/how-can-i-project-level-curves-onto-the-axis-planes-in-3d/53016 "2021-01-07T23:51:52Z")

</div>

I’m interested in plotting the level curves of a surface onto the xy plane. Here is an example of what I want to achieve I’ve got some code to make the surface and plot it already. How can I modify my code to get m…

---

## [Workflow to create and update \[compat\] section of Project.toml](https://discourse.julialang.org/t/workflow-to-create-and-update-compat-section-of-project-toml/53005)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 5\
**Last updated:** [January 7, 2021, 10:13pm UTC](https://discourse.julialang.org/t/workflow-to-create-and-update-compat-section-of-project-toml/53005 "2021-01-07T22:13:42Z")

</div>

What is the preferred workflow to create the \[compat\] section for a new package, and then maintain it up to date? Creating Can you tell if the following algorithm for creation of \[compat\] section is reasonable: Creat…

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

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