# General Usage

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

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

**Page:** 296

---

## [Execute a matrix of functions](https://discourse.julialang.org/t/execute-a-matrix-of-functions/98440)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 15\
**Last updated:** [May 7, 2023, 6:59pm UTC](https://discourse.julialang.org/t/execute-a-matrix-of-functions/98440 "2023-05-07T18:59:45Z")

</div>

I have defined a 3x3 matrix of functions (all cos(t)) as follows: vij = SizedMatrix{3,3}(\[t-\>cos(t) for i in 1:3 for j in 1:3\]) I’d like to execute the matrix for a particular value of t, say t=2.: values = \[vij\[i,j\](…

---

## [Best practices for removing singleton dimension](https://discourse.julialang.org/t/best-practices-for-removing-singleton-dimension/98435)

<div class="topic-metadata">

**Author:** [@gaspardb](https://discourse.julialang.org/u/gaspardb)\
**Replies:** 3\
**Last updated:** [May 7, 2023, 1:30pm UTC](https://discourse.julialang.org/t/best-practices-for-removing-singleton-dimension/98435 "2023-05-07T13:30:31Z")

</div>

Hi! I often use reduction like sum or prod by specifying dimensions with the dims keyword argument. I’m wondering now how to get rid of the singleton dimension. Typically, if X is an array of size (1, n), we can do se…

---

## [PackageCompiler error creating sysimage](https://discourse.julialang.org/t/packagecompiler-error-creating-sysimage/75710)

<div class="topic-metadata">

**Author:** [@notthetup](https://discourse.julialang.org/u/notthetup)\
**Replies:** 2\
**Last updated:** [May 7, 2023, 11:31am UTC](https://discourse.julialang.org/t/packagecompiler-error-creating-sysimage/75710 "2023-05-07T11:31:04Z")

</div>

Hello, I’m having issues using PackageCompiler on a Linux on aarch64(nVidia Jetson TX2) machine. Running through the basic example from the documentation causes this error. julia\> create\_sysimage(\["Example"\]; sysimage\_…

---

## [Neighborhood information in Julia mesh Libraries](https://discourse.julialang.org/t/neighborhood-information-in-julia-mesh-libraries/97875)

<div class="topic-metadata">

**Author:** [@mm-crj](https://discourse.julialang.org/u/mm-crj)\
**Replies:** 11\
**Last updated:** [May 7, 2023, 10:25am UTC](https://discourse.julialang.org/t/neighborhood-information-in-julia-mesh-libraries/97875 "2023-05-07T10:25:07Z")

</div>

I have a mesh in msh format from Gmsh. I am importing it to Julia via Gmsh.jl. I need information about the neighbours of each cell in the grid. However none of the Julia libraries seem to provide that information. I hav…

---

## [How to create a vector of string elements from a combination of different strings and numbers?](https://discourse.julialang.org/t/how-to-create-a-vector-of-string-elements-from-a-combination-of-different-strings-and-numbers/98400)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 6\
**Last updated:** [May 7, 2023, 9:47am UTC](https://discourse.julialang.org/t/how-to-create-a-vector-of-string-elements-from-a-combination-of-different-strings-and-numbers/98400 "2023-05-07T09:47:49Z")

</div>

I know how to combine a string "s" with a vector of integers i to get a string "si". For example, if I want to create the vector \["a1","a2","a3"\], I do "a".\* string.(\[1,2,3\]) #3-element Vector{String}: # "a1" # "a2" #…

---

## [Does Julia has packages to calculate the haar integral over a unitary group?](https://discourse.julialang.org/t/does-julia-has-packages-to-calculate-the-haar-integral-over-a-unitary-group/98432)

<div class="topic-metadata">

**Author:** [@narip](https://discourse.julialang.org/u/narip)\
**Replies:** 0\
**Last updated:** [May 7, 2023, 5:12am UTC](https://discourse.julialang.org/t/does-julia-has-packages-to-calculate-the-haar-integral-over-a-unitary-group/98432 "2023-05-07T05:12:49Z")

</div>

I want to calculate the haar integral over a unitary group. Such as the formula of form \\int{dvUXU^{\\dagger}}. Mathematica has a package to do this. I wonder if Julia has similar packages?

---

## [\[ModelingToolkit.jl\] varmap\_to\_vars function](https://discourse.julialang.org/t/modelingtoolkit-jl-varmap-to-vars-function/98207)

<div class="topic-metadata">

**Author:** [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Replies:** 3\
**Last updated:** [May 7, 2023, 3:28am UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-varmap-to-vars-function/98207 "2023-05-07T03:28:44Z")

</div>

Hello, I have a question about the ModelingToolkit package, and in particular about @parameters value maps. @parameters t k₁₂ k₂₁ α p = \[k₁₂ =\> 0.0005 k₂₁ =\> 0.009 α =\> 0.09\] I have an ODE system and I want to fit s…

---

## [Hard to find error (might relate to Zygote)](https://discourse.julialang.org/t/hard-to-find-error-might-relate-to-zygote/98421)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 11\
**Last updated:** [May 6, 2023, 9:31pm UTC](https://discourse.julialang.org/t/hard-to-find-error-might-relate-to-zygote/98421 "2023-05-06T21:31:27Z")

</div>

@ChrisRackauckas Note the stack trace below. But first some comments: There is an error in the init(::Nothing, ::Tsit5...) function. I should be able to locate this Init function in the Julia library. I have not found …

---

## [Array could not broadcast to match destination in solve](https://discourse.julialang.org/t/array-could-not-broadcast-to-match-destination-in-solve/98397)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 8\
**Last updated:** [May 6, 2023, 4:04pm UTC](https://discourse.julialang.org/t/array-could-not-broadcast-to-match-destination-in-solve/98397 "2023-05-06T16:04:55Z")

</div>

@ChrisRackauckas Here is a MWE solving a simple 3x3 equation, where I use the SizedVector from StaticArrays.jl: using DifferentialEquations using StaticArrays # Set up the Giesekus model function dudt!(du, σ, p, t) …

---

## [Arguments, unexpected behavior](https://discourse.julialang.org/t/arguments-unexpected-behavior/18263)

<div class="topic-metadata">

**Author:** [@henrykironde](https://discourse.julialang.org/u/henrykironde)\
**Replies:** 4\
**Last updated:** [May 6, 2023, 12:40pm UTC](https://discourse.julialang.org/t/arguments-unexpected-behavior/18263 "2023-05-06T12:40:04Z")

</div>

https://github.com/JuliaLang/julia/issues/30252 https://docs.julialang.org/en/v1/manual/functions/#Optional-Arguments-1 Julia \_ \_ \_ \_(\_)\_ | A fresh approach to technical computing (\_) …

---

## [Using LoopVectorization with StructArrays](https://discourse.julialang.org/t/using-loopvectorization-with-structarrays/98154)

<div class="topic-metadata">

**Author:** [@DylanMMarques](https://discourse.julialang.org/u/DylanMMarques)\
**Replies:** 3\
**Last updated:** [May 6, 2023, 11:47am UTC](https://discourse.julialang.org/t/using-loopvectorization-with-structarrays/98154 "2023-05-06T11:47:21Z")

</div>

Hello, I am using LoopVectorization combined with StructArrays to vectorize some code that used structures. I have created a simple example of what I am trying to achive using the struct Point2D. using StructArrays, Lo…

---

## [Julia in VSCODE: IntelliSense is very slow for code complete](https://discourse.julialang.org/t/julia-in-vscode-intellisense-is-very-slow-for-code-complete/98416)

<div class="topic-metadata">

**Author:** [@lionisxn](https://discourse.julialang.org/u/lionisxn)\
**Replies:** 2\
**Last updated:** [May 6, 2023, 11:04am UTC](https://discourse.julialang.org/t/julia-in-vscode-intellisense-is-very-slow-for-code-complete/98416 "2023-05-06T11:04:58Z")

</div>

I just switched from Atom to Vscode, and found that the code complete performs well when editing a script, but acts very slowly in the case of editing a package. Any suggestion on how to improve it ？

---

## [Importing packages takes very long inside jupyter notebook](https://discourse.julialang.org/t/importing-packages-takes-very-long-inside-jupyter-notebook/98306)

<div class="topic-metadata">

**Author:** [@Optimization](https://discourse.julialang.org/u/Optimization)\
**Replies:** 7\
**Last updated:** [May 6, 2023, 9:07am UTC](https://discourse.julialang.org/t/importing-packages-takes-very-long-inside-jupyter-notebook/98306 "2023-05-06T09:07:42Z")

</div>

Hello, Is there any particular resoan that importing packages in Jupyter notebook takes quite a long time. Every time it takes somewhere around 7 minutes while when not working with jupyter the import only takes a few s…

---

## [REPL autocomplete doesn't work with specific \`using\` statement](https://discourse.julialang.org/t/repl-autocomplete-doesnt-work-with-specific-using-statement/98401)

<div class="topic-metadata">

**Author:** [@hhaensel](https://discourse.julialang.org/u/hhaensel)\
**Replies:** 1\
**Last updated:** [May 6, 2023, 12:04am UTC](https://discourse.julialang.org/t/repl-autocomplete-doesnt-work-with-specific-using-statement/98401 "2023-05-06T00:04:31Z")

</div>

When I import a name via using the autocomplete doesn’t work while it does work when I import the same name. Example: after using Pkg: activate activate is not completed upon pressing of the tab key. after import P…

---

## [Backporting new Julia features in old versions of Julia](https://discourse.julialang.org/t/backporting-new-julia-features-in-old-versions-of-julia/98144)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 3\
**Last updated:** [May 5, 2023, 7:20pm UTC](https://discourse.julialang.org/t/backporting-new-julia-features-in-old-versions-of-julia/98144 "2023-05-05T19:20:37Z")

</div>

Let’s say that there is a simple new feature in Julia 1.9 that I would like to use in my library. However, for various reasons I need to keep my library compatible with older Julia versions as well. Is there a standard w…

---

## [Feedback on new package called Peccon.jl](https://discourse.julialang.org/t/feedback-on-new-package-called-peccon-jl/98398)

<div class="topic-metadata">

**Author:** [@korilium](https://discourse.julialang.org/u/korilium)\
**Replies:** 0\
**Last updated:** [May 5, 2023, 8:42pm UTC](https://discourse.julialang.org/t/feedback-on-new-package-called-peccon-jl/98398 "2023-05-05T20:42:35Z")

</div>

Hello, I have written my first Julia package called Peccon and I wanted to have some constructive feedback to improve the package. I thus created this thread. This post is also a reach out to the community to find like-…

---

## [Overloading \`fieldnames()\` function](https://discourse.julialang.org/t/overloading-fieldnames-function/98387)

<div class="topic-metadata">

**Author:** [@sirion34](https://discourse.julialang.org/u/sirion34)\
**Replies:** 7\
**Last updated:** [May 5, 2023, 8:17pm UTC](https://discourse.julialang.org/t/overloading-fieldnames-function/98387 "2023-05-05T20:17:44Z")

</div>

Is it safe to overload the fieldnames() function if I want to hide some fields for a specific type?

---

## [Julia cannot solve Ax=b with LU where A is sparse,](https://discourse.julialang.org/t/julia-cannot-solve-ax-b-with-lu-where-a-is-sparse/98383)

<div class="topic-metadata">

**Author:** [@jonassoleil](https://discourse.julialang.org/u/jonassoleil)\
**Replies:** 12\
**Last updated:** [May 5, 2023, 7:10pm UTC](https://discourse.julialang.org/t/julia-cannot-solve-ax-b-with-lu-where-a-is-sparse/98383 "2023-05-05T19:10:03Z")

</div>

Hi, I get very wrong answers on solving Ax=b with LU where A is a sparse matrix. I am a bit puzzled by this, since as far as I understand Julia calls the SuiteSparse library for sparse Linear-Algebra like Matlab does. …

---

## [+= operator](https://discourse.julialang.org/t/operator/98275)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 12\
**Last updated:** [May 5, 2023, 7:03pm UTC](https://discourse.julialang.org/t/operator/98275 "2023-05-05T19:03:36Z")

</div>

Is the += operator used as in: x = 5. x += 3. equivalent to x .= x + 3. or x = x + 3 According to the documentation, it is equivalent to the latter (Mathematical Operations and Elementary Functions · The Julia Lang…

---

## [Efficient way of creating a vector of length L with unique elements](https://discourse.julialang.org/t/efficient-way-of-creating-a-vector-of-length-l-with-unique-elements/98388)

<div class="topic-metadata">

**Author:** [@dm17017](https://discourse.julialang.org/u/dm17017)\
**Replies:** 3\
**Last updated:** [May 5, 2023, 4:45pm UTC](https://discourse.julialang.org/t/efficient-way-of-creating-a-vector-of-length-l-with-unique-elements/98388 "2023-05-05T16:45:31Z")

</div>

Hi, I am looking to fill a vector of a desired length up with randomly chosen, unique elements. Currently I have the code below which has the desired effect however, I suspect I can speed it up. If anyone has any ideas …

---

## [What is the most efficient way to compute the inverse of a sparse matrix?](https://discourse.julialang.org/t/what-is-the-most-efficient-way-to-compute-the-inverse-of-a-sparse-matrix/98167)

<div class="topic-metadata">

**Author:** [@schwob](https://discourse.julialang.org/u/schwob)\
**Replies:** 15\
**Last updated:** [May 5, 2023, 4:06pm UTC](https://discourse.julialang.org/t/what-is-the-most-efficient-way-to-compute-the-inverse-of-a-sparse-matrix/98167 "2023-05-05T16:06:57Z")

</div>

I have a sparse matrix Q that is a covariance matrix for a Gaussian Process. I need to invert Q for computations in Bayesian full-conditional distributions. For example, I need to compute terms like \\boldsymbol{\\beta}^T\\…

---

## [Struggling to get Julia as fast as Matlab mex. (Filling large matrix, doing pairwise calculations over particles)](https://discourse.julialang.org/t/struggling-to-get-julia-as-fast-as-matlab-mex-filling-large-matrix-doing-pairwise-calculations-over-particles/98379)

<div class="topic-metadata">

**Author:** [@p\_f](https://discourse.julialang.org/u/p_f)\
**Replies:** 7\
**Last updated:** [May 5, 2023, 3:31pm UTC](https://discourse.julialang.org/t/struggling-to-get-julia-as-fast-as-matlab-mex-filling-large-matrix-doing-pairwise-calculations-over-particles/98379 "2023-05-05T15:31:30Z")

</div>

I have a system with Ntot particles. I am creating a matrix Mh that is 6Ntot x 6Ntot and symmetric, and elements are given by pairwise calculations between particles. I’ve tried my best to speed up my Julia code, but fe…

---

## [Easy packaging of a complete environment for running a course?](https://discourse.julialang.org/t/easy-packaging-of-a-complete-environment-for-running-a-course/19497)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 12\
**Last updated:** [May 5, 2023, 2:56pm UTC](https://discourse.julialang.org/t/easy-packaging-of-a-complete-environment-for-running-a-course/19497 "2023-05-05T14:56:35Z")

</div>

One solution for universities that cannot pony up the use fees for juliabox could be to make it really easy for the instructor to set up the environment just the way the instructor wants it (with the packages that are re…

---

## [Pluto.jl using with custom project gets workspaces mixed up](https://discourse.julialang.org/t/pluto-jl-using-with-custom-project-gets-workspaces-mixed-up/97969)

<div class="topic-metadata">

**Author:** [@bryaan](https://discourse.julialang.org/u/bryaan)\
**Replies:** 11\
**Last updated:** [May 5, 2023, 2:27pm UTC](https://discourse.julialang.org/t/pluto-jl-using-with-custom-project-gets-workspaces-mixed-up/97969 "2023-05-05T14:27:47Z")

</div>

I want Pluto to use my current project Tibra.jl so I do Pkg.activate(.) then import my project. Problem is I can’t access any of the exported types from my package in a Pluto cell so I try to use Reexport. I’m not sure…

---

## [After 1.7.3, could not download registries (getaddrinfo() thread failed to start)](https://discourse.julialang.org/t/after-1-7-3-could-not-download-registries-getaddrinfo-thread-failed-to-start/81731)

<div class="topic-metadata">

**Author:** [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Replies:** 3\
**Last updated:** [May 26, 2022, 4:50pm UTC](https://discourse.julialang.org/t/after-1-7-3-could-not-download-registries-getaddrinfo-thread-failed-to-start/81731 "2022-05-26T16:50:04Z")

</div>

Upgraded to Julia 1.7.3. Thanks to all involved for the new release. Afterwards julia\> using Pkg julia\> Pkg.update() Updating registry at \`C:\\Users\\Audrius-St\\.julia\\registries\\General.toml\` ┌ Warning: could not d…

---

## [Why does it make allocation when using tuples parameters in closure?](https://discourse.julialang.org/t/why-does-it-make-allocation-when-using-tuples-parameters-in-closure/98369)

<div class="topic-metadata">

**Author:** [@wly](https://discourse.julialang.org/u/wly)\
**Replies:** 3\
**Last updated:** [May 5, 2023, 8:32am UTC](https://discourse.julialang.org/t/why-does-it-make-allocation-when-using-tuples-parameters-in-closure/98369 "2023-05-05T08:32:00Z")

</div>

The following code have some allocation: using BenchmarkTools function memoize\_test(n\_outputs) function foo\_i(i::Int64, u...) end return \[(u...) -\> foo\_i(i, u...) for i in 1:n\_outputs\] end fun = memoize\_te…

---

## [Maximum value for Julia integer types](https://discourse.julialang.org/t/maximum-value-for-julia-integer-types/98373)

<div class="topic-metadata">

**Author:** [@Brinkhuis](https://discourse.julialang.org/u/Brinkhuis)\
**Replies:** 1\
**Last updated:** [May 5, 2023, 8:14am UTC](https://discourse.julialang.org/t/maximum-value-for-julia-integer-types/98373 "2023-05-05T08:14:11Z")

</div>

Julia Integer types have a minimum and maximum value. When calculations go beyond those boundaries, results are ‘incorrect’. for i in Int8\[5, 10, 15, 20\] println(i, " -\> ", i^2) end Result: 5 -\> 25 10 -\> 100 15 -\>…

---

## [Comparition of timing v1.9 vs v1.8 and how to get this precompilation in my own packages?](https://discourse.julialang.org/t/comparition-of-timing-v1-9-vs-v1-8-and-how-to-get-this-precompilation-in-my-own-packages/98372)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 4\
**Last updated:** [May 5, 2023, 8:13am UTC](https://discourse.julialang.org/t/comparition-of-timing-v1-9-vs-v1-8-and-how-to-get-this-precompilation-in-my-own-packages/98372 "2023-05-05T08:13:58Z")

</div>

Just tested Julia v1.9rc3 and compared the timining to first plot with Julia 1.8 on a terminal under a new temporary project environment: Command Julia 1.9rc3 Julia 1.8 add Plots 2’ 32’’ 1’ 22’’ using Plots 3’…

---

## [Big files placed in .config \[Linux\]](https://discourse.julialang.org/t/big-files-placed-in-config-linux/98258)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 6\
**Last updated:** [May 4, 2023, 11:51am UTC](https://discourse.julialang.org/t/big-files-placed-in-config-linux/98258 "2023-05-04T11:51:04Z")

</div>

I just made the following discovery: It looks like there is about 1GB from julialang in the .config folder, including a .so file. That does not feel right (I am cloud-syncing my .config). Anyone else who sees this as…

---

## [Is there a package for multidimensional ranges?](https://discourse.julialang.org/t/is-there-a-package-for-multidimensional-ranges/98355)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 3\
**Last updated:** [May 5, 2023, 6:48am UTC](https://discourse.julialang.org/t/is-there-a-package-for-multidimensional-ranges/98355 "2023-05-05T06:48:14Z")

</div>

Is there a convenience package for nonstandard ranges? For instance, I want a rectangle on the complex plane I could use rectangulardomain from RootsAndPoles but that feels pretty specific.

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

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