# General Usage

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

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

**Page:** 579

---

## [Interact.jl custom layout to @manipulate macro](https://discourse.julialang.org/t/interact-jl-custom-layout-to-manipulate-macro/51757)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 7\
**Last updated:** [July 7, 2021, 10:53pm UTC](https://discourse.julialang.org/t/interact-jl-custom-layout-to-manipulate-macro/51757 "2021-07-07T22:53:06Z")

</div>

based on this example from the Interact.jl docs function mycolorpicker() r = slider(0:255, label = "red") g = slider(0:255, label = "green") b = slider(0:255, label = "blue") output = Interact.@map Color…

---

## [Pkg.test() is orders of magnitude slower than include("test/runtests.jl")](https://discourse.julialang.org/t/pkg-test-is-orders-of-magnitude-slower-than-include-test-runtests-jl/64235)

<div class="topic-metadata">

**Author:** [@Brad\_Carman](https://discourse.julialang.org/u/Brad_Carman)\
**Replies:** 4\
**Last updated:** [July 7, 2021, 9:23pm UTC](https://discourse.julialang.org/t/pkg-test-is-orders-of-magnitude-slower-than-include-test-runtests-jl/64235 "2021-07-07T21:23:37Z")

</div>

If I run the following (starting Julia with only --project switch) include("test/runtests.jl") @time of my function gives 0.030818 seconds (130.79 k allocations: 7.158 MiB) But, if I run using Pkg; Pkg.test(;julia…

---

## [Specific layout for @layout macro in Plots.jl](https://discourse.julialang.org/t/specific-layout-for-layout-macro-in-plots-jl/64228)

<div class="topic-metadata">

**Author:** [@Nick\_k](https://discourse.julialang.org/u/Nick_k)\
**Replies:** 5\
**Last updated:** [July 7, 2021, 9:23pm UTC](https://discourse.julialang.org/t/specific-layout-for-layout-macro-in-plots-jl/64228 "2021-07-07T21:23:16Z")

</div>

I’m trying to generate a rather specific custom layout with the @layout macro. I’ve checked the documentation (http://docs.juliaplots.org/latest/layouts/#advanced-layouts), but it’s rather sparse and doesn’t quite give m…

---

## [Pde heat diffusion solution](https://discourse.julialang.org/t/pde-heat-diffusion-solution/64027)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 33\
**Last updated:** [July 7, 2021, 2:47pm UTC](https://discourse.julialang.org/t/pde-heat-diffusion-solution/64027 "2021-07-07T14:47:00Z")

</div>

m = 100 delta\_z = 0.015 delta\_t = 0.15 z= delta\_z : delta\_z : 1-delta\_z print(z) j=1 n=1 while j\<=10 f(j)=1/(j\*(delta\_z)-1) a(j) = (1+((2\*(delta\_t))/((delta\_z)^2))+(((delta\_t)f(j))/(delta\_z))-((delta\_t)m(f(j)))) …

---

## [Documenter: publish in different languages?](https://discourse.julialang.org/t/documenter-publish-in-different-languages/64217)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 4\
**Last updated:** [July 7, 2021, 2:44pm UTC](https://discourse.julialang.org/t/documenter-publish-in-different-languages/64217 "2021-07-07T14:44:34Z")

</div>

Is it possible to publish documentation with Documenter in more than one language? For example by adding a flag somewhere for the reader to choose which language to read?

---

## [Typestable caching of multiple arrays with different eltype](https://discourse.julialang.org/t/typestable-caching-of-multiple-arrays-with-different-eltype/64197)

<div class="topic-metadata">

**Author:** [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Replies:** 3\
**Last updated:** [July 7, 2021, 12:48pm UTC](https://discourse.julialang.org/t/typestable-caching-of-multiple-arrays-with-different-eltype/64197 "2021-07-07T12:48:05Z")

</div>

Hello, i was wondering, whether it is possible to code some kind of cache pool, where i can request cache arrays of various types. Each type of cache array should be only created once. I’ve tried # cache arbitrary arra…

---

## [Automatic differentiation with a for loop in the function definition](https://discourse.julialang.org/t/automatic-differentiation-with-a-for-loop-in-the-function-definition/64196)

<div class="topic-metadata">

**Author:** [@aymercan](https://discourse.julialang.org/u/aymercan)\
**Replies:** 2\
**Last updated:** [July 7, 2021, 9:55am UTC](https://discourse.julialang.org/t/automatic-differentiation-with-a-for-loop-in-the-function-definition/64196 "2021-07-07T09:55:34Z")

</div>

Hi Julia community, I am using Julia for my economics research and this is my first question posted here. Hopefully it is a simple one that more experienced users can easily answer. I am trying to use automatic differe…

---

## [StaticArrays being used with DifferentialEquation callbacks](https://discourse.julialang.org/t/staticarrays-being-used-with-differentialequation-callbacks/64178)

<div class="topic-metadata">

**Author:** [@LionMod](https://discourse.julialang.org/u/LionMod)\
**Replies:** 3\
**Last updated:** [July 7, 2021, 9:47am UTC](https://discourse.julialang.org/t/staticarrays-being-used-with-differentialequation-callbacks/64178 "2021-07-07T09:47:50Z")

</div>

I’ve been improving performance of my differential equations with @SVector and @MVectorbut I’ve got stuck when it comes to using it with callbacks specifically PresetTimeCallback. The idea is there is a large spike in v…

---

## [Function return type depends on an input flag : Bad?](https://discourse.julialang.org/t/function-return-type-depends-on-an-input-flag-bad/63486)

<div class="topic-metadata">

**Author:** [@rakeshvar](https://discourse.julialang.org/u/rakeshvar)\
**Replies:** 15\
**Last updated:** [July 7, 2021, 8:14am UTC](https://discourse.julialang.org/t/function-return-type-depends-on-an-input-flag-bad/63486 "2021-07-07T08:14:53Z")

</div>

I have a function that calculates ‘sky’ loss and optionally its gradient. function \_sky\_loss\_gradient(x, loss\_only::Bool) # calculation loss\_only && return loss # more calculation return loss, grad end …

---

## [How to change .julia folder location](https://discourse.julialang.org/t/how-to-change-julia-folder-location/64193)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 4\
**Last updated:** [July 7, 2021, 7:38am UTC](https://discourse.julialang.org/t/how-to-change-julia-folder-location/64193 "2021-07-07T07:38:55Z")

</div>

Hey all, Usually the .julia folder location is in the home directory of the current user. I want to change that. But it for example on c:.julia. I read that therefore I have to change the global variable JULIA\_DEPOT\_PA…

---

## [User defined logger behaviour](https://discourse.julialang.org/t/user-defined-logger-behaviour/63367)

<div class="topic-metadata">

**Author:** [@Jan\_Dolinsky](https://discourse.julialang.org/u/Jan_Dolinsky)\
**Replies:** 4\
**Last updated:** [July 7, 2021, 7:11am UTC](https://discourse.julialang.org/t/user-defined-logger-behaviour/63367 "2021-07-07T07:11:13Z")

</div>

Hello, I read on how logging in Julia works at: Logging · The Julia Language . Great stuff, good to see the split in the overall design between creating events and processing them by means of defining a logger. I am in…

---

## [How to achieve the expected graph?](https://discourse.julialang.org/t/how-to-achieve-the-expected-graph/64195)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 1\
**Last updated:** [July 7, 2021, 6:48am UTC](https://discourse.julialang.org/t/how-to-achieve-the-expected-graph/64195 "2021-07-07T06:48:23Z")

</div>

I try to reproduce the example of the following link: Example: The Polynomials.jl logo, but I don’t get the image shown in the link: I only get the following image #https://juliamath.github.io/Polynomials.jl/stabl…

---

## [Compiler optimizations on integer exponentation](https://discourse.julialang.org/t/compiler-optimizations-on-integer-exponentation/64185)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 3\
**Last updated:** [July 7, 2021, 12:48am UTC](https://discourse.julialang.org/t/compiler-optimizations-on-integer-exponentation/64185 "2021-07-07T00:48:29Z")

</div>

The following code contains two functions that compute Lennard-Jones potentials, U(r) = 4\\varepsilon \\left(\\frac{\\sigma^{12}}{r^{12}} - \\frac{\\sigma^6}{r^6}\\right) for all pairs of a set of 1000 particles. The first fun…

---

## [Find neighbored segments/labels in Matrix](https://discourse.julialang.org/t/find-neighbored-segments-labels-in-matrix/64151)

<div class="topic-metadata">

**Author:** [@Bjorn\_De](https://discourse.julialang.org/u/Bjorn_De)\
**Replies:** 7\
**Last updated:** [July 6, 2021, 6:18pm UTC](https://discourse.julialang.org/t/find-neighbored-segments-labels-in-matrix/64151 "2021-07-06T18:18:18Z")

</div>

Hi all! I have applied a segmentation on an array and want to find the neighbors of each segment. For example: Input: 4×6 Matrix{Int64}: 1 1 1 2 2 2 1 1 5 5 4 4 7 7 3 3 3 3 9 9 9 9 8 8 Output: Dic…

---

## [@autodocs methodswith(MyType) using Documenter](https://discourse.julialang.org/t/autodocs-methodswith-mytype-using-documenter/63873)

<div class="topic-metadata">

**Author:** [@RaulDurand](https://discourse.julialang.org/u/RaulDurand)\
**Replies:** 2\
**Last updated:** [July 6, 2021, 5:16pm UTC](https://discourse.julialang.org/t/autodocs-methodswith-mytype-using-documenter/63873 "2021-07-06T17:16:09Z")

</div>

Hi! Is there a way to automatically document all the methods related to a type? Something similar to @autodocs Mudule=MyModule but for all methods with my Type.

---

## [Starting GLMakie takes very long](https://discourse.julialang.org/t/starting-glmakie-takes-very-long/64106)

<div class="topic-metadata">

**Author:** [@peteole](https://discourse.julialang.org/u/peteole)\
**Replies:** 28\
**Last updated:** [July 6, 2021, 4:50pm UTC](https://discourse.julialang.org/t/starting-glmakie-takes-very-long/64106 "2021-07-06T16:50:22Z")

</div>

Hi, I am getting started with Makie. The functionality is cool. However I am really annoyed by the startup time: It takes over a minute to open the first plot in GLMakie. After that plotting works instantly, but the st…

---

## [Julia slowdown on long running programs with many allocations](https://discourse.julialang.org/t/julia-slowdown-on-long-running-programs-with-many-allocations/63516)

<div class="topic-metadata">

**Author:** [@scottjordan](https://discourse.julialang.org/u/scottjordan)\
**Replies:** 6\
**Last updated:** [July 6, 2021, 2:22pm UTC](https://discourse.julialang.org/t/julia-slowdown-on-long-running-programs-with-many-allocations/63516 "2021-07-06T14:22:24Z")

</div>

Currently, I am benchmarking flux code compared to python code for different configurations of data and network sizes. However, I noticed that execution slows as more models have been trained with different configuration…

---

## [Memory usage data for getproperty function](https://discourse.julialang.org/t/memory-usage-data-for-getproperty-function/64139)

<div class="topic-metadata">

**Author:** [@jsjie](https://discourse.julialang.org/u/jsjie)\
**Replies:** 3\
**Last updated:** [July 6, 2021, 10:56am UTC](https://discourse.julialang.org/t/memory-usage-data-for-getproperty-function/64139 "2021-07-06T10:56:09Z")

</div>

I’m analysing memory usage as described in julia manual , and I found that getproperty functions seem to be related to large numbers. The following lines is taken from the result .mem file: - function Base.getp…

---

## [Overloading ≫ yields ERROR: TypeError: non-boolean used in boolean context](https://discourse.julialang.org/t/overloading-yields-error-typeerror-non-boolean-used-in-boolean-context/64132)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 3\
**Last updated:** [July 6, 2021, 9:56am UTC](https://discourse.julialang.org/t/overloading-yields-error-typeerror-non-boolean-used-in-boolean-context/64132 "2021-07-06T09:56:07Z")

</div>

Can anyone help why this weird error happens? (working on julia 1.6.1) julia\> a ≫ b = a + b ≫ (generic function with 1 method) julia\> (1 ≫ 2) ≫ 3 6 julia\> 1 ≫ (2 ≫ 3) 6 julia\> 1 ≫ 2 ≫ 3 ERROR: TypeError: non-b…

---

## [@printf not consistent with C printf?](https://discourse.julialang.org/t/printf-not-consistent-with-c-printf/64136)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 3\
**Last updated:** [July 6, 2021, 9:32am UTC](https://discourse.julialang.org/t/printf-not-consistent-with-c-printf/64136 "2021-07-06T09:32:57Z")

</div>

quick question about %02.3f format specifier - that should left pad zeros to the left of the comma sign, and have 3 digits afterwards, like here formatting - 'printf' with leading zeros in C - Stack Overflow julia\> @pri…

---

## [Julia 1.6 UndefVarError: .. not defined](https://discourse.julialang.org/t/julia-1-6-undefvarerror-not-defined/64085)

<div class="topic-metadata">

**Author:** [@reemmasoud123](https://discourse.julialang.org/u/reemmasoud123)\
**Replies:** 5\
**Last updated:** [July 6, 2021, 8:56am UTC](https://discourse.julialang.org/t/julia-1-6-undefvarerror-not-defined/64085 "2021-07-06T08:56:00Z")

</div>

I just downloaded Julia 1.6 and the syntax: \[-1. .1\] that expresses a range of numbers which used to work in Julia 1.5 no longer works. Does anyone know what the latest syntax for “. .” is? I need it as I am using the…

---

## [Using functors for sparse Jacobian evaluations](https://discourse.julialang.org/t/using-functors-for-sparse-jacobian-evaluations/64111)

<div class="topic-metadata">

**Author:** [@jdlara-berkeley](https://discourse.julialang.org/u/jdlara-berkeley)\
**Replies:** 2\
**Last updated:** [July 6, 2021, 12:13am UTC](https://discourse.julialang.org/t/using-functors-for-sparse-jacobian-evaluations/64111 "2021-07-06T00:13:38Z")

</div>

I am trying to use ForwardDiff to calculate the Jacobian of a function so that I can reuse the resulting Jacobian function and use it as an input for several packages. For instance, pass it to NLsolve and later use it in…

---

## [ForwardDiff.derivative! of inplace functions](https://discourse.julialang.org/t/forwarddiff-derivative-of-inplace-functions/54014)

<div class="topic-metadata">

**Author:** [@jokasimr](https://discourse.julialang.org/u/jokasimr)\
**Replies:** 1\
**Last updated:** [July 5, 2021, 10:17pm UTC](https://discourse.julialang.org/t/forwarddiff-derivative-of-inplace-functions/54014 "2021-07-05T22:17:43Z")

</div>

I’m learning how to use the FiniteDifference.jl package without allocating, and I want to implement a function for doing Jacobian vector products inplace. :slight\_smile: The goal is to accomplish the same as jvp\_finite…

---

## [Unable to use Flux](https://discourse.julialang.org/t/unable-to-use-flux/64077)

<div class="topic-metadata">

**Author:** [@development\_mentor](https://discourse.julialang.org/u/development_mentor)\
**Replies:** 5\
**Last updated:** [July 5, 2021, 8:25pm UTC](https://discourse.julialang.org/t/unable-to-use-flux/64077 "2021-07-05T20:25:08Z")

</div>

Hello, I’m trying to do reinforcement learning and deep learning with Julia. But can’t use Flux. I get an error: ┌ Info: Precompiling Flux \[587475ba-b771-5e3f-ad9e-33799f191a9c\] └ @ Base loading.jl:1317 ERROR: LoadError…

---

## [Unable to install JuliaPro on Ubuntu](https://discourse.julialang.org/t/unable-to-install-juliapro-on-ubuntu/64091)

<div class="topic-metadata">

**Author:** [@Mahesh](https://discourse.julialang.org/u/Mahesh)\
**Replies:** 2\
**Last updated:** [July 5, 2021, 7:59pm UTC](https://discourse.julialang.org/t/unable-to-install-juliapro-on-ubuntu/64091 "2021-07-05T19:59:32Z")

</div>

Hello Julia, I have tried installing Julia on my Ubuntu 20.04 LTS but could not install it. Your help is much appreciated. sudo yum -y install xclip && sudo yum -y install libXScrnSaver chmod 777 JuliaPro-1.5.4-1\_buil…

---

## [Does Julia have tail call optimization?](https://discourse.julialang.org/t/does-julia-have-tail-call-optimization/64101)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 4\
**Last updated:** [July 5, 2021, 7:50pm UTC](https://discourse.julialang.org/t/does-julia-have-tail-call-optimization/64101 "2021-07-05T19:50:10Z")

</div>

does Julia have tail call optimization ? or does a recursive function always overflow regardless of if you are careful to construct it in that fashion ?

---

## [Differential operators: curl div, grad, laplacian, partial derivatives with automatic differentiation](https://discourse.julialang.org/t/differential-operators-curl-div-grad-laplacian-partial-derivatives-with-automatic-differentiation/39375)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 9\
**Last updated:** [July 5, 2021, 7:21pm UTC](https://discourse.julialang.org/t/differential-operators-curl-div-grad-laplacian-partial-derivatives-with-automatic-differentiation/39375 "2021-07-05T19:21:52Z")

</div>

Hello, Is there a package that implements the operators curl div, grad, laplacian, partial derivatives with automatic differentiation for scalar functions and vector fields?

---

## [ForwardDiff caches usage](https://discourse.julialang.org/t/forwarddiff-caches-usage/64058)

<div class="topic-metadata">

**Author:** [@jdlara-berkeley](https://discourse.julialang.org/u/jdlara-berkeley)\
**Replies:** 5\
**Last updated:** [July 5, 2021, 4:07pm UTC](https://discourse.julialang.org/t/forwarddiff-caches-usage/64058 "2021-07-05T16:07:06Z")

</div>

I have been trying to implement a cache correctly for ForwardDiff similar to DiffEqCache without too much success. My final objective is to have a Jacobian function of the system that we can reuse in multiple steps sinc…

---

## [How do I best convert a nested named tuple to a nested struct?](https://discourse.julialang.org/t/how-do-i-best-convert-a-nested-named-tuple-to-a-nested-struct/64001)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 5\
**Last updated:** [July 5, 2021, 4:03pm UTC](https://discourse.julialang.org/t/how-do-i-best-convert-a-nested-named-tuple-to-a-nested-struct/64001 "2021-07-05T16:03:51Z")

</div>

The code below contains two examples: the first example works, the second one doesn’t. The first example creates a struct, then writes it to an arrow file (which converts it to a named tuple along the way). Reading it …

---

## [Unpacking semi-structured binary stream](https://discourse.julialang.org/t/unpacking-semi-structured-binary-stream/64070)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 4\
**Last updated:** [July 5, 2021, 2:23pm UTC](https://discourse.julialang.org/t/unpacking-semi-structured-binary-stream/64070 "2021-07-05T14:23:22Z")

</div>

Continuation of: say we have two similar but slightly different struct: struct TKey32 \<: TKey fNbytes::Int32 fVersion::Int16 ... fSeekKey::Int32 fSeekPdir::Int32 fClassName::String fName::S…

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

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