# General Usage

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

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

**Page:** 176

---

## [Segmentation fault with SharedArrays when --threads is set?](https://discourse.julialang.org/t/segmentation-fault-with-sharedarrays-when-threads-is-set/113424)

<div class="topic-metadata">

**Author:** [@lmtzx9h4qqnt](https://discourse.julialang.org/u/lmtzx9h4qqnt)\
**Replies:** 1\
**Last updated:** [April 25, 2024, 7:30pm UTC](https://discourse.julialang.org/t/segmentation-fault-with-sharedarrays-when-threads-is-set/113424 "2024-04-25T19:30:20Z")

</div>

I’m getting strange segmentation faults when using SharedArrays and passing --threads to Julia, even when I’m not actually using any of those threads! Here is a minimal example: using Distributed function main() sa = …

---

## [Matrix inside Matrix in Julia](https://discourse.julialang.org/t/matrix-inside-matrix-in-julia/113280)

<div class="topic-metadata">

**Author:** [@sati](https://discourse.julialang.org/u/sati)\
**Replies:** 10\
**Last updated:** [April 25, 2024, 5:09pm UTC](https://discourse.julialang.org/t/matrix-inside-matrix-in-julia/113280 "2024-04-25T17:09:53Z")

</div>

This is a matrix formula derived from algebra. My question is how to implement this in Julia? For the first row : I is an identity matrix with a size 3x3 , 0 is a zero matrix with a size 3x6, AG is a 3x10 matrix, and…

---

## [How to take the gradient of an ODE system with respect to many data points?](https://discourse.julialang.org/t/how-to-take-the-gradient-of-an-ode-system-with-respect-to-many-data-points/113368)

<div class="topic-metadata">

**Author:** [@ctessum](https://discourse.julialang.org/u/ctessum)\
**Replies:** 17\
**Last updated:** [April 25, 2024, 4:58pm UTC](https://discourse.julialang.org/t/how-to-take-the-gradient-of-an-ode-system-with-respect-to-many-data-points/113368 "2024-04-25T16:58:41Z")

</div>

Hello! I have an ode system (dx = f(x, ξ, k)), and I would like to find optimal values of ξ so that: \\mathrm{argmin}\_\\xi \\left( f(x, \\xi, k) - dx \\right)^2 where \\xi \\in R^{n\\xi} are the parameters I want to tune, x…

---

## [Making 3D text appear 2D GLMakie](https://discourse.julialang.org/t/making-3d-text-appear-2d-glmakie/113404)

<div class="topic-metadata">

**Author:** [@Gavin\_Held](https://discourse.julialang.org/u/Gavin_Held)\
**Replies:** 6\
**Last updated:** [April 25, 2024, 4:26pm UTC](https://discourse.julialang.org/t/making-3d-text-appear-2d-glmakie/113404 "2024-04-25T16:26:26Z")

</div>

Hello, I am currently trying to make a nice figure with GLMakie that will help aid in describing a specific geometry. To do this I want to include the basis vectors that go along with it, however, I am having difficulti…

---

## [Replacing components with indices](https://discourse.julialang.org/t/replacing-components-with-indices/113412)

<div class="topic-metadata">

**Author:** [@KeepLearning](https://discourse.julialang.org/u/KeepLearning)\
**Replies:** 12\
**Last updated:** [April 25, 2024, 4:00pm UTC](https://discourse.julialang.org/t/replacing-components-with-indices/113412 "2024-04-25T16:00:55Z")

</div>

I am wondering if the following can be done in a better way (without for loop, perhaps): given a vector and a vector of vectors, e.g. v = \[1, 2, 3, 3, 4, 4, 5\] u = \[\[1,2\], \[3, 5\], \[4\]\] I like to get \[1, 1, 2, 2, 3, 3,…

---

## [QuantumOptics.jl time-dependent Hamiltonian cannot run](https://discourse.julialang.org/t/quantumoptics-jl-time-dependent-hamiltonian-cannot-run/113448)

<div class="topic-metadata">

**Author:** [@fqguo](https://discourse.julialang.org/u/fqguo)\
**Replies:** 11\
**Last updated:** [April 25, 2024, 3:43pm UTC](https://discourse.julialang.org/t/quantumoptics-jl-time-dependent-hamiltonian-cannot-run/113448 "2024-04-25T15:43:20Z")

</div>

I cannot modefiy my programma, in which the Hamiltonian is time-dependent, then the “timeevolution.master” show some bug. I cannot run. Can someone help me? using QuantumOptics using PyPlot using SpecialFunctions b…

---

## [Dispatch differences between restricted and unrestricte type parameter](https://discourse.julialang.org/t/dispatch-differences-between-restricted-and-unrestricte-type-parameter/113505)

<div class="topic-metadata">

**Author:** [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Replies:** 4\
**Last updated:** [April 25, 2024, 3:09pm UTC](https://discourse.julialang.org/t/dispatch-differences-between-restricted-and-unrestricte-type-parameter/113505 "2024-04-25T15:09:28Z")

</div>

Why is the dispatch behavior different for the following codes? The only difference is that the type parameter T of the abstract type is restricted (\<:Real) in the first snippet and unrestricted in the second snippet. a…

---

## [Deploying documentation with Documenter (automatically with each new push to the repo)](https://discourse.julialang.org/t/deploying-documentation-with-documenter-automatically-with-each-new-push-to-the-repo/57615)

<div class="topic-metadata">

**Author:** [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Replies:** 25\
**Last updated:** [April 25, 2024, 2:33pm UTC](https://discourse.julialang.org/t/deploying-documentation-with-documenter-automatically-with-each-new-push-to-the-repo/57615 "2024-04-25T14:33:24Z")

</div>

I made a small package as a way of “practicing” all of the good software practices (CI, unit tests, coverage testing, etc). Here it is: GitHub - glwhart/MinkowskiReduction.jl: Lattice reduction in three dimensions I use…

---

## [How to patch another package?](https://discourse.julialang.org/t/how-to-patch-another-package/113454)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 8\
**Last updated:** [April 25, 2024, 12:54pm UTC](https://discourse.julialang.org/t/how-to-patch-another-package/113454 "2024-04-25T12:54:37Z")

</div>

Hi there, I would like to patch another package. This worked perfectly fine up to julia 1.9 but with 1.10 it broke. See this thread ERROR: Method overwriting is not permitted during Module precompilation. Use \`\_\_precomp…

---

## [Build without SparseArrays and SuiteSparse](https://discourse.julialang.org/t/build-without-sparsearrays-and-suitesparse/111809)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 2\
**Last updated:** [April 25, 2024, 10:43am UTC](https://discourse.julialang.org/t/build-without-sparsearrays-and-suitesparse/111809 "2024-04-25T10:43:24Z")

</div>

Hi, I read in the news for of 1.10 that: " SparseArrays and SuiteSparse are no longer included in the default system image, so the core language no longer contains GPL libraries. However, these libraries are still incl…

---

## [Segmentation fault when embedding Julia and using DifferentialEquations.jl](https://discourse.julialang.org/t/segmentation-fault-when-embedding-julia-and-using-differentialequations-jl/113274)

<div class="topic-metadata">

**Author:** [@dmitry-kabanov](https://discourse.julialang.org/u/dmitry-kabanov)\
**Replies:** 1\
**Last updated:** [April 25, 2024, 9:46am UTC](https://discourse.julialang.org/t/segmentation-fault-when-embedding-julia-and-using-differentialequations-jl/113274 "2024-04-25T09:46:33Z")

</div>

Hi, I need to embed Julia in a C library that is dynamically loaded and invoked from Python. I can make basic stuff work with the embedded Julia. However, when I try to import DifferentialEquations.jl, I get a segmentati…

---

## [Custom reshape() function for specific usage](https://discourse.julialang.org/t/custom-reshape-function-for-specific-usage/113382)

<div class="topic-metadata">

**Author:** [@Harrykjg-physics](https://discourse.julialang.org/u/Harrykjg-physics)\
**Replies:** 3\
**Last updated:** [April 25, 2024, 9:14am UTC](https://discourse.julialang.org/t/custom-reshape-function-for-specific-usage/113382 "2024-04-25T09:14:10Z")

</div>

Hi there ! Is there any way to minimize the memory usage of the following custom function graded\_reshape() ( Or even achieve the same performance as the Julia reshape function ) ? Suppose we have a usual Julia reshape…

---

## [Techniques for defining commutative functions](https://discourse.julialang.org/t/techniques-for-defining-commutative-functions/113406)

<div class="topic-metadata">

**Author:** [@mike.ingold](https://discourse.julialang.org/u/mike.ingold)\
**Replies:** 5\
**Last updated:** [April 24, 2024, 7:04pm UTC](https://discourse.julialang.org/t/techniques-for-defining-commutative-functions/113406 "2024-04-24T19:04:01Z")

</div>

I stumbled into a curious problem that seems like it surely must already been solved by someone before, maybe even somewhere in Base that I’m just not familar with. I figured I’d consult the brain-trust here to see if an…

---

## [Resolve ambiguous date comparisons with possible missing return?](https://discourse.julialang.org/t/resolve-ambiguous-date-comparisons-with-possible-missing-return/113409)

<div class="topic-metadata">

**Author:** [@croberts](https://discourse.julialang.org/u/croberts)\
**Replies:** 3\
**Last updated:** [April 24, 2024, 6:08pm UTC](https://discourse.julialang.org/t/resolve-ambiguous-date-comparisons-with-possible-missing-return/113409 "2024-04-24T18:08:30Z")

</div>

Opinion: Some Date comparisons are, in certain contexts, ambiguous. The Julia Dates package refrains from defining operations where these operations are ambiguous. For example: using Dates max(Quarter(1), Month(1))…

---

## [Help with Levenberg-Marquardt Optimization in Homography](https://discourse.julialang.org/t/help-with-levenberg-marquardt-optimization-in-homography/112740)

<div class="topic-metadata">

**Author:** [@dennispureza](https://discourse.julialang.org/u/dennispureza)\
**Replies:** 3\
**Last updated:** [April 24, 2024, 5:57pm UTC](https://discourse.julialang.org/t/help-with-levenberg-marquardt-optimization-in-homography/112740 "2024-04-24T17:57:13Z")

</div>

Hi! I have to solve an optmization problem of refining a Homography matrix using the Levenberg-Marquardt method. My reference is in Java and calls a function in the following way: Optimize(Val; Jac; X; Y; h) Where: V…

---

## [Minimum Spanning Tree](https://discourse.julialang.org/t/minimum-spanning-tree/35845)

<div class="topic-metadata">

**Author:** [@JosenildoFerreira](https://discourse.julialang.org/u/JosenildoFerreira)\
**Replies:** 9\
**Last updated:** [April 24, 2024, 4:35pm UTC](https://discourse.julialang.org/t/minimum-spanning-tree/35845 "2024-04-24T16:35:22Z")

</div>

Hi everyone, I want the vectors combination of a minimum spanning tree. I don’t think that I was very clear, but its like the following example, I have this array, generated by the function kruskal\_mst from the LightGrap…

---

## [Native Windows vs WSL2](https://discourse.julialang.org/t/native-windows-vs-wsl2/113468)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 0\
**Last updated:** [April 24, 2024, 4:24pm UTC](https://discourse.julialang.org/t/native-windows-vs-wsl2/113468 "2024-04-24T16:24:00Z")

</div>

There is a comparison of Julia running either natively in Windows vs in WSL2 (Ubuntu) from approximately four years ago (link1, link2) Has the situation changed? or is there still a significant performance gap in favor …

---

## [How to use WeakRef inside construtor?](https://discourse.julialang.org/t/how-to-use-weakref-inside-construtor/113405)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 3\
**Last updated:** [April 24, 2024, 4:14pm UTC](https://discourse.julialang.org/t/how-to-use-weakref-inside-construtor/113405 "2024-04-24T16:14:46Z")

</div>

Hi there, I am trying to create a self-updating object which kills its own updating process as soon as it is finalized mutable struct SelfUpdating value function SelfUpdating(value) finalize(x) = Thread…

---

## [Julia 1.10.2 crashes when embedded from Python due to \`libgomp.so\` compiled with GCC 13.2](https://discourse.julialang.org/t/julia-1-10-2-crashes-when-embedded-from-python-due-to-libgomp-so-compiled-with-gcc-13-2/113456)

<div class="topic-metadata">

**Author:** [@dmitry-kabanov](https://discourse.julialang.org/u/dmitry-kabanov)\
**Replies:** 1\
**Last updated:** [April 24, 2024, 3:43pm UTC](https://discourse.julialang.org/t/julia-1-10-2-crashes-when-embedded-from-python-due-to-libgomp-so-compiled-with-gcc-13-2/113456 "2024-04-24T15:43:59Z")

</div>

Hi, I have the problem with embedded Julia 1.10.2 when called from Python, although the problem does not appear when called from C. Specifically, segmentation fault occurs in libgomp.so shipped with Julia 1.10.2 becaus…

---

## [ERROR: Method overwriting is not permitted during Module precompilation. Use \`\_\_precompile\_\_(false)\` to opt-out of precompilation](https://discourse.julialang.org/t/error-method-overwriting-is-not-permitted-during-module-precompilation-use-precompile-false-to-opt-out-of-precompilation/109191)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 8\
**Last updated:** [April 24, 2024, 2:39pm UTC](https://discourse.julialang.org/t/error-method-overwriting-is-not-permitted-during-module-precompilation-use-precompile-false-to-opt-out-of-precompilation/109191 "2024-04-24T14:39:45Z")

</div>

Hello, I switched to julia 1.10 and see that one of my packages now shows an error during precompilation ERROR: Method overwriting is not permitted during Module precompilation. Use \`\_\_precompile\_\_(false)\` to opt-out o…

---

## [JULIA\_PKG\_PRECOMPILE\_AUTO=0 does not seem to work](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 11\
**Last updated:** [April 24, 2024, 12:40pm UTC](https://discourse.julialang.org/t/julia-pkg-precompile-auto-0-does-not-seem-to-work/113434 "2024-04-24T12:40:29Z")

</div>

Hi there, for development purposes I would like to turn off precompilation, I found JULIA\_PKG\_PRECOMPILE\_AUTO, but it apparently does not work JULIA\_PKG\_PRECOMPILE\_AUTO=0 julia \_ \_ \_ \_(\_)\_ | …

---

## [Clipboard through ssh](https://discourse.julialang.org/t/clipboard-through-ssh/113421)

<div class="topic-metadata">

**Author:** [@thomasj](https://discourse.julialang.org/u/thomasj)\
**Replies:** 0\
**Last updated:** [April 24, 2024, 5:58am UTC](https://discourse.julialang.org/t/clipboard-through-ssh/113421 "2024-04-24T05:58:11Z")

</div>

I’m using ssh -X user@IPADDRESS to access a computer on which I run julia. I would like to use the clipboard function to paste data on the local computer. Both computer are running Linux, and are using wayland. If both…

---

## [How to use \`integration\_qawc\` with function wrapped with local variables?](https://discourse.julialang.org/t/how-to-use-integration-qawc-with-function-wrapped-with-local-variables/113269)

<div class="topic-metadata">

**Author:** [@zxct](https://discourse.julialang.org/u/zxct)\
**Replies:** 2\
**Last updated:** [April 24, 2024, 2:05am UTC](https://discourse.julialang.org/t/how-to-use-integration-qawc-with-function-wrapped-with-local-variables/113269 "2024-04-24T02:05:09Z")

</div>

Hi, I want to calculate the cauchy principle value integration of a three arguments function inside a function with two arguments decided at runtime with local variables. But it seemed that integration\_qawc will not find…

---

## [Multiplying Matrix inside a loop](https://discourse.julialang.org/t/multiplying-matrix-inside-a-loop/113352)

<div class="topic-metadata">

**Author:** [@Digidi](https://discourse.julialang.org/u/Digidi)\
**Replies:** 9\
**Last updated:** [April 23, 2024, 9:51pm UTC](https://discourse.julialang.org/t/multiplying-matrix-inside-a-loop/113352 "2024-04-23T21:51:37Z")

</div>

Hello, i try to write an alorithm where the Matrix is iterated ofer a table value. In each step the Matrix should be multiplyed with the Matrix before. I tried severl approches but i didn’t find something which is workin…

---

## [Change parameters of array components in ModelingToolkit.jl](https://discourse.julialang.org/t/change-parameters-of-array-components-in-modelingtoolkit-jl/113358)

<div class="topic-metadata">

**Author:** [@Antomek](https://discourse.julialang.org/u/Antomek)\
**Replies:** 5\
**Last updated:** [April 23, 2024, 7:00pm UTC](https://discourse.julialang.org/t/change-parameters-of-array-components-in-modelingtoolkit-jl/113358 "2024-04-23T19:00:35Z")

</div>

Hello all, I am looking for a way of setting the individual parameters of an array of components in ModelingToolkit. Consider the following example (inspired by the ModelingToolkit docs): using ModelingToolkit using M…

---

## [Using \`\`\`@nall\`\`\` or \`\`\`@nexpr \`\`\`inside of \`\`\`@nif\`\`\` (from Base.Cartesian package)](https://discourse.julialang.org/t/using-nall-or-nexpr-inside-of-nif-from-base-cartesian-package/113403)

<div class="topic-metadata">

**Author:** [@lukeb](https://discourse.julialang.org/u/lukeb)\
**Replies:** 1\
**Last updated:** [April 23, 2024, 4:42pm UTC](https://discourse.julialang.org/t/using-nall-or-nexpr-inside-of-nif-from-base-cartesian-package/113403 "2024-04-23T16:42:22Z")

</div>

Hi, I’m trying to do some meta-programming and have hit a wall. I’ve reduced my problem to what I think is a MWE containing the important aspects of the larger problem. It revolves around trying to use @nall (or, alterna…

---

## [Status of Julia on Windows](https://discourse.julialang.org/t/status-of-julia-on-windows/113050)

<div class="topic-metadata">

**Author:** [@jsjie](https://discourse.julialang.org/u/jsjie)\
**Replies:** 13\
**Last updated:** [April 23, 2024, 3:23pm UTC](https://discourse.julialang.org/t/status-of-julia-on-windows/113050 "2024-04-23T15:23:12Z")

</div>

It is often believed that Julia somehow performs worse on Windows, while some say the situation is exaggerated. I’d like to open a topic and gather information about this. 2024 April 17th ThreadPinning cannot be used on…

---

## [Avoiding runtime dispatch randomly selecting an algorithm in a loop](https://discourse.julialang.org/t/avoiding-runtime-dispatch-randomly-selecting-an-algorithm-in-a-loop/113389)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 1\
**Last updated:** [April 23, 2024, 2:55pm UTC](https://discourse.julialang.org/t/avoiding-runtime-dispatch-randomly-selecting-an-algorithm-in-a-loop/113389 "2024-04-23T14:55:15Z")

</div>

I have a scenario where I’m switching between different methods of one function in a loop that has a long lifetime. I have a tuple of structs, where I’m selecting one randomly to be put into a function like so: functio…

---

## [Solving a set of equations using Symbolics.jl](https://discourse.julialang.org/t/solving-a-set-of-equations-using-symbolics-jl/113388)

<div class="topic-metadata">

**Author:** [@skvibimigger](https://discourse.julialang.org/u/skvibimigger)\
**Replies:** 1\
**Last updated:** [April 23, 2024, 2:17pm UTC](https://discourse.julialang.org/t/solving-a-set-of-equations-using-symbolics-jl/113388 "2024-04-23T14:17:13Z")

</div>

Hello, How can I solve a system of equations to obtain the following coefficients a1, a2, a3 and a4 using the Symbolics.jl package. I know that it is possible using the SymPy package, but I am interesting in solving it…

---

## [How to encourage compiler optimizations?](https://discourse.julialang.org/t/how-to-encourage-compiler-optimizations/113325)

<div class="topic-metadata">

**Author:** [@DanDoe](https://discourse.julialang.org/u/DanDoe)\
**Replies:** 12\
**Last updated:** [April 23, 2024, 1:32pm UTC](https://discourse.julialang.org/t/how-to-encourage-compiler-optimizations/113325 "2024-04-23T13:32:18Z")

</div>

I have two functions which contain an identical block of code foo followed by different blocks of code bar1, bar2. I time these functions using our timing tool which is essentially a derivate of \_timer\_expr from TimerOut…

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

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