# General Usage

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

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

**Page:** 146

---

## [How to improve efficiency of my linear algebra code (matrix equivalency)](https://discourse.julialang.org/t/how-to-improve-efficiency-of-my-linear-algebra-code-matrix-equivalency/110572)

<div class="topic-metadata">

**Author:** [@Leo\_I](https://discourse.julialang.org/u/Leo_I)\
**Replies:** 33\
**Last updated:** [July 29, 2024, 8:23pm UTC](https://discourse.julialang.org/t/how-to-improve-efficiency-of-my-linear-algebra-code-matrix-equivalency/110572 "2024-07-29T20:23:20Z")

</div>

I wish to write a function decompose\_diag\_over\_field! that, given an mxn matrix X over a field, decomposes it in-place as X=U\*D\*V, where D is a diagonal mxn matrix and U,V are invertible mxm and nxn matrices, with inver…

---

## [Pkg.update fail SSL](https://discourse.julialang.org/t/pkg-update-fail-ssl/114305)

<div class="topic-metadata">

**Author:** [@daro.slai](https://discourse.julialang.org/u/daro.slai)\
**Replies:** 7\
**Last updated:** [July 29, 2024, 6:39pm UTC](https://discourse.julialang.org/t/pkg-update-fail-ssl/114305 "2024-07-29T18:39:26Z")

</div>

Hi everyone, I’m trying to Pkg.update() a project / env I’m working on and I get the following error: ERROR: GitError(Code:ERROR, Class:SSL, Your Julia is built with a SSL/TLS engine that libgit2 doesn't know how to co…

---

## [Thread-safe array building](https://discourse.julialang.org/t/thread-safe-array-building/3275)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 21\
**Last updated:** [October 24, 2017, 4:09pm UTC](https://discourse.julialang.org/t/thread-safe-array-building/3275 "2017-10-24T16:09:35Z")

</div>

I want to use threading to build a result. But it seems push! isn’t thread-safe: num\_monte = Int(1e6) solution\_data = Vector{Float64}() Threads.@threads for i in 1:num\_monte push!(solution\_data,i) …

---

## [Objects not being finalized until exit() when using multithreading. Is this a bug?](https://discourse.julialang.org/t/objects-not-being-finalized-until-exit-when-using-multithreading-is-this-a-bug/117595)

<div class="topic-metadata">

**Author:** [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Replies:** 2\
**Last updated:** [July 29, 2024, 4:17pm UTC](https://discourse.julialang.org/t/objects-not-being-finalized-until-exit-when-using-multithreading-is-this-a-bug/117595 "2024-07-29T16:17:21Z")

</div>

Here’s a script which defines a mutable struct Foo, creates 10 of them, loops over them using Threads.@threads and then calls GC: mutable struct Foo value::Int function Foo(value) finalizer(new(value)) d…

---

## [UDE: Estimating multiple parameters with NN and choosing best optimizers](https://discourse.julialang.org/t/ude-estimating-multiple-parameters-with-nn-and-choosing-best-optimizers/116444)

<div class="topic-metadata">

**Author:** [@MINimal-Code](https://discourse.julialang.org/u/MINimal-Code)\
**Replies:** 6\
**Last updated:** [July 29, 2024, 1:22pm UTC](https://discourse.julialang.org/t/ude-estimating-multiple-parameters-with-nn-and-choosing-best-optimizers/116444 "2024-07-29T13:22:47Z")

</div>

Hello, I am currently trying to implement a UDE to help me create a formulation for 2 parameters in a lung model. The code is based on the tutorial https://docs.sciml.ai/Overview/dev/showcase/missing\_physics/#Visualizing…

---

## [Does Julia support Chinese characters when plotting graph?](https://discourse.julialang.org/t/does-julia-support-chinese-characters-when-plotting-graph/81806)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 2\
**Last updated:** [July 29, 2024, 7:42am UTC](https://discourse.julialang.org/t/does-julia-support-chinese-characters-when-plotting-graph/81806 "2024-07-29T07:42:04Z")

</div>

Dear all , How to dispaly Chinese characters in the graph? julia\> y = rand(10); julia\> t = 1:10; julia\> plot(t, y, xlabel = "时间") GKS: glyph missing from current font: 26102 GKS: glyph missing from current font: 3838…

---

## [Use multiple output neural network in NeuralPDE](https://discourse.julialang.org/t/use-multiple-output-neural-network-in-neuralpde/117225)

<div class="topic-metadata">

**Author:** [@gradureau](https://discourse.julialang.org/u/gradureau)\
**Replies:** 2\
**Last updated:** [July 29, 2024, 8:39am UTC](https://discourse.julialang.org/t/use-multiple-output-neural-network-in-neuralpde/117225 "2024-07-29T08:39:41Z")

</div>

Hey everyone, I am trying out neural PDE to solve Euler’s equations in 1D. In my problem, I have two inputs : t and x, and I have three outputs : density ρ, velocity v and pressure p. Here are the equations: \\partial\_t…

---

## [Artifacts folder not empty - error when installing Plots.jl](https://discourse.julialang.org/t/artifacts-folder-not-empty-error-when-installing-plots-jl/117289)

<div class="topic-metadata">

**Author:** [@c\_sell](https://discourse.julialang.org/u/c_sell)\
**Replies:** 5\
**Last updated:** [July 29, 2024, 8:05am UTC](https://discourse.julialang.org/t/artifacts-folder-not-empty-error-when-installing-plots-jl/117289 "2024-07-29T08:05:32Z")

</div>

Hi, I’m getting the same error for different packages in Julia. For example, when I try to install Plots, I get the error. IOError: rm("C:\\\\Users\\\\\_\_\_\\\\.julia\\\\artifacts\\\\jl\_6eeUjb\\\\bin"): directory not empty (ENOTEMPT…

---

## [How to achieve Non blocking IO with Julia](https://discourse.julialang.org/t/how-to-achieve-non-blocking-io-with-julia/117503)

<div class="topic-metadata">

**Author:** [@Chamika\_Kasun](https://discourse.julialang.org/u/Chamika_Kasun)\
**Replies:** 3\
**Last updated:** [July 29, 2024, 6:48am UTC](https://discourse.julialang.org/t/how-to-achieve-non-blocking-io-with-julia/117503 "2024-07-29T06:48:23Z")

</div>

I have a function that is executed through a Julia thread. In this function, there is a execute\_psql\_string\_await function that performs a PostgreSQL stored procedure call using the LibPQ library. Currently, while this q…

---

## [Wrapping Unitful macros](https://discourse.julialang.org/t/wrapping-unitful-macros/95171)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 2\
**Last updated:** [March 18, 2023, 9:44pm UTC](https://discourse.julialang.org/t/wrapping-unitful-macros/95171 "2023-03-18T21:44:54Z")

</div>

Inspired by a commenter on Unitful.jl I’m trying to do unitful calculations with bookshelves: how many books do I have in 10 book cases? (20book / shelf) \* (8shelf / case) \* (10case) == 1600book I would like to replace…

---

## [Why isn't \`Vector{\<:Float64}\` reduced to \`Vector{Float64}\`?](https://discourse.julialang.org/t/why-isnt-vector-float64-reduced-to-vector-float64/117555)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 16\
**Last updated:** [July 28, 2024, 10:25pm UTC](https://discourse.julialang.org/t/why-isnt-vector-float64-reduced-to-vector-float64/117555 "2024-07-28T22:25:38Z")

</div>

I’m not sure if I misremembered, but I thought when applying \<: to a type parameter that represents a concrete type, \<: would automatically be removed. However, it seems that in Julia 1.10 and 1.11, that’s not the case,…

---

## [Code review: parser and error propagation](https://discourse.julialang.org/t/code-review-parser-and-error-propagation/117563)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 3\
**Last updated:** [July 28, 2024, 3:07pm UTC](https://discourse.julialang.org/t/code-review-parser-and-error-propagation/117563 "2024-07-28T15:07:24Z")

</div>

I need to write parsers for ad-hoc data formats from time to time. I’ve always wondered if I’m propagating errors in a “Julian” way. I don’t know if it’s the best to represent errors by nothing as in Base.tryparse, a cus…

---

## [Access to the documentation while working offline](https://discourse.julialang.org/t/access-to-the-documentation-while-working-offline/117536)

<div class="topic-metadata">

**Author:** [@indymnv](https://discourse.julialang.org/u/indymnv)\
**Replies:** 6\
**Last updated:** [July 28, 2024, 10:18am UTC](https://discourse.julialang.org/t/access-to-the-documentation-while-working-offline/117536 "2024-07-28T10:18:21Z")

</div>

Hi community! For a couple of weeks, I will have limited access to the internet, and I would like to know if there is a way to get full access to the package documentation offline, especially packages related to DataFram…

---

## [How to extract type parameters that are used as upper bounds in \`UnionAll\`?](https://discourse.julialang.org/t/how-to-extract-type-parameters-that-are-used-as-upper-bounds-in-unionall/117557)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 1\
**Last updated:** [July 28, 2024, 7:30am UTC](https://discourse.julialang.org/t/how-to-extract-type-parameters-that-are-used-as-upper-bounds-in-unionall/117557 "2024-07-28T07:30:05Z")

</div>

MWE: julia\> const DictPar{T, V} = Dict{T, \<:V} Dict{T, \<:V} where {T, V} julia\> getPar(::Type{D}) where {T, V, D\<:DictPar{T, V}} = (T, V) getPar (generic function with 1 method) julia\> d = DictPar{Int, Real} Dict{Int6…

---

## [\`include\` calls in a Julia package](https://discourse.julialang.org/t/include-calls-in-a-julia-package/117558)

<div class="topic-metadata">

**Author:** [@Santiago\_Lopez](https://discourse.julialang.org/u/Santiago_Lopez)\
**Replies:** 2\
**Last updated:** [July 28, 2024, 3:58am UTC](https://discourse.julialang.org/t/include-calls-in-a-julia-package/117558 "2024-07-28T03:58:59Z")

</div>

Assume we are developing a package called MyPkg. Step 3 of this tutorial states that, in order to export our package functions, we should add the following to our src/MyPkg.jl file: A statement export my\_function A sta…

---

## [Create Generic Function Without Macros From String and Symbolic Variable](https://discourse.julialang.org/t/create-generic-function-without-macros-from-string-and-symbolic-variable/117535)

<div class="topic-metadata">

**Author:** [@brombo](https://discourse.julialang.org/u/brombo)\
**Replies:** 13\
**Last updated:** [July 28, 2024, 12:15am UTC](https://discourse.julialang.org/t/create-generic-function-without-macros-from-string-and-symbolic-variable/117535 "2024-07-28T00:15:57Z")

</div>

I know you can create a function, say f(t) where t is a symbolic variable with a macro. How can you do it without using a macro where I have previously defined t. More specifically I wish to define several different fu…

---

## [Julia 1.7 sort issue?](https://discourse.julialang.org/t/julia-1-7-sort-issue/117531)

<div class="topic-metadata">

**Author:** [@danny.s](https://discourse.julialang.org/u/danny.s)\
**Replies:** 5\
**Last updated:** [July 28, 2024, 12:03am UTC](https://discourse.julialang.org/t/julia-1-7-sort-issue/117531 "2024-07-28T00:03:02Z")

</div>

I was trying to do some lexicographic sorting and came up with this “simple” code (sorry for the kinda long matrix, everything seems to work fine for the full slice): final\_pts = \[0.5 0.1127016653792583 0.61169334321448…

---

## [Gtk4.jl open\_dialog warning](https://discourse.julialang.org/t/gtk4-jl-open-dialog-warning/117553)

<div class="topic-metadata">

**Author:** [@janonime](https://discourse.julialang.org/u/janonime)\
**Replies:** 0\
**Last updated:** [July 27, 2024, 10:09pm UTC](https://discourse.julialang.org/t/gtk4-jl-open-dialog-warning/117553 "2024-07-27T22:09:26Z")

</div>

Minimal working example of the problem: using Gtk4 win = GtkWindow("Plasmatrace") open\_dialog("Pick a file to open", win) do filename println(filename) end destroy(win) Storing this script in a file called test.j…

---

## [Handling large values correctly](https://discourse.julialang.org/t/handling-large-values-correctly/117537)

<div class="topic-metadata">

**Author:** [@vh94](https://discourse.julialang.org/u/vh94)\
**Replies:** 4\
**Last updated:** [July 27, 2024, 9:27pm UTC](https://discourse.julialang.org/t/handling-large-values-correctly/117537 "2024-07-27T21:27:35Z")

</div>

I repeatedly run into issues handling large values (values beyond 1e+15), and couldn’t find a clear answer on how to address those. Consider following comparison: (1.0e+16 + 1 + 1 + 1) \> 1.0e+16 will wrongfully return…

---

## [How to create a struct from a dict](https://discourse.julialang.org/t/how-to-create-a-struct-from-a-dict/117550)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 7\
**Last updated:** [July 27, 2024, 9:32pm UTC](https://discourse.julialang.org/t/how-to-create-a-struct-from-a-dict/117550 "2024-07-27T21:32:08Z")

</div>

I have a Dict from parsing a JSON message, and want to convert it into a struct. This works: using StaticArrays const MyFloat = Float64 sys\_state\_dict = Dict(:time =\> 0, :t\_sim =\> 0, :sys\_state =\> 0,…

---

## [How can an user load a package extension?](https://discourse.julialang.org/t/how-can-an-user-load-a-package-extension/117323)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 13\
**Last updated:** [July 27, 2024, 4:57pm UTC](https://discourse.julialang.org/t/how-can-an-user-load-a-package-extension/117323 "2024-07-27T16:57:48Z")

</div>

I have read Julia’s documentation about package extensions as well as this GitHub example and though I first thought it was suitable for my use case, it seems it isn’t. I have in my package a mutable struct SolveParamet…

---

## [Make ProgressMeter description display depends on a for-loop variable](https://discourse.julialang.org/t/make-progressmeter-description-display-depends-on-a-for-loop-variable/117509)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 3\
**Last updated:** [July 27, 2024, 12:49pm UTC](https://discourse.julialang.org/t/make-progressmeter-description-display-depends-on-a-for-loop-variable/117509 "2024-07-27T12:49:53Z")

</div>

The following works well: using ProgressMeter @showprogress dt=1 desc="Computing ..." for c in 1:100\_000 # Some computing end However, I’d like the description to display some string that depends on c: using Progr…

---

## [Passing simulation parameters into app](https://discourse.julialang.org/t/passing-simulation-parameters-into-app/117438)

<div class="topic-metadata">

**Author:** [@markowkes](https://discourse.julialang.org/u/markowkes)\
**Replies:** 3\
**Last updated:** [July 27, 2024, 10:50am UTC](https://discourse.julialang.org/t/passing-simulation-parameters-into-app/117438 "2024-07-27T10:50:48Z")

</div>

I’m trying to use PackageCompiler to make my code into an app to share. The compiler is working, but it’s forcing me to modify how I deal with input parameters. The code takes in a number of inputs (including functions…

---

## [Export julia code from VSCode to html](https://discourse.julialang.org/t/export-julia-code-from-vscode-to-html/117480)

<div class="topic-metadata">

**Author:** [@Gilles\_Dubois](https://discourse.julialang.org/u/Gilles_Dubois)\
**Replies:** 15\
**Last updated:** [July 27, 2024, 5:22am UTC](https://discourse.julialang.org/t/export-julia-code-from-vscode-to-html/117480 "2024-07-27T05:22:08Z")

</div>

Hi everybody ! Some IDEs for instance Pycharm propose export to html format directly from the main menu . I decided to shift to VSCode (Visual Studio) and expected the same. In vain … So I began to understand that it…

---

## [Custom implicit type conversion](https://discourse.julialang.org/t/custom-implicit-type-conversion/117315)

<div class="topic-metadata">

**Author:** [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Replies:** 14\
**Last updated:** [July 27, 2024, 1:37am UTC](https://discourse.julialang.org/t/custom-implicit-type-conversion/117315 "2024-07-27T01:37:18Z")

</div>

I would like to specify my own implicit type conversion and according to Conversion and Promotion · The Julia Language I should be able to do something like: julia\> struct AA end julia\> Base.convert(::Type{Float64}, x:…

---

## [Exponentiation of floats](https://discourse.julialang.org/t/exponentiation-of-floats/105951)

<div class="topic-metadata">

**Author:** [@richard\_sti](https://discourse.julialang.org/u/richard_sti)\
**Replies:** 25\
**Last updated:** [July 26, 2024, 10:52pm UTC](https://discourse.julialang.org/t/exponentiation-of-floats/105951 "2024-07-26T22:52:01Z")

</div>

Hi, I noticed that there is a significant loss of performance between Julia 1.7.3 and 1.9.x for exponentiation of floats, which becomes ~ 5 times slower. I tested this independently on a few machines. A minimal example o…

---

## [FFTW x 2 = symbol lookup error](https://discourse.julialang.org/t/fftw-x-2-symbol-lookup-error/117528)

<div class="topic-metadata">

**Author:** [@moble](https://discourse.julialang.org/u/moble)\
**Replies:** 8\
**Last updated:** [July 26, 2024, 10:47pm UTC](https://discourse.julialang.org/t/fftw-x-2-symbol-lookup-error/117528 "2024-07-26T22:47:04Z")

</div>

I have a package that uses FFTW (via FastTransforms). A user is trying to load it in python (via PythonCall), along with any one of various other python packages that also use FFTW. Apparently, the latter include share…

---

## [Help writing a \`collect\` for iterators](https://discourse.julialang.org/t/help-writing-a-collect-for-iterators/117494)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 11\
**Last updated:** [July 26, 2024, 8:38pm UTC](https://discourse.julialang.org/t/help-writing-a-collect-for-iterators/117494 "2024-07-26T20:38:58Z")

</div>

Here is a task that I am having a hard time to accomplish with Julia Base: Given an iterator iter and a set of linear indices inds, write a function collectat(iter, inds) that collects the iterator at the indices witho…

---

## [Dagger one task per group in GDTable](https://discourse.julialang.org/t/dagger-one-task-per-group-in-gdtable/117530)

<div class="topic-metadata">

**Author:** [@SamTheGeneticCoder](https://discourse.julialang.org/u/SamTheGeneticCoder)\
**Replies:** 0\
**Last updated:** [July 26, 2024, 7:55pm UTC](https://discourse.julialang.org/t/dagger-one-task-per-group-in-gdtable/117530 "2024-07-26T19:55:57Z")

</div>

Hi! I’m new to distributed computing with Julia and I’m trying to figure out how to make this problem work fine. I’d like to make spawning tasks on each group of a GDTable as efficient as possible. I have a GDTable of …

---

## [NaN-aware \`imresize\`](https://discourse.julialang.org/t/nan-aware-imresize/117526)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 3\
**Last updated:** [July 26, 2024, 7:27pm UTC](https://discourse.julialang.org/t/nan-aware-imresize/117526 "2024-07-26T19:27:51Z")

</div>

Is there an easy way hack ImageTransforms.imresize to not propagate NaN values? julia\> using ImageTransformations julia\> im = Float32\[ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 NaN \] 4×4 Matr…

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

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