# General Usage

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

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

**Page:** 553

---

## [Updating a value in JLD2](https://discourse.julialang.org/t/updating-a-value-in-jld2/29702)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 1\
**Last updated:** [September 1, 2021, 8:31am UTC](https://discourse.julialang.org/t/updating-a-value-in-jld2/29702 "2021-09-01T08:31:05Z")

</div>

Is it possible to update a value written to a JLD2 file? With version 1 there was a delete! method to delete the old value before writing it’s new value. With v2 I don’t see that method. I’ve looked for other methods i…

---

## [EOFError: read end of file JLD2](https://discourse.julialang.org/t/eoferror-read-end-of-file-jld2/59693)

<div class="topic-metadata">

**Author:** [@Sebastian\_Mena](https://discourse.julialang.org/u/Sebastian_Mena)\
**Replies:** 1\
**Last updated:** [September 1, 2021, 8:29am UTC](https://discourse.julialang.org/t/eoferror-read-end-of-file-jld2/59693 "2021-09-01T08:29:37Z")

</div>

Hi, I tried to import a dictionary into jupyter notebook (julia 1.5.1), but it threw me this error: \>import JLD2 \>dict\_duels\_accurate\_probs = load("path/dict\_duels\_accurate\_probs.jld2") Error encountered while loading…

---

## [Plot size changes depending on installed packages](https://discourse.julialang.org/t/plot-size-changes-depending-on-installed-packages/67068)

<div class="topic-metadata">

**Author:** [@ForceBru](https://discourse.julialang.org/u/ForceBru)\
**Replies:** 9\
**Last updated:** [September 1, 2021, 7:40am UTC](https://discourse.julialang.org/t/plot-size-changes-depending-on-installed-packages/67068 "2021-09-01T07:40:49Z")

</div>

I have two Pluto notebooks that are identical except for the line with imports. Yet the plot in the second one is consistently tiny. Notebook with tiny plot First like: using StatsPlots, Distributions, LoopVectorization…

---

## [Running time](https://discourse.julialang.org/t/running-time/67462)

<div class="topic-metadata">

**Author:** [@tortijazz](https://discourse.julialang.org/u/tortijazz)\
**Replies:** 5\
**Last updated:** [September 1, 2021, 6:55am UTC](https://discourse.julialang.org/t/running-time/67462 "2021-09-01T06:55:23Z")

</div>

Hi everybody, I was making simulations with Flux.jl, DiffEqFlux.jl, Optim.jl, DiffEqSensitivity.jl and OrdinaryDiffEq.jl in Julia-1.5.2 and I saw that there was a new stable release (1.6.2 version), so I did upgrade Jul…

---

## [Multi-threading and Dierckx.jl & Interpolations.jl and gradients](https://discourse.julialang.org/t/multi-threading-and-dierckx-jl-interpolations-jl-and-gradients/67452)

<div class="topic-metadata">

**Author:** [@gianmariomanca](https://discourse.julialang.org/u/gianmariomanca)\
**Replies:** 6\
**Last updated:** [September 1, 2021, 6:15am UTC](https://discourse.julialang.org/t/multi-threading-and-dierckx-jl-interpolations-jl-and-gradients/67452 "2021-09-01T06:15:55Z")

</div>

I noticed that if I use https://github.com/kbarbary/Dierckx.jl (1D, k=3 and derivatives) in a loop with the Threads.@threads macro I get partially corrupted results. If I remove the Threads.@threads macro results look f…

---

## [Behavior of Julia package manager, deleting folders in registeries/General very frequently, unacceptable](https://discourse.julialang.org/t/behavior-of-julia-package-manager-deleting-folders-in-registeries-general-very-frequently-unacceptable/67468)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 6\
**Last updated:** [September 1, 2021, 3:19am UTC](https://discourse.julialang.org/t/behavior-of-julia-package-manager-deleting-folders-in-registeries-general-very-frequently-unacceptable/67468 "2021-09-01T03:19:58Z")

</div>

Dear Julia developers and experts, I am a scientific researcher and a regular Julia user. I often run Julia programs on HPC. During the development of my own package, I need to add other packages from time to time. Ever…

---

## [Can't understand what LoopVectorization is doing](https://discourse.julialang.org/t/cant-understand-what-loopvectorization-is-doing/67439)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 7\
**Last updated:** [September 1, 2021, 2:18am UTC](https://discourse.julialang.org/t/cant-understand-what-loopvectorization-is-doing/67439 "2021-09-01T02:18:35Z")

</div>

I’ve stumbled upon something which looks like black magic to me. I am solving an ODE, where the right-hand-side function needs to evaluate a large sum, which can be paralleled over a number of threads. I have replaced T…

---

## [How to define structure with its field is matrix?](https://discourse.julialang.org/t/how-to-define-structure-with-its-field-is-matrix/67450)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 8\
**Last updated:** [August 31, 2021, 11:09pm UTC](https://discourse.julialang.org/t/how-to-define-structure-with-its-field-is-matrix/67450 "2021-08-31T23:09:08Z")

</div>

I have a structure as below: struct R value::Vector{Float64} = \[\] end however, I want to make the “value” to be matrix (undefined,3) with elements type as “Float64” so I adjusted as below: struct R value::Arra…

---

## [Does Julia cache version of function with given input value?](https://discourse.julialang.org/t/does-julia-cache-version-of-function-with-given-input-value/67445)

<div class="topic-metadata">

**Author:** [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Replies:** 7\
**Last updated:** [August 31, 2021, 9:24pm UTC](https://discourse.julialang.org/t/does-julia-cache-version-of-function-with-given-input-value/67445 "2021-08-31T21:24:02Z")

</div>

Say I am doing y = x\[perm\] for a permutation perm. I believe that Julia would dispatch and compile a version of getindex(x, perm) for the type that I called. Now if I call y1 = x1\[perm\] again for the same types but diffe…

---

## [Product of two symmetric matrices: LoopVectorization.jl vs LinearAlgebra](https://discourse.julialang.org/t/product-of-two-symmetric-matrices-loopvectorization-jl-vs-linearalgebra/67396)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 9\
**Last updated:** [August 31, 2021, 8:11pm UTC](https://discourse.julialang.org/t/product-of-two-symmetric-matrices-loopvectorization-jl-vs-linearalgebra/67396 "2021-08-31T20:11:59Z")

</div>

Hi, I am playing around with LoopVectorization.jl. In doing so, I have noticed that it seems to be about 1.5x faster than LinearAlgebra in computing the product between two symmetric matrices (while being about as fast …

---

## [@cfunction within function, scoping problem](https://discourse.julialang.org/t/cfunction-within-function-scoping-problem/66484)

<div class="topic-metadata">

**Author:** [@dbertini](https://discourse.julialang.org/u/dbertini)\
**Replies:** 10\
**Last updated:** [August 31, 2021, 7:09pm UTC](https://discourse.julialang.org/t/cfunction-within-function-scoping-problem/66484 "2021-08-31T19:09:59Z")

</div>

Hi it seems that the macro @cfunction work only with function defined in global scope. Used within a function like function get\_ptr(f::Function) integrand\_c = @cfunction( $f,Cdouble,(Ptr{Cdouble},Ptr{Cdouble},Ptr…

---

## [ReferenceTests for a Matrix](https://discourse.julialang.org/t/referencetests-for-a-matrix/67431)

<div class="topic-metadata">

**Author:** [@Brad\_Carman](https://discourse.julialang.org/u/Brad_Carman)\
**Replies:** 1\
**Last updated:** [August 31, 2021, 5:23pm UTC](https://discourse.julialang.org/t/referencetests-for-a-matrix/67431 "2021-08-31T17:23:17Z")

</div>

I’m struggling to figure out how to use @test\_reference from ReferenceTests.jl for a Matrix{Float64} type. If I do @test\_reference "data.dat" data then the data is stored as a string and compared as a string. This m…

---

## [Correct way of: f(::T) where T = zero(T)?](https://discourse.julialang.org/t/correct-way-of-f-t-where-t-zero-t/67426)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 2\
**Last updated:** [August 31, 2021, 5:14pm UTC](https://discourse.julialang.org/t/correct-way-of-f-t-where-t-zero-t/67426 "2021-08-31T17:14:31Z")

</div>

What is the correct way to pass only a type to control dispatch and use that type inside the function? As the title says, I want to do something like: f(::T) where T = zero(T) Is this one? julia\> f(T::DataType) = zer…

---

## [How to control group sorting in boxplot?](https://discourse.julialang.org/t/how-to-control-group-sorting-in-boxplot/67432)

<div class="topic-metadata">

**Author:** [@gedankenexperiment](https://discourse.julialang.org/u/gedankenexperiment)\
**Replies:** 2\
**Last updated:** [August 31, 2021, 4:38pm UTC](https://discourse.julialang.org/t/how-to-control-group-sorting-in-boxplot/67432 "2021-08-31T16:38:10Z")

</div>

How can I control the order in which groups are sorted along the x-axis? The xsort attribute seems to be deprecated, cf. How to adjust the X-axis order of boxplot with StatsPlots.jl - #9 by Shuhua I’m using Julia v1.6 a…

---

## [Recommended serialization for distributed file systems (and is old jld2 data gone forever)?](https://discourse.julialang.org/t/recommended-serialization-for-distributed-file-systems-and-is-old-jld2-data-gone-forever/65759)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 1\
**Last updated:** [August 31, 2021, 3:09pm UTC](https://discourse.julialang.org/t/recommended-serialization-for-distributed-file-systems-and-is-old-jld2-data-gone-forever/65759 "2021-08-31T15:09:14Z")

</div>

I’m trying to read .jld2 files from a cluster dfs share and keep getting stuff like: BoundsError: attempt to access 23-element Vector{Int64} at index \[31\] Stacktrace: \[1\] getindex @ ./array.jl:801 \[inlined\] \[2\] …

---

## [Can fields of structure be indexed by number?](https://discourse.julialang.org/t/can-fields-of-structure-be-indexed-by-number/67423)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 6\
**Last updated:** [August 31, 2021, 1:47pm UTC](https://discourse.julialang.org/t/can-fields-of-structure-be-indexed-by-number/67423 "2021-08-31T13:47:26Z")

</div>

It is know that accessing a field of structure is by using the dot method. Such as, accessing the first field of the below structure is Point.x. However, I would like to access the fields by using a index number accompan…

---

## [Unhexlify and int.from\_bytes (From a lazy pythonist to a confused Julia user)](https://discourse.julialang.org/t/unhexlify-and-int-from-bytes-from-a-lazy-pythonist-to-a-confused-julia-user/67388)

<div class="topic-metadata">

**Author:** [@Mrs.Pelle](https://discourse.julialang.org/u/Mrs.Pelle)\
**Replies:** 6\
**Last updated:** [August 31, 2021, 12:58pm UTC](https://discourse.julialang.org/t/unhexlify-and-int-from-bytes-from-a-lazy-pythonist-to-a-confused-julia-user/67388 "2021-08-31T12:58:32Z")

</div>

So I’m slowly transferring some crypto blockchain programming to Julia and I’m hitting quite a wall with all the whole hashing, bytes, etc etc. So the first one I’m trying to migrate over is the python binascii.unhexlif…

---

## [Forwarddiff through setindex](https://discourse.julialang.org/t/forwarddiff-through-setindex/67422)

<div class="topic-metadata">

**Author:** [@weymouth](https://discourse.julialang.org/u/weymouth)\
**Replies:** 1\
**Last updated:** [August 31, 2021, 12:38pm UTC](https://discourse.julialang.org/t/forwarddiff-through-setindex/67422 "2021-08-31T12:38:07Z")

</div>

I’m having trouble differentiating through the setindex!() of a custom type. Here’s a minimum example using the ArrayAndChar type from the Julia docs to replicate the issue. using ForwardDiff struct ArrayAndChar{T,N} \<…

---

## [Can Symbolics.jl simplify subexpressions?](https://discourse.julialang.org/t/can-symbolics-jl-simplify-subexpressions/66731)

<div class="topic-metadata">

**Author:** [@nhardy](https://discourse.julialang.org/u/nhardy)\
**Replies:** 6\
**Last updated:** [August 31, 2021, 12:41pm UTC](https://discourse.julialang.org/t/can-symbolics-jl-simplify-subexpressions/66731 "2021-08-31T12:41:29Z")

</div>

I have been trying out Symbolics.jl for a few projects recently. Initially I was excited but have run into a few issues that are road blocks. Some are probably asking too much this early in development - (A::SparseMatri…

---

## [Fuzzy rounding for Rationals](https://discourse.julialang.org/t/fuzzy-rounding-for-rationals/67420)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 3\
**Last updated:** [August 31, 2021, 11:57am UTC](https://discourse.julialang.org/t/fuzzy-rounding-for-rationals/67420 "2021-08-31T11:57:45Z")

</div>

Is there an easy way to convert 0.005 to a Rational 1//200 ? I guess 0.005 has no exact representation in base 2, which is why it is interpreted as this terribly long fraction. EDIT: Actually my use case is more “gener…

---

## [Custom coloring function?](https://discourse.julialang.org/t/custom-coloring-function/67417)

<div class="topic-metadata">

**Author:** [@Sukera](https://discourse.julialang.org/u/Sukera)\
**Replies:** 1\
**Last updated:** [August 31, 2021, 10:46am UTC](https://discourse.julialang.org/t/custom-coloring-function/67417 "2021-08-31T10:46:07Z")

</div>

Hi! I’m trying to plot a function f returning complex values using contour. f has a limited number of possibly returned values, which I’d like to plot with a unique color in the resulting contour plot. I thought I could…

---

## [Option for changing distance between plot guide and axis](https://discourse.julialang.org/t/option-for-changing-distance-between-plot-guide-and-axis/67416)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 0\
**Last updated:** [August 31, 2021, 10:06am UTC](https://discourse.julialang.org/t/option-for-changing-distance-between-plot-guide-and-axis/67416 "2021-08-31T10:06:03Z")

</div>

A very simple example of why I am interested in this should explain my problem properly: hill(x,v,K,n) = v\*(x^n)/(x^n+K^n) plot(\[1.,1.\],\[-0.05,0.5\],lw=2,linestyle=:dot,color=:black,label="") plot!(\[0.0,1.\],\[0.5,0.5\],lw=…

---

## [Using ChainRules rrule for mutating function to work with Zygote](https://discourse.julialang.org/t/using-chainrules-rrule-for-mutating-function-to-work-with-zygote/67375)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 2\
**Last updated:** [August 31, 2021, 10:03am UTC](https://discourse.julialang.org/t/using-chainrules-rrule-for-mutating-function-to-work-with-zygote/67375 "2021-08-31T10:03:39Z")

</div>

Hi there, I would like to add an rrule for a function that mutates an input array that I want to differentiate with. The following functions can be used with Forward/ReverseDiff, but gives me an Mutation error with Zyg…

---

## [Symbolics - Identity matrices for beginners](https://discourse.julialang.org/t/symbolics-identity-matrices-for-beginners/67391)

<div class="topic-metadata">

**Author:** [@banksiaboy](https://discourse.julialang.org/u/banksiaboy)\
**Replies:** 5\
**Last updated:** [August 31, 2021, 4:50am UTC](https://discourse.julialang.org/t/symbolics-identity-matrices-for-beginners/67391 "2021-08-31T04:50:56Z")

</div>

Hi, I’m trying to relearn linear algebra for the basics of deep-learning. I also want to bootstrap myself into using Symbolics.jl at the same time. I used to enjoy owning MuMath back in the day. I have basic 2 x 2 matr…

---

## [Encapsulating enum access via dot syntax](https://discourse.julialang.org/t/encapsulating-enum-access-via-dot-syntax/11785)

<div class="topic-metadata">

**Author:** [@fbruetting](https://discourse.julialang.org/u/fbruetting)\
**Replies:** 13\
**Last updated:** [August 31, 2021, 2:05am UTC](https://discourse.julialang.org/t/encapsulating-enum-access-via-dot-syntax/11785 "2021-08-31T02:05:01Z")

</div>

Wouldn’t it make sense to access enums via dot syntax, together with maybe/optionally not to pushing all enum members into the scope? I currently have two issues: I am not able to create different enums with the same …

---

## [SystemError for adding new package](https://discourse.julialang.org/t/systemerror-for-adding-new-package/67394)

<div class="topic-metadata">

**Author:** [@zlq178](https://discourse.julialang.org/u/zlq178)\
**Replies:** 0\
**Last updated:** [August 31, 2021, 1:07am UTC](https://discourse.julialang.org/t/systemerror-for-adding-new-package/67394 "2021-08-31T01:07:45Z")

</div>

I want to add a new package. But it always failed. What is missing?

---

## [Confused about how to deploy versions of documentation](https://discourse.julialang.org/t/confused-about-how-to-deploy-versions-of-documentation/67031)

<div class="topic-metadata">

**Author:** [@plafer](https://discourse.julialang.org/u/plafer)\
**Replies:** 2\
**Last updated:** [August 31, 2021, 12:35am UTC](https://discourse.julialang.org/t/confused-about-how-to-deploy-versions-of-documentation/67031 "2021-08-31T00:35:54Z")

</div>

I am confused as to how to deploy my package’s documentation per version. I use Github Actions, and followed the docs for tagbot and documenter.jl, but something still escapes me. Here is my Tagbot config: name: TagBot…

---

## [PlotlyJS: restyle! not working inside Pluto -- how to change labels?](https://discourse.julialang.org/t/plotlyjs-restyle-not-working-inside-pluto-how-to-change-labels/67381)

<div class="topic-metadata">

**Author:** [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Replies:** 0\
**Last updated:** [August 30, 2021, 9:39pm UTC](https://discourse.julialang.org/t/plotlyjs-restyle-not-working-inside-pluto-how-to-change-labels/67381 "2021-08-30T21:39:15Z")

</div>

I am stuck with a stupid small detail. I have two outputs from a loop, both of which are 1×16 Matrix{Float64}. I know how to plot the two outputs together on a single plot. The point is that is I do not know how to chang…

---

## [Hide output from external function](https://discourse.julialang.org/t/hide-output-from-external-function/67000)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 8\
**Last updated:** [August 30, 2021, 6:47pm UTC](https://discourse.julialang.org/t/hide-output-from-external-function/67000 "2021-08-30T18:47:57Z")

</div>

I am using a package, Chemfiles, which has a function to read some simulation trajectory files. This function is a wrapper to a C++ function, and this C++ function writes to “the screen” (?) some stuff every time a file …

---

## [Taking advantage of rowwise-constant sparse matrix](https://discourse.julialang.org/t/taking-advantage-of-rowwise-constant-sparse-matrix/67366)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 7\
**Last updated:** [August 30, 2021, 4:48pm UTC](https://discourse.julialang.org/t/taking-advantage-of-rowwise-constant-sparse-matrix/67366 "2021-08-30T16:48:58Z")

</div>

Hi, This is a follow-up of this previous thread where we discussed with @Sukera the possibility to improve matrix-vector product in the case where the matrix is sparse, but also has only one possible non-zero value per …

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

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