# General Usage

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

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

**Page:** 348

---

## [Could not download forward compatibility package for CUDA](https://discourse.julialang.org/t/could-not-download-forward-compatibility-package-for-cuda/92142)

<div class="topic-metadata">

**Author:** [@Pavel\_Petrov](https://discourse.julialang.org/u/Pavel_Petrov)\
**Replies:** 7\
**Last updated:** [January 5, 2023, 8:55am UTC](https://discourse.julialang.org/t/could-not-download-forward-compatibility-package-for-cuda/92142 "2023-01-05T08:55:05Z")

</div>

I am trying to run some CUDA calculations on a cluster and I have a problem with CUDA artifacts. Here is a simple test code, which I run on cluster node. ENV\["JULIA\_CUDA\_USE\_BINARYBUILDER"\] = false using CUDA CUDA.versi…

---

## [Segmentation fault in jupyter notebook but not REPL?](https://discourse.julialang.org/t/segmentation-fault-in-jupyter-notebook-but-not-repl/92543)

<div class="topic-metadata">

**Author:** [@cjproud](https://discourse.julialang.org/u/cjproud)\
**Replies:** 0\
**Last updated:** [January 5, 2023, 8:07am UTC](https://discourse.julialang.org/t/segmentation-fault-in-jupyter-notebook-but-not-repl/92543 "2023-01-05T08:07:01Z")

</div>

Hi everyone, I’ve run into an extremely bizarre issue. When running Julia code, which calls Fortran code via CCall, I get a Stack Overflow Error when a particular subroutine is called in Fortran. This however, only happ…

---

## [Why can't I combine a macro call with a comparison operator?](https://discourse.julialang.org/t/why-cant-i-combine-a-macro-call-with-a-comparison-operator/92493)

<div class="topic-metadata">

**Author:** [@veddox](https://discourse.julialang.org/u/veddox)\
**Replies:** 5\
**Last updated:** [January 5, 2023, 6:13am UTC](https://discourse.julialang.org/t/why-cant-i-combine-a-macro-call-with-a-comparison-operator/92493 "2023-01-05T06:13:37Z")

</div>

To save myself a bit of typing, I have created a wrapper macro around a function in my model, to be used in a specific context: macro landcover() :(landcover($(esc(:pos)), $(esc(:model)))) end I want to be able to …

---

## [Update array](https://discourse.julialang.org/t/update-array/92530)

<div class="topic-metadata">

**Author:** [@jgr](https://discourse.julialang.org/u/jgr)\
**Replies:** 4\
**Last updated:** [January 5, 2023, 12:40am UTC](https://discourse.julialang.org/t/update-array/92530 "2023-01-05T00:40:38Z")

</div>

Hi, I am trying to update an array using the following code add!(z::Val{1}, list, a) = add!(list, a) function add!(list, a) list = list .+a return nothing end However, this does not seem to work well: list …

---

## [How make .+ work with A::Vector{Float64} and B::OffsetArray(::Vector{Float64}, 0:1)](https://discourse.julialang.org/t/how-make-work-with-a-vector-float64-and-b-offsetarray-vector-float64-0-1/92524)

<div class="topic-metadata">

**Author:** [@elvispy](https://discourse.julialang.org/u/elvispy)\
**Replies:** 7\
**Last updated:** [January 4, 2023, 10:48pm UTC](https://discourse.julialang.org/t/how-make-work-with-a-vector-float64-and-b-offsetarray-vector-float64-0-1/92524 "2023-01-04T22:48:46Z")

</div>

The LegendrePolynomials.jl package has a function collectPl which returns an OffsetArray Object. It appears that, for some reason, the dot operations are not working properly with this type of data: julia\> A = \[1.0, 2.…

---

## [Symbolics: get the coefficients of the polynomial binomial(x, c)](https://discourse.julialang.org/t/symbolics-get-the-coefficients-of-the-polynomial-binomial-x-c/92511)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 11\
**Last updated:** [January 4, 2023, 10:01pm UTC](https://discourse.julialang.org/t/symbolics-get-the-coefficients-of-the-polynomial-binomial-x-c/92511 "2023-01-04T22:01:28Z")

</div>

How to get a polynomial expression from, e.g., binomial(x, 3)? julia\> using Symbolics julia\> @variables x 1-element Vector{Num}: x julia\> binomial(x, 3) binomial(x, 3) julia\> simplify(ans) binomial(x, 3)

---

## [Julia-1.8.4.pdf Page 455 update required](https://discourse.julialang.org/t/julia-1-8-4-pdf-page-455-update-required/92469)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 1\
**Last updated:** [January 4, 2023, 12:23am UTC](https://discourse.julialang.org/t/julia-1-8-4-pdf-page-455-update-required/92469 "2023-01-04T00:23:33Z")

</div>

In section 37.15 Paragraph 2 the documentation should be updated from 1.0.x to 1.6.x for the current LTS version. This is probably not the right place for this request but I don’t know the proper procedure.

---

## [How can I fix the following type unstability? (Example of a Type unstable function)](https://discourse.julialang.org/t/how-can-i-fix-the-following-type-unstability-example-of-a-type-unstable-function/92510)

<div class="topic-metadata">

**Author:** [@Shayan](https://discourse.julialang.org/u/Shayan)\
**Replies:** 4\
**Last updated:** [January 4, 2023, 3:27pm UTC](https://discourse.julialang.org/t/how-can-i-fix-the-following-type-unstability-example-of-a-type-unstable-function/92510 "2023-01-04T15:27:07Z")

</div>

I’ve defined the following function: using DataFrames function Silouhette( input\_data, model::KmeansResult )::Float64 if Tables.istable(input\_data) RunSilouhette(Tables.matrix(input\_data), model) else …

---

## [Debugging invalidations](https://discourse.julialang.org/t/debugging-invalidations/92357)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 17\
**Last updated:** [January 4, 2023, 3:03pm UTC](https://discourse.julialang.org/t/debugging-invalidations/92357 "2023-01-04T15:03:54Z")

</div>

I am testing Julia-1.9-beta2 on Ubuntu 22.04 and would like to improve the performance of plots using Bokeh.jl. In the moment the first time to plot with this package is about 13s, and it would be nice to improve that. …

---

## [Are computations with Dual numbers twice as slow as non Duals?](https://discourse.julialang.org/t/are-computations-with-dual-numbers-twice-as-slow-as-non-duals/92502)

<div class="topic-metadata">

**Author:** [@nrontsis](https://discourse.julialang.org/u/nrontsis)\
**Replies:** 2\
**Last updated:** [January 4, 2023, 2:39pm UTC](https://discourse.julialang.org/t/are-computations-with-dual-numbers-twice-as-slow-as-non-duals/92502 "2023-01-04T14:39:08Z")

</div>

After reading this I got the impression that computations with dual numbers are typically expected to be twice as slow as non-duals. The reasoning was that both the normal and dual computations have to calculated at each…

---

## [Understanding allocs/constant propagation issue?](https://discourse.julialang.org/t/understanding-allocs-constant-propagation-issue/92474)

<div class="topic-metadata">

**Author:** [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Replies:** 7\
**Last updated:** [January 4, 2023, 2:30pm UTC](https://discourse.julialang.org/t/understanding-allocs-constant-propagation-issue/92474 "2023-01-04T14:30:17Z")

</div>

Consider the example, using LinearAlgebra, BenchmarkTools function comu\_f!(r, a, b, p, s) mul!(r, a, b, s, p) mul!(r, b, a, -s, true) return nothing end m1, m2, m3 = \[rand(ComplexF64, 10, 10) for \_ in 1:3\]…

---

## [How to insert a constant element at a list of indices of a Vector of Vectors/Matrices](https://discourse.julialang.org/t/how-to-insert-a-constant-element-at-a-list-of-indices-of-a-vector-of-vectors-matrices/92503)

<div class="topic-metadata">

**Author:** [@empet](https://discourse.julialang.org/u/empet)\
**Replies:** 2\
**Last updated:** [January 4, 2023, 12:49pm UTC](https://discourse.julialang.org/t/how-to-insert-a-constant-element-at-a-list-of-indices-of-a-vector-of-vectors-matrices/92503 "2023-01-04T12:49:52Z")

</div>

I have a vector of QuatRotation{Float64}, defined initially as: Q = Vector{QuatRotation{Float64}}(undef, 10) and a vector of indices ids= \[1, 4, 7\]. I want to insert at each index ∈ ids, the rotation Rotations.Unit…

---

## [Setting overal font in figure](https://discourse.julialang.org/t/setting-overal-font-in-figure/92497)

<div class="topic-metadata">

**Author:** [@mpirke](https://discourse.julialang.org/u/mpirke)\
**Replies:** 2\
**Last updated:** [January 4, 2023, 11:46am UTC](https://discourse.julialang.org/t/setting-overal-font-in-figure/92497 "2023-01-04T11:46:45Z")

</div>

Hey out there! I have the following problem. I want to set the font for all my plots in Make to a certain font, for example Times New Roman. The following is not working. \[276b4fcb\] WGLMakie v0.8.3 julia\> using WGLMa…

---

## [Is there something like the get() function for namedTuples?](https://discourse.julialang.org/t/is-there-something-like-the-get-function-for-namedtuples/92463)

<div class="topic-metadata">

**Author:** [@rakshith95](https://discourse.julialang.org/u/rakshith95)\
**Replies:** 3\
**Last updated:** [January 4, 2023, 10:50am UTC](https://discourse.julialang.org/t/is-there-something-like-the-get-function-for-namedtuples/92463 "2023-01-04T10:50:18Z")

</div>

Hello, Is there an equivalent of the get() function for dictionaries for NamedTuples? I want to get the value for the ‘key’ of a NamedTuple if it exists, and if it does not assign it to some default value; pretty much …

---

## [Are there any julia zmq.jl examples](https://discourse.julialang.org/t/are-there-any-julia-zmq-jl-examples/76996)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 4\
**Last updated:** [January 4, 2023, 10:12am UTC](https://discourse.julialang.org/t/are-there-any-julia-zmq-jl-examples/76996 "2023-01-04T10:12:39Z")

</div>

I am investigating using ZMQ to move a data stream around my project and would like to see some examples but I can’t find any for julia. My use case is to take streamed data and filter it to other julia scripts running …

---

## [Getting SQLite data without runtime dispatch](https://discourse.julialang.org/t/getting-sqlite-data-without-runtime-dispatch/91789)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 1\
**Last updated:** [January 4, 2023, 4:26am UTC](https://discourse.julialang.org/t/getting-sqlite-data-without-runtime-dispatch/91789 "2023-01-04T04:26:42Z")

</div>

I can’t figure out how to avoid runtime dispatch when using SQLite (or understand if the profiler is indicating incorrectly). I ran @profview, and it’s showing most of the time in SQLite.getvalue, I think the call to sql…

---

## [Resize! and empty! immediately, why?](https://discourse.julialang.org/t/resize-and-empty-immediately-why/92093)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 7\
**Last updated:** [January 4, 2023, 4:20am UTC](https://discourse.julialang.org/t/resize-and-empty-immediately-why/92093 "2023-01-04T04:20:32Z")

</div>

hello, found someone else’s code like this abstract type AbstractFoo{T} end struct Foo{T} \<: AbstractFoo{T} a::Vector{T} function Foo{T}(size::Int) where T foo = new(T\[\]) resize!(foo.a, size) …

---

## [Dot product not parallelized on cluster](https://discourse.julialang.org/t/dot-product-not-parallelized-on-cluster/92472)

<div class="topic-metadata">

**Author:** [@nbakas](https://discourse.julialang.org/u/nbakas)\
**Replies:** 4\
**Last updated:** [January 4, 2023, 3:12am UTC](https://discourse.julialang.org/t/dot-product-not-parallelized-on-cluster/92472 "2023-01-04T03:12:00Z")

</div>

I am trying to optimize a code involving a dot product which is called many times. I run the code on a cluster’s node with 256 threads, using the built-in dot. I check with htop the performance of the threads, and only…

---

## [Wrong derivatives saved with SavingCallback](https://discourse.julialang.org/t/wrong-derivatives-saved-with-savingcallback/92471)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 1\
**Last updated:** [January 4, 2023, 2:40am UTC](https://discourse.julialang.org/t/wrong-derivatives-saved-with-savingcallback/92471 "2023-01-04T02:40:34Z")

</div>

I’m trying to save the derivative values from an ODE using SavingCallback from DiffEqCallbacks.jl. Why is manual\_du not the same as save\_du.saveval in this code? Am I misunderstanding when these values are saved, or is t…

---

## [What is the deal with copy/paste in the vscode terminal?](https://discourse.julialang.org/t/what-is-the-deal-with-copy-paste-in-the-vscode-terminal/92478)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 5\
**Last updated:** [January 4, 2023, 1:49am UTC](https://discourse.julialang.org/t/what-is-the-deal-with-copy-paste-in-the-vscode-terminal/92478 "2023-01-04T01:49:26Z")

</div>

ctrl-c and ctrl-v used to work (1.66.2). Now I am unable to persuade vscode to use these keys to copy from/ paste to the terminal. Any clues?

---

## [Peculiarity with plotting \`seriestype = :straightlines\`](https://discourse.julialang.org/t/peculiarity-with-plotting-seriestype-straightlines/92299)

<div class="topic-metadata">

**Author:** [@Jollywatt](https://discourse.julialang.org/u/Jollywatt)\
**Replies:** 2\
**Last updated:** [January 4, 2023, 1:06am UTC](https://discourse.julialang.org/t/peculiarity-with-plotting-seriestype-straightlines/92299 "2023-01-04T01:06:27Z")

</div>

I’m trying to plot a bunch of infinite straight lines, where each line is defined by a pair of points. julia\> lines = hcat(\[\[(0, 0), (cos(θ), sin(θ))\] for θ=range(0, π, 10)\]...) 2×10 Matrix{Tuple{Real, Real}}: (0, 0) …

---

## [Exponential of a "large" vector is faster in Matlab](https://discourse.julialang.org/t/exponential-of-a-large-vector-is-faster-in-matlab/92468)

<div class="topic-metadata">

**Author:** [@alexdmeyer](https://discourse.julialang.org/u/alexdmeyer)\
**Replies:** 5\
**Last updated:** [January 4, 2023, 12:04am UTC](https://discourse.julialang.org/t/exponential-of-a-large-vector-is-faster-in-matlab/92468 "2023-01-04T00:04:27Z")

</div>

Hi Julia folks, In my current project, the rate-limiting step of a simulation model is evaluating the element-wise exponential of a vector with about N = 30,000 elements: # Julia MWE using Random trials = 10^4 # numb…

---

## [Importing a julia variable into python using PyCall](https://discourse.julialang.org/t/importing-a-julia-variable-into-python-using-pycall/92470)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 1\
**Last updated:** [January 3, 2023, 11:58pm UTC](https://discourse.julialang.org/t/importing-a-julia-variable-into-python-using-pycall/92470 "2023-01-03T23:58:09Z")

</div>

Why does the following code produce an error? A = 2+2 py""" B = 2 C = A + B """ The error produced is: NameError(“name ‘A’ is not defined”) I guess that I need to pass A into the pycall, but how?

---

## [Unexpected behavior of @async](https://discourse.julialang.org/t/unexpected-behavior-of-async/91921)

<div class="topic-metadata">

**Author:** [@sparrowhawk](https://discourse.julialang.org/u/sparrowhawk)\
**Replies:** 6\
**Last updated:** [January 3, 2023, 11:20pm UTC](https://discourse.julialang.org/t/unexpected-behavior-of-async/91921 "2023-01-03T23:20:11Z")

</div>

I find this easiest to explain with an MWE. Basically, @async is changing values in a remote task when I think it shouldn’t. (Julia 1.8.1) using Distributed fnames = \["inside\_1", "inside\_2"\] addprocs(length(fnames)) @…

---

## [Error when build MATLAB](https://discourse.julialang.org/t/error-when-build-matlab/92050)

<div class="topic-metadata">

**Author:** [@jxpeng98](https://discourse.julialang.org/u/jxpeng98)\
**Replies:** 2\
**Last updated:** [January 3, 2023, 10:40pm UTC](https://discourse.julialang.org/t/error-when-build-matlab/92050 "2023-01-03T22:40:01Z")

</div>

Hello everyone, I use MacBook Pro M1 Max with macOS 13.2. When I try to add the package with MATLAB R2022b. I will get the error: Building MATLAB → \`~/.julia/scratchspaces/44cfe95a-1eb2-52ea-b672-e2afdf69b78f/e263…

---

## [Reading headers of delimited files](https://discourse.julialang.org/t/reading-headers-of-delimited-files/92464)

<div class="topic-metadata">

**Author:** [@DanDeepPhase](https://discourse.julialang.org/u/DanDeepPhase)\
**Replies:** 1\
**Last updated:** [January 3, 2023, 6:54pm UTC](https://discourse.julialang.org/t/reading-headers-of-delimited-files/92464 "2023-01-03T18:54:06Z")

</div>

I frequently have to read CSVs that mix headers and data. Currently i have a hacky workflow, which could use some help. The header information needs to be parsed, and cannot be discarded. The files take two general form…

---

## [How to run julia code that depends on other packages in Jenkins？](https://discourse.julialang.org/t/how-to-run-julia-code-that-depends-on-other-packages-in-jenkins/92388)

<div class="topic-metadata">

**Author:** [@YiboXia](https://discourse.julialang.org/u/YiboXia)\
**Replies:** 15\
**Last updated:** [January 3, 2023, 4:37pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-that-depends-on-other-packages-in-jenkins/92388 "2023-01-03T16:37:33Z")

</div>

Hi guys, I try to run some codes with the help of Jenkins. OS is win10. I tried this command but failed: cd E:\\\\sim\_1\\scripts set JULIA\_NUM\_THREADS=8 julia E:\\\\sim\_1\\scripts\\main.jl error says that julia is not a comm…

---

## [Accuracy issues on Flux](https://discourse.julialang.org/t/accuracy-issues-on-flux/92016)

<div class="topic-metadata">

**Author:** [@Radu\_Mihai\_Diaconu](https://discourse.julialang.org/u/Radu_Mihai_Diaconu)\
**Replies:** 25\
**Last updated:** [January 3, 2023, 3:43pm UTC](https://discourse.julialang.org/t/accuracy-issues-on-flux/92016 "2023-01-03T15:43:17Z")

</div>

Hello guys. I have a problem with Flux. I have a very low accuracy (about 50%) on this code and I dont know why. i converted some tf code to Flux bu i dont get the issue. i mention that i am new to Julia and Flux so mayb…

---

## [Cannot add RxInfer latest version](https://discourse.julialang.org/t/cannot-add-rxinfer-latest-version/91910)

<div class="topic-metadata">

**Author:** [@BinaryBot](https://discourse.julialang.org/u/BinaryBot)\
**Replies:** 1\
**Last updated:** [January 3, 2023, 2:14pm UTC](https://discourse.julialang.org/t/cannot-add-rxinfer-latest-version/91910 "2023-01-03T14:14:10Z")

</div>

Although there exists a newer RxInfer package, Julia only downloads v1.0.0 and refuses to update either. I have tried \]update, but Julia makes no changes to the manifest or the project. I am using the latest 1.8.3 Julia …

---

## [Segmentation fault using Plots in 1.8.4](https://discourse.julialang.org/t/segmentation-fault-using-plots-in-1-8-4/92456)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 6\
**Last updated:** [January 3, 2023, 1:21pm UTC](https://discourse.julialang.org/t/segmentation-fault-using-plots-in-1-8-4/92456 "2023-01-03T13:21:31Z")

</div>

I’m experiencing a segmentation fault when using Plots in 1.8.4. Thing I have done recently: upgraded Mint to 21 (fresh install) installed (with juliaup) the 1.9.0-beta2 version of julia, and added Plots to it The p…

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

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