# General Usage

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

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

**Page:** 194

---

## [Why so many libraries on github say that their builds are failing?](https://discourse.julialang.org/t/why-so-many-libraries-on-github-say-that-their-builds-are-failing/111027)

<div class="topic-metadata">

**Author:** [@Veenty](https://discourse.julialang.org/u/Veenty)\
**Replies:** 1\
**Last updated:** [March 1, 2024, 7:34pm UTC](https://discourse.julialang.org/t/why-so-many-libraries-on-github-say-that-their-builds-are-failing/111027 "2024-03-01T19:34:59Z")

</div>

This has been going on more months and I’m not sure why. Like even the official one say this.

---

## [Tyler maps sometimes show, sometimes they don't in vscode](https://discourse.julialang.org/t/tyler-maps-sometimes-show-sometimes-they-dont-in-vscode/110196)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 1\
**Last updated:** [March 1, 2024, 3:28pm UTC](https://discourse.julialang.org/t/tyler-maps-sometimes-show-sometimes-they-dont-in-vscode/110196 "2024-03-01T15:28:33Z")

</div>

In vscode I’m running the most basic example for Tyler.jl, namely: using Tyler, GLMakie tyler = Tyler.Map(Rect2f(-0.0921, 51.5, 0.04, 0.025)) Sometimes the map shows, sometimes it doesn’t (in which case it isn’t liste…

---

## [Are these type functors the same as Outer Constructors?](https://discourse.julialang.org/t/are-these-type-functors-the-same-as-outer-constructors/110598)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 7\
**Last updated:** [March 1, 2024, 2:26pm UTC](https://discourse.julialang.org/t/are-these-type-functors-the-same-as-outer-constructors/110598 "2024-03-01T14:26:02Z")

</div>

I found this approach in Rotations.jl. Why code it this way? Note that AngleAxis is a concrete type, so AA can only be one type. @inline function (::Type{AA})(q::QuatRotation) where AA \<: AngleAxis w = real(q.q) …

---

## [Strange method overwriting case -\> precompilation issue](https://discourse.julialang.org/t/strange-method-overwriting-case-precompilation-issue/110835)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 8\
**Last updated:** [March 1, 2024, 10:28am UTC](https://discourse.julialang.org/t/strange-method-overwriting-case-precompilation-issue/110835 "2024-03-01T10:28:37Z")

</div>

Hey, I have a module: Arithmetics.jl I have precompilation issue due to. mean(arr; dims) = sum(arr, dims=dims) / prod(size(arr, r) for r in dims) mean(arr) = sum(arr) / length(arr) It says that mean(arr) is overwritt…

---

## [ERROR: LoadError: InitError: UndefVarError: \`GR\_jll\` not defined](https://discourse.julialang.org/t/error-loaderror-initerror-undefvarerror-gr-jll-not-defined/110945)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 31\
**Last updated:** [March 1, 2024, 9:19am UTC](https://discourse.julialang.org/t/error-loaderror-initerror-undefvarerror-gr-jll-not-defined/110945 "2024-03-01T09:19:30Z")

</div>

It reports error when using Plots: Precompiling project... ✗ GR\_jll ✗ Plots 43 dependencies successfully precompiled in 44 seconds. 123 already precompiled. 1 skipped during auto due to previous errors. 2 depend…

---

## [How to redirect messages from worker procecces into \`stderr\` on the master procecces](https://discourse.julialang.org/t/how-to-redirect-messages-from-worker-procecces-into-stderr-on-the-master-procecces/111000)

<div class="topic-metadata">

**Author:** [@mdyuki](https://discourse.julialang.org/u/mdyuki)\
**Replies:** 0\
**Last updated:** [March 1, 2024, 8:30am UTC](https://discourse.julialang.org/t/how-to-redirect-messages-from-worker-procecces-into-stderr-on-the-master-procecces/111000 "2024-03-01T08:30:40Z")

</div>

Hello, I am writing a program that uses Distributed package for parallelization. I have a question about messages passed from the workers to master. It seems to be printed on the stdout, even if the message is originally…

---

## [Preallocation and data race in parallelization](https://discourse.julialang.org/t/preallocation-and-data-race-in-parallelization/110831)

<div class="topic-metadata">

**Author:** [@physh](https://discourse.julialang.org/u/physh)\
**Replies:** 9\
**Last updated:** [March 1, 2024, 8:16am UTC](https://discourse.julialang.org/t/preallocation-and-data-race-in-parallelization/110831 "2024-03-01T08:16:18Z")

</div>

Hi all, I wonder what is the best way to deal with temporary arrays in function calls within a parallelized calculation. The (very reduced) structure of my code is something like function fun1() p = SA\[1,2,3,4\] …

---

## [Plots causes Julia exit](https://discourse.julialang.org/t/plots-causes-julia-exit/110980)

<div class="topic-metadata">

**Author:** [@rtapia](https://discourse.julialang.org/u/rtapia)\
**Replies:** 3\
**Last updated:** [March 1, 2024, 2:13am UTC](https://discourse.julialang.org/t/plots-causes-julia-exit/110980 "2024-03-01T02:13:34Z")

</div>

I am using PyPlot and as soon as I define a figure Julia closes instantly. I am new to Julia and PyPlot in general. Windows 11, Julia 1.10.1 Thanks

---

## [Semantics of :: in return type vs. argument type annotations](https://discourse.julialang.org/t/semantics-of-in-return-type-vs-argument-type-annotations/109838)

<div class="topic-metadata">

**Author:** [@mnemnion](https://discourse.julialang.org/u/mnemnion)\
**Replies:** 76\
**Last updated:** [March 1, 2024, 12:47am UTC](https://discourse.julialang.org/t/semantics-of-in-return-type-vs-argument-type-annotations/109838 "2024-03-01T00:47:03Z")

</div>

That utterly baffled me when I found out. A return annotation has the same appearance as an argument annotation, but a subtly different semantic. I still use them, but I don’t like having to think about whether I shoul…

---

## [TimerOutputs.jl : How to correctly stop timing?](https://discourse.julialang.org/t/timeroutputs-jl-how-to-correctly-stop-timing/110924)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 1\
**Last updated:** [February 29, 2024, 7:24pm UTC](https://discourse.julialang.org/t/timeroutputs-jl-how-to-correctly-stop-timing/110924 "2024-02-29T19:24:44Z")

</div>

Hi all! I have a need to “freeze” a timer object and ensure that it stops counting the time. I have the following example code: using TimerOutputs # Create a new timer object const MyTimer = TimerOutput() function si…

---

## [How to compile Android library](https://discourse.julialang.org/t/how-to-compile-android-library/83519)

<div class="topic-metadata">

**Author:** [@ZR233](https://discourse.julialang.org/u/ZR233)\
**Replies:** 1\
**Last updated:** [February 29, 2024, 7:08pm UTC](https://discourse.julialang.org/t/how-to-compile-android-library/83519 "2024-02-29T19:08:50Z")

</div>

I want to make a library for android app, but PackageCompiler doc didn’t tell how to do it.

---

## [\`import \<module\>\` makes all objects available without prefix](https://discourse.julialang.org/t/import-module-makes-all-objects-available-without-prefix/110931)

<div class="topic-metadata">

**Author:** [@suiato](https://discourse.julialang.org/u/suiato)\
**Replies:** 3\
**Last updated:** [February 29, 2024, 6:17pm UTC](https://discourse.julialang.org/t/import-module-makes-all-objects-available-without-prefix/110931 "2024-02-29T18:17:00Z")

</div>

I have a simple question: what is import \<module\> supposed to do? Say, a module A.jl is module A export sayA function sayA() println("This is A.") end end and, test.jl is import A sayA() They are in the same di…

---

## [Default constructor for any type?](https://discourse.julialang.org/t/default-constructor-for-any-type/110546)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 94\
**Last updated:** [February 29, 2024, 5:08pm UTC](https://discourse.julialang.org/t/default-constructor-for-any-type/110546 "2024-02-29T17:08:22Z")

</div>

I am trying to create generic defaults in an immutable struct for a parametric type. Say that I am trying to create a linked list, like this: struct List{T} value::T next::RefValue{List{T}} List(value::\_T)…

---

## [Inconsistent display of values with DataFrames](https://discourse.julialang.org/t/inconsistent-display-of-values-with-dataframes/110777)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 2\
**Last updated:** [February 29, 2024, 4:37pm UTC](https://discourse.julialang.org/t/inconsistent-display-of-values-with-dataframes/110777 "2024-02-29T16:37:31Z")

</div>

I’m not sure if it’s specific to DataFrames.jl but I noticed the following inconsistency: using DataFrames julia\> d = Dict(i=\>DataFrame(a=rand(1000)) for i in 1:10) Dict{Int64, DataFrame} with 10 entries: 5 =\> 1000×…

---

## [Best practice in package globals](https://discourse.julialang.org/t/best-practice-in-package-globals/110517)

<div class="topic-metadata">

**Author:** [@screw\_dog](https://discourse.julialang.org/u/screw_dog)\
**Replies:** 7\
**Last updated:** [February 26, 2024, 3:12am UTC](https://discourse.julialang.org/t/best-practice-in-package-globals/110517 "2024-02-26T03:12:34Z")

</div>

I’m developing a package that has a couple of settings that are “global” to the package. Is there a best practice for this kind of thing? At the moment I have some getters and setters but should I use ENV, which would a…

---

## [Get Correlation matrix from dataframe with row and column titles](https://discourse.julialang.org/t/get-correlation-matrix-from-dataframe-with-row-and-column-titles/81301)

<div class="topic-metadata">

**Author:** [@DWSchulze](https://discourse.julialang.org/u/DWSchulze)\
**Replies:** 10\
**Last updated:** [February 29, 2024, 2:21pm UTC](https://discourse.julialang.org/t/get-correlation-matrix-from-dataframe-with-row-and-column-titles/81301 "2024-02-29T14:21:49Z")

</div>

I have a dataframe and I want to get the correlation matrix with row/column titles so I know what I’m looking at. If I do this cormat = cor(Matrix(df)) There are no row/column titles. How do I get a correlation matri…

---

## [Multiplication of \`BitMatrix\`s for linear algebra modulo 2](https://discourse.julialang.org/t/multiplication-of-bitmatrix-s-for-linear-algebra-modulo-2/110750)

<div class="topic-metadata">

**Author:** [@Leo\_I](https://discourse.julialang.org/u/Leo_I)\
**Replies:** 10\
**Last updated:** [February 29, 2024, 11:23am UTC](https://discourse.julialang.org/t/multiplication-of-bitmatrix-s-for-linear-algebra-modulo-2/110750 "2024-02-29T11:23:53Z")

</div>

When dealing with matrices over \\mathbb{Z}\_2 that are enormours (e.g. of size 10^5\\times10^5), it is desirable to use implementations that minimize the allocated memory. For instance: julia\> using FiniteFields julia\> si…

---

## [Named parameters with type overloads](https://discourse.julialang.org/t/named-parameters-with-type-overloads/18860)

<div class="topic-metadata">

**Author:** [@grahamstark](https://discourse.julialang.org/u/grahamstark)\
**Replies:** 34\
**Last updated:** [February 29, 2024, 11:13am UTC](https://discourse.julialang.org/t/named-parameters-with-type-overloads/18860 "2024-02-29T11:13:07Z")

</div>

Hi, I’m relatively new to Julia. Here’s a thing that puzzles me. If you have a simple overloaded function like this: function a( x :: Float64 ) print( "Float version" ) end function a( x :: Integer ) …

---

## [Why doesn't Julia have the \`switch-case\` structure?](https://discourse.julialang.org/t/why-doesnt-julia-have-the-switch-case-structure/110936)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 4\
**Last updated:** [February 29, 2024, 9:26am UTC](https://discourse.julialang.org/t/why-doesnt-julia-have-the-switch-case-structure/110936 "2024-02-29T09:26:58Z")

</div>

Why doesn’t Julia have the switch-case structure? Is it unnecessary, or is there a better solution?

---

## [A compiler trick for performance-holic](https://discourse.julialang.org/t/a-compiler-trick-for-performance-holic/110932)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 0\
**Last updated:** [February 29, 2024, 7:35am UTC](https://discourse.julialang.org/t/a-compiler-trick-for-performance-holic/110932 "2024-02-29T07:35:44Z")

</div>

In the settings. "terminal.integrated.env.windows": {"JULIA\_LLVM\_ARGS":\<your LLVM arguments here.\>} LLVM has lots of optimization options you can toggle. Maybe if you dig hard enough, you’ll find something that makes y…

---

## [Why does "QuadGK.jl" not behave the same as "Integrals.jl with QuadGKJL()"](https://discourse.julialang.org/t/why-does-quadgk-jl-not-behave-the-same-as-integrals-jl-with-quadgkjl/110795)

<div class="topic-metadata">

**Author:** [@Laura](https://discourse.julialang.org/u/Laura)\
**Replies:** 3\
**Last updated:** [February 29, 2024, 7:08am UTC](https://discourse.julialang.org/t/why-does-quadgk-jl-not-behave-the-same-as-integrals-jl-with-quadgkjl/110795 "2024-02-29T07:08:36Z")

</div>

I am writing a program to perform a spherical Bessel transformation which requires some one dimensional integrals but I am having some trouble with the Integrals.jl package. Naturally my first attempt to do this was to …

---

## [Dispatch based on symbol parameter](https://discourse.julialang.org/t/dispatch-based-on-symbol-parameter/110849)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 15\
**Last updated:** [February 29, 2024, 5:40am UTC](https://discourse.julialang.org/t/dispatch-based-on-symbol-parameter/110849 "2024-02-29T05:40:37Z")

</div>

Is there any way to dispatch directly on a symbol function parameter? I have a function which takes a symbol and returns a different type based on a symbol that is passed into it. In order for this function to have a typ…

---

## [Differences between running in debugger and REPL?](https://discourse.julialang.org/t/differences-between-running-in-debugger-and-repl/110930)

<div class="topic-metadata">

**Author:** [@mpeters2](https://discourse.julialang.org/u/mpeters2)\
**Replies:** 0\
**Last updated:** [February 29, 2024, 3:45am UTC](https://discourse.julialang.org/t/differences-between-running-in-debugger-and-repl/110930 "2024-02-29T03:45:38Z")

</div>

Specifically, the context is within VSCode, but it might not matter. I have a function that runs correctly in the debugger, but not when chosing “Julia: Execute active File in REPL” or “Julia: Run file in New Process” …

---

## [Arithmetic for parametric type values in structs e.g., N+1](https://discourse.julialang.org/t/arithmetic-for-parametric-type-values-in-structs-e-g-n-1/110925)

<div class="topic-metadata">

**Author:** [@Abhinav\_Bhatia](https://discourse.julialang.org/u/Abhinav_Bhatia)\
**Replies:** 5\
**Last updated:** [February 29, 2024, 3:37am UTC](https://discourse.julialang.org/t/arithmetic-for-parametric-type-values-in-structs-e-g-n-1/110925 "2024-02-29T03:37:47Z")

</div>

How can I do something like: struct Foo{N} arr1::Array{Float64, N} arr2::Array{Float64, N+1} end i.e., I want arr2 to be always of 1 higher rank than arr1. How to do this?

---

## [Lux + Turing: How to not to use a global variable for state \`st\`](https://discourse.julialang.org/t/lux-turing-how-to-not-to-use-a-global-variable-for-state-st/110878)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 1\
**Last updated:** [February 29, 2024, 12:06am UTC](https://discourse.julialang.org/t/lux-turing-how-to-not-to-use-a-global-variable-for-state-st/110878 "2024-02-29T00:06:20Z")

</div>

Hi there, Lux state handling, while lovely explicit, seems sometimes a bit difficult. Here the example from the Bayesian Lux Tutorial # Specify the probabilistic model. @model function bayes\_nn(xs, ts) global st …

---

## [Enhancing Simulation Timing Reports with Color-Coded Outputs in Julia](https://discourse.julialang.org/t/enhancing-simulation-timing-reports-with-color-coded-outputs-in-julia/110912)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 2\
**Last updated:** [February 28, 2024, 10:44pm UTC](https://discourse.julialang.org/t/enhancing-simulation-timing-reports-with-color-coded-outputs-in-julia/110912 "2024-02-28T22:44:55Z")

</div>

Hello all! I am currently working on a simulation project and have been using Julia’s timing functionalities to monitor the performance of various sections of my code. The timing report provides a detailed breakdown of …

---

## [Saving information to a log file](https://discourse.julialang.org/t/saving-information-to-a-log-file/110869)

<div class="topic-metadata">

**Author:** [@mpeters2](https://discourse.julialang.org/u/mpeters2)\
**Replies:** 3\
**Last updated:** [February 28, 2024, 10:02pm UTC](https://discourse.julialang.org/t/saving-information-to-a-log-file/110869 "2024-02-28T22:02:44Z")

</div>

I’m trying to debug some code that crashes Julia (yet, ironically, works perfectly fine in the debugger!). My problem is that it crashes the REPL, so I can’t see what’s going on. I went so far as to use QuickTime player…

---

## [Overlay a line plot and a heatmap in Makie.jl](https://discourse.julialang.org/t/overlay-a-line-plot-and-a-heatmap-in-makie-jl/110921)

<div class="topic-metadata">

**Author:** [@bryaan](https://discourse.julialang.org/u/bryaan)\
**Replies:** 1\
**Last updated:** [February 28, 2024, 8:54pm UTC](https://discourse.julialang.org/t/overlay-a-line-plot-and-a-heatmap-in-makie-jl/110921 "2024-02-28T20:54:29Z")

</div>

How can I draw a heatmap in the bg and a line plot over it in Makie.jl? fig\[2, :\] = chartgrid = GridLayout(tellwidth=false) ax = Axis(chartgrid\[1, 1\]) heatmap!(ax, obc, colormap=:thermal) lineplot = lines!(ax, plot\_s…

---

## [How to efficiently skip calculating some vector elements?](https://discourse.julialang.org/t/how-to-efficiently-skip-calculating-some-vector-elements/110915)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 4\
**Last updated:** [February 28, 2024, 8:49pm UTC](https://discourse.julialang.org/t/how-to-efficiently-skip-calculating-some-vector-elements/110915 "2024-02-28T20:49:39Z")

</div>

There are significant efficiency gains by implementing Projective Geometric Algebra (PGA) in OpenGL shader hardware as described in Steven De Keninck’s recent paper, “Look, Ma, No Matrices!” Less significant (because it…

---

## [ParallelDataTransfer.jl with local variables](https://discourse.julialang.org/t/paralleldatatransfer-jl-with-local-variables/110916)

<div class="topic-metadata">

**Author:** [@lgo](https://discourse.julialang.org/u/lgo)\
**Replies:** 1\
**Last updated:** [February 28, 2024, 7:49pm UTC](https://discourse.julialang.org/t/paralleldatatransfer-jl-with-local-variables/110916 "2024-02-28T19:49:13Z")

</div>

I want to pass a variable to my workers inside a function (see minimum example below) but I get stuck on passobj. I assume this is because passobj is evaluated at the global scope where the variable is not defined? Is th…

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

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