# General Usage

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

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

**Page:** 126

---

## [Fastest way for GLMM](https://discourse.julialang.org/t/fastest-way-for-glmm/119892)

<div class="topic-metadata">

**Author:** [@Juh](https://discourse.julialang.org/u/Juh)\
**Replies:** 6\
**Last updated:** [October 7, 2024, 11:18pm UTC](https://discourse.julialang.org/t/fastest-way-for-glmm/119892 "2024-10-07T23:18:38Z")

</div>

Hi, I am conducting a single-cell eQTL analysis using Julia. I have several covariates (genotype PCs, sex, age) and a random effect represented by sample ID, as the single-cell data is quite structured. The model should…

---

## [Connection to BigQuery with GoogleStorage](https://discourse.julialang.org/t/connection-to-bigquery-with-googlestorage/120930)

<div class="topic-metadata">

**Author:** [@ErwanPiR](https://discourse.julialang.org/u/ErwanPiR)\
**Replies:** 4\
**Last updated:** [October 7, 2024, 4:01pm UTC](https://discourse.julialang.org/t/connection-to-bigquery-with-googlestorage/120930 "2024-10-07T16:01:08Z")

</div>

Hi, I have a question regarding the usage of the package GoogleCloud.jl Following the documentation, I manage to connect to a bucket in Google Cloud Storage but the documentation doesn’t provide a example to connect to…

---

## [Tuple-based (immutable, ordered) Dictionary and nested REPLCompletion](https://discourse.julialang.org/t/tuple-based-immutable-ordered-dictionary-and-nested-replcompletion/121004)

<div class="topic-metadata">

**Author:** [@marquito](https://discourse.julialang.org/u/marquito)\
**Replies:** 2\
**Last updated:** [October 7, 2024, 3:48pm UTC](https://discourse.julialang.org/t/tuple-based-immutable-ordered-dictionary-and-nested-replcompletion/121004 "2024-10-07T15:48:51Z")

</div>

Hi! Since I couldn’t find a tuple-based (immutable and ordered) dictionary I came up with the following: struct TupleDict{K,V} \<: AbstractDict{K,V} ks::Tuple{Vararg{K}} vs::Tuple{Vararg{V}} function TupleDict{K,…

---

## [Timing compilation when using threads](https://discourse.julialang.org/t/timing-compilation-when-using-threads/121001)

<div class="topic-metadata">

**Author:** [@theogf](https://discourse.julialang.org/u/theogf)\
**Replies:** 0\
**Last updated:** [October 7, 2024, 11:56am UTC](https://discourse.julialang.org/t/timing-compilation-when-using-threads/121001 "2024-10-07T11:56:38Z")

</div>

Is it possible to correctly measure compilation time when using Tasks on separate threads? I have tried using the 1.11 @timed but get inconsistent timings for the compilation time. I also don’t have a clear picture of …

---

## [How to increase number of facets for cylinder plotting in Makie](https://discourse.julialang.org/t/how-to-increase-number-of-facets-for-cylinder-plotting-in-makie/120984)

<div class="topic-metadata">

**Author:** [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Replies:** 1\
**Last updated:** [October 7, 2024, 1:55am UTC](https://discourse.julialang.org/t/how-to-increase-number-of-facets-for-cylinder-plotting-in-makie/120984 "2024-10-07T01:55:42Z")

</div>

I am plotting a cylinder in makie like so: julia\> cyl = GeometryBasics.Cylinder(GeometryBasics.Point(0.0,0.0,0.0),GeometryBasics.Point(0.0,1.0,0.0),.5) Cylinder3{Float64}(\[0.0, 0.0, 0.0\], \[0.0, 1.0, 0.0\], 0.5) julia\> m…

---

## [Elements in my \`Set\` are not unique](https://discourse.julialang.org/t/elements-in-my-set-are-not-unique/120985)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 2\
**Last updated:** [October 7, 2024, 3:14am UTC](https://discourse.julialang.org/t/elements-in-my-set-are-not-unique/120985 "2024-10-07T03:14:36Z")

</div>

The documentation for Set says: Elements in a Set are unique, as determined by the elements’ definition of isequal. This doesn’t seem to be true: struct S x::Vector{Int} S() = new(Int\[\]) end Base.isequal(::S…

---

## [When to define a \`module\`](https://discourse.julialang.org/t/when-to-define-a-module/120935)

<div class="topic-metadata">

**Author:** [@Santiago\_Lopez](https://discourse.julialang.org/u/Santiago_Lopez)\
**Replies:** 22\
**Last updated:** [October 6, 2024, 11:20pm UTC](https://discourse.julialang.org/t/when-to-define-a-module/120935 "2024-10-06T23:20:53Z")

</div>

When developing a package (call it MyPackage) one usually has a “main” function src/MyPackage.jl. This file is a module with a bunch of using, export and include statements. The export statements establish the API of th…

---

## [Pseudoinverse x Factorization in a repeated linear solve: when to use which?](https://discourse.julialang.org/t/pseudoinverse-x-factorization-in-a-repeated-linear-solve-when-to-use-which/120972)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 6\
**Last updated:** [October 6, 2024, 9:41pm UTC](https://discourse.julialang.org/t/pseudoinverse-x-factorization-in-a-repeated-linear-solve-when-to-use-which/120972 "2024-10-06T21:41:34Z")

</div>

Assume I want to solve Ax = b for a bunch of different b's, but keeping A fixed. Furthermore, assume A is a tall matrix. The question is, what are the pros and cons of precomputing the pseudoinverse of A and precomputing…

---

## [IO Parallelism Strategies](https://discourse.julialang.org/t/io-parallelism-strategies/120970)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 3\
**Last updated:** [October 6, 2024, 9:14pm UTC](https://discourse.julialang.org/t/io-parallelism-strategies/120970 "2024-10-06T21:14:46Z")

</div>

I have a use case with many small IOs (get/put S3 objects \<300mb), a heartbeat (keep SQS message from timing out), and a heavy compute task which consumes a constant stream of inputs. The machine I’m using has 2 cores. R…

---

## [Solving a Diagonal ODE using DifferentialEquations.jl](https://discourse.julialang.org/t/solving-a-diagonal-ode-using-differentialequations-jl/120956)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 8\
**Last updated:** [October 6, 2024, 11:43am UTC](https://discourse.julialang.org/t/solving-a-diagonal-ode-using-differentialequations-jl/120956 "2024-10-06T11:43:21Z")

</div>

Hello, I have the following ODE system \\dot{\\mathbf{u}} = \\mathbf{A} \\ \\mathbf{u} where \\mathbf{u} is a vector and \\mathbf{A} is a Diagonal matrix. The following ODE system admits an analytical solution of the form …

---

## [Determine if Array is Mmap?](https://discourse.julialang.org/t/determine-if-array-is-mmap/87354)

<div class="topic-metadata">

**Author:** [@JesperMartinsson](https://discourse.julialang.org/u/JesperMartinsson)\
**Replies:** 4\
**Last updated:** [October 6, 2024, 7:34am UTC](https://discourse.julialang.org/t/determine-if-array-is-mmap/87354 "2024-10-06T07:34:23Z")

</div>

Is there a way to determine if an Array is memory mapped or standard? For example, taken from the doc: # Create a file for mmapping # (you could alternatively use mmap to do this step, too) using Mmap A = rand(1:20, 5,…

---

## [Reducing usage of resources during precompilation](https://discourse.julialang.org/t/reducing-usage-of-resources-during-precompilation/109903)

<div class="topic-metadata">

**Author:** [@pvarshinee](https://discourse.julialang.org/u/pvarshinee)\
**Replies:** 9\
**Last updated:** [October 6, 2024, 2:14am UTC](https://discourse.julialang.org/t/reducing-usage-of-resources-during-precompilation/109903 "2024-10-06T02:14:00Z")

</div>

Hello, I am trying to set up a Julia kernel in mybinder.org with a few packages. Here is the GitHub repo for the kernel. I find the precompilation failing due to the process overrunning the maximum amount of RAM (2GB) pr…

---

## [How to change the artifact path temporarily?](https://discourse.julialang.org/t/how-to-change-the-artifact-path-temporarily/120950)

<div class="topic-metadata">

**Author:** [@happyxie](https://discourse.julialang.org/u/happyxie)\
**Replies:** 3\
**Last updated:** [October 5, 2024, 7:28pm UTC](https://discourse.julialang.org/t/how-to-change-the-artifact-path-temporarily/120950 "2024-10-05T19:28:47Z")

</div>

I am trying to download some matrices from SuiteSparseMatrixCollection and it always downloads it to C:\\Users\\username\\.julia\\artifacts . Is it possible to download it to the current project directory by temporarily chan…

---

## [When I am running Julia in VS Code and I press Shift Enter the line of Code is not evaluated. Help](https://discourse.julialang.org/t/when-i-am-running-julia-in-vs-code-and-i-press-shift-enter-the-line-of-code-is-not-evaluated-help/120943)

<div class="topic-metadata">

**Author:** [@larrysievers](https://discourse.julialang.org/u/larrysievers)\
**Replies:** 2\
**Last updated:** [October 5, 2024, 11:48am UTC](https://discourse.julialang.org/t/when-i-am-running-julia-in-vs-code-and-i-press-shift-enter-the-line-of-code-is-not-evaluated-help/120943 "2024-10-05T11:48:24Z")

</div>

How do I get VS Code, running with Julia, to evaluate a line of Code? I thought pressing Shift Enter was the way to accomplish evaluating a line of Code.

---

## [Julia manual evaluates the expression. Why does it report an error when I run it myself?](https://discourse.julialang.org/t/julia-manual-evaluates-the-expression-why-does-it-report-an-error-when-i-run-it-myself/120954)

<div class="topic-metadata">

**Author:** [@qianlvzhe](https://discourse.julialang.org/u/qianlvzhe)\
**Replies:** 3\
**Last updated:** [October 5, 2024, 10:30am UTC](https://discourse.julialang.org/t/julia-manual-evaluates-the-expression-why-does-it-report-an-error-when-i-run-it-myself/120954 "2024-10-05T10:30:02Z")

</div>

---

## [Best way to ensure only certain values are allowed for a particular arg?](https://discourse.julialang.org/t/best-way-to-ensure-only-certain-values-are-allowed-for-a-particular-arg/120952)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 4\
**Last updated:** [October 5, 2024, 10:17am UTC](https://discourse.julialang.org/t/best-way-to-ensure-only-certain-values-are-allowed-for-a-particular-arg/120952 "2024-10-05T10:17:53Z")

</div>

In trying to write a clone of numpy API in Julia, I see the numpy.array has an argument which accepts only 4 values but is other a string in Python. The 4 possibles values are C , F, A, K. So I want to make sure that ar…

---

## [How to define a Julia Vector with only integers ≥ 0](https://discourse.julialang.org/t/how-to-define-a-julia-vector-with-only-integers-0/120894)

<div class="topic-metadata">

**Author:** [@Brinkhuis](https://discourse.julialang.org/u/Brinkhuis)\
**Replies:** 3\
**Last updated:** [October 5, 2024, 4:18am UTC](https://discourse.julialang.org/t/how-to-define-a-julia-vector-with-only-integers-0/120894 "2024-10-05T04:18:30Z")

</div>

As input for a function, I need a Vector with values greater than or equal to zero. I tried l = Array{\>:UInt8, 1} However push!(l, 9) throws an error. MethodError: no method matching push!(::Type{Vector{\>:UInt8}}, ::I…

---

## [Task scheduling and Priority](https://discourse.julialang.org/t/task-scheduling-and-priority/120817)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 16\
**Last updated:** [October 5, 2024, 2:33am UTC](https://discourse.julialang.org/t/task-scheduling-and-priority/120817 "2024-10-05T02:33:29Z")

</div>

I have a package that both collects data and analyzes the data. These parts are separated, with the data acquisition function periodically collecting data and writing this data to a file. The analysis function looks fo…

---

## [Forcing the E or F format without losing precision](https://discourse.julialang.org/t/forcing-the-e-or-f-format-without-losing-precision/120837)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 7\
**Last updated:** [October 4, 2024, 9:33pm UTC](https://discourse.julialang.org/t/forcing-the-e-or-f-format-without-losing-precision/120837 "2024-10-04T21:33:35Z")

</div>

I need a string decimal representation of a Float64 and I’d like to specify either the E format, e.g., “3.14e-3”, or the F format, “0.00314”, without having to worry about how many digits are necessary to preserve precis…

---

## [XLSX.writexlsx spends excessive time in gc on Windows](https://discourse.julialang.org/t/xlsx-writexlsx-spends-excessive-time-in-gc-on-windows/120687)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 9\
**Last updated:** [October 4, 2024, 5:56pm UTC](https://discourse.julialang.org/t/xlsx-writexlsx-spends-excessive-time-in-gc-on-windows/120687 "2024-10-04T17:56:06Z")

</div>

I need to create many Excel files in a batch. I use a common template and populate with different data and then write out the file to an IOBuffer() using XLSX.jl. This remains slower than I expected, even after this PR w…

---

## [Find positions of minimum and maximum values at once](https://discourse.julialang.org/t/find-positions-of-minimum-and-maximum-values-at-once/120908)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 5\
**Last updated:** [October 4, 2024, 5:48pm UTC](https://discourse.julialang.org/t/find-positions-of-minimum-and-maximum-values-at-once/120908 "2024-10-04T17:48:35Z")

</div>

The minimum and maximum values of an iterable can be found either with minimum and maximum, and more conveniently(\*) with extrema. Also, the positions of those extrema can be found with findmin and findmax (or argmin, a…

---

## [Remove dep from dev'd package](https://discourse.julialang.org/t/remove-dep-from-devd-package/120927)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 1\
**Last updated:** [October 4, 2024, 4:33pm UTC](https://discourse.julialang.org/t/remove-dep-from-devd-package/120927 "2024-10-04T16:33:38Z")

</div>

I’m getting an error like this: Failed to precompile XLSX \[fdbf4ff8-1666-58a4-91e7-1b58723a45e0\] to "C:\\\\Users\\\\TGebbels\\\\.julia\\\\compiled\\\\v1.10\\\\XLSX\\\\jl\_9E8E.tmp". ERROR: LoadError: ArgumentError: Package XLSX does n…

---

## [Plot problem, flat line in the middle of the plot](https://discourse.julialang.org/t/plot-problem-flat-line-in-the-middle-of-the-plot/120921)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 6\
**Last updated:** [October 4, 2024, 3:51pm UTC](https://discourse.julialang.org/t/plot-problem-flat-line-in-the-middle-of-the-plot/120921 "2024-10-04T15:51:38Z")

</div>

Hi, I have this datafile: data.jl (1.7 MB) I plot doing: using CSV using Plots csv=CSV.File("data.jl"; header=false, missingstring=\["99999.00"\]) res=hcat(csv.Column2,csv.Column3,csv.Column4,csv.Column5) plot(csv.Co…

---

## [Use exceptions vs other patterns?](https://discourse.julialang.org/t/use-exceptions-vs-other-patterns/120900)

<div class="topic-metadata">

**Author:** [@anon91151494](https://discourse.julialang.org/u/anon91151494)\
**Replies:** 22\
**Last updated:** [October 3, 2024, 2:47pm UTC](https://discourse.julialang.org/t/use-exceptions-vs-other-patterns/120900 "2024-10-03T14:47:52Z")

</div>

Again, I don’t understand what you mean here. I read elsewhere in the Julia documentation that Exception handling in Julia is done using try — catch — finally, instead of try — except — finally. In contrast to Python…

---

## [Reusing a complex FFT array’s memory as a real array, “C-style”](https://discourse.julialang.org/t/reusing-a-complex-fft-array-s-memory-as-a-real-array-c-style/120849)

<div class="topic-metadata">

**Author:** [@lmtzx9h4qqnt](https://discourse.julialang.org/u/lmtzx9h4qqnt)\
**Replies:** 7\
**Last updated:** [October 4, 2024, 1:50pm UTC](https://discourse.julialang.org/t/reusing-a-complex-fft-array-s-memory-as-a-real-array-c-style/120849 "2024-10-04T13:50:28Z")

</div>

When doing a complex-to-real FFT (using FFTW.jl), the real input and complex output arrays take roughly the same amount of memory. To quote from the rfft() docstring, If A has size (n\_1, …, n\_d), the result has size (n…

---

## [.cov files?](https://discourse.julialang.org/t/cov-files/44275)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 2\
**Last updated:** [October 4, 2024, 1:46pm UTC](https://discourse.julialang.org/t/cov-files/44275 "2024-10-04T13:46:21Z")

</div>

I don’t think this is Julia-related, but maybe it is still related to some practice of coding in Julia (and I don’t know where else to ask). Today I notice that lots of .cov files are generated in my Julia project direc…

---

## [Arrays of NamedTuples](https://discourse.julialang.org/t/arrays-of-namedtuples/120910)

<div class="topic-metadata">

**Author:** [@kingaa](https://discourse.julialang.org/u/kingaa)\
**Replies:** 2\
**Last updated:** [October 4, 2024, 1:29pm UTC](https://discourse.julialang.org/t/arrays-of-namedtuples/120910 "2024-10-04T13:29:49Z")

</div>

I’m designing a package based on manipulating arrays of NamedTuples. Should I be aware of any performance pitfalls associated with such structures? In particular, while many use cases will have NamedTuples, the element…

---

## [Type instabilities when introducing a Channel as a parameter in a ODE problem](https://discourse.julialang.org/t/type-instabilities-when-introducing-a-channel-as-a-parameter-in-a-ode-problem/105737)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 10\
**Last updated:** [October 4, 2024, 11:31am UTC](https://discourse.julialang.org/t/type-instabilities-when-introducing-a-channel-as-a-parameter-in-a-ode-problem/105737 "2024-10-04T11:31:40Z")

</div>

Hello. Hello, in the following I show a minimal working example of the problem. I want to implement a type stable function that solves an ODE that implements a Channel as a parameter. But I figured out that the solve fu…

---

## [Recursively using Rewrite rules in SymbolicUtils.jl](https://discourse.julialang.org/t/recursively-using-rewrite-rules-in-symbolicutils-jl/120899)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 0\
**Last updated:** [October 4, 2024, 9:15am UTC](https://discourse.julialang.org/t/recursively-using-rewrite-rules-in-symbolicutils-jl/120899 "2024-10-04T09:15:34Z")

</div>

I am trying to use SymbollicUtils.jls rewriting functionality to bring trigonometric expressions into a canonical form. Namely, I want to expand sin/cos of sums into products of sins/coss. The rules that I define work as…

---

## ["Type function"/"functor" -- where is info in documentation?](https://discourse.julialang.org/t/type-function-functor-where-is-info-in-documentation/120892)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 4\
**Last updated:** [October 4, 2024, 8:50am UTC](https://discourse.julialang.org/t/type-function-functor-where-is-info-in-documentation/120892 "2024-10-04T08:50:56Z")

</div>

I’m trying to find the correct name/documentation for defining “type functions” – any hint on where I can find it? As an example, consider the following function for computing some norms of a vector: function (v::Vecto…

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

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