# General Usage

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

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

**Page:** 196

---

## [Best practices for feature compatible only with specific version of dependency](https://discourse.julialang.org/t/best-practices-for-feature-compatible-only-with-specific-version-of-dependency/110792)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 0\
**Last updated:** [February 26, 2024, 4:57pm UTC](https://discourse.julialang.org/t/best-practices-for-feature-compatible-only-with-specific-version-of-dependency/110792 "2024-02-26T16:57:44Z")

</div>

In my DocumenterInterLinks package, I would like to add a specific feature that is compatible only with Documenter \>= 1.3.0. Generally, the package is compatible with Documenter \>= 1.0.0, and I’d like to keep it that way…

---

## [Adding the result of a tensor contraction to a preallocated array](https://discourse.julialang.org/t/adding-the-result-of-a-tensor-contraction-to-a-preallocated-array/110789)

<div class="topic-metadata">

**Author:** [@paulp](https://discourse.julialang.org/u/paulp)\
**Replies:** 0\
**Last updated:** [February 26, 2024, 4:19pm UTC](https://discourse.julialang.org/t/adding-the-result-of-a-tensor-contraction-to-a-preallocated-array/110789 "2024-02-26T16:19:40Z")

</div>

Hi all, I’d like to perform an arbitrary contraction between two tensors and add the result to an existing array, without allocating an additional array. Tullio has the operation that I want, here is a simple example: u…

---

## [Installation error](https://discourse.julialang.org/t/installation-error/110785)

<div class="topic-metadata">

**Author:** [@Igor](https://discourse.julialang.org/u/Igor)\
**Replies:** 2\
**Last updated:** [February 26, 2024, 3:47pm UTC](https://discourse.julialang.org/t/installation-error/110785 "2024-02-26T15:47:59Z")

</div>

Installation not finished. Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use statu…

---

## [How do I make background in Makie transparent](https://discourse.julialang.org/t/how-do-i-make-background-in-makie-transparent/61958)

<div class="topic-metadata">

**Author:** [@Wei\_Yang](https://discourse.julialang.org/u/Wei_Yang)\
**Replies:** 12\
**Last updated:** [February 26, 2024, 3:18pm UTC](https://discourse.julialang.org/t/how-do-i-make-background-in-makie-transparent/61958 "2024-02-26T15:18:17Z")

</div>

I’m trying to get plots with transparent (nothing at all) background in Makie using GLMakie F = Figure() ax = Axis(F\[1,1\]) θ = 0:0.1:2pi X = cos.(θ) Y = sin.(θ) lines!(X,Y) hidespines!(ax) hidedecorations!(ax) save("ic…

---

## [What is the fastest way to check if a hermitian matrix is positive semi-definite?](https://discourse.julialang.org/t/what-is-the-fastest-way-to-check-if-a-hermitian-matrix-is-positive-semi-definite/110769)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 7\
**Last updated:** [February 26, 2024, 1:46pm UTC](https://discourse.julialang.org/t/what-is-the-fastest-way-to-check-if-a-hermitian-matrix-is-positive-semi-definite/110769 "2024-02-26T13:46:00Z")

</div>

Hello, I would like to check if a hermitian matrix is positive semi-definite (the smallest eigenvalue is \>= 0). The simplest implementation would be using LinearAlgebra is\_positive(A::Hermitian) = eigmin(A) ≥ 0 and ru…

---

## [LibCEED.jl: do you use it?](https://discourse.julialang.org/t/libceed-jl-do-you-use-it/110737)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 0\
**Last updated:** [February 25, 2024, 2:04pm UTC](https://discourse.julialang.org/t/libceed-jl-do-you-use-it/110737 "2024-02-25T14:04:56Z")

</div>

I’d be interested in looking at some use cases for this library. If your package is on Github, do let me know. Many thanks!

---

## [Not able to use Plots.jl with Julia 1.8.0](https://discourse.julialang.org/t/not-able-to-use-plots-jl-with-julia-1-8-0/86076)

<div class="topic-metadata">

**Author:** [@geekbear](https://discourse.julialang.org/u/geekbear)\
**Replies:** 5\
**Last updated:** [February 25, 2024, 11:14pm UTC](https://discourse.julialang.org/t/not-able-to-use-plots-jl-with-julia-1-8-0/86076 "2024-02-25T23:14:30Z")

</div>

I updated Julia to 1.8.0 and then installed Plots.jl, and wasn’t able to execute the “using Plots” command. Ran Pkg.update() a few times to no avail. Got error messages below and have no clue what to do. Advice would be …

---

## [Simplify Julia Expr with Symbolics.jl](https://discourse.julialang.org/t/simplify-julia-expr-with-symbolics-jl/110094)

<div class="topic-metadata">

**Author:** [@VPBML](https://discourse.julialang.org/u/VPBML)\
**Replies:** 2\
**Last updated:** [February 25, 2024, 9:52pm UTC](https://discourse.julialang.org/t/simplify-julia-expr-with-symbolics-jl/110094 "2024-02-25T21:52:23Z")

</div>

Hi, Can we use Symbolics.jl to simplify Julia Expr directly? For example, simplifying :(a + b - a) to :(b)? Thank you.

---

## [Using Zygote.jl with IterativeSolvers.jl](https://discourse.julialang.org/t/using-zygote-jl-with-iterativesolvers-jl/107634)

<div class="topic-metadata">

**Author:** [@leespen1](https://discourse.julialang.org/u/leespen1)\
**Replies:** 11\
**Last updated:** [February 25, 2024, 9:08pm UTC](https://discourse.julialang.org/t/using-zygote-jl-with-iterativesolvers-jl/107634 "2024-02-25T21:08:40Z")

</div>

I have a code which solves an initial value problem of ODEs parameterized by a control vector, then uses the solution as an argument to calculate an objective function, which I compute the gradient of (by my own methods…

---

## [XLSX and DataFrame column type](https://discourse.julialang.org/t/xlsx-and-dataframe-column-type/110741)

<div class="topic-metadata">

**Author:** [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Replies:** 3\
**Last updated:** [February 25, 2024, 6:50pm UTC](https://discourse.julialang.org/t/xlsx-and-dataframe-column-type/110741 "2024-02-25T18:50:10Z")

</div>

Hello everyone :grin:, I want to load an excel file with the XLSX.jl package and then convert it to DataFrame with DataFrame.jl with the following code: data = DataFrame(XLSX.readtable(path\_data, "Sheet1")) However, t…

---

## [Why is this simple code type unstable?](https://discourse.julialang.org/t/why-is-this-simple-code-type-unstable/110734)

<div class="topic-metadata">

**Author:** [@photor](https://discourse.julialang.org/u/photor)\
**Replies:** 2\
**Last updated:** [February 25, 2024, 5:29pm UTC](https://discourse.julialang.org/t/why-is-this-simple-code-type-unstable/110734 "2024-02-25T17:29:40Z")

</div>

julia\> function test() for i=1:1 end end test (generic function with 1 method) julia\> @code\_warntype test() MethodInstance for test() from test() in Main at REPL\[1\]:1 Arguments #self#::Core.Const(test)…

---

## [LDA example in multivariatestats.jl flipped x and y values](https://discourse.julialang.org/t/lda-example-in-multivariatestats-jl-flipped-x-and-y-values/110508)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 4\
**Last updated:** [February 25, 2024, 2:08pm UTC](https://discourse.julialang.org/t/lda-example-in-multivariatestats-jl-flipped-x-and-y-values/110508 "2024-02-25T14:08:29Z")

</div>

Hello, good morning. Days ago I started looking the multivariatestats.jl to do some pca and lda analysis, and notice that lda plots data inverted in this example: https://juliastats.org/MultivariateStats.jl/stable/lda/ …

---

## [\[GMT.jl\] Text Encoding issue (UTF8)](https://discourse.julialang.org/t/gmt-jl-text-encoding-issue-utf8/110735)

<div class="topic-metadata">

**Author:** [@SingingKim](https://discourse.julialang.org/u/SingingKim)\
**Replies:** 2\
**Last updated:** [February 25, 2024, 1:28pm UTC](https://discourse.julialang.org/t/gmt-jl-text-encoding-issue-utf8/110735 "2024-02-25T13:28:59Z")

</div>

I’m new to GMT.jl and I am struggling with text function. using GMT text("대한민국", fmt="pdf", x=12, y=15, font=12, show=true) Give the following result: Can anyone help me with this issue? Thanks!

---

## [Advanced Metaprogramming Uses of QuoteNode](https://discourse.julialang.org/t/advanced-metaprogramming-uses-of-quotenode/110708)

<div class="topic-metadata">

**Author:** [@mnemnion](https://discourse.julialang.org/u/mnemnion)\
**Replies:** 1\
**Last updated:** [February 24, 2024, 10:28pm UTC](https://discourse.julialang.org/t/advanced-metaprogramming-uses-of-quotenode/110708 "2024-02-24T22:28:37Z")

</div>

Continuing the discussion from Is there a better way to write this macro?: Quoth The Manual: The parser yields QuoteNodes for simple quoted items like symbols. QuoteNode can also be used for certain advanced metapro…

---

## [Symbolics.jl convert string to symbolic equation](https://discourse.julialang.org/t/symbolics-jl-convert-string-to-symbolic-equation/110704)

<div class="topic-metadata">

**Author:** [@brombo](https://discourse.julialang.org/u/brombo)\
**Replies:** 3\
**Last updated:** [February 24, 2024, 10:17pm UTC](https://discourse.julialang.org/t/symbolics-jl-convert-string-to-symbolic-equation/110704 "2024-02-24T22:17:47Z")

</div>

Consider that I have a string S = "r^2\*sin(th)^2" that I want to convert to an Symbolics expression, Sexpr, so that - Derivative(r)\*Sexpr = 2\*r\*sin(th)^2 Derivative(th)\*Sexpr = 2r^2\*sin(th)\*cos(th) Basically I wish to…

---

## [Reducing Materialize in Profiling](https://discourse.julialang.org/t/reducing-materialize-in-profiling/110698)

<div class="topic-metadata">

**Author:** [@dennispureza](https://discourse.julialang.org/u/dennispureza)\
**Replies:** 5\
**Last updated:** [February 24, 2024, 5:50pm UTC](https://discourse.julialang.org/t/reducing-materialize-in-profiling/110698 "2024-02-24T17:50:51Z")

</div>

Hi! I am profiling my code and roughly 75% of the following line’s time is occupied with Materialize, any ideia how to optimize this? J = sum((dfdWdP.\*(f.- f̄ - ((f̃/g̃)\*(g.-ḡ)))), dims=1)' dfdWdP is a Matrix{Float64…

---

## [Is there a better way to write this macro?](https://discourse.julialang.org/t/is-there-a-better-way-to-write-this-macro/110610)

<div class="topic-metadata">

**Author:** [@mnemnion](https://discourse.julialang.org/u/mnemnion)\
**Replies:** 35\
**Last updated:** [February 24, 2024, 7:09pm UTC](https://discourse.julialang.org/t/is-there-a-better-way-to-write-this-macro/110610 "2024-02-24T19:09:51Z")

</div>

I’m working on a VM, of the classic dispatch-on-value sort, and the last step (which I’m bearing down on) will be to make it type stable. The current implementation uses a multimethod for dispatch, but the Vector holding…

---

## [Symbolics and vector](https://discourse.julialang.org/t/symbolics-and-vector/110457)

<div class="topic-metadata">

**Author:** [@blob](https://discourse.julialang.org/u/blob)\
**Replies:** 2\
**Last updated:** [February 24, 2024, 12:54pm UTC](https://discourse.julialang.org/t/symbolics-and-vector/110457 "2024-02-24T12:54:09Z")

</div>

So in a similar way to this post I wonder why I am getting the following: using Symbolics @variables x\[1:5\] y ex1 = x\[1\]^2+3\*x\[5\]+x\[3\]\*y ex2 = x\[1\]\*x\[2\]\*x\[4\]^2+10 Symbolics.jacobian(\[ex2\], x\[1:5\]) ###Works, gives : x…

---

## [Why do Julia BigInt iterative functions overflow?](https://discourse.julialang.org/t/why-do-julia-bigint-iterative-functions-overflow/110674)

<div class="topic-metadata">

**Author:** [@Claude\_Shannon](https://discourse.julialang.org/u/Claude_Shannon)\
**Replies:** 6\
**Last updated:** [February 23, 2024, 11:47pm UTC](https://discourse.julialang.org/t/why-do-julia-bigint-iterative-functions-overflow/110674 "2024-02-23T23:47:59Z")

</div>

Let’s say I want to write the factorial function in Julia in the following recursive way: FACTORIAL(n) = n==1 ? 1 : n\*BigInt(FACTORIAL(n-1)) Doing so, it shows the following error when trying to compute FACTORIAL(1e6) …

---

## [Inconsistent CPU utilisation in @threads loops](https://discourse.julialang.org/t/inconsistent-cpu-utilisation-in-threads-loops/110512)

<div class="topic-metadata">

**Author:** [@ysh](https://discourse.julialang.org/u/ysh)\
**Replies:** 20\
**Last updated:** [February 23, 2024, 8:55pm UTC](https://discourse.julialang.org/t/inconsistent-cpu-utilisation-in-threads-loops/110512 "2024-02-23T20:55:43Z")

</div>

Consider a MWE where some moderately-heavy calculations are performed in a parallel loop. Here, I am simulating the calculations by doing eigen: using LinearAlgebra, Random BLAS.set\_num\_threads(1) # turn off BLAS parall…

---

## [How do I create a Makie recipe with keyword-argument?](https://discourse.julialang.org/t/how-do-i-create-a-makie-recipe-with-keyword-argument/110641)

<div class="topic-metadata">

**Author:** [@Larbino1](https://discourse.julialang.org/u/Larbino1)\
**Replies:** 3\
**Last updated:** [February 23, 2024, 4:36pm UTC](https://discourse.julialang.org/t/how-do-i-create-a-makie-recipe-with-keyword-argument/110641 "2024-02-23T16:36:57Z")

</div>

Let me explain my case: I want to create a plotting function that plots a 3D transformation by drawing x-y-z axes relative to the origin. I’m not decided whether or not to use scatter or give it a custom name like plot…

---

## [Fast solution of a two-point boundary value problem with Shooting](https://discourse.julialang.org/t/fast-solution-of-a-two-point-boundary-value-problem-with-shooting/110531)

<div class="topic-metadata">

**Author:** [@flibe](https://discourse.julialang.org/u/flibe)\
**Replies:** 1\
**Last updated:** [February 23, 2024, 3:01pm UTC](https://discourse.julialang.org/t/fast-solution-of-a-two-point-boundary-value-problem-with-shooting/110531 "2024-02-23T15:01:05Z")

</div>

Dear All, I am trying to find a way to solve as fast as possible a two point boundary value problem (TPBVP) related to the optimal control of a storage system (it arises from the associated optimality necessary conditio…

---

## [Which matrix multiplication is more efficient? A\*B and C\*B or \[A; C\]\*B](https://discourse.julialang.org/t/which-matrix-multiplication-is-more-efficient-a-b-and-c-b-or-a-c-b/110636)

<div class="topic-metadata">

**Author:** [@MatheusJanczkowski](https://discourse.julialang.org/u/MatheusJanczkowski)\
**Replies:** 9\
**Last updated:** [February 23, 2024, 1:07pm UTC](https://discourse.julialang.org/t/which-matrix-multiplication-is-more-efficient-a-b-and-c-b-or-a-c-b/110636 "2024-02-23T13:07:25Z")

</div>

I have pairs of square matrix multiplications which share one of the matrices, for example: AB, CB, where A, B and C are real square matrices. My question is: is it more efficient to compute both multiplications separ…

---

## [Unit testing with generated code](https://discourse.julialang.org/t/unit-testing-with-generated-code/110614)

<div class="topic-metadata">

**Author:** [@mike.ingold](https://discourse.julialang.org/u/mike.ingold)\
**Replies:** 8\
**Last updated:** [February 23, 2024, 1:02pm UTC](https://discourse.julialang.org/t/unit-testing-with-generated-code/110614 "2024-02-23T13:02:04Z")

</div>

Problem Statement: I have a package where a number of functions are defined with multiple-dispatch signatures like f(x::A, y::B). Say that methods may be implemented for m types A and n types B and there are p functions,…

---

## [Fail to install FerriteViz package](https://discourse.julialang.org/t/fail-to-install-ferriteviz-package/110639)

<div class="topic-metadata">

**Author:** [@Hieu\_Huynh](https://discourse.julialang.org/u/Hieu_Huynh)\
**Replies:** 0\
**Last updated:** [February 23, 2024, 12:52pm UTC](https://discourse.julialang.org/t/fail-to-install-ferriteviz-package/110639 "2024-02-23T12:52:38Z")

</div>

Hello I’m new with Julia and trying to install the FerriteViz package. Almost everything is installed except for MathTexengine, Makie, and FerriteViz isn’t. When i tried to look for the error using julia\> err, it show P…

---

## [Skipping a lot of lines in CSV.read() allocates too much memory](https://discourse.julialang.org/t/skipping-a-lot-of-lines-in-csv-read-allocates-too-much-memory/110121)

<div class="topic-metadata">

**Author:** [@aris](https://discourse.julialang.org/u/aris)\
**Replies:** 77\
**Last updated:** [February 23, 2024, 11:30am UTC](https://discourse.julialang.org/t/skipping-a-lot-of-lines-in-csv-read-allocates-too-much-memory/110121 "2024-02-23T11:30:30Z")

</div>

Hello everyone, Consider the following example: using CSV, DataFrames number\_of\_lines = 10^4 CSV.write("data.csv", DataFrame(rand(number\_of\_lines,10), :auto)) steps = 20 chunk = round(Int,number\_of\_lines/steps) for …

---

## [Loading data sometimes very slow on HPC system](https://discourse.julialang.org/t/loading-data-sometimes-very-slow-on-hpc-system/110563)

<div class="topic-metadata">

**Author:** [@fgerick](https://discourse.julialang.org/u/fgerick)\
**Replies:** 24\
**Last updated:** [February 23, 2024, 11:19am UTC](https://discourse.julialang.org/t/loading-data-sometimes-very-slow-on-hpc-system/110563 "2024-02-23T11:19:13Z")

</div>

Hi there, I am processing a bunch of JLD2 files (O(10GB)) on my local cluster. Sometimes (not always), loading a file takes ages (\>10min), but sometimes it only takes ~10 seconds. Usually after loading it slowly once, t…

---

## [Cast Polygon to Multipolygon with ArchGDAL.jl](https://discourse.julialang.org/t/cast-polygon-to-multipolygon-with-archgdal-jl/110592)

<div class="topic-metadata">

**Author:** [@Jakob](https://discourse.julialang.org/u/Jakob)\
**Replies:** 2\
**Last updated:** [February 23, 2024, 8:32am UTC](https://discourse.julialang.org/t/cast-polygon-to-multipolygon-with-archgdal-jl/110592 "2024-02-23T08:32:31Z")

</div>

I have a Vector{IGeometry{wkbMultiPolygon}} which I need to simplify for plotting. However, doing ArchGDAL.simplify.(geoms, 0.001) results in some wkbMultiPolygons becoming wkbPolygons and Makie is not happy about the h…

---

## [Is the warning about \`@assert\` or \`AssertionError\`?](https://discourse.julialang.org/t/is-the-warning-about-assert-or-assertionerror/110613)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 7\
**Last updated:** [February 23, 2024, 3:22am UTC](https://discourse.julialang.org/t/is-the-warning-about-assert-or-assertionerror/110613 "2024-02-23T03:22:10Z")

</div>

I use the @assert macro all over the place, including inside struct constructors to make sure my types are following the restrictions they’re supposed to. The documentation on @assert says it is the preferred syntax for…

---

## [Yolov9 example in Julia](https://discourse.julialang.org/t/yolov9-example-in-julia/110619)

<div class="topic-metadata">

**Author:** [@Jose\_Diaz](https://discourse.julialang.org/u/Jose_Diaz)\
**Replies:** 0\
**Last updated:** [February 23, 2024, 2:03am UTC](https://discourse.julialang.org/t/yolov9-example-in-julia/110619 "2024-02-23T02:03:44Z")

</div>

I wrote a tiny example, it’s not perfect but it can give an idea on how to use this model with onnxruntime in Julia

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

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