# General Usage

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

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

**Page:** 154

---

## [Colors GLMakie](https://discourse.julialang.org/t/colors-glmakie/116515)

<div class="topic-metadata">

**Author:** [@NaSi](https://discourse.julialang.org/u/NaSi)\
**Replies:** 1\
**Last updated:** [July 2, 2024, 11:52am UTC](https://discourse.julialang.org/t/colors-glmakie/116515 "2024-07-02T11:52:48Z")

</div>

Hi! I am using GLMakie to make plots. I would like to know what is the colorset used in this package. In other words, what is by default, the first color used ? the second ? etc In fact, I want to plot 4 lines and I wo…

---

## [How to add axis labels, color bar, and marker shape to TernaryDiagrams?](https://discourse.julialang.org/t/how-to-add-axis-labels-color-bar-and-marker-shape-to-ternarydiagrams/116513)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 0\
**Last updated:** [July 2, 2024, 10:26am UTC](https://discourse.julialang.org/t/how-to-add-axis-labels-color-bar-and-marker-shape-to-ternarydiagrams/116513 "2024-07-02T10:26:46Z")

</div>

Hello, I have two data sets that I would like to represent as a 3-simplex. My goal is to plot the first 3 dimensions as a ternary diagram with TernaryDiagrams.jl and represent the fourth dimension with a color gradient.…

---

## [Build and install Julia from source code with cmake](https://discourse.julialang.org/t/build-and-install-julia-from-source-code-with-cmake/116483)

<div class="topic-metadata">

**Author:** [@PatriceLebrun](https://discourse.julialang.org/u/PatriceLebrun)\
**Replies:** 7\
**Last updated:** [July 2, 2024, 10:12am UTC](https://discourse.julialang.org/t/build-and-install-julia-from-source-code-with-cmake/116483 "2024-07-02T10:12:51Z")

</div>

Hi, I would like use julia in c++ environment in Particule Physics. All external packages are build from source code by using cmake. In this environment it’s very difficult to add Julia because of CMakeLists.txt is no…

---

## [\`touch\` function errors where touch command in terminal works](https://discourse.julialang.org/t/touch-function-errors-where-touch-command-in-terminal-works/116510)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 0\
**Last updated:** [July 2, 2024, 9:54am UTC](https://discourse.julialang.org/t/touch-function-errors-where-touch-command-in-terminal-works/116510 "2024-07-02T09:54:59Z")

</div>

I am unable to update the modification time of a folder using touch: julia\> mkdir("temp") "temp" julia\> mtime("temp") 1.7199137885920577e9 julia\> touch("temp") ERROR: IOError: open("temp", 65, 438): illegal operation …

---

## [Automatically generating methods for a specialised struct](https://discourse.julialang.org/t/automatically-generating-methods-for-a-specialised-struct/116455)

<div class="topic-metadata">

**Author:** [@TimHargreaves](https://discourse.julialang.org/u/TimHargreaves)\
**Replies:** 5\
**Last updated:** [July 2, 2024, 9:41am UTC](https://discourse.julialang.org/t/automatically-generating-methods-for-a-specialised-struct/116455 "2024-07-02T09:41:14Z")

</div>

Suppose I have the following struct struct Foo a::Float64 b::Float64 end that I have defined many methods for. This is the most general representation, but most of the time I only care about a specialised vers…

---

## [📢 Julia Coders: 1-Minute Survey to Shape the Future of Gen AI](https://discourse.julialang.org/t/julia-coders-1-minute-survey-to-shape-the-future-of-gen-ai/116292)

<div class="topic-metadata">

**Author:** [@svilupp](https://discourse.julialang.org/u/svilupp)\
**Replies:** 10\
**Last updated:** [July 2, 2024, 8:34am UTC](https://discourse.julialang.org/t/julia-coders-1-minute-survey-to-shape-the-future-of-gen-ai/116292 "2024-07-02T08:34:14Z")

</div>

:fire: Julia Gen AI Survey :fire: We’ve compiled a super quick survey (5 multiple-choice questions + 2 optional open-ended ones) to understand the interest and challenges around Generative AI, Large Language Models, and…

---

## [Declaring types: Vector{Union{Int64, Matrix{Int64}}} is much slower than Vector{Any}, why is that?](https://discourse.julialang.org/t/declaring-types-vector-union-int64-matrix-int64-is-much-slower-than-vector-any-why-is-that/116480)

<div class="topic-metadata">

**Author:** [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Replies:** 10\
**Last updated:** [July 2, 2024, 7:48am UTC](https://discourse.julialang.org/t/declaring-types-vector-union-int64-matrix-int64-is-much-slower-than-vector-any-why-is-that/116480 "2024-07-02T07:48:48Z")

</div>

Declaring types: Vector{Union{Int64, Matrix{Int64}}} is much slower than Vector{Any}, why is that? The following code is different from my declarations. f0 is not declared, f1 is declared ::Vector{Any}, and f2 is declar…

---

## [How to get the parent process id, ppid?](https://discourse.julialang.org/t/how-to-get-the-parent-process-id-ppid/116507)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 2\
**Last updated:** [July 2, 2024, 7:51am UTC](https://discourse.julialang.org/t/how-to-get-the-parent-process-id-ppid/116507 "2024-07-02T07:51:00Z")

</div>

I am trying to find out whether my julia is called from python, from R or plainly julia. Research brought me to using the ppid on Unix based systems, however I couldn’t find how to get it using julia.

---

## [Getting output of command from run(pipeline(...)) in both stdout and file](https://discourse.julialang.org/t/getting-output-of-command-from-run-pipeline-in-both-stdout-and-file/116472)

<div class="topic-metadata">

**Author:** [@Pablo\_Marchant](https://discourse.julialang.org/u/Pablo_Marchant)\
**Replies:** 3\
**Last updated:** [July 2, 2024, 7:49am UTC](https://discourse.julialang.org/t/getting-output-of-command-from-run-pipeline-in-both-stdout-and-file/116472 "2024-07-02T07:49:05Z")

</div>

Hi, I’m trying to write a small script to setup simulations in a cluster. These take a while to compute, and while doing so provide useful output informing of the state of the simulation. For that purpose, when using ba…

---

## [Python project calling Julia functions](https://discourse.julialang.org/t/python-project-calling-julia-functions/116191)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [July 2, 2024, 7:16am UTC](https://discourse.julialang.org/t/python-project-calling-julia-functions/116191 "2024-07-02T07:16:35Z")

</div>

I need to create a Python project that calls some of the functions exported by my Julia package KiteModels.jl. I need to manage both the Python and the Julia dependencies. What would be a good way to do that? For now i…

---

## [Can we add an alarm to Julia?](https://discourse.julialang.org/t/can-we-add-an-alarm-to-julia/116505)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 2\
**Last updated:** [July 2, 2024, 7:00am UTC](https://discourse.julialang.org/t/can-we-add-an-alarm-to-julia/116505 "2024-07-02T07:00:58Z")

</div>

Can we add an alarm to Julia so that it can sound an alarm when a program terminates?

---

## [CUDA kernel crash very occasionally when MPI.jl is just loaded](https://discourse.julialang.org/t/cuda-kernel-crash-very-occasionally-when-mpi-jl-is-just-loaded/116481)

<div class="topic-metadata">

**Author:** [@0samuraiE](https://discourse.julialang.org/u/0samuraiE)\
**Replies:** 2\
**Last updated:** [July 1, 2024, 10:39pm UTC](https://discourse.julialang.org/t/cuda-kernel-crash-very-occasionally-when-mpi-jl-is-just-loaded/116481 "2024-07-01T22:39:43Z")

</div>

Title: Feedback Needed on \[CUDA kernel crash very occasionally when MPI.jl is just loaded.\] (GitHub Issue #2429) Hello Julia community, I have encountered an issue “CUDA.jl kernel crash very occasionally when MPI.jl is …

---

## [Julia 1.10.x on Raspberry Pi 400](https://discourse.julialang.org/t/julia-1-10-x-on-raspberry-pi-400/116400)

<div class="topic-metadata">

**Author:** [@devel-chm](https://discourse.julialang.org/u/devel-chm)\
**Replies:** 8\
**Last updated:** [July 1, 2024, 5:49pm UTC](https://discourse.julialang.org/t/julia-1-10-x-on-raspberry-pi-400/116400 "2024-07-01T17:49:55Z")

</div>

I just installed the 1.6.7 julia on my Raspberry Pi 400. It runs but the TTFX is excruciating. I would like to install 1.10.x+ but there appear to be no binaries from the julialang.org site. Has anyone successfully …

---

## [Is there a nice way to add submatrices to a larger matrix?](https://discourse.julialang.org/t/is-there-a-nice-way-to-add-submatrices-to-a-larger-matrix/116420)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 4\
**Last updated:** [July 1, 2024, 2:34pm UTC](https://discourse.julialang.org/t/is-there-a-nice-way-to-add-submatrices-to-a-larger-matrix/116420 "2024-07-01T14:34:23Z")

</div>

So I’ve found two ways of doing this, the obvious for-loop way and the slightly more Julian infix operator way. First, the for-loop way for (ind,i) in enumerate(indices) M\[i:i+n, i:i+m\] .= A\[ind\] end Where indices co…

---

## [Saving Makie plot so one can pan/zoom on the saved file](https://discourse.julialang.org/t/saving-makie-plot-so-one-can-pan-zoom-on-the-saved-file/116467)

<div class="topic-metadata">

**Author:** [@hhindley](https://discourse.julialang.org/u/hhindley)\
**Replies:** 2\
**Last updated:** [July 1, 2024, 12:41pm UTC](https://discourse.julialang.org/t/saving-makie-plot-so-one-can-pan-zoom-on-the-saved-file/116467 "2024-07-01T12:41:08Z")

</div>

In PlotlyJS you can save plots as HTML and the interactivity is preserved, however the data I’m plotting is much too big for PlotlyJS so I’m using Makie.jl and InteractiveViz.jl. I’m trying to save these plots so that t…

---

## [Insert value with fixed size/gc time](https://discourse.julialang.org/t/insert-value-with-fixed-size-gc-time/116419)

<div class="topic-metadata">

**Author:** [@Sihyun\_Kim](https://discourse.julialang.org/u/Sihyun_Kim)\
**Replies:** 5\
**Last updated:** [July 1, 2024, 9:03am UTC](https://discourse.julialang.org/t/insert-value-with-fixed-size-gc-time/116419 "2024-07-01T09:03:43Z")

</div>

I am a julia beginner. I am working on a large structural (economic) model. But, the problem is that one iteration of the entire model takes 395 seconds, and its 42.84% consists of gc time. My suspicion is that the follo…

---

## [Anomalous "JuliaSyntax parser failed" error - julia 1.11.0-DEV](https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382)

<div class="topic-metadata">

**Author:** [@jjiw](https://discourse.julialang.org/u/jjiw)\
**Replies:** 6\
**Last updated:** [July 1, 2024, 7:25am UTC](https://discourse.julialang.org/t/anomalous-juliasyntax-parser-failed-error-julia-1-11-0-dev/116382 "2024-07-01T07:25:14Z")

</div>

Running julia parsererr2.jl (with parsererr2.jl as shown later) produces a proper error message\* about a misplaced bracket: ERROR: LoadError: syntax: missing last argument in "w\[4\]:" range expression Stacktrace: \[1\] …

---

## [How to save @macroexpand output to file on windows?](https://discourse.julialang.org/t/how-to-save-macroexpand-output-to-file-on-windows/116452)

<div class="topic-metadata">

**Author:** [@freedomjin](https://discourse.julialang.org/u/freedomjin)\
**Replies:** 1\
**Last updated:** [July 1, 2024, 1:55am UTC](https://discourse.julialang.org/t/how-to-save-macroexpand-output-to-file-on-windows/116452 "2024-07-01T01:55:04Z")

</div>

Hi, I’m studying someone else’s macro code, and would like to save the generated code to a file using @macroexpand and check out what is been done. But @macroexpand does not seem to return a string or any object, it only…

---

## [Multithreading with seperate caches for each thread?](https://discourse.julialang.org/t/multithreading-with-seperate-caches-for-each-thread/116441)

<div class="topic-metadata">

**Author:** [@recklurker](https://discourse.julialang.org/u/recklurker)\
**Replies:** 7\
**Last updated:** [June 30, 2024, 9:04pm UTC](https://discourse.julialang.org/t/multithreading-with-seperate-caches-for-each-thread/116441 "2024-06-30T21:04:25Z")

</div>

Hi everyone, I am writing a finite element solver. Since the solver takes a lot of time on a single core, I am trying to parallelize it. The solver method has several functional calls which share some cache. This has be…

---

## [Type instability in parametric struct](https://discourse.julialang.org/t/type-instability-in-parametric-struct/116266)

<div class="topic-metadata">

**Author:** [@moble](https://discourse.julialang.org/u/moble)\
**Replies:** 7\
**Last updated:** [June 30, 2024, 8:54pm UTC](https://discourse.julialang.org/t/type-instability-in-parametric-struct/116266 "2024-06-30T20:54:49Z")

</div>

I have a struct where one field is some collection, and another is just a single element of the collection’s eltype. (The real application is more complicated, but I describe the MWE.) I need to use the collection’s ty…

---

## [\`sizeof\` on custom struct does not check fields](https://discourse.julialang.org/t/sizeof-on-custom-struct-does-not-check-fields/116311)

<div class="topic-metadata">

**Author:** [@Leo\_I](https://discourse.julialang.org/u/Leo_I)\
**Replies:** 4\
**Last updated:** [June 30, 2024, 6:53pm UTC](https://discourse.julialang.org/t/sizeof-on-custom-struct-does-not-check-fields/116311 "2024-06-30T18:53:45Z")

</div>

For any Julia variable, I wish to check how much memory it uses just to exist. The docstring of sizeof states: Size, in bytes, of the canonical binary representation of the given DataType T, if any. Or the size, in byt…

---

## [Running multiple instances of an already parallel external program in parallel](https://discourse.julialang.org/t/running-multiple-instances-of-an-already-parallel-external-program-in-parallel/116436)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 1\
**Last updated:** [June 30, 2024, 6:42pm UTC](https://discourse.julialang.org/t/running-multiple-instances-of-an-already-parallel-external-program-in-parallel/116436 "2024-06-30T18:42:40Z")

</div>

I have a situation like below: Julia nrep = 3 Threads.@threads for i in 1:nrep run(\`bash -c """cd $path && ./external\_program"""\`) end external\_program.cpp #pragma omp parallel for num\_threads(10) for (int i = 0;…

---

## [Help in deploying docs](https://discourse.julialang.org/t/help-in-deploying-docs/116434)

<div class="topic-metadata">

**Author:** [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Replies:** 3\
**Last updated:** [June 30, 2024, 5:27pm UTC](https://discourse.julialang.org/t/help-in-deploying-docs/116434 "2024-06-30T17:27:10Z")

</div>

Hello, i am ready to publish a package. The documentation is not deployed, although the github workflow completes successfully and the documentation build smoothly locally. The package is here https://github.com/Marco-…

---

## [How Julia has an unrealized potential to have some of the best ECS(Entity Component System) in the world](https://discourse.julialang.org/t/how-julia-has-an-unrealized-potential-to-have-some-of-the-best-ecs-entity-component-system-in-the-world/116383)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 1\
**Last updated:** [June 30, 2024, 12:48pm UTC](https://discourse.julialang.org/t/how-julia-has-an-unrealized-potential-to-have-some-of-the-best-ecs-entity-component-system-in-the-world/116383 "2024-06-30T12:48:49Z")

</div>

ECS is used in game development and potentially other simulations. Archetypal ECS works by grouping entities with the same combination of traits together and update entities “all at once”. However, even with the huge pe…

---

## [AssertionError in K-medoids algorithm](https://discourse.julialang.org/t/assertionerror-in-k-medoids-algorithm/116425)

<div class="topic-metadata">

**Author:** [@Hasselvej](https://discourse.julialang.org/u/Hasselvej)\
**Replies:** 0\
**Last updated:** [June 30, 2024, 12:12pm UTC](https://discourse.julialang.org/t/assertionerror-in-k-medoids-algorithm/116425 "2024-06-30T12:12:20Z")

</div>

I am using K-medoids to reduce my data (potential future scenarios of a stock’s price) from 400 scenarios to n = 25. I computed the distance matrix based on the Eucledian distance: C = pairwise(Euclidean(), data', data'…

---

## [Possibly unclear manual regarding Base.touch](https://discourse.julialang.org/t/possibly-unclear-manual-regarding-base-touch/116388)

<div class="topic-metadata">

**Author:** [@George\_Morrison](https://discourse.julialang.org/u/George_Morrison)\
**Replies:** 4\
**Last updated:** [June 30, 2024, 10:31am UTC](https://discourse.julialang.org/t/possibly-unclear-manual-regarding-base-touch/116388 "2024-06-30T10:31:02Z")

</div>

Sorry I was not sure where this should go. I was trying to follow a tutorial and it suggested the following command: touch(“10\_Streams\_Networking\\sample\_file.txt”) changed touch(joinpath(“10\_Streams\_Networking”, “samp…

---

## [How can I use a Holy trait defined in a module outside of it?](https://discourse.julialang.org/t/how-can-i-use-a-holy-trait-defined-in-a-module-outside-of-it/116408)

<div class="topic-metadata">

**Author:** [@paalon](https://discourse.julialang.org/u/paalon)\
**Replies:** 3\
**Last updated:** [June 30, 2024, 7:49am UTC](https://discourse.julialang.org/t/how-can-i-use-a-holy-trait-defined-in-a-module-outside-of-it/116408 "2024-06-30T07:49:28Z")

</div>

I’m studying Julia’s Holy traits along with traits in Rust, Scala and the original traits paper, “Traits: A Mechanism for Fine-grained Reuse”. I want to use a trait Color defined in ColorModule outside of its module. I w…

---

## [Which pivoting strategy is used in \`LinearAlgebra.bunchkaufman()\` function for Bunch-Kaufman factorization when we still not using rook pivoting?](https://discourse.julialang.org/t/which-pivoting-strategy-is-used-in-linearalgebra-bunchkaufman-function-for-bunch-kaufman-factorization-when-we-still-not-using-rook-pivoting/116399)

<div class="topic-metadata">

**Author:** [@shubh\_b](https://discourse.julialang.org/u/shubh_b)\
**Replies:** 0\
**Last updated:** [June 29, 2024, 8:21pm UTC](https://discourse.julialang.org/t/which-pivoting-strategy-is-used-in-linearalgebra-bunchkaufman-function-for-bunch-kaufman-factorization-when-we-still-not-using-rook-pivoting/116399 "2024-06-29T20:21:02Z")

</div>

When trying to do Bunch-Kaufman factorization of the symmetric matrix A like below: julia\> using LinearAlgebra julia\> M = \[4 12 -16; 9.5 37 -43; 11 -6.5 9\]; julia\> A = Symmetric(M, :L) 3×3 Symmetric{Float64, Matrix{Fl…

---

## [What is the use case for ScopedValues?](https://discourse.julialang.org/t/what-is-the-use-case-for-scopedvalues/116390)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 1\
**Last updated:** [June 29, 2024, 2:31pm UTC](https://discourse.julialang.org/t/what-is-the-use-case-for-scopedvalues/116390 "2024-06-29T14:31:29Z")

</div>

I did some googling about ScopedValues, and generally understand that they are useful for threaded applications, but I’m still not tracking their value against just passing a value as an argument. Could someone give me …

---

## [How to release the extra buffer after insert! an array?](https://discourse.julialang.org/t/how-to-release-the-extra-buffer-after-insert-an-array/116385)

<div class="topic-metadata">

**Author:** [@Blumenkranz](https://discourse.julialang.org/u/Blumenkranz)\
**Replies:** 8\
**Last updated:** [June 29, 2024, 9:41am UTC](https://discourse.julialang.org/t/how-to-release-the-extra-buffer-after-insert-an-array/116385 "2024-06-29T09:41:29Z")

</div>

I found that julia allocates a lot when insert! an array for the first time. But for the second or subsequent insert! operations, the memory allocation becomes 0. I guess that the initial insert! pre-allocates memory to …

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

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