# General Usage

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

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

**Page:** 658

---

## [Scalar getindex is disallowed](https://discourse.julialang.org/t/scalar-getindex-is-disallowed/53280)

<div class="topic-metadata">

**Author:** [@tgautam03](https://discourse.julialang.org/u/tgautam03)\
**Replies:** 2\
**Last updated:** [January 13, 2021, 4:20pm UTC](https://discourse.julialang.org/t/scalar-getindex-is-disallowed/53280 "2021-01-13T16:20:22Z")

</div>

Hi, I just wrote a function that computes chain rule using Finite Difference derivatives and ran into a weird issue. The function that calculates the derivative is defined as function chain\_deriv(chain:: Vector{\<:Funct…

---

## [Using Flux for a neural net solution to differential equations](https://discourse.julialang.org/t/using-flux-for-a-neural-net-solution-to-differential-equations/41996)

<div class="topic-metadata">

**Author:** [@RuckerC](https://discourse.julialang.org/u/RuckerC)\
**Replies:** 4\
**Last updated:** [January 13, 2021, 4:16pm UTC](https://discourse.julialang.org/t/using-flux-for-a-neural-net-solution-to-differential-equations/41996 "2021-01-13T16:16:12Z")

</div>

I have recently started using Flux to construct a physics informed neural network. To do this, I start with a model u = Chain(Dense(1, 10), Dense(10,15), Dense(15,1)) Then I construct a function to impose the different…

---

## [Unsatisfiable requirement (Nemo SIUnit Images TexExtensions)](https://discourse.julialang.org/t/unsatisfiable-requirement-nemo-siunit-images-texextensions/22246)

<div class="topic-metadata">

**Author:** [@harven](https://discourse.julialang.org/u/harven)\
**Replies:** 5\
**Last updated:** [January 13, 2021, 1:17pm UTC](https://discourse.julialang.org/t/unsatisfiable-requirement-nemo-siunit-images-texextensions/22246 "2021-01-13T13:17:36Z")

</div>

I installed julia 1.1.0 (linux binary 64bits) together with a few packages (among which Images 0.17.2). I am now trying to install Nemo and I get the following error. julia\> using Pkg; Pkg.add("Nemo") Updating reg…

---

## [Two Configuration Questions about Julia in VSCode](https://discourse.julialang.org/t/two-configuration-questions-about-julia-in-vscode/52913)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 4\
**Last updated:** [January 13, 2021, 12:11pm UTC](https://discourse.julialang.org/t/two-configuration-questions-about-julia-in-vscode/52913 "2021-01-13T12:11:04Z")

</div>

Hello, I have two questions regarding Julia and the Julia extension for VS Code. Coming from C++, I know I can use things like tasks.json, c\_cpp\_properties.json, and launch.json to configure my code compilation, its ex…

---

## [Plot in even grid layout when the number of subplots is prime (using Plots.jl)](https://discourse.julialang.org/t/plot-in-even-grid-layout-when-the-number-of-subplots-is-prime-using-plots-jl/53206)

<div class="topic-metadata">

**Author:** [@Sh4pe](https://discourse.julialang.org/u/Sh4pe)\
**Replies:** 2\
**Last updated:** [January 13, 2021, 9:40am UTC](https://discourse.julialang.org/t/plot-in-even-grid-layout-when-the-number-of-subplots-is-prime-using-plots-jl/53206 "2021-01-13T09:40:36Z")

</div>

Hi there! I’m using Plots.jl and I’m trying to customize a layout. I want to draw some plots in a grid layout, kind of like they are arranged when I don’t specify a layout at all. Say we have the following situation: l…

---

## [Question on LaTeX in Axis Labels in Pluto with Plots.jl](https://discourse.julialang.org/t/question-on-latex-in-axis-labels-in-pluto-with-plots-jl/53268)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 0\
**Last updated:** [January 13, 2021, 4:30am UTC](https://discourse.julialang.org/t/question-on-latex-in-axis-labels-in-pluto-with-plots-jl/53268 "2021-01-13T04:30:11Z")

</div>

Hello, I’m watching this video here in which a plot has been created in a Pluto notebook and which appears to be the GR backend. I’ve tried to reproduce it but I can’t get my text to be superscripts and keep the origina…

---

## [How to print name of parametric type without, uhm, parameters?](https://discourse.julialang.org/t/how-to-print-name-of-parametric-type-without-uhm-parameters/53248)

<div class="topic-metadata">

**Author:** [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Replies:** 5\
**Last updated:** [January 12, 2021, 10:41pm UTC](https://discourse.julialang.org/t/how-to-print-name-of-parametric-type-without-uhm-parameters/53248 "2021-01-12T22:41:02Z")

</div>

For example: julia\> struct A{T} a::T end julia\> simpletypename1(x::F) where F = string(F); julia\> @assert simpletypename1(A(3)) === "A" # Fails, as type is A{Int64} julia\> simpletypename2(x::F) where F…

---

## [Large ODE System Solving using @threads Crashes with Different Thread Counts](https://discourse.julialang.org/t/large-ode-system-solving-using-threads-crashes-with-different-thread-counts/50398)

<div class="topic-metadata">

**Author:** [@Jack\_hues](https://discourse.julialang.org/u/Jack_hues)\
**Replies:** 8\
**Last updated:** [January 12, 2021, 10:05pm UTC](https://discourse.julialang.org/t/large-ode-system-solving-using-threads-crashes-with-different-thread-counts/50398 "2021-01-12T22:05:37Z")

</div>

Hi, I’m currently working on solving a discretized PDE-ODE coupled system, which has been discretized into a system of odes where we then a noise in the form of a stochastic process, converting the ODE system into a sys…

---

## [Julia recompiling unchanged modules](https://discourse.julialang.org/t/julia-recompiling-unchanged-modules/53252)

<div class="topic-metadata">

**Author:** [@bluesmoon](https://discourse.julialang.org/u/bluesmoon)\
**Replies:** 5\
**Last updated:** [January 12, 2021, 9:59pm UTC](https://discourse.julialang.org/t/julia-recompiling-unchanged-modules/53252 "2021-01-12T21:59:05Z")

</div>

Hi all, I’m using julia 1.5.3 on Ubuntu. I have a bunch of modules with dependencies, and a one line script that just has a using statement for these modules (no other code in the script). I first precompile all my mo…

---

## [Performance differences of contiguous vs non-contiguous column indexing?](https://discourse.julialang.org/t/performance-differences-of-contiguous-vs-non-contiguous-column-indexing/53243)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 2\
**Last updated:** [January 12, 2021, 9:23pm UTC](https://discourse.julialang.org/t/performance-differences-of-contiguous-vs-non-contiguous-column-indexing/53243 "2021-01-12T21:23:38Z")

</div>

A quick test shows a 15% decrease in mean run time for the non-contiguous case, which seems huge. Why would this happen? using Random,BenchmarkTools,LinearAlgebra rng = MersenneTwister(1234); # data a = rand(rng,1000,…

---

## [Explicit distribution of chunks in SharedArray?](https://discourse.julialang.org/t/explicit-distribution-of-chunks-in-sharedarray/53249)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 2\
**Last updated:** [January 12, 2021, 8:23pm UTC](https://discourse.julialang.org/t/explicit-distribution-of-chunks-in-sharedarray/53249 "2021-01-12T20:23:24Z")

</div>

How can I construct a SharedArray with a specific chunk distribution across workers? For instance: julia -p 2 using SharedArrays,Distributed,Test @everywhere using SharedArrays a = SharedArray{Float64,2}((3,5),init = …

---

## [ArchGDAL.jl compile error using Julia1.6](https://discourse.julialang.org/t/archgdal-jl-compile-error-using-julia1-6/53238)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 1\
**Last updated:** [January 12, 2021, 7:59pm UTC](https://discourse.julialang.org/t/archgdal-jl-compile-error-using-julia1-6/53238 "2021-01-12T19:59:20Z")

</div>

I got the following error when run using ArchGDAL with Julia1.6. There is no problem with Julia1.5. The error is as following. Julia Version 1.6.0-beta1 Commit b84990e1ac (2021-01-08 12:42 UTC) Platform Info: OS: mac…

---

## [UndefVarError with list comprehensions, but not with for...end](https://discourse.julialang.org/t/undefvarerror-with-list-comprehensions-but-not-with-for-end/53237)

<div class="topic-metadata">

**Author:** [@hdavid16](https://discourse.julialang.org/u/hdavid16)\
**Replies:** 5\
**Last updated:** [January 12, 2021, 7:23pm UTC](https://discourse.julialang.org/t/undefvarerror-with-list-comprehensions-but-not-with-for-end/53237 "2021-01-12T19:23:13Z")

</div>

It would be nice to be able to do the following without the UndefVarError: julia\> reduce(+, 1 for i in 1:2, j in i:3; init = 0) ERROR: UndefVarError: i not defined Stacktrace: \[1\] top-level scope at none:1 julia\> sum(…

---

## [Help with bottleneck in dynamic programming](https://discourse.julialang.org/t/help-with-bottleneck-in-dynamic-programming/53066)

<div class="topic-metadata">

**Author:** [@jmatheusgpa](https://discourse.julialang.org/u/jmatheusgpa)\
**Replies:** 4\
**Last updated:** [January 12, 2021, 6:14pm UTC](https://discourse.julialang.org/t/help-with-bottleneck-in-dynamic-programming/53066 "2021-01-12T18:14:14Z")

</div>

My goal is to calculate all the possible outcomes in a finite dynamic programming problem. The grid size is 100, there are three state variables and T periods. A bottleneck is the following function, which I’ve started …

---

## [Resolving package versions... when adding Makie](https://discourse.julialang.org/t/resolving-package-versions-when-adding-makie/53139)

<div class="topic-metadata">

**Author:** [@elkinjosuerc](https://discourse.julialang.org/u/elkinjosuerc)\
**Replies:** 1\
**Last updated:** [January 12, 2021, 6:04pm UTC](https://discourse.julialang.org/t/resolving-package-versions-when-adding-makie/53139 "2021-01-12T18:04:57Z")

</div>

Hi everyone!!! when i try to import Pkg Pkg.add(“Makie”) It shows me this error, may anyone helpme with this? Resolving package versions… Unsatisfiable requirements detected for package PlotUtils \[995b91a9\]: PlotUt…

---

## [How to make Date objects in "mm-dd-yyyy" format?](https://discourse.julialang.org/t/how-to-make-date-objects-in-mm-dd-yyyy-format/53175)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 2\
**Last updated:** [January 12, 2021, 5:27pm UTC](https://discourse.julialang.org/t/how-to-make-date-objects-in-mm-dd-yyyy-format/53175 "2021-01-12T17:27:00Z")

</div>

I’m trying to create some Dates which I want to display in “mm-dd-yyyy” format. The documentation (https://docs.julialang.org/en/v1/stdlib/Dates/#Constructors) only seems to give examples where the dates are in “yyyy-mm-…

---

## [DataFrames/CSV.read: error on different machines](https://discourse.julialang.org/t/dataframes-csv-read-error-on-different-machines/53211)

<div class="topic-metadata">

**Author:** [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Replies:** 4\
**Last updated:** [January 12, 2021, 3:10pm UTC](https://discourse.julialang.org/t/dataframes-csv-read-error-on-different-machines/53211 "2021-01-12T15:10:55Z")

</div>

Dear folks, I work on one and the same project on two different machines (both Ubuntu, Julia 1.4). The project-related Project.toml and Manifest.toml are in the project folder and I activate them before running my scrip…

---

## [Any shortcut to 1:length(myVector)?](https://discourse.julialang.org/t/any-shortcut-to-1-length-myvector/52816)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 34\
**Last updated:** [January 12, 2021, 2:35pm UTC](https://discourse.julialang.org/t/any-shortcut-to-1-length-myvector/52816 "2021-01-12T14:35:54Z")

</div>

Is there any build-in function in Julia to replace 1:length(myVector), i.e. to return a vector of integers from 1 to the length of myVector ? e.g.: myVector =\["a","b","c"\] for i in ???(myVector) println(i) # 1,2,3 …

---

## [Meaning and error message of type-parameters](https://discourse.julialang.org/t/meaning-and-error-message-of-type-parameters/53198)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 4\
**Last updated:** [January 12, 2021, 1:43pm UTC](https://discourse.julialang.org/t/meaning-and-error-message-of-type-parameters/53198 "2021-01-12T13:43:18Z")

</div>

Following this thread: We have this example: julia\> struct A{T} i end julia\> A(1) # does not work ERROR: MethodError: no method matching A(::Int64) Stacktrace: \[1\] top-level scope at REPL\[2\]:1 juli…

---

## [Locating a method defined through a macro](https://discourse.julialang.org/t/locating-a-method-defined-through-a-macro/51764)

<div class="topic-metadata">

**Author:** [@yha](https://discourse.julialang.org/u/yha)\
**Replies:** 3\
**Last updated:** [January 12, 2021, 12:19pm UTC](https://discourse.julialang.org/t/locating-a-method-defined-through-a-macro/51764 "2021-01-12T12:19:45Z")

</div>

I’ve often encountered a problem figuring out where a method is defined when it’s definition happens through a macro. For example: macro foo() :(bar() = x) end @foo() bar() This gives an UndefVarError with a stac…

---

## [Cannot update packages](https://discourse.julialang.org/t/cannot-update-packages/53193)

<div class="topic-metadata">

**Author:** [@zwwi](https://discourse.julialang.org/u/zwwi)\
**Replies:** 0\
**Last updated:** [January 12, 2021, 11:55am UTC](https://discourse.julialang.org/t/cannot-update-packages/53193 "2021-01-12T11:55:57Z")

</div>

Hello, I am using Julia 1.5.3 under WSL2. I haven’t updated the packages for a couple of months and tried to update them. But I got the following error: (@v1.5) pkg\> up Updating registry at \`~/.julia/registries/Gene…

---

## [How to NOT interpolate on remote worker?](https://discourse.julialang.org/t/how-to-not-interpolate-on-remote-worker/53027)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 3\
**Last updated:** [January 12, 2021, 3:17am UTC](https://discourse.julialang.org/t/how-to-not-interpolate-on-remote-worker/53027 "2021-01-12T03:17:40Z")

</div>

julia\> using Distributed julia\> addprocs(2); julia\> @everywhere a = \[1,2\] julia\> @everywhere println(a) \[1, 2\] From worker 3: \[1, 2\] From worker 2: \[1, 2\] julia\> a = 5 5 julia\> @everywhere println(…

---

## [Exploiting parallel Julia's auto-global shipping from inside functions and other submodules?](https://discourse.julialang.org/t/exploiting-parallel-julias-auto-global-shipping-from-inside-functions-and-other-submodules/53185)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 1\
**Last updated:** [January 12, 2021, 2:51am UTC](https://discourse.julialang.org/t/exploiting-parallel-julias-auto-global-shipping-from-inside-functions-and-other-submodules/53185 "2021-01-12T02:51:33Z")

</div>

The fact that Julia automatically ships globals from Main to workers for you is a super useful construct, using Distributed addprocs(1) x = \[1,2,3\] @fetch x .+ 1 # x was shipped to worker here @fetch x .+ 2 # x wasn…

---

## [Operating on large TIFF stacks without loading whole thing into memory?](https://discourse.julialang.org/t/operating-on-large-tiff-stacks-without-loading-whole-thing-into-memory/51868)

<div class="topic-metadata">

**Author:** [@ajsc4](https://discourse.julialang.org/u/ajsc4)\
**Replies:** 7\
**Last updated:** [January 11, 2021, 10:36pm UTC](https://discourse.julialang.org/t/operating-on-large-tiff-stacks-without-loading-whole-thing-into-memory/51868 "2021-01-11T22:36:29Z")

</div>

I’m doing some basic image processing on large .tif stacks. For instance, taking the average intensity of each frame. Currently the step that takes by far the longest is loading the stack into memory using: stack = loa…

---

## [Julia:alpine + SpecialFunctions issue](https://discourse.julialang.org/t/julia-alpine-specialfunctions-issue/53178)

<div class="topic-metadata">

**Author:** [@AsafManela](https://discourse.julialang.org/u/AsafManela)\
**Replies:** 2\
**Last updated:** [January 11, 2021, 10:08pm UTC](https://discourse.julialang.org/t/julia-alpine-specialfunctions-issue/53178 "2021-01-11T22:08:14Z")

</div>

Trying to use julia:alpine from docker hub but I’m getting errors when compiling SpecialFunctions.jl: $ docker run -ti --rm julia:alpine \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.o…

---

## [Data-exchange Julia-LabView](https://discourse.julialang.org/t/data-exchange-julia-labview/46315)

<div class="topic-metadata">

**Author:** [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Replies:** 13\
**Last updated:** [January 11, 2021, 9:08pm UTC](https://discourse.julialang.org/t/data-exchange-julia-labview/46315 "2021-01-11T21:08:04Z")

</div>

For an experiment I need for a Julia process to communicate with a LabView process and exchange data every few seconds (1-5 s). Since (I think) there is no package to directly bind Julia and LabView I was thinking of con…

---

## [Orthonormalize a matrix in place](https://discourse.julialang.org/t/orthonormalize-a-matrix-in-place/52887)

<div class="topic-metadata">

**Author:** [@matthiasbe](https://discourse.julialang.org/u/matthiasbe)\
**Replies:** 10\
**Last updated:** [January 11, 2021, 6:21pm UTC](https://discourse.julialang.org/t/orthonormalize-a-matrix-in-place/52887 "2021-01-11T18:21:32Z")

</div>

Hi, For a given matrix M \\in \\mathbb{R}^{m \\times n}, m \\geq n , I would like to orthonormalize the columns of M in place. M \\leftarrow \\texttt{qr}(M)\\texttt{.Q} I see that the function LinearAlgebra.qr! aims at some…

---

## [Exploratory research project workflow](https://discourse.julialang.org/t/exploratory-research-project-workflow/53030)

<div class="topic-metadata">

**Author:** [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Replies:** 26\
**Last updated:** [January 11, 2021, 5:35pm UTC](https://discourse.julialang.org/t/exploratory-research-project-workflow/53030 "2021-01-11T17:35:25Z")

</div>

People scale academic research, what is your workflow in Julia? I mean, how do you develop your project, in which point move functions to the module, when writing tests, how you scale, how you pass parameters between …

---

## [Callback function in a plot library](https://discourse.julialang.org/t/callback-function-in-a-plot-library/52826)

<div class="topic-metadata">

**Author:** [@David\_Ortley](https://discourse.julialang.org/u/David_Ortley)\
**Replies:** 2\
**Last updated:** [January 11, 2021, 5:06pm UTC](https://discourse.julialang.org/t/callback-function-in-a-plot-library/52826 "2021-01-11T17:06:14Z")

</div>

Hey all, I want to create a plot that will will have clickable elements that do some active thing. My interest is in plotting a scatter plot of certain features from a set of waveforms that, when individual elements ar…

---

## [Calling sympy.stats.sample from SymPy.jl](https://discourse.julialang.org/t/calling-sympy-stats-sample-from-sympy-jl/53092)

<div class="topic-metadata">

**Author:** [@Brian\_Toomey](https://discourse.julialang.org/u/Brian_Toomey)\
**Replies:** 3\
**Last updated:** [January 11, 2021, 4:01pm UTC](https://discourse.julialang.org/t/calling-sympy-stats-sample-from-sympy-jl/53092 "2021-01-11T16:01:11Z")

</div>

Hi Julia discourse – this forum (and Julia) seems so great I thought I would stop lurking. I’ve been looking at how to interact with sympy.stats using SymPy.jl. The author of the package was kind enough to give some ini…

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

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