# General Usage

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

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

**Page:** 680

---

## [ModelingToolkit and Integrals](https://discourse.julialang.org/t/modelingtoolkit-and-integrals/49938)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 1\
**Last updated:** [November 10, 2020, 9:00pm UTC](https://discourse.julialang.org/t/modelingtoolkit-and-integrals/49938 "2020-11-10T21:00:58Z")

</div>

I don’t see a way to do integrals in modeling toolkit? Is this feature included presently?

---

## [Is there a way to test individual \`jldoctests\`?](https://discourse.julialang.org/t/is-there-a-way-to-test-individual-jldoctests/49930)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 2\
**Last updated:** [November 10, 2020, 6:34pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-test-individual-jldoctests/49930 "2020-11-10T18:34:10Z")

</div>

I am using Documenter.jl for the first time and my attempts at using jldoctest aren’t very good. There are a lot of failures. It would be nice to debug these failures one by one, say """ foo(x) Returns 1 \`\`\`jldoc…

---

## [Ecosystem of SampledSignals](https://discourse.julialang.org/t/ecosystem-of-sampledsignals/49922)

<div class="topic-metadata">

**Author:** [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Replies:** 1\
**Last updated:** [November 10, 2020, 5:28pm UTC](https://discourse.julialang.org/t/ecosystem-of-sampledsignals/49922 "2020-11-10T17:28:50Z")

</div>

I’d like to ask if there is some consensus in the sampled signal domain on basic type definitions. In my work, I have my algorithms and packages for signal processing (FFT spectrum comparisons, different ways of chopping…

---

## [Struct with a field of type \`Function\`](https://discourse.julialang.org/t/struct-with-a-field-of-type-function/49669)

<div class="topic-metadata">

**Author:** [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Replies:** 8\
**Last updated:** [November 10, 2020, 4:33pm UTC](https://discourse.julialang.org/t/struct-with-a-field-of-type-function/49669 "2020-11-10T16:33:26Z")

</div>

Hi there, I am trying to define a struct that contains the keys to a set of variables vars and a function with a signature that corresponds to those variables. struct MyType f::Function vars::Vector{Int} end A…

---

## [VS Code Stuck Indexing Julia](https://discourse.julialang.org/t/vs-code-stuck-indexing-julia/49865)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 4\
**Last updated:** [November 10, 2020, 4:05pm UTC](https://discourse.julialang.org/t/vs-code-stuck-indexing-julia/49865 "2020-11-10T16:05:08Z")

</div>

In VS Code, I get a message that Julia crashed, and several notices of Julia indexing. It doesn’t seem to stop, and I can’t use certain packages. As can be seen, it doesen’t mention indexing a particular package. I…

---

## [Flux example 100x slower with L2 regularisation(?!)](https://discourse.julialang.org/t/flux-example-100x-slower-with-l2-regularisation/49914)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 5\
**Last updated:** [November 10, 2020, 2:51pm UTC](https://discourse.julialang.org/t/flux-example-100x-slower-with-l2-regularisation/49914 "2020-11-10T14:51:20Z")

</div>

I am running a network in Flux/ADAM without regularisation which does 100 epochs in about as many seconds. When I add an L2-penalty of 0.01\*sum(abs2 , m\[2\].W) to the loss function and train, it takes 90-100 seconds per…

---

## [Making use of \`optlevel\` etc](https://discourse.julialang.org/t/making-use-of-optlevel-etc/49917)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 1\
**Last updated:** [November 10, 2020, 2:35pm UTC](https://discourse.julialang.org/t/making-use-of-optlevel-etc/49917 "2020-11-10T14:35:05Z")

</div>

The Makie ecosystem still suffers from large compilation latency. Tim Holy has kindly been looking at invalidations for us, but that is relatively slow work and hard to do for the amount of code that is there. One option…

---

## [Addprocs() to different achitectures](https://discourse.julialang.org/t/addprocs-to-different-achitectures/5454)

<div class="topic-metadata">

**Author:** [@Frank\_Applin](https://discourse.julialang.org/u/Frank_Applin)\
**Replies:** 2\
**Last updated:** [November 10, 2020, 9:01am UTC](https://discourse.julialang.org/t/addprocs-to-different-achitectures/5454 "2020-11-10T09:01:20Z")

</div>

Hi, I’m experimenting with doing remote calls to different architectures (beaglebone and Raspberry Pi). I have successfully done a remotecall\_fetch() to a UDOO x86 running Mint Linux from my Dell Optiplex 755 desktop. T…

---

## [Defining const inside struct](https://discourse.julialang.org/t/defining-const-inside-struct/49866)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 6\
**Last updated:** [November 10, 2020, 2:47am UTC](https://discourse.julialang.org/t/defining-const-inside-struct/49866 "2020-11-10T02:47:10Z")

</div>

This is a follow-up of this thread, which ended with this new issue I am not sure how to solve: https://discourse.julialang.org/t/nightly-build-ci-failing-because-rand-unitrange-changed-when-to-care/49857/10 The issue …

---

## [Nested loops](https://discourse.julialang.org/t/nested-loops/49810)

<div class="topic-metadata">

**Author:** [@caetanotc](https://discourse.julialang.org/u/caetanotc)\
**Replies:** 5\
**Last updated:** [November 9, 2020, 10:20pm UTC](https://discourse.julialang.org/t/nested-loops/49810 "2020-11-09T22:20:05Z")

</div>

Hi, I need a program where I’m computing a 2D NxN lattice, and for that I need N^2 nested loops, for N=2 would be: for S\[1,1\] in \[-1,1\], S\[1,2\] in \[-1,1\], S\[2,1\] in \[-1,1\], S\[2,2\] in \[-1,1\] ... end But I need to c…

---

## [Make Struct available on all workers](https://discourse.julialang.org/t/make-struct-available-on-all-workers/49869)

<div class="topic-metadata">

**Author:** [@oskar](https://discourse.julialang.org/u/oskar)\
**Replies:** 0\
**Last updated:** [November 9, 2020, 9:19pm UTC](https://discourse.julialang.org/t/make-struct-available-on-all-workers/49869 "2020-11-09T21:19:05Z")

</div>

I am using Distributed.jl and DistributedArrays.jl to write code that runs in parallel and I want to make a certain struct available to all processes, because they all need to (only) read from it several times every time…

---

## [UndefVarError: ncounter](https://discourse.julialang.org/t/undefvarerror-ncounter/49867)

<div class="topic-metadata">

**Author:** [@panditabupesh](https://discourse.julialang.org/u/panditabupesh)\
**Replies:** 1\
**Last updated:** [November 9, 2020, 9:01pm UTC](https://discourse.julialang.org/t/undefvarerror-ncounter/49867 "2020-11-09T21:01:46Z")

</div>

I am new to Julia. How do I fix this function? function count(word, ltr) ncounter = 0; for letter in word if letter == “a” global ncounter = ncounter + 1 end result = ncounter end return result end wcoun…

---

## [Call function without Keywordarguments with an empty NamedTuple](https://discourse.julialang.org/t/call-function-without-keywordarguments-with-an-empty-namedtuple/49653)

<div class="topic-metadata">

**Author:** [@oskar](https://discourse.julialang.org/u/oskar)\
**Replies:** 2\
**Last updated:** [November 9, 2020, 8:56pm UTC](https://discourse.julialang.org/t/call-function-without-keywordarguments-with-an-empty-namedtuple/49653 "2020-11-09T20:56:05Z")

</div>

Since it is possible to call functions with NamedTuples, I was wondering if there is a way to call a function that has no keywordarguments with an empty NamedTuple, and if not, why is it not desirable? I.e. function f(…

---

## [How to remove quotes folowing variable interpolation in Run() command?](https://discourse.julialang.org/t/how-to-remove-quotes-folowing-variable-interpolation-in-run-command/49849)

<div class="topic-metadata">

**Author:** [@Fred](https://discourse.julialang.org/u/Fred)\
**Replies:** 4\
**Last updated:** [November 9, 2020, 5:19pm UTC](https://discourse.julialang.org/t/how-to-remove-quotes-folowing-variable-interpolation-in-run-command/49849 "2020-11-09T17:19:12Z")

</div>

Hi, I try to use Julia to start and existing R software. But I have problems because I dont know how to remove extra quotes added by variable interpolation. Thanks ! See example here (it is a toy example, I have a muc…

---

## [Can't add packages](https://discourse.julialang.org/t/cant-add-packages/49816)

<div class="topic-metadata">

**Author:** [@xFrenchy](https://discourse.julialang.org/u/xFrenchy)\
**Replies:** 5\
**Last updated:** [November 9, 2020, 4:26pm UTC](https://discourse.julialang.org/t/cant-add-packages/49816 "2020-11-09T16:26:45Z")

</div>

Hey everyone, it appears that I cannot add packages anymore due to the path being wrong. In the past I’ve been able to add packages without any issue and I was messing around with creating a package and now it appears to…

---

## [Conceptual problem with user recipes: draw a sphere before drawing the data](https://discourse.julialang.org/t/conceptual-problem-with-user-recipes-draw-a-sphere-before-drawing-the-data/49385)

<div class="topic-metadata">

**Author:** [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Replies:** 5\
**Last updated:** [November 9, 2020, 3:00pm UTC](https://discourse.julialang.org/t/conceptual-problem-with-user-recipes-draw-a-sphere-before-drawing-the-data/49385 "2020-11-09T15:00:18Z")

</div>

I am trying to do a user recipe from RecipesBase.jl but I seem to not get the idea how Recipes work I fear. Context. I would like to do something that I thought was quite easy. Given the M=Sphere(2) from Manifolds.jl a…

---

## [Cant add plots](https://discourse.julialang.org/t/cant-add-plots/49843)

<div class="topic-metadata">

**Author:** [@Stropy28](https://discourse.julialang.org/u/Stropy28)\
**Replies:** 3\
**Last updated:** [November 9, 2020, 2:56pm UTC](https://discourse.julialang.org/t/cant-add-plots/49843 "2020-11-09T14:56:51Z")

</div>

Can anyone help me with this problem?

---

## [Add UMAP to julia](https://discourse.julialang.org/t/add-umap-to-julia/49813)

<div class="topic-metadata">

**Author:** [@bhavinmoriya](https://discourse.julialang.org/u/bhavinmoriya)\
**Replies:** 4\
**Last updated:** [November 9, 2020, 2:44pm UTC](https://discourse.julialang.org/t/add-umap-to-julia/49813 "2020-11-09T14:44:52Z")

</div>

Hi, I was trying to add the package UMAP, while doing so, the following message showed up, RROR: Unsatisfiable requirements detected for package Distances \[b4f34e82\]: Distances \[b4f34e82\] log: ├─possible versions are…

---

## [How to add different meshes in JuAFEM?](https://discourse.julialang.org/t/how-to-add-different-meshes-in-juafem/49769)

<div class="topic-metadata">

**Author:** [@Hrishikesh\_Das](https://discourse.julialang.org/u/Hrishikesh_Das)\
**Replies:** 7\
**Last updated:** [November 9, 2020, 2:18pm UTC](https://discourse.julialang.org/t/how-to-add-different-meshes-in-juafem/49769 "2020-11-09T14:18:34Z")

</div>

I am using the package JuAFEM. I want to join three different meshes and make it into one. Below is the picture attached. Plz help.

---

## [Add sum term to ODE in DifferentialEquations](https://discourse.julialang.org/t/add-sum-term-to-ode-in-differentialequations/49463)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 4\
**Last updated:** [November 9, 2020, 9:13am UTC](https://discourse.julialang.org/t/add-sum-term-to-ode-in-differentialequations/49463 "2020-11-09T09:13:10Z")

</div>

Hello, I wrote some ODEs in Julia with DifferentialEquations. Now I have to translate the following into Julia: The ODEs I have written are: function ode!(du, u, p, t) μ, ϕ, ω, β, τ = p #= with: a = μ …

---

## [ERROR: LoadError: Unable to import Arpack\_jll on Julia versions older than 1.3!](https://discourse.julialang.org/t/error-loaderror-unable-to-import-arpack-jll-on-julia-versions-older-than-1-3/34603)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 5\
**Last updated:** [November 9, 2020, 8:55am UTC](https://discourse.julialang.org/t/error-loaderror-unable-to-import-arpack-jll-on-julia-versions-older-than-1-3/34603 "2020-11-09T08:55:30Z")

</div>

Anyone have any ideas about this? julia\> using MLJBase \[ Info: Precompiling MLJBase \[a7f614a8-145f-11e9-1d2a-a57a1082229d\] ERROR: LoadError: Unable to import Arpack\_jll on Julia versions older than 1.3! Stacktrace: \[1\]…

---

## [Gnuplot.jl opens up plot pane as well as an external window](https://discourse.julialang.org/t/gnuplot-jl-opens-up-plot-pane-as-well-as-an-external-window/49822)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 1\
**Last updated:** [November 9, 2020, 4:36am UTC](https://discourse.julialang.org/t/gnuplot-jl-opens-up-plot-pane-as-well-as-an-external-window/49822 "2020-11-09T04:36:34Z")

</div>

Plotting a figure using Gnuplot.jl inside VSCode will display an external window + the plot pane (however, the plot pane is empty). I am using WSL 2, so using the Remote - WSL extension on VSCode and also running an X-S…

---

## [Clone Julia version from user's \`~/.Julia\`](https://discourse.julialang.org/t/clone-julia-version-from-users-julia/49820)

<div class="topic-metadata">

**Author:** [@lobshi](https://discourse.julialang.org/u/lobshi)\
**Replies:** 0\
**Last updated:** [November 9, 2020, 3:40am UTC](https://discourse.julialang.org/t/clone-julia-version-from-users-julia/49820 "2020-11-09T03:40:51Z")

</div>

Hi, I updated my Julia by downloading the newest version from official website. Now I get stuck when I try to update the Julia in Anaconda environment. Is there any easy way to update Julia in Conda, no matter by clonin…

---

## [Pronounciation guide?](https://discourse.julialang.org/t/pronounciation-guide/49556)

<div class="topic-metadata">

**Author:** [@claforte](https://discourse.julialang.org/u/claforte)\
**Replies:** 12\
**Last updated:** [November 9, 2020, 2:41am UTC](https://discourse.julialang.org/t/pronounciation-guide/49556 "2020-11-09T02:41:02Z")

</div>

Hi, I love Julia but I have a hard type guessing how some of the functions/operators are called/pronounced. For instance, how do people pronounce: → =\> …? Single-arrow, double-arrow? It would be great if the documen…

---

## [Unable to expand derivatives in modelingtoolkit](https://discourse.julialang.org/t/unable-to-expand-derivatives-in-modelingtoolkit/49803)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 2\
**Last updated:** [November 8, 2020, 10:03pm UTC](https://discourse.julialang.org/t/unable-to-expand-derivatives-in-modelingtoolkit/49803 "2020-11-08T22:03:03Z")

</div>

using ModelingToolkit @variables x y Δy u μ # these are symbols, they are used in symbolic computing @derivatives δx'~x δy'~y δu'~u δμ'~μ # these are derivatives, they are assigned with macros expand\_derivatives(δu(sq…

---

## [Resize arrays in mutable structs](https://discourse.julialang.org/t/resize-arrays-in-mutable-structs/49701)

<div class="topic-metadata">

**Author:** [@robertdj](https://discourse.julialang.org/u/robertdj)\
**Replies:** 6\
**Last updated:** [November 8, 2020, 7:27pm UTC](https://discourse.julialang.org/t/resize-arrays-in-mutable-structs/49701 "2020-11-08T19:27:36Z")

</div>

In my Deldir package I use ccall on a code with 17 arguments that are all vectors. I have collected those in a mutable struct. When executing the ccall the content of the vectors in the struct are replaced. If the Fortr…

---

## [How to elegantly express the same operation for permutations of x, y and z?](https://discourse.julialang.org/t/how-to-elegantly-express-the-same-operation-for-permutations-of-x-y-and-z/49728)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 9\
**Last updated:** [November 8, 2020, 1:31pm UTC](https://discourse.julialang.org/t/how-to-elegantly-express-the-same-operation-for-permutations-of-x-y-and-z/49728 "2020-11-08T13:31:38Z")

</div>

This is a situation I face very often: I have the same operation that needs to be run once for each dimension of a 3D construct. This is complicated because the order of indices differs for each variant, and I don’t kno…

---

## [How to write @memoize that works in both local and global scope](https://discourse.julialang.org/t/how-to-write-memoize-that-works-in-both-local-and-global-scope/49727)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 6\
**Last updated:** [November 8, 2020, 7:51am UTC](https://discourse.julialang.org/t/how-to-write-memoize-that-works-in-both-local-and-global-scope/49727 "2020-11-08T07:51:23Z")

</div>

Let’s write a @memoize f(x) = ... macro in Julia. Glossing over gensyms etc. it can just macroexpand into memo = Dict() f(x) = get(memo, x) do ... end At the global scope memo will be a slow global variable, so let’s i…

---

## [How to sum every element but one](https://discourse.julialang.org/t/how-to-sum-every-element-but-one/49771)

<div class="topic-metadata">

**Author:** [@carlos](https://discourse.julialang.org/u/carlos)\
**Replies:** 7\
**Last updated:** [November 8, 2020, 11:16am UTC](https://discourse.julialang.org/t/how-to-sum-every-element-but-one/49771 "2020-11-08T11:16:59Z")

</div>

I want to sum every element of x\[i\] except when i = j. For example: j=10 I = 1:30 sum(x\[i\] for i in I) #here I want to sum every element but j.

---

## [Issues Building RCall atom](https://discourse.julialang.org/t/issues-building-rcall-atom/49714)

<div class="topic-metadata">

**Author:** [@atparedes](https://discourse.julialang.org/u/atparedes)\
**Replies:** 2\
**Last updated:** [November 8, 2020, 2:58am UTC](https://discourse.julialang.org/t/issues-building-rcall-atom/49714 "2020-11-08T02:58:07Z")

</div>

New to Julia: I need to use R in Julia to run several simulation studies, and I am having problems using RCall. I want to use R to sample from a skew-normal distribution. Here is the massage - which hopefully it is clear…

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

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