# General Usage

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

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

**Page:** 133

---

## [A lot of memory only loading modules!](https://discourse.julialang.org/t/a-lot-of-memory-only-loading-modules/119295)

<div class="topic-metadata">

**Author:** [@Ronneesley](https://discourse.julialang.org/u/Ronneesley)\
**Replies:** 8\
**Last updated:** [September 14, 2024, 4:35am UTC](https://discourse.julialang.org/t/a-lot-of-memory-only-loading-modules/119295 "2024-09-14T04:35:03Z")

</div>

Hi, I’m study why my modules requires a lot of memory \> 500MB. So I decided to study the growth of memory of my modules. I discovered that only one module using LibPQ let Julia use 213,1 MB. If I compare only Julia RE…

---

## [Correct way to benchmark StaticVectors](https://discourse.julialang.org/t/correct-way-to-benchmark-staticvectors/119357)

<div class="topic-metadata">

**Author:** [@bthorne93](https://discourse.julialang.org/u/bthorne93)\
**Replies:** 4\
**Last updated:** [September 13, 2024, 5:01pm UTC](https://discourse.julialang.org/t/correct-way-to-benchmark-staticvectors/119357 "2024-09-13T17:01:22Z")

</div>

I am writing some code to do geometric intersection tests using StaticArrays.jl. I would like to keep some benchmarks as I am developing and would like to know if I am benchmarking static arrays correctly. The documenta…

---

## [Does GC.@preserve v preserve elements of vector v?](https://discourse.julialang.org/t/does-gc-preserve-v-preserve-elements-of-vector-v/119375)

<div class="topic-metadata">

**Author:** [@grasph](https://discourse.julialang.org/u/grasph)\
**Replies:** 0\
**Last updated:** [September 13, 2024, 3:11pm UTC](https://discourse.julialang.org/t/does-gc-preserve-v-preserve-elements-of-vector-v/119375 "2024-09-13T15:11:11Z")

</div>

Hello, I need to preserve from GC a list of arrays define at runtime. In the following code, will the GC.@preserve statement preserve the content of v\[1\] to be garbage collected and ensure p to be valid ? v = \[ \[1, 2\]…

---

## [SVectors + @reset from Accessors: Strange Benchmarks](https://discourse.julialang.org/t/svectors-reset-from-accessors-strange-benchmarks/119201)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 31\
**Last updated:** [September 13, 2024, 3:00pm UTC](https://discourse.julialang.org/t/svectors-reset-from-accessors-strange-benchmarks/119201 "2024-09-13T15:00:53Z")

</div>

Full MWE: MWEusing StaticArrays, Parameters, Accessors, BenchmarkTools # Test Functions function loop1(dat) for t in 1:10 for i in eachindex(dat) @reset dat\[i\].A .+= dat\[i\].B end end…

---

## [Type Definition of Array Arguments to Functions](https://discourse.julialang.org/t/type-definition-of-array-arguments-to-functions/119372)

<div class="topic-metadata">

**Author:** [@freestatelabs](https://discourse.julialang.org/u/freestatelabs)\
**Replies:** 8\
**Last updated:** [September 13, 2024, 2:36pm UTC](https://discourse.julialang.org/t/type-definition-of-array-arguments-to-functions/119372 "2024-09-13T14:36:42Z")

</div>

Hi, for a project I’m working on, I defaulted to defining my functions with input arrays with data types as Float64, i.e. function foo(vec::Vector{Float64}) # do stuff end However, I realized later that this was a…

---

## [How to include a Distributed into a package?](https://discourse.julialang.org/t/how-to-include-a-distributed-into-a-package/81561)

<div class="topic-metadata">

**Author:** [@dmetivie](https://discourse.julialang.org/u/dmetivie)\
**Replies:** 2\
**Last updated:** [September 13, 2024, 1:52pm UTC](https://discourse.julialang.org/t/how-to-include-a-distributed-into-a-package/81561 "2024-09-13T13:52:51Z")

</div>

I am writing a package where at some point a big loop appears. What is the proper way to allow using the Distributed.jl package to replace map by pmap? Should we do like that: module MyPackage using Distributed ### …

---

## [Maximizing Input File Read Performance](https://discourse.julialang.org/t/maximizing-input-file-read-performance/117034)

<div class="topic-metadata">

**Author:** [@freestatelabs](https://discourse.julialang.org/u/freestatelabs)\
**Replies:** 7\
**Last updated:** [September 13, 2024, 1:20pm UTC](https://discourse.julialang.org/t/maximizing-input-file-read-performance/117034 "2024-09-13T13:20:47Z")

</div>

Hi everyone, I’m writing a simple simulation program, and trying to figure out the best way of designing a format for my input files. The simulation calculates the effect of multiple types of sources (each defined in a …

---

## [Suffix Tree/Suffix Arrays](https://discourse.julialang.org/t/suffix-tree-suffix-arrays/119369)

<div class="topic-metadata">

**Author:** [@Jose\_Ghislain\_Quenum](https://discourse.julialang.org/u/Jose_Ghislain_Quenum)\
**Replies:** 0\
**Last updated:** [September 13, 2024, 11:47am UTC](https://discourse.julialang.org/t/suffix-tree-suffix-arrays/119369 "2024-09-13T11:47:59Z")

</div>

Hi all, what’s the best library to implement (exact and inexact) search with suffix trees or suffix arrays? I tried SuffixArrays.jl, but the API was limited. Any suggestion? Thanks in advance.

---

## [Bug in DifferentialEquations](https://discourse.julialang.org/t/bug-in-differentialequations/116968)

<div class="topic-metadata">

**Author:** [@elcup](https://discourse.julialang.org/u/elcup)\
**Replies:** 2\
**Last updated:** [September 13, 2024, 11:04am UTC](https://discourse.julialang.org/t/bug-in-differentialequations/116968 "2024-09-13T11:04:49Z")

</div>

Hi! Note: I am working on a new environment with only DifferentialEquations.jl installed. When I run the following simple code taken from the tutorials of DifferentialEquations.jl (Conditional Dosing in Pharmacometrics…

---

## [App using Makie.jl or Plots.jl compiled with PackageCompiler.jl does not work](https://discourse.julialang.org/t/app-using-makie-jl-or-plots-jl-compiled-with-packagecompiler-jl-does-not-work/104319)

<div class="topic-metadata">

**Author:** [@Miroslav-Stimac](https://discourse.julialang.org/u/Miroslav-Stimac)\
**Replies:** 9\
**Last updated:** [September 13, 2024, 2:17am UTC](https://discourse.julialang.org/t/app-using-makie-jl-or-plots-jl-compiled-with-packagecompiler-jl-does-not-work/104319 "2024-09-13T02:17:13Z")

</div>

Hello, I have a program that I programmed with Julia using DataFrames, ODBC, TOML any some other packages. I had been compiling it to a Windows App (.EXE-file) by using PackageCompiler.jl many times and everything is OK…

---

## [Error message: The Julia launcher failed to load a configuration file](https://discourse.julialang.org/t/error-message-the-julia-launcher-failed-to-load-a-configuration-file/119336)

<div class="topic-metadata">

**Author:** [@GiovanniPaiela](https://discourse.julialang.org/u/GiovanniPaiela)\
**Replies:** 3\
**Last updated:** [September 12, 2024, 7:06pm UTC](https://discourse.julialang.org/t/error-message-the-julia-launcher-failed-to-load-a-configuration-file/119336 "2024-09-12T19:06:19Z")

</div>

I wanted to run my julia code but after I did so (trying both from vs code and command prompt), I received an error message: "Error: The Julia launcher failed to load a configuration file. Caused by: Could not create …

---

## [Function property differs based on the position of the generic type](https://discourse.julialang.org/t/function-property-differs-based-on-the-position-of-the-generic-type/119340)

<div class="topic-metadata">

**Author:** [@akrishnamoorthy](https://discourse.julialang.org/u/akrishnamoorthy)\
**Replies:** 2\
**Last updated:** [September 12, 2024, 6:08pm UTC](https://discourse.julialang.org/t/function-property-differs-based-on-the-position-of-the-generic-type/119340 "2024-09-12T18:08:58Z")

</div>

Let julia\> using LinearAlgebra julia\> id(X,T) = T(Matrix{eltype(X)}(I, size(X)...)) id (generic function with 1 method) julia\> A = complex.(randn(2,2),randn(2,2)); julia\> typeof(transpose(id(A,Hermitian))) Transpose{…

---

## [Question on performance of views](https://discourse.julialang.org/t/question-on-performance-of-views/119292)

<div class="topic-metadata">

**Author:** [@xvries](https://discourse.julialang.org/u/xvries)\
**Replies:** 4\
**Last updated:** [September 12, 2024, 5:20pm UTC](https://discourse.julialang.org/t/question-on-performance-of-views/119292 "2024-09-12T17:20:12Z")

</div>

In some of our code we use views based on integer indexing (we need to remove some colums from our matrices). I noticed that these views have very poor performance in multiplication. a = rand(1000, 1000) @btime a\*a # 1…

---

## [For statement type instability](https://discourse.julialang.org/t/for-statement-type-instability/118817)

<div class="topic-metadata">

**Author:** [@0samuraiE](https://discourse.julialang.org/u/0samuraiE)\
**Replies:** 10\
**Last updated:** [September 12, 2024, 4:24pm UTC](https://discourse.julialang.org/t/for-statement-type-instability/118817 "2024-09-12T16:24:14Z")

</div>

Hello all. I encountered the same problem as in the title. Sorry if this is a known problem. \[Added later\] @code\_warntype warns @\_2::Union{Nothing, Tuple{Union{One, Two}, Int64}} has type instability. How can I solve …

---

## [How would you solve this DAE?](https://discourse.julialang.org/t/how-would-you-solve-this-dae/119303)

<div class="topic-metadata">

**Author:** [@martru](https://discourse.julialang.org/u/martru)\
**Replies:** 2\
**Last updated:** [September 12, 2024, 4:00pm UTC](https://discourse.julialang.org/t/how-would-you-solve-this-dae/119303 "2024-09-12T16:00:08Z")

</div>

Hi everyone, I’m a new user and I’m struggling to solve this (pictured below) DAE system. I know next to nothing about solvers so I’d appreciate all the help I can get! So far I’ve tried: function f(out, dx, x, p, …

---

## [How to add diagonal line to log-log plot](https://discourse.julialang.org/t/how-to-add-diagonal-line-to-log-log-plot/119322)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 7\
**Last updated:** [September 12, 2024, 3:44pm UTC](https://discourse.julialang.org/t/how-to-add-diagonal-line-to-log-log-plot/119322 "2024-09-12T15:44:21Z")

</div>

Hello, I would like to plot a diagonal line on a log-log plot. How can I do that? using Plots x = 1:4 y = \[44,29,6,1\] scatter(x, y, xaxis=:log10, yaxis=:log10) Plots.abline!(-1, 44)

---

## [Solve equation in Symbolics.jl](https://discourse.julialang.org/t/solve-equation-in-symbolics-jl/119302)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 6\
**Last updated:** [September 12, 2024, 2:43pm UTC](https://discourse.julialang.org/t/solve-equation-in-symbolics-jl/119302 "2024-09-12T14:43:49Z")

</div>

Symbolics.jl can’t solve this equation but if I multiply both sides by x^3 then it can. Wolfram Alpha can solve both. Symbolics.jl’s docs say it can do polynomial equations; do these count? What’s the problem? \[2edaba…

---

## [RFC: @jet\_ignore to let JET.jl ignore specific functions](https://discourse.julialang.org/t/rfc-jet-ignore-to-let-jet-jl-ignore-specific-functions/119258)

<div class="topic-metadata">

**Author:** [@nielsls](https://discourse.julialang.org/u/nielsls)\
**Replies:** 0\
**Last updated:** [September 10, 2024, 7:45pm UTC](https://discourse.julialang.org/t/rfc-jet-ignore-to-let-jet-jl-ignore-specific-functions/119258 "2024-09-10T19:45:57Z")

</div>

Unleashing JET.jl on my codebase tends to flood the prompt with errors due to the use of IO, DataFrames, etc… A lot of these runtime-dispatches are okay, but some are not. As an example, assume that I’m okay with the p…

---

## [Allocation-free weighted samples](https://discourse.julialang.org/t/allocation-free-weighted-samples/119265)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 12\
**Last updated:** [September 12, 2024, 1:50pm UTC](https://discourse.julialang.org/t/allocation-free-weighted-samples/119265 "2024-09-12T13:50:12Z")

</div>

Given an SVector of weights, is there a way to take a single weighted sample without any allocations? Ie, these work great but require an allocation: x = \[1\] wts = @SVector rand(16) @btime wsample(1:16, $wts) @btime wsa…

---

## [XLSX.jl cannot handle customXml elements correctly when opening files as templates](https://discourse.julialang.org/t/xlsx-jl-cannot-handle-customxml-elements-correctly-when-opening-files-as-templates/115778)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 10\
**Last updated:** [September 12, 2024, 10:20am UTC](https://discourse.julialang.org/t/xlsx-jl-cannot-handle-customxml-elements-correctly-when-opening-files-as-templates/115778 "2024-09-12T10:20:56Z")

</div>

This is a cross post from an issue on github. My application uses XLSX.jl to open xlsx files as templates, add data and then write them out again. It stopped working when I moved the template files to a new directory. I…

---

## [No node name error with XLSX](https://discourse.julialang.org/t/no-node-name-error-with-xlsx/90849)

<div class="topic-metadata">

**Author:** [@Pino](https://discourse.julialang.org/u/Pino)\
**Replies:** 8\
**Last updated:** [September 12, 2024, 9:30am UTC](https://discourse.julialang.org/t/no-node-name-error-with-xlsx/90849 "2024-09-12T09:30:48Z")

</div>

Hi, I’m trying to write some code to import spreadsheets into julia, stack them together in an array, manipulate them a bit and save them into a csv. I’m however having problems in importing programmatically the excel …

---

## [Is this a good workflow with Julia environment?](https://discourse.julialang.org/t/is-this-a-good-workflow-with-julia-environment/100848)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 21\
**Last updated:** [September 12, 2024, 9:08am UTC](https://discourse.julialang.org/t/is-this-a-good-workflow-with-julia-environment/100848 "2024-09-12T09:08:41Z")

</div>

Will the following be a good workflow with Julia environment? Is there any bug in it? Or is there anything better to do? The workflow: Create a folder named myProject for a certain project. Open folder myProject with …

---

## [Optimising voronoi computation](https://discourse.julialang.org/t/optimising-voronoi-computation/119297)

<div class="topic-metadata">

**Author:** [@Manasa\_S](https://discourse.julialang.org/u/Manasa_S)\
**Replies:** 4\
**Last updated:** [September 12, 2024, 8:20am UTC](https://discourse.julialang.org/t/optimising-voronoi-computation/119297 "2024-09-12T08:20:43Z")

</div>

Hi, I am currently working on a project that needs to compute voronoi of points. The points increase exponentially over time. I am currently using DelaunayTriangulation package. I compute tri for the points and then vor…

---

## [Improving GPU performance for symbolic regression](https://discourse.julialang.org/t/improving-gpu-performance-for-symbolic-regression/108800)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 14\
**Last updated:** [September 12, 2024, 5:58am UTC](https://discourse.julialang.org/t/improving-gpu-performance-for-symbolic-regression/108800 "2024-09-12T05:58:56Z")

</div>

I’m trying to improve the GPU performance for evaluation of an expression represented as a tree in DynamicExpressions.jl. The way it works is that an expression is created at runtime – here’s a movie of how this is used …

---

## [Functional programming is not capable of achieving absolute top performance](https://discourse.julialang.org/t/functional-programming-is-not-capable-of-achieving-absolute-top-performance/119233)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 20\
**Last updated:** [September 12, 2024, 12:57am UTC](https://discourse.julialang.org/t/functional-programming-is-not-capable-of-achieving-absolute-top-performance/119233 "2024-09-12T00:57:33Z")

</div>

I was just playing around with the best way to compute the mean and standard deviation of a vector of values. Obviously, sum(x), std(x) is the cleanest but it isn’t the fastest, as I assume that approach needs to scan t…

---

## [ERROR: UndefVarError: \`install\` not defined](https://discourse.julialang.org/t/error-undefvarerror-install-not-defined/119305)

<div class="topic-metadata">

**Author:** [@phylo\_nick](https://discourse.julialang.org/u/phylo_nick)\
**Replies:** 1\
**Last updated:** [September 12, 2024, 12:24am UTC](https://discourse.julialang.org/t/error-undefvarerror-install-not-defined/119305 "2024-09-12T00:24:39Z")

</div>

I am trying to get R working in Julia to no avail. Here is my input: using Pkg Pkg.add("RCall") using RCall install.packages("ape", "coda", "RColorBrewer", "fields") Output: ERROR: UndefVarError: \`install\` not define…

---

## [Does Julia support Zen 4 CPUs?](https://discourse.julialang.org/t/does-julia-support-zen-4-cpus/119224)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 9\
**Last updated:** [September 11, 2024, 10:46pm UTC](https://discourse.julialang.org/t/does-julia-support-zen-4-cpus/119224 "2024-09-11T22:46:23Z")

</div>

I have a laptop with an Ryzen 7 7840U CPU, which - according to https://www.amd.com/en/products/processors/laptop/ryzen/7000-series/amd-ryzen-7-7840u.html - has a Zen 4 architecture. In Julia 1.10.5, the output of Sys.…

---

## [Method tracing in Julia?](https://discourse.julialang.org/t/method-tracing-in-julia/85387)

<div class="topic-metadata">

**Author:** [@bertschi](https://discourse.julialang.org/u/bertschi)\
**Replies:** 5\
**Last updated:** [September 11, 2024, 7:52pm UTC](https://discourse.julialang.org/t/method-tracing-in-julia/85387 "2024-09-11T19:52:35Z")

</div>

One of my favourite (and most missed) tools for exploring and debugging code is the trace facility often seen in Lisp. I.e., in Common Lisp, I can just trace any function and get a view of its stack trace: CL-USER\> (tra…

---

## [Set up Bitbucket pipelines for automatic testing of Julia packages](https://discourse.julialang.org/t/set-up-bitbucket-pipelines-for-automatic-testing-of-julia-packages/7040)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 3\
**Last updated:** [September 11, 2024, 6:49pm UTC](https://discourse.julialang.org/t/set-up-bitbucket-pipelines-for-automatic-testing-of-julia-packages/7040 "2024-09-11T18:49:53Z")

</div>

I am trying to setup automatic testing (on each commit) for a package hosted on Bitbucket. Something like what Trevis-CI does for packages in Github. I think it should use Bitbucket pipelines somehow, but I have no idea …

---

## [Passive elements implementation in helmholtz PDE](https://discourse.julialang.org/t/passive-elements-implementation-in-helmholtz-pde/119288)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 0\
**Last updated:** [September 11, 2024, 4:52pm UTC](https://discourse.julialang.org/t/passive-elements-implementation-in-helmholtz-pde/119288 "2024-09-11T16:52:55Z")

</div>

Hi, I am using gridap to solve helmholtz PDE. I have some passive elements which has fixed values of solution there. I have defined this elements as Dirichlet BC as below in two ways once fixing those elements surface an…

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

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