# General Usage

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

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

**Page:** 707

---

## [Config information in Project.toml](https://discourse.julialang.org/t/config-information-in-project-toml/46016)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 3\
**Last updated:** [September 4, 2020, 12:14am UTC](https://discourse.julialang.org/t/config-information-in-project-toml/46016 "2020-09-04T00:14:53Z")

</div>

Is it reasonable / possible to put config information in Project.toml? For instance, my\_app\_port = 8889. Are there facilities for parsing them? Or am I simply better off using environment variables somehow?

---

## [Can't catch InitErrors?](https://discourse.julialang.org/t/cant-catch-initerrors/46033)

<div class="topic-metadata">

**Author:** [@jwveysey](https://discourse.julialang.org/u/jwveysey)\
**Replies:** 0\
**Last updated:** [September 3, 2020, 11:35pm UTC](https://discourse.julialang.org/t/cant-catch-initerrors/46033 "2020-09-03T23:35:01Z")

</div>

There’s probably an obvious answer to this question, but I can’t seem to find it. I have a package that loads another package with a using statement. The package that’s loaded has an init function that may error, so I’ve…

---

## [Static Arrays in pure Julia](https://discourse.julialang.org/t/static-arrays-in-pure-julia/46030)

<div class="topic-metadata">

**Author:** [@Renan\_Rabelo](https://discourse.julialang.org/u/Renan_Rabelo)\
**Replies:** 2\
**Last updated:** [September 3, 2020, 11:22pm UTC](https://discourse.julialang.org/t/static-arrays-in-pure-julia/46030 "2020-09-03T23:22:17Z")

</div>

Before Julia I used to code in Java, and Java has static arrays (immutable size). I know for sure that static arrays are way faster than dynamic ones, so how can I use they in pure Julia? I found a package called “Stat…

---

## [Unable to automatically install 'CompilerSupportLibraries'](https://discourse.julialang.org/t/unable-to-automatically-install-compilersupportlibraries/36669)

<div class="topic-metadata">

**Author:** [@aliceee](https://discourse.julialang.org/u/aliceee)\
**Replies:** 39\
**Last updated:** [September 3, 2020, 4:38pm UTC](https://discourse.julialang.org/t/unable-to-automatically-install-compilersupportlibraries/36669 "2020-09-03T16:38:09Z")

</div>

Hi! I’m new to Julia and I was trying to install the package “Distributions”. After running Pkg.add("Distributions"), I got the following error Resolving package versions... Unable to automatically install 'CompilerSupp…

---

## [Julia is crashing. What to do with the error?](https://discourse.julialang.org/t/julia-is-crashing-what-to-do-with-the-error/46008)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 4\
**Last updated:** [September 3, 2020, 2:57pm UTC](https://discourse.julialang.org/t/julia-is-crashing-what-to-do-with-the-error/46008 "2020-09-03T14:57:53Z")

</div>

I’m using some JSON3, JSON, PyCall and Tasks and get such a bug? Does anyone know what it means? Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Tha…

---

## [Cpu name from Julia](https://discourse.julialang.org/t/cpu-name-from-julia/45964)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 4\
**Last updated:** [September 2, 2020, 9:10pm UTC](https://discourse.julialang.org/t/cpu-name-from-julia/45964 "2020-09-02T21:10:10Z")

</div>

Hi, Is it possible to get the cpu name with Julia ? I tried CpuId.jl but it returns a lot of information which I am not able extract…

---

## [Parallel loading of packages, to help e.g. Queryverse (VegaLite), time-to-first plot](https://discourse.julialang.org/t/parallel-loading-of-packages-to-help-e-g-queryverse-vegalite-time-to-first-plot/45700)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 5\
**Last updated:** [September 2, 2020, 3:43pm UTC](https://discourse.julialang.org/t/parallel-loading-of-packages-to-help-e-g-queryverse-vegalite-time-to-first-plot/45700 "2020-09-02T15:43:19Z")

</div>

First I want to say, time-to-first-plot isn’t really an issue (I consider it a solved problem if you know what you’re doing, using right packages/options), e.g. in about a sec. on Julia 1.6 (you can excpect this speed so…

---

## [No line number for: syntax: unexpected ")"](https://discourse.julialang.org/t/no-line-number-for-syntax-unexpected/45604)

<div class="topic-metadata">

**Author:** [@jleman](https://discourse.julialang.org/u/jleman)\
**Replies:** 9\
**Last updated:** [September 2, 2020, 6:03pm UTC](https://discourse.julialang.org/t/no-line-number-for-syntax-unexpected/45604 "2020-09-02T18:03:55Z")

</div>

Is there a way to get syntax messages like this to show a line number? syntax: unexpected “)”

---

## [Julia in x32 mode?! Precompiling Plots slow (or any package) with --compile=min](https://discourse.julialang.org/t/julia-in-x32-mode-precompiling-plots-slow-or-any-package-with-compile-min/45948)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 6\
**Last updated:** [September 2, 2020, 2:35pm UTC](https://discourse.julialang.org/t/julia-in-x32-mode-precompiling-plots-slow-or-any-package-with-compile-min/45948 "2020-09-02T14:35:20Z")

</div>

On Julia 1.6 using Plots is taking forever (EDIT: now done, took 21 minutes) to precompile so I ran strace on the Julia process: strace: Process 4845 attached strace: \[ Process PID=4845 runs in x32 mode. \] \[hung foreve…

---

## [How to replace list of char in string array?](https://discourse.julialang.org/t/how-to-replace-list-of-char-in-string-array/45951)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 2\
**Last updated:** [September 2, 2020, 2:33pm UTC](https://discourse.julialang.org/t/how-to-replace-list-of-char-in-string-array/45951 "2020-09-02T14:33:26Z")

</div>

I have a list of chars julia\> usuwam 96×1 Array{Any,2}: "\\"" """ "A" "/" ... and i need to repalce all from string Array: julia\> string.(dane\[:,5\]) 1074762-element Array{String,1}: "TEST" "VENDISERVISSp.zo.o." …

---

## [Julia 1.5.1 slows down when running multiple instances in parallel](https://discourse.julialang.org/t/julia-1-5-1-slows-down-when-running-multiple-instances-in-parallel/45934)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 7\
**Last updated:** [September 2, 2020, 11:27am UTC](https://discourse.julialang.org/t/julia-1-5-1-slows-down-when-running-multiple-instances-in-parallel/45934 "2020-09-02T11:27:57Z")

</div>

Hello, I noticed a weird behavior in julia 1.5.1 performance (e. g. loading packages) compared to julia 1.1.0. I have a batch script which starts various julia scripts simultaneously on a cluster. In a simplified versi…

---

## [Makie: animation becomes slow after redrawing surface about 25 times](https://discourse.julialang.org/t/makie-animation-becomes-slow-after-redrawing-surface-about-25-times/45582)

<div class="topic-metadata">

**Author:** [@samo](https://discourse.julialang.org/u/samo)\
**Replies:** 8\
**Last updated:** [September 2, 2020, 10:16am UTC](https://discourse.julialang.org/t/makie-animation-becomes-slow-after-redrawing-surface-about-25-times/45582 "2020-09-02T10:16:27Z")

</div>

Context I am working on an example of a 3-D visualization of a 2-D glacier flow. Until now the visualization is done for a very small problem (256x256 grid points). Later it should also work for much larger problems. Pr…

---

## [Stack overflow when reshaping image array](https://discourse.julialang.org/t/stack-overflow-when-reshaping-image-array/45927)

<div class="topic-metadata">

**Author:** [@timmor](https://discourse.julialang.org/u/timmor)\
**Replies:** 2\
**Last updated:** [September 2, 2020, 5:33am UTC](https://discourse.julialang.org/t/stack-overflow-when-reshaping-image-array/45927 "2020-09-02T05:33:05Z")

</div>

I’m trying to read a few frames of video from a file and reshape the data into a three-dimensional array. I’m getting an infinite recursion when reshaping the array. using VideoIO io = VideoIO.testvideo("ladybird") f =…

---

## [Switched from Python to Julia for speed, but it's not faster...?](https://discourse.julialang.org/t/switched-from-python-to-julia-for-speed-but-its-not-faster/45904)

<div class="topic-metadata">

**Author:** [@PaulScotti](https://discourse.julialang.org/u/PaulScotti)\
**Replies:** 12\
**Last updated:** [September 2, 2020, 2:51am UTC](https://discourse.julialang.org/t/switched-from-python-to-julia-for-speed-but-its-not-faster/45904 "2020-09-02T02:51:43Z")

</div>

I have a Python script where the major speed hurdle is a single function in the statsmodels package. However, it seems that if I use PyCall to use the same Python function in Julia, the speed hurdle persists to the same …

---

## [Differentiation method for element-wise "abs"-function applied on "Operation"-types in ModelingToolKit.jl?](https://discourse.julialang.org/t/differentiation-method-for-element-wise-abs-function-applied-on-operation-types-in-modelingtoolkit-jl/45867)

<div class="topic-metadata">

**Author:** [@luis\_munoz](https://discourse.julialang.org/u/luis_munoz)\
**Replies:** 4\
**Last updated:** [September 2, 2020, 2:22am UTC](https://discourse.julialang.org/t/differentiation-method-for-element-wise-abs-function-applied-on-operation-types-in-modelingtoolkit-jl/45867 "2020-09-02T02:22:18Z")

</div>

Hi, I am trying to apply ModelingToolkit.sparsejacobian() to my differential function including element-wise calls of the absolute function abs(). How can I appropriately define the derivative of abs() to be used with t…

---

## [How to clean strings?](https://discourse.julialang.org/t/how-to-clean-strings/45917)

<div class="topic-metadata">

**Author:** [@Brad\_Carman](https://discourse.julialang.org/u/Brad_Carman)\
**Replies:** 5\
**Last updated:** [September 2, 2020, 12:32am UTC](https://discourse.julialang.org/t/how-to-clean-strings/45917 "2020-09-02T00:32:27Z")

</div>

I have 2 strings that as a human appear exactly the same, but Julia sees 2 different strings. test1 = raw"C:\\Program Files\\MATLAB\\R2019a" test2 = raw"C:\\Program Files\\MATLAB\\R2019a" test1 == test2 #julia says this is f…

---

## [Understanding relative performance of (returning vs. mutating vs. both) functions](https://discourse.julialang.org/t/understanding-relative-performance-of-returning-vs-mutating-vs-both-functions/45862)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 9\
**Last updated:** [September 1, 2020, 10:29pm UTC](https://discourse.julialang.org/t/understanding-relative-performance-of-returning-vs-mutating-vs-both-functions/45862 "2020-09-01T22:29:23Z")

</div>

I’m trying to choose the fastest among the following 3 functions: using Test, BenchmarkTools function Mut!(x::Array{Int64,2},y::Array{Int64,1}) map!(z-\>z\*2,x,x) y .= vec(reduce(+,x,dims=1)) end function MutRet(…

---

## [Kuramoto-like coupled oscillators in DifferentialEquations.jl](https://discourse.julialang.org/t/kuramoto-like-coupled-oscillators-in-differentialequations-jl/45873)

<div class="topic-metadata">

**Author:** [@VMHidalgo](https://discourse.julialang.org/u/VMHidalgo)\
**Replies:** 5\
**Last updated:** [September 1, 2020, 8:30pm UTC](https://discourse.julialang.org/t/kuramoto-like-coupled-oscillators-in-differentialequations-jl/45873 "2020-09-01T20:30:55Z")

</div>

Hi I’d like to know how to implement a Kuramoto-like (coupled nonlinear oscillators) system in DifferentialEquations.jl. If you are familiar with this stuff, I am trying to produce a system proposed by Matthew,Mirollo a…

---

## [Local scope in for loops AGAIN](https://discourse.julialang.org/t/local-scope-in-for-loops-again/45899)

<div class="topic-metadata">

**Author:** [@sandeep\_prakash](https://discourse.julialang.org/u/sandeep_prakash)\
**Replies:** 11\
**Last updated:** [September 1, 2020, 4:47pm UTC](https://discourse.julialang.org/t/local-scope-in-for-loops-again/45899 "2020-09-01T16:47:50Z")

</div>

Hi, New to Julia from MATLAB. I’ve been reading up on the local variable scope rules in Julia, but fail to understand the behaviour i see in the following example Example code u0 = 10 #The global scope variable …

---

## [Speed up in Julia](https://discourse.julialang.org/t/speed-up-in-julia/45864)

<div class="topic-metadata">

**Author:** [@Nova](https://discourse.julialang.org/u/Nova)\
**Replies:** 11\
**Last updated:** [September 1, 2020, 2:58pm UTC](https://discourse.julialang.org/t/speed-up-in-julia/45864 "2020-09-01T14:58:35Z")

</div>

I have a question to figure out how to improve the performance of my code in Julia. I have a function that takes N seconds to be finished. I want to optimize the function to achieve a better performance. To do this, I g…

---

## [Question about task scheduling order](https://discourse.julialang.org/t/question-about-task-scheduling-order/45875)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 4\
**Last updated:** [September 1, 2020, 9:59am UTC](https://discourse.julialang.org/t/question-about-task-scheduling-order/45875 "2020-09-01T09:59:57Z")

</div>

Haven’t done much with Julia Tasks (or coroutines in any language) so maybe a basic question, but can’t seem to find a definite answer. Basically, if I schedule one task before another, does that guarantee that it will s…

---

## [Reading data in Julia 1.2.0](https://discourse.julialang.org/t/reading-data-in-julia-1-2-0/45876)

<div class="topic-metadata">

**Author:** [@Nova](https://discourse.julialang.org/u/Nova)\
**Replies:** 1\
**Last updated:** [September 1, 2020, 7:55am UTC](https://discourse.julialang.org/t/reading-data-in-julia-1-2-0/45876 "2020-09-01T07:55:24Z")

</div>

I have a file (A.nets) storing data in the following format: NetDegree : 4 n0 o197239 I : -0.500000 -6.000000 o197110 O : -1.500000 -3.000000 o85644 I : -6.000000 -2.000000 o0 I : -3.000000 -5.000000 NetDegree : …

---

## [How to solve problem with TOML.jl?](https://discourse.julialang.org/t/how-to-solve-problem-with-toml-jl/9319)

<div class="topic-metadata">

**Author:** [@Liso](https://discourse.julialang.org/u/Liso)\
**Replies:** 48\
**Last updated:** [September 1, 2020, 7:43am UTC](https://discourse.julialang.org/t/how-to-solve-problem-with-toml-jl/9319 "2020-09-01T07:43:31Z")

</div>

I just saw nice dependency graph from @kristoffer.carlsson Code starts with: cd("/Users/kristoffer/julia/stdlib") import TOML So I tried it and get: ERROR: ArgumentError: Module TOML not found in current path. Run \`…

---

## [Error when trying to install JuMP (or any package)](https://discourse.julialang.org/t/error-when-trying-to-install-jump-or-any-package/45713)

<div class="topic-metadata">

**Author:** [@Eugenio\_Fischetti](https://discourse.julialang.org/u/Eugenio_Fischetti)\
**Replies:** 3\
**Last updated:** [August 31, 2020, 11:40pm UTC](https://discourse.julialang.org/t/error-when-trying-to-install-jump-or-any-package/45713 "2020-08-31T23:40:36Z")

</div>

Hello there! I have Julia 1.5.1 on Windows 7. When installing JuMP i get the following error, below: Anyone can help me, please?

---

## [Best way to initialize a sparse matrix with some non-zero columns](https://discourse.julialang.org/t/best-way-to-initialize-a-sparse-matrix-with-some-non-zero-columns/45856)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 2\
**Last updated:** [August 31, 2020, 10:41pm UTC](https://discourse.julialang.org/t/best-way-to-initialize-a-sparse-matrix-with-some-non-zero-columns/45856 "2020-08-31T22:41:42Z")

</div>

Hello, I would like to initialize a sparse array A of size N \\times Nx, for which only the columns in dims are non-zeros. How can I improve this code? using LinearAlgebra using SparseArrays N = 200 Nx = 20 dim = \[1…

---

## [Package update on Windows 7 and offline use](https://discourse.julialang.org/t/package-update-on-windows-7-and-offline-use/45823)

<div class="topic-metadata">

**Author:** [@Mikhail\_Kagalenko](https://discourse.julialang.org/u/Mikhail_Kagalenko)\
**Replies:** 16\
**Last updated:** [August 31, 2020, 10:20pm UTC](https://discourse.julialang.org/t/package-update-on-windows-7-and-offline-use/45823 "2020-08-31T22:20:25Z")

</div>

Running \]update on a fresh installation (no .julia folder) of Julia 1.5.1 just took me 35 minutes. Windows defender real-time protection was disabled. Observed this behavior on two separate Win 7 machines. Connected wit…

---

## [Speed up sparse matrix multiplication](https://discourse.julialang.org/t/speed-up-sparse-matrix-multiplication/45819)

<div class="topic-metadata">

**Author:** [@Nova](https://discourse.julialang.org/u/Nova)\
**Replies:** 8\
**Last updated:** [August 31, 2020, 7:55pm UTC](https://discourse.julialang.org/t/speed-up-sparse-matrix-multiplication/45819 "2020-08-31T19:55:56Z")

</div>

I have a sparse matrix multiplication in my code but it’s very slow, is there anyway to make it faster? @btime A2 = D \* A \* D 50.816 s (18 allocations: 5.12 GiB) A: adjacency matrix, 6554063×6554063 SparseMatrixCSC{F…

---

## [Conditionally suppress output of @time](https://discourse.julialang.org/t/conditionally-suppress-output-of-time/45851)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 2\
**Last updated:** [August 31, 2020, 7:39pm UTC](https://discourse.julialang.org/t/conditionally-suppress-output-of-time/45851 "2020-08-31T19:39:49Z")

</div>

Is there a parameterized version of @time where I can suppress output unless e.g. ‘log\_level \> k’ ? I would like to make the performance of a sequence of function calls debuggable with minimal repetition of code

---

## [Comparing performance of 2 simple averaging functions - why is one faster?](https://discourse.julialang.org/t/comparing-performance-of-2-simple-averaging-functions-why-is-one-faster/45854)

<div class="topic-metadata">

**Author:** [@lwhitefox](https://discourse.julialang.org/u/lwhitefox)\
**Replies:** 5\
**Last updated:** [August 31, 2020, 7:06pm UTC](https://discourse.julialang.org/t/comparing-performance-of-2-simple-averaging-functions-why-is-one-faster/45854 "2020-08-31T19:06:29Z")

</div>

Below I include code for two simple functions that compute averages of pairs of adjacent values in an input 1D vector. Function f2 is almost twice as fast as f3 - I’d like to understand why! If anything, I would have ex…

---

## [copy(::CartesianIndices)](https://discourse.julialang.org/t/copy-cartesianindices/45818)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 10\
**Last updated:** [August 31, 2020, 5:48pm UTC](https://discourse.julialang.org/t/copy-cartesianindices/45818 "2020-08-31T17:48:58Z")

</div>

copy(x::CartesianIndices) and copy(x::LinearIndices) do not return the same type as the input argument. I guess you could argue that it doesn’t make sense to copy an immutable. But perhaps you could also argue that tryi…

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

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