# General Usage

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

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

**Page:** 111

---

## [Allocations when using getfield with a tuple/vector of symbols](https://discourse.julialang.org/t/allocations-when-using-getfield-with-a-tuple-vector-of-symbols/122756)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 12\
**Last updated:** [November 20, 2024, 2:45am UTC](https://discourse.julialang.org/t/allocations-when-using-getfield-with-a-tuple-vector-of-symbols/122756 "2024-11-20T02:45:24Z")

</div>

MWE: using Parameters, BenchmarkTools @with\_kw struct Test A :: String = "A" B :: Int64 = 0 end test = Test() tup = (:A, :B) @btime getfield($test, :A) @btime getfield($test, $tup\[1\]) Is there a way to loop…

---

## [Find nearest neighbours among boundary sets](https://discourse.julialang.org/t/find-nearest-neighbours-among-boundary-sets/122342)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 33\
**Last updated:** [November 19, 2024, 7:43pm UTC](https://discourse.julialang.org/t/find-nearest-neighbours-among-boundary-sets/122342 "2024-11-19T19:43:51Z")

</div>

I have a set of boundaries defining UK electoral constituencies. I can pick one and look for its nearest neighbours like this: con\_bounds = GeoIO.load("Westminster\_Parliamentary\_Constituencies\_July\_2024\_Boundaries\_UK\_BF…

---

## [Use PrettyTables.pretty\_table for StructArray display](https://discourse.julialang.org/t/use-prettytables-pretty-table-for-structarray-display/122797)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 4\
**Last updated:** [November 19, 2024, 7:06pm UTC](https://discourse.julialang.org/t/use-prettytables-pretty-table-for-structarray-display/122797 "2024-11-19T19:06:26Z")

</div>

In my VSCode REPL I want the normal display of StructArray instances to be PrettyTables.pretty\_table. What should I do?

---

## [Display of dictionary contents to file](https://discourse.julialang.org/t/display-of-dictionary-contents-to-file/122785)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 3\
**Last updated:** [November 19, 2024, 6:24pm UTC](https://discourse.julialang.org/t/display-of-dictionary-contents-to-file/122785 "2024-11-19T18:24:36Z")

</div>

Hi, I have a general question regarding dictionaries display. I have a dictionary that has several fields, some of which are instances of types I’ve created that conatin really large arrays of numbers. When I print its …

---

## [Read a .xlsx file](https://discourse.julialang.org/t/read-a-xlsx-file/122770)

<div class="topic-metadata">

**Author:** [@Dionysus](https://discourse.julialang.org/u/Dionysus)\
**Replies:** 15\
**Last updated:** [November 19, 2024, 4:54pm UTC](https://discourse.julialang.org/t/read-a-xlsx-file/122770 "2024-11-19T16:54:51Z")

</div>

Hello, I am encountering difficulties while trying to read a .xlsx file using Julia. Why is my code unable to find the sheet?

---

## [Support for signaling NaNs?](https://discourse.julialang.org/t/support-for-signaling-nans/75571)

<div class="topic-metadata">

**Author:** [@stephancb](https://discourse.julialang.org/u/stephancb)\
**Replies:** 1\
**Last updated:** [November 19, 2024, 3:47pm UTC](https://discourse.julialang.org/t/support-for-signaling-nans/75571 "2024-11-19T15:47:08Z")

</div>

In Julia generally missing is favored over NaN, among other because NaN work only for floating point types, and because the origin of NaNs can be hard to trace once they have infected the data. However, IEEE745 has als…

---

## [Project.toml \[sources\] section not working?](https://discourse.julialang.org/t/project-toml-sources-section-not-working/122795)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 2\
**Last updated:** [November 19, 2024, 2:04pm UTC](https://discourse.julialang.org/t/project-toml-sources-section-not-working/122795 "2024-11-19T14:04:36Z")

</div>

Now that sources are enabled in Project.toml files, I expected to be able to define my package dependency source once and have that be know to all users of my package, but that does not seem to be working. I think Julia …

---

## [How to execute a script in the current project?](https://discourse.julialang.org/t/how-to-execute-a-script-in-the-current-project/122669)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 3\
**Last updated:** [November 17, 2024, 4:18pm UTC](https://discourse.julialang.org/t/how-to-execute-a-script-in-the-current-project/122669 "2024-11-17T16:18:15Z")

</div>

I have many packages that include examples on how to use them in an example folder. In addition I have a terminal menu to execute the examples. If you want to try it out: git clone https://github.com/ufechner7/KiteMode…

---

## [Automatic saving of Pluto notebooks in a Mac](https://discourse.julialang.org/t/automatic-saving-of-pluto-notebooks-in-a-mac/122776)

<div class="topic-metadata">

**Author:** [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Replies:** 3\
**Last updated:** [November 19, 2024, 9:33am UTC](https://discourse.julialang.org/t/automatic-saving-of-pluto-notebooks-in-a-mac/122776 "2024-11-19T09:33:23Z")

</div>

I have a problem with students who drag and drop a Pluto notebook into the “Open a notebook” window, running the notebook but not giving a particular path and name to save it. Pluto saves the notebook automatically if o…

---

## [Package for rendering/customizing html tables in Quarto](https://discourse.julialang.org/t/package-for-rendering-customizing-html-tables-in-quarto/122802)

<div class="topic-metadata">

**Author:** [@aww-r](https://discourse.julialang.org/u/aww-r)\
**Replies:** 4\
**Last updated:** [November 19, 2024, 8:48am UTC](https://discourse.julialang.org/t/package-for-rendering-customizing-html-tables-in-quarto/122802 "2024-11-19T08:48:45Z")

</div>

I’m working on some Quarto documents (text/charts/tables) and I’m struggling to find a package similar to GT (in R) where I can fully customize the layout. Apart from PrettyTables (which doesn’t look good on a modern htm…

---

## [How to customize figure size (and other things) with using GraphMakie?](https://discourse.julialang.org/t/how-to-customize-figure-size-and-other-things-with-using-graphmakie/122572)

<div class="topic-metadata">

**Author:** [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Replies:** 5\
**Last updated:** [November 19, 2024, 6:59am UTC](https://discourse.julialang.org/t/how-to-customize-figure-size-and-other-things-with-using-graphmakie/122572 "2024-11-19T06:59:22Z")

</div>

I have the following code to draw a directed graph with edge weights. ## Load the packages using Random using CairoMakie using GraphMakie using Graphs using LaTeXStrings using Colors ## Create a random directed graph v…

---

## [Resize! error in 1.11](https://discourse.julialang.org/t/resize-error-in-1-11/122777)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 4\
**Last updated:** [November 19, 2024, 3:08am UTC](https://discourse.julialang.org/t/resize-error-in-1-11/122777 "2024-11-19T03:08:42Z")

</div>

I tried out the old example code from 2018 at this link for some real time plotting. It errored in 1.11.1 with a resize! error. When I tried it in 1.10.6 it worked fine. I am assuming there should be a new method writ…

---

## [Most efficient way of adding elements within matrices in loops](https://discourse.julialang.org/t/most-efficient-way-of-adding-elements-within-matrices-in-loops/122789)

<div class="topic-metadata">

**Author:** [@BMI\_OR](https://discourse.julialang.org/u/BMI_OR)\
**Replies:** 4\
**Last updated:** [November 18, 2024, 11:31pm UTC](https://discourse.julialang.org/t/most-efficient-way-of-adding-elements-within-matrices-in-loops/122789 "2024-11-18T23:31:41Z")

</div>

I have a vector A and I need to update its values with the ones of matrix B. Each element of B needs to be added to some values in A. The mapping of indeces from matrix to vector is given by a matrix of vectors C. I have…

---

## [Understanding DataFrame allocations](https://discourse.julialang.org/t/understanding-dataframe-allocations/122792)

<div class="topic-metadata">

**Author:** [@miguelborrero](https://discourse.julialang.org/u/miguelborrero)\
**Replies:** 1\
**Last updated:** [November 18, 2024, 10:16pm UTC](https://discourse.julialang.org/t/understanding-dataframe-allocations/122792 "2024-11-18T22:16:22Z")

</div>

Hi there, The split-apply-combine strategy is something that I use a lot so Im trying to understand a bit more what goes under the hood so that I can write better code. I was just looking at the following example: df =…

---

## [Best way to use/implement Debye function in Julia?](https://discourse.julialang.org/t/best-way-to-use-implement-debye-function-in-julia/111090)

<div class="topic-metadata">

**Author:** [@trg818](https://discourse.julialang.org/u/trg818)\
**Replies:** 29\
**Last updated:** [November 18, 2024, 8:56pm UTC](https://discourse.julialang.org/t/best-way-to-use-implement-debye-function-in-julia/111090 "2024-11-18T20:56:46Z")

</div>

I need the 3rd-order Debye function in a Julia routine and wonder which is the best way to use/implement it. Searching for it in different repositories, I found various implementations, some of which based on simply sol…

---

## [Julia access to Apple GPU with MLX, and or Metal Performance Shaders (MPS)?](https://discourse.julialang.org/t/julia-access-to-apple-gpu-with-mlx-and-or-metal-performance-shaders-mps/117647)

<div class="topic-metadata">

**Author:** [@pitsianis](https://discourse.julialang.org/u/pitsianis)\
**Replies:** 5\
**Last updated:** [November 18, 2024, 8:13pm UTC](https://discourse.julialang.org/t/julia-access-to-apple-gpu-with-mlx-and-or-metal-performance-shaders-mps/117647 "2024-11-18T20:13:22Z")

</div>

Is there any on-going effort to provide a Julia interface to the following? Metal Performance Shaders (MPS) is a PyTorch framework backend for GPU training acceleration, providing scripts and capabilities to set up an…

---

## [Updating julia on macos](https://discourse.julialang.org/t/updating-julia-on-macos/103484)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 7\
**Last updated:** [November 18, 2024, 7:42pm UTC](https://discourse.julialang.org/t/updating-julia-on-macos/103484 "2024-11-18T19:42:27Z")

</div>

when I update julia, I use the tar.gz file. after opening the archive, I get security warnings/errors from macos about running unrecognized software I have to “allow anyway” in the security settings “julia”, and when up…

---

## [How to differentiate using Enzyme.jl?](https://discourse.julialang.org/t/how-to-differentiate-using-enzyme-jl/122765)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 7\
**Last updated:** [November 18, 2024, 7:02pm UTC](https://discourse.julialang.org/t/how-to-differentiate-using-enzyme-jl/122765 "2024-11-18T19:02:34Z")

</div>

Hello, I don’t really understand how Enzyme.jl actually works. I more or less understand that the Const arguments are not considered in the differentiation, and that Active and Duplicated are used otherwise. Duplicated …

---

## [Why is my one loop faster than the other?](https://discourse.julialang.org/t/why-is-my-one-loop-faster-than-the-other/122771)

<div class="topic-metadata">

**Author:** [@J-J](https://discourse.julialang.org/u/J-J)\
**Replies:** 6\
**Last updated:** [November 18, 2024, 2:35pm UTC](https://discourse.julialang.org/t/why-is-my-one-loop-faster-than-the-other/122771 "2024-11-18T14:35:57Z")

</div>

As a MWE, I wrote the following two functions in Julia, both of which depend on a global constant integer N and a global constant vector global\_vector: using BenchmarkTools const N = 1024 const global\_vector = rand(N) …

---

## [Check if is folder empty](https://discourse.julialang.org/t/check-if-is-folder-empty/122761)

<div class="topic-metadata">

**Author:** [@hhaensel](https://discourse.julialang.org/u/hhaensel)\
**Replies:** 3\
**Last updated:** [November 18, 2024, 2:35pm UTC](https://discourse.julialang.org/t/check-if-is-folder-empty/122761 "2024-11-18T14:35:02Z")

</div>

What’s the best way to check if a folder is empty if folders possibly contains 10\_000 files? isempty(readdir(mydir)) The point is that I want to list all empty subfolders of a directory, but mapping readdir on all non-…

---

## [Artifact not found for test in Github CI](https://discourse.julialang.org/t/artifact-not-found-for-test-in-github-ci/122697)

<div class="topic-metadata">

**Author:** [@aTrotier](https://discourse.julialang.org/u/aTrotier)\
**Replies:** 3\
**Last updated:** [November 18, 2024, 2:31pm UTC](https://discourse.julialang.org/t/artifact-not-found-for-test-in-github-ci/122697 "2024-11-18T14:31:50Z")

</div>

Hi, I am trying to use an artifact download from zenodo during the test (and also in the doc). I was able to figure out a way to use it for the doc but it keeps failing in the github CI : Testing Running tests...…

---

## [Installing OrdinaryDiffEqBDF fails](https://discourse.julialang.org/t/installing-ordinarydiffeqbdf-fails/122767)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 6\
**Last updated:** [November 18, 2024, 2:10pm UTC](https://discourse.julialang.org/t/installing-ordinarydiffeqbdf-fails/122767 "2024-11-18T14:10:42Z")

</div>

If I try to install OrdinaryDiffEqBDF in a new, empty project I get the following error: ufechner@framework:~/repos/Ord$ julia --project="." \_ \_ \_ \_(\_)\_ | Documentation: https://docs.juliala…

---

## [Allocations even when using StaticArrays.jl](https://discourse.julialang.org/t/allocations-even-when-using-staticarrays-jl/122775)

<div class="topic-metadata">

**Author:** [@johnmyslinski](https://discourse.julialang.org/u/johnmyslinski)\
**Replies:** 2\
**Last updated:** [November 18, 2024, 2:09pm UTC](https://discourse.julialang.org/t/allocations-even-when-using-staticarrays-jl/122775 "2024-11-18T14:09:43Z")

</div>

Hi All, In this below MRE I am still seeing some allocations when using @btime. Based on my understanding, I would expect to see 0 allocations. Am I misunderstanding something? Are the 8 allocations I see a byproduct …

---

## [Can Symbolics handle complex numbers?](https://discourse.julialang.org/t/can-symbolics-handle-complex-numbers/122753)

<div class="topic-metadata">

**Author:** [@ccmejia](https://discourse.julialang.org/u/ccmejia)\
**Replies:** 4\
**Last updated:** [November 18, 2024, 12:41pm UTC](https://discourse.julialang.org/t/can-symbolics-handle-complex-numbers/122753 "2024-11-18T12:41:40Z")

</div>

Hi there! My code: using Symbolics @variables C\_0, C\_1, R, T, V, k, R0, g M = \[-2\*V\*cos(k) - im\*g V V\*exp(im\*k) 0; V -2\*V\*cos(k) + im\*g 0 V\*exp(2\*im\*k); 0 V 0 -2\*V\*cos(k)\*exp(2\*im\*k) + V\*exp(3\*im\*k); V…

---

## [ConcurrencyViolationError when loading packages via Requires.jl in julia 1.11](https://discourse.julialang.org/t/concurrencyviolationerror-when-loading-packages-via-requires-jl-in-julia-1-11/122685)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [November 18, 2024, 11:51am UTC](https://discourse.julialang.org/t/concurrencyviolationerror-when-loading-packages-via-requires-jl-in-julia-1-11/122685 "2024-11-18T11:51:43Z")

</div>

I have a package (not public, not registered) that loads ForwardDiff.jl and NonhomotheticCES.jl, which defines an extension for the former via Requires.jl. In Julia 1.11, I started getting the following error: 1 depen…

---

## [Retrieve current timezone](https://discourse.julialang.org/t/retrieve-current-timezone/122763)

<div class="topic-metadata">

**Author:** [@hhaensel](https://discourse.julialang.org/u/hhaensel)\
**Replies:** 6\
**Last updated:** [November 18, 2024, 11:41am UTC](https://discourse.julialang.org/t/retrieve-current-timezone/122763 "2024-11-18T11:41:36Z")

</div>

I am missing two things in Dates/TimeZones convert a unix timestamp into the computer’s local time determine the system’s timezone Maybe I missed something? For 1) I have found a solution, which could go into Dates a…

---

## [The smallest positive usable number](https://discourse.julialang.org/t/the-smallest-positive-usable-number/981)

<div class="topic-metadata">

**Author:** [@Alvaro\_M](https://discourse.julialang.org/u/Alvaro_M)\
**Replies:** 6\
**Last updated:** [November 18, 2024, 11:18am UTC](https://discourse.julialang.org/t/the-smallest-positive-usable-number/981 "2024-11-18T11:18:08Z")

</div>

In python to get the smallest positive usable number for a float you can use: numpy.finfo(float).tiny Julia implement the function eps, but I don’t see nothing similar to tiny. Thanks.

---

## [ChainRules(TestUtils) slow on Mac (Github CI)?](https://discourse.julialang.org/t/chainrules-testutils-slow-on-mac-github-ci/122760)

<div class="topic-metadata">

**Author:** [@juthohaegeman](https://discourse.julialang.org/u/juthohaegeman)\
**Replies:** 0\
**Last updated:** [November 18, 2024, 9:47am UTC](https://discourse.julialang.org/t/chainrules-testutils-slow-on-mac-github-ci/122760 "2024-11-18T09:47:53Z")

</div>

Is there any known issue with the speed of ChainRules.jl or ChainRulesTestUtils.jl on MacOS, in particular on the Github CI runners? For our package TensorKit.jl, we have a quite extensive suite of tests that are ran vi…

---

## [How to Automatically Generate Labels for \`ComposedFunction\`s in \`Plots.jl\`?](https://discourse.julialang.org/t/how-to-automatically-generate-labels-for-composedfunction-s-in-plots-jl/122702)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 1\
**Last updated:** [November 18, 2024, 7:40am UTC](https://discourse.julialang.org/t/how-to-automatically-generate-labels-for-composedfunction-s-in-plots-jl/122702 "2024-11-18T07:40:54Z")

</div>

I have the following code: using Plots f(x) = sin(x) plot(1:10, f.(1:10); label="$f") # This works as expected; the label is "f". g = f ∘ f plot(1:10, g.(1:10); label="$g") # The label here is "Main.f ∘ Main.f", but…

---

## [How to get a linsolve solution in matrix form?](https://discourse.julialang.org/t/how-to-get-a-linsolve-solution-in-matrix-form/39710)

<div class="topic-metadata">

**Author:** [@Jorge\_Silva](https://discourse.julialang.org/u/Jorge_Silva)\
**Replies:** 2\
**Last updated:** [November 18, 2024, 1:57am UTC](https://discourse.julialang.org/t/how-to-get-a-linsolve-solution-in-matrix-form/39710 "2024-11-18T01:57:30Z")

</div>

m using SymPy in Julia. My purpose is to solve a homogeneous system of linear equations (Ax=0) with more unknowns than variables (A is not square). Then, Im using the following code. using SymPy x, y, z, w = symbols("x…

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

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