# General Usage

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

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

**Page:** 119

---

## [Most Efficient Way to Compute a Quadratic Matrix Form](https://discourse.julialang.org/t/most-efficient-way-to-compute-a-quadratic-matrix-form/66606)

<div class="topic-metadata">

**Author:** [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Replies:** 15\
**Last updated:** [October 27, 2024, 6:24pm UTC](https://discourse.julialang.org/t/most-efficient-way-to-compute-a-quadratic-matrix-form/66606 "2024-10-27T18:24:33Z")

</div>

Given a Symmetric Positive Semi definite Matrix P , what would be the most efficient (Fast) way to calculate the matrix quadratic form: {x}^{T} P x For the following cases: The matrix P is dense. The matrix P i…

---

## [How to make a quaternary plot](https://discourse.julialang.org/t/how-to-make-a-quaternary-plot/121822)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 6\
**Last updated:** [October 27, 2024, 4:02pm UTC](https://discourse.julialang.org/t/how-to-make-a-quaternary-plot/121822 "2024-10-27T16:02:09Z")

</div>

Hi all, I have data that represents a 2X2 joint probability distribution. I would like to visualize it with a quaternary plot, similar to the second to last example here. I don’t have clusters, but I would like to color…

---

## [Tests fail for Julia 1.11 on GitHub](https://discourse.julialang.org/t/tests-fail-for-julia-1-11-on-github/121823)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [October 27, 2024, 3:49pm UTC](https://discourse.julialang.org/t/tests-fail-for-julia-1-11-on-github/121823 "2024-10-27T15:49:16Z")

</div>

My tests pass for Julia 1.10: Adapt to new KiteModels, using new conventions · aenarete/KiteControllers.jl@dd84a3f · GitHub and fail for Julia 1.11: I do not really understand why. This might be related to my use of P…

---

## [How to benefit from package specific @recompile\_invalidations when developing the same package?](https://discourse.julialang.org/t/how-to-benefit-from-package-specific-recompile-invalidations-when-developing-the-same-package/120805)

<div class="topic-metadata">

**Author:** [@frankier](https://discourse.julialang.org/u/frankier)\
**Replies:** 3\
**Last updated:** [October 27, 2024, 11:41am UTC](https://discourse.julialang.org/t/how-to-benefit-from-package-specific-recompile-invalidations-when-developing-the-same-package/120805 "2024-10-27T11:41:08Z")

</div>

I have a package MyPackage that loads stuff in an order that ends up invalidating a lot of Makie. using DependencyA using Makie Long term I would like to solve it, but for now I would just like to work around it. If I …

---

## [Allocations MVectors](https://discourse.julialang.org/t/allocations-mvectors/121818)

<div class="topic-metadata">

**Author:** [@AdaemmerP](https://discourse.julialang.org/u/AdaemmerP)\
**Replies:** 10\
**Last updated:** [October 27, 2024, 10:38am UTC](https://discourse.julialang.org/t/allocations-mvectors/121818 "2024-10-27T10:38:56Z")

</div>

Why does this: m! = factorial(3) @btime MVector{$m!, Float64}(undef); 576.677 ns (10 allocations: 512 bytes) allocate ten times as much as this: @btime MVector{6, Float64}(undef); 4.148 ns (1 allocation: 64 bytes) I …

---

## [Is there any IDE alternative to VSC+debugger?](https://discourse.julialang.org/t/is-there-any-ide-alternative-to-vsc-debugger/121754)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 22\
**Last updated:** [October 27, 2024, 2:10am UTC](https://discourse.julialang.org/t/is-there-any-ide-alternative-to-vsc-debugger/121754 "2024-10-27T02:10:28Z")

</div>

With current state of the debugger in VSC only allowing to run it once, the utility for me of VSC itself dropped to very low. Only the code navigation facilities still makes me using it. Are there any alternatives (Subl…

---

## [Integrating Julia with Rust?](https://discourse.julialang.org/t/integrating-julia-with-rust/121745)

<div class="topic-metadata">

**Author:** [@benslinux](https://discourse.julialang.org/u/benslinux)\
**Replies:** 56\
**Last updated:** [October 27, 2024, 1:43am UTC](https://discourse.julialang.org/t/integrating-julia-with-rust/121745 "2024-10-27T01:43:17Z")

</div>

Interested in the results / experiences who may have taken this approach - using Julia’s strengths in scientific computation with Rust’s efficiency and superior packaging via Cargo. Integrating Julia WITHIN Rust implie…

---

## [Problem on model and gradient descend in Flux](https://discourse.julialang.org/t/problem-on-model-and-gradient-descend-in-flux/121589)

<div class="topic-metadata">

**Author:** [@Yaozhong\_Liu](https://discourse.julialang.org/u/Yaozhong_Liu)\
**Replies:** 18\
**Last updated:** [October 27, 2024, 1:05am UTC](https://discourse.julialang.org/t/problem-on-model-and-gradient-descend-in-flux/121589 "2024-10-27T01:05:54Z")

</div>

Hi. I have a problem on gradient descend in Flux. Suppose I have a model like this: model1 = Chain(x-\>Dense(5,5),relu) model2 = Chain(x-\>model1(x), Dense(5,5), vec) model3 = Chain(x-\>model1(x), Dense(5,5), vec) And I …

---

## [Installing OrdinaryEqDiff on Julia 1.10](https://discourse.julialang.org/t/installing-ordinaryeqdiff-on-julia-1-10/121780)

<div class="topic-metadata">

**Author:** [@nicomerino](https://discourse.julialang.org/u/nicomerino)\
**Replies:** 6\
**Last updated:** [October 26, 2024, 6:19pm UTC](https://discourse.julialang.org/t/installing-ordinaryeqdiff-on-julia-1-10/121780 "2024-10-26T18:19:40Z")

</div>

Hey there, I having trouble installing OrdinaryEqDiff and I have no clue what the problem could be. It just gets stuck forever, always in this specific part: Info Packages marked with ⌅ have new versions availa…

---

## [Designing interfaces for objects constructable from a file](https://discourse.julialang.org/t/designing-interfaces-for-objects-constructable-from-a-file/121710)

<div class="topic-metadata">

**Author:** [@anon91151494](https://discourse.julialang.org/u/anon91151494)\
**Replies:** 34\
**Last updated:** [October 26, 2024, 4:32pm UTC](https://discourse.julialang.org/t/designing-interfaces-for-objects-constructable-from-a-file/121710 "2024-10-26T16:32:23Z")

</div>

Hi, I’m trying to understand how to design interfaces for types in Julia well. More specifically, I am writing a type which is effectively a wrapper around a DataFrame. Its purpose is to manage some configuration for …

---

## [Loop over array of static arrays](https://discourse.julialang.org/t/loop-over-array-of-static-arrays/121769)

<div class="topic-metadata">

**Author:** [@nicolas](https://discourse.julialang.org/u/nicolas)\
**Replies:** 12\
**Last updated:** [October 26, 2024, 3:29pm UTC](https://discourse.julialang.org/t/loop-over-array-of-static-arrays/121769 "2024-10-26T15:29:15Z")

</div>

I have the following loop over arrays (the function double() will obviously be more complicated, but the number of arrays is always the same) double(x) = 2x function doubles\_using\_arrays() xs = \[ones(10) for i in 1…

---

## [How to exit a Julia program without completely exit REPL or shutting down Julia?](https://discourse.julialang.org/t/how-to-exit-a-julia-program-without-completely-exit-repl-or-shutting-down-julia/66655)

<div class="topic-metadata">

**Author:** [@CRquantum](https://discourse.julialang.org/u/CRquantum)\
**Replies:** 21\
**Last updated:** [October 26, 2024, 2:53pm UTC](https://discourse.julialang.org/t/how-to-exit-a-julia-program-without-completely-exit-repl-or-shutting-down-julia/66655 "2024-10-26T14:53:17Z")

</div>

Sorry for another stupid question. In a Julia program, or a function, if some ‘Oops’ happens, I know that I can put exit() somewhere in the code, so that I can automatically and completely shutting down julia and quit…

---

## [Outer product of each row of a matrix](https://discourse.julialang.org/t/outer-product-of-each-row-of-a-matrix/121764)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 5\
**Last updated:** [October 26, 2024, 2:44pm UTC](https://discourse.julialang.org/t/outer-product-of-each-row-of-a-matrix/121764 "2024-10-26T14:44:12Z")

</div>

I’m looking for an efficient way to take the outer product of each row of a matrix, e.g.: julia\> A = \[1 2;4 8\] 2×2 Matrix{Int64}: 1 2 4 8 julia\> cat(\[r \* r' for r in eachrow(A)\]..., dims=3) 2×2×2 Array{Int64, 3}: \[…

---

## [Multiple Julia processes while using Modules](https://discourse.julialang.org/t/multiple-julia-processes-while-using-modules/75071)

<div class="topic-metadata">

**Author:** [@roh\_codeur](https://discourse.julialang.org/u/roh_codeur)\
**Replies:** 6\
**Last updated:** [October 26, 2024, 9:32am UTC](https://discourse.julialang.org/t/multiple-julia-processes-while-using-modules/75071 "2024-10-26T09:32:10Z")

</div>

Hi Following my discussion from the below thread, I have been trying out 2 approaches to evaluate Julia project organisation approaches. Creating files as modules and “using” them in other files Creating them as ind…

---

## [What is a good design for a settable global with a known type?](https://discourse.julialang.org/t/what-is-a-good-design-for-a-settable-global-with-a-known-type/121770)

<div class="topic-metadata">

**Author:** [@jakobjpeters](https://discourse.julialang.org/u/jakobjpeters)\
**Replies:** 4\
**Last updated:** [October 26, 2024, 8:49am UTC](https://discourse.julialang.org/t/what-is-a-good-design-for-a-settable-global-with-a-known-type/121770 "2024-10-26T08:49:45Z")

</div>

In a package, I have a const s = "" that is used in a couple of functions. One of these functions doesn’t have a way for a user to specify a different string to use instead. What is a good way to make the value settable? …

---

## [Is VSCode \`@profview\` broken on 1.11?](https://discourse.julialang.org/t/is-vscode-profview-broken-on-1-11/121630)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 4\
**Last updated:** [October 26, 2024, 8:45am UTC](https://discourse.julialang.org/t/is-vscode-profview-broken-on-1-11/121630 "2024-10-26T08:45:42Z")

</div>

When I run the profiling code from this example in VSCode with Julia 1.11, the flame graph is empty. With Julia 1.10 it displays the usual way. function profile\_test(n) for i = 1:n A = randn(100,100,20) …

---

## [Allocations with StaticArrays and \`+=\` in Julia \`v1.11\`](https://discourse.julialang.org/t/allocations-with-staticarrays-and-in-julia-v1-11/121578)

<div class="topic-metadata">

**Author:** [@kaipartmann](https://discourse.julialang.org/u/kaipartmann)\
**Replies:** 6\
**Last updated:** [October 26, 2024, 7:54am UTC](https://discourse.julialang.org/t/allocations-with-staticarrays-and-in-julia-v1-11/121578 "2024-10-26T07:54:27Z")

</div>

Hello everyone, I am the main author of the package Peridynamics.jl and recently changed to Julia v1.11. With the new Julia version, a significant increase in the simulation time can be found when using a certain mater…

---

## [Print vs @printf](https://discourse.julialang.org/t/print-vs-printf/121272)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 6\
**Last updated:** [October 26, 2024, 7:51am UTC](https://discourse.julialang.org/t/print-vs-printf/121272 "2024-10-26T07:51:40Z")

</div>

Hello, Is it possible to write the following program using print, round and digits instead of using @printf? using Printf # needed in order to use @printf function tickets() print("Price of reserved ticket? ") rP…

---

## [Language server - "Missing references" in files included in an examples folder](https://discourse.julialang.org/t/language-server-missing-references-in-files-included-in-an-examples-folder/121584)

<div class="topic-metadata">

**Author:** [@lieskjur](https://discourse.julialang.org/u/lieskjur)\
**Replies:** 11\
**Last updated:** [October 25, 2024, 7:39pm UTC](https://discourse.julialang.org/t/language-server-missing-references-in-files-included-in-an-examples-folder/121584 "2024-10-25T19:39:12Z")

</div>

Hi, I am developing a package to which I have added an example folder including some additional dependencies in a separate Project.toml file. The overall structure looks more or less like ├── examples │ ├── first\_exam…

---

## [Bug in copy!(z,view(x,2,:)')?](https://discourse.julialang.org/t/bug-in-copy-z-view-x-2/121753)

<div class="topic-metadata">

**Author:** [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Replies:** 7\
**Last updated:** [October 25, 2024, 6:51pm UTC](https://discourse.julialang.org/t/bug-in-copy-z-view-x-2/121753 "2024-10-25T18:51:32Z")

</div>

Hi, I am buffled by what copy!(z,view(x,1,:)') does. Seems off. Example: x = \[11 12;111 112\] #to read from y = \[ones(1,2)\*1,ones(1,2)\*2\] #2-vector of matrices, to be pushed to z = zeros(1,2) …

---

## [Reading responses to ANSI escape codes](https://discourse.julialang.org/t/reading-responses-to-ansi-escape-codes/44572)

<div class="topic-metadata">

**Author:** [@simonschoelly](https://discourse.julialang.org/u/simonschoelly)\
**Replies:** 7\
**Last updated:** [October 25, 2024, 6:32pm UTC](https://discourse.julialang.org/t/reading-responses-to-ansi-escape-codes/44572 "2024-10-25T18:32:10Z")

</div>

When writing an ANSI escape code to the console like this: julia\> print(stdout, "\\033\[14t"); One gets an answer back that is also written to the console. In this case we get ^\[\[4;1012;1419t which is the width and hei…

---

## [Different ways of declaring the same StepRangeLen are not equivalent](https://discourse.julialang.org/t/different-ways-of-declaring-the-same-steprangelen-are-not-equivalent/121750)

<div class="topic-metadata">

**Author:** [@Jacques\_Cornec](https://discourse.julialang.org/u/Jacques_Cornec)\
**Replies:** 5\
**Last updated:** [October 25, 2024, 4:58pm UTC](https://discourse.julialang.org/t/different-ways-of-declaring-the-same-steprangelen-are-not-equivalent/121750 "2024-10-25T16:58:48Z")

</div>

Hey everyone, This is my first post on here. I will do my best to follow the posted guidelines, but please let me know if I should change anything. I noticed something slightly odd about the range function. Here is a m…

---

## [Rule of thumb to estimate theoretical lower bound on benchmarks?](https://discourse.julialang.org/t/rule-of-thumb-to-estimate-theoretical-lower-bound-on-benchmarks/121509)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 4\
**Last updated:** [October 25, 2024, 4:41pm UTC](https://discourse.julialang.org/t/rule-of-thumb-to-estimate-theoretical-lower-bound-on-benchmarks/121509 "2024-10-25T16:41:32Z")

</div>

I have a somewhat complex inner loop (I can share if needed but I am looking for general rules here) that benchmarks at 200-800 ns with no allocations. A range makes sense, it depends on which conditionals are randomly u…

---

## [Bounds check performance](https://discourse.julialang.org/t/bounds-check-performance/121741)

<div class="topic-metadata">

**Author:** [@shatanzikou](https://discourse.julialang.org/u/shatanzikou)\
**Replies:** 2\
**Last updated:** [October 25, 2024, 4:11pm UTC](https://discourse.julialang.org/t/bounds-check-performance/121741 "2024-10-25T16:11:40Z")

</div>

The SciML Style guide reads that in Julia after ver1.9, bounds check will reduce performance. But I didn’t see others recommended this, there is no performance reducing in my test. I want to know why it is not recommende…

---

## [What is the preferred way to use multiple files?](https://discourse.julialang.org/t/what-is-the-preferred-way-to-use-multiple-files/30687)

<div class="topic-metadata">

**Author:** [@EvgeniyMist](https://discourse.julialang.org/u/EvgeniyMist)\
**Replies:** 15\
**Last updated:** [October 25, 2024, 3:06pm UTC](https://discourse.julialang.org/t/what-is-the-preferred-way-to-use-multiple-files/30687 "2024-10-25T15:06:59Z")

</div>

I wanted to structure my code by dividing it into several files. But I ran into some problem. So, in its simplest form, I have 3 files: main.jl module main include("structs.jl") include("functions.jl") first\_point =…

---

## [Error using example for NeuralODE](https://discourse.julialang.org/t/error-using-example-for-neuralode/121697)

<div class="topic-metadata">

**Author:** [@agme2014](https://discourse.julialang.org/u/agme2014)\
**Replies:** 4\
**Last updated:** [October 25, 2024, 1:45pm UTC](https://discourse.julialang.org/t/error-using-example-for-neuralode/121697 "2024-10-25T13:45:53Z")

</div>

Getting an error in the last optimization step : result\_neuralode2 = Optimization.solve( optprob2, Optim.BFGS(; initial\_stepnorm = 0.01); callback, allow\_f\_increases = false) \*\*Error message : \*\* \*\*ERROR: Output …

---

## [Add unregistered package to CI](https://discourse.julialang.org/t/add-unregistered-package-to-ci/121720)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 2\
**Last updated:** [October 25, 2024, 8:28am UTC](https://discourse.julialang.org/t/add-unregistered-package-to-ci/121720 "2024-10-25T08:28:29Z")

</div>

I would like to run CI with an unregistered package, or a package that is registered to an alternative registry via LocalRegistry.jl. To do something similar with Documenter.jl, I added something like this to the yml fil…

---

## [Problem with installing Julia/notebooks for a course](https://discourse.julialang.org/t/problem-with-installing-julia-notebooks-for-a-course/121540)

<div class="topic-metadata">

**Author:** [@tduretz](https://discourse.julialang.org/u/tduretz)\
**Replies:** 10\
**Last updated:** [October 25, 2024, 6:53am UTC](https://discourse.julialang.org/t/problem-with-installing-julia-notebooks-for-a-course/121540 "2024-10-25T06:53:47Z")

</div>

Hi all, I have been using Julia for most of my course over the last 5 years. The students usually install VScode + Julia on their own machines and then the course mostly relies on notebooks. Habitually, things go smooth…

---

## [\--project=. no longer works, and gives fatal error because of ENOENT. Why?](https://discourse.julialang.org/t/project-no-longer-works-and-gives-fatal-error-because-of-enoent-why/121704)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 6\
**Last updated:** [October 25, 2024, 12:18am UTC](https://discourse.julialang.org/t/project-no-longer-works-and-gives-fatal-error-because-of-enoent-why/121704 "2024-10-25T00:18:24Z")

</div>

$ ~/.julia/environments/v1.11/.CondaPkg/env/bin$ pwd /home/pharaldsson/.julia/environments/v1.11/.CondaPkg/env/bin there pwd works but not here: $ julia +1.11.1 julia\> pwd() ERROR: IOError: pwd(): no such file or dire…

---

## [What can I remove from /.julia?](https://discourse.julialang.org/t/what-can-i-remove-from-julia/121657)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 6\
**Last updated:** [October 24, 2024, 11:50pm UTC](https://discourse.julialang.org/t/what-can-i-remove-from-julia/121657 "2024-10-24T23:50:00Z")

</div>

I am trying to build a slim docker image to run an app. I’m using PackageCompiler.jl to build a sysimage (using filter\_stdlibs). I’d like to remove unnecessary files from the .julia file to slim even more. I feel pretty…

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

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