# General Usage

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

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

**Page:** 115

---

## [Is \`empty!\` O(1)?](https://discourse.julialang.org/t/is-empty-o-1/122367)

<div class="topic-metadata">

**Author:** [@guoyongzhi](https://discourse.julialang.org/u/guoyongzhi)\
**Replies:** 4\
**Last updated:** [November 7, 2024, 12:35pm UTC](https://discourse.julialang.org/t/is-empty-o-1/122367 "2024-11-07T12:35:49Z")

</div>

The doc page says that empty! is nearly costless (and O(1)) for types that support this kind of preallocation. But the code of empty! and \_deleteend! show that it’s in O(n) complexity. The \_unsetindex! in iteration b…

---

## [A chainrule for multi-threaded map](https://discourse.julialang.org/t/a-chainrule-for-multi-threaded-map/122357)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 3\
**Last updated:** [November 7, 2024, 12:32pm UTC](https://discourse.julialang.org/t/a-chainrule-for-multi-threaded-map/122357 "2024-11-07T12:32:13Z")

</div>

Hi All, does anyone has a a chainrule for multi-threaded map? It should be “relatively” easy to implement by adapting ChainRules.jl/src/rulesets/Base/base.jl at 955941ec31aab80942658f517a2e024b3e7c812b · JuliaDiff/Chain…

---

## [Makie (GeoMakie + GLMakie) arrows doesn't use 'alpha=' parameter](https://discourse.julialang.org/t/makie-geomakie-glmakie-arrows-doesnt-use-alpha-parameter/122339)

<div class="topic-metadata">

**Author:** [@RobbesU](https://discourse.julialang.org/u/RobbesU)\
**Replies:** 2\
**Last updated:** [November 6, 2024, 7:23pm UTC](https://discourse.julialang.org/t/makie-geomakie-glmakie-arrows-doesnt-use-alpha-parameter/122339 "2024-11-06T19:23:28Z")

</div>

The docs for Makie arrows state alpha Defaults to 1.0 The alpha value of the colormap or color attribute. Multiple alphas like in plot(alpha=0.2, color=(:red, 0.5), will get multiplied. However, it appears the color…

---

## [UndefVarError Main.xxx issue](https://discourse.julialang.org/t/undefvarerror-main-xxx-issue/122061)

<div class="topic-metadata">

**Author:** [@Math027d](https://discourse.julialang.org/u/Math027d)\
**Replies:** 9\
**Last updated:** [November 7, 2024, 10:52am UTC](https://discourse.julialang.org/t/undefvarerror-main-xxx-issue/122061 "2024-11-07T10:52:05Z")

</div>

I have just bought a new computer, which is a MacBook Air with an M3 chip. Ever since installing Julia and adding the extension via Visual Studio Code I receive errors such as "UndefVarError: ‘…’ not defined in ‘Main.xxx…

---

## [What interface to implement for \`round(x, digits=n)\` to work?](https://discourse.julialang.org/t/what-interface-to-implement-for-round-x-digits-n-to-work/122372)

<div class="topic-metadata">

**Author:** [@barucden](https://discourse.julialang.org/u/barucden)\
**Replies:** 2\
**Last updated:** [November 7, 2024, 9:32am UTC](https://discourse.julialang.org/t/what-interface-to-implement-for-round-x-digits-n-to-work/122372 "2024-11-07T09:32:38Z")

</div>

There is a section in the documentation that explains what methods to implement to support rounding on a new type: Apparently, one needs to implement round(x::ObjType, r::RoundingMode). The section even includes an exa…

---

## [How do i import custom python modules in Julia](https://discourse.julialang.org/t/how-do-i-import-custom-python-modules-in-julia/122370)

<div class="topic-metadata">

**Author:** [@hangita101](https://discourse.julialang.org/u/hangita101)\
**Replies:** 1\
**Last updated:** [November 7, 2024, 6:57am UTC](https://discourse.julialang.org/t/how-do-i-import-custom-python-modules-in-julia/122370 "2024-11-07T06:57:54Z")

</div>

I am trying to import my custom python module in julia I have stored the module in the same directory as the julia file I am using PyCall but its shows that module does not exist

---

## [What are the current (late 2024) best practices for CLI development?](https://discourse.julialang.org/t/what-are-the-current-late-2024-best-practices-for-cli-development/122013)

<div class="topic-metadata">

**Author:** [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Replies:** 3\
**Last updated:** [November 7, 2024, 3:12am UTC](https://discourse.julialang.org/t/what-are-the-current-late-2024-best-practices-for-cli-development/122013 "2024-11-07T03:12:28Z")

</div>

Say someone is developing a package, and wants to include some command line interface. What are current best practices / ways to do this? My motivation here is twofold - I am actively working on such a project, and also …

---

## [Number contours in PlotlyJS.contour](https://discourse.julialang.org/t/number-contours-in-plotlyjs-contour/122360)

<div class="topic-metadata">

**Author:** [@miguelborrero](https://discourse.julialang.org/u/miguelborrero)\
**Replies:** 2\
**Last updated:** [November 7, 2024, 12:28am UTC](https://discourse.julialang.org/t/number-contours-in-plotlyjs-contour/122360 "2024-11-07T00:28:21Z")

</div>

Hi there, I would like to produce a contour plot of a quadratic function and I found a nice way to do so with PlotlyJS.contour but I am not able to customize the number of contours. It seems like the documentation gives …

---

## [Extending type functionality in Python and Julia](https://discourse.julialang.org/t/extending-type-functionality-in-python-and-julia/122222)

<div class="topic-metadata">

**Author:** [@Nikos\_Gianniotis](https://discourse.julialang.org/u/Nikos_Gianniotis)\
**Replies:** 7\
**Last updated:** [November 6, 2024, 7:35pm UTC](https://discourse.julialang.org/t/extending-type-functionality-in-python-and-julia/122222 "2024-11-06T19:35:18Z")

</div>

I have been using Julia for the last 9 years. As one of the few (if not the only one) users of Julia in the institute I work, I was asked to give a talk about it. One of the things I want to talk about is the ease with w…

---

## [Minimal loading of OrdinaryDiffEq](https://discourse.julialang.org/t/minimal-loading-of-ordinarydiffeq/122335)

<div class="topic-metadata">

**Author:** [@svretina](https://discourse.julialang.org/u/svretina)\
**Replies:** 4\
**Last updated:** [November 6, 2024, 5:32pm UTC](https://discourse.julialang.org/t/minimal-loading-of-ordinarydiffeq/122335 "2024-11-06T17:32:34Z")

</div>

I was wondering if it is possible (or if there are plans to do so) to load a minimal subspace of functionalities that one needs. The precompilation times are high and for my usage they deter me from using it. I would lik…

---

## [Why does \`A .= sign.(view(A, diagind(A))) .\* A\` allocate?](https://discourse.julialang.org/t/why-does-a-sign-view-a-diagind-a-a-allocate/122332)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 9\
**Last updated:** [November 6, 2024, 5:23pm UTC](https://discourse.julialang.org/t/why-does-a-sign-view-a-diagind-a-a-allocate/122332 "2024-11-06T17:23:47Z")

</div>

Hey, consider this function: using LinearAlgebra function correct\_sign(A) A .= sign.(view(A, diagind(A))) .\* A end Why would that allocate? Am I missing something? using BenchmarkTools B = randn(3,3) @btime correct…

---

## [How to access mingw64 files in pluto notebook?](https://discourse.julialang.org/t/how-to-access-mingw64-files-in-pluto-notebook/122340)

<div class="topic-metadata">

**Author:** [@selinguler94](https://discourse.julialang.org/u/selinguler94)\
**Replies:** 0\
**Last updated:** [November 6, 2024, 4:35pm UTC](https://discourse.julialang.org/t/how-to-access-mingw64-files-in-pluto-notebook/122340 "2024-11-06T16:35:22Z")

</div>

I want to execute some fortran files so windows isn’t working for that, I have mingw64 to execute fortran but I can not access the files now. C:/Users/name /c/Users/name I replaced the first with the second but can’t …

---

## [PackageCompiler warnings](https://discourse.julialang.org/t/packagecompiler-warnings/122338)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 0\
**Last updated:** [November 6, 2024, 3:15pm UTC](https://discourse.julialang.org/t/packagecompiler-warnings/122338 "2024-11-06T15:15:43Z")

</div>

I’m seeing many warnings like these: Warning: .drectve \`-exclude-symbols:jl\_pgcstack\_key\_slot ' unrecognized Warning: .drectve \`-exclude-symbols:jl\_tls\_offset ' unrecognized Warning: .drectve \`-exclude-symbols:jl\_ptls\_t…

---

## [Documenter.jl is not documenting any changes](https://discourse.julialang.org/t/documenter-jl-is-not-documenting-any-changes/94781)

<div class="topic-metadata">

**Author:** [@mdogan](https://discourse.julialang.org/u/mdogan)\
**Replies:** 17\
**Last updated:** [November 6, 2024, 10:41am UTC](https://discourse.julialang.org/t/documenter-jl-is-not-documenting-any-changes/94781 "2024-11-06T10:41:57Z")

</div>

I don’t know what I am doing wrong. I download the project Example.jl from GitHub. JuliaLang/Example.jl: Example Julia package repo. (github.com) I only changed the content of the Example.jl under src folder; just remo…

---

## [Get process id from worker id](https://discourse.julialang.org/t/get-process-id-from-worker-id/122315)

<div class="topic-metadata">

**Author:** [@sparrowhawk](https://discourse.julialang.org/u/sparrowhawk)\
**Replies:** 0\
**Last updated:** [November 6, 2024, 2:51am UTC](https://discourse.julialang.org/t/get-process-id-from-worker-id/122315 "2024-11-06T02:51:54Z")

</div>

Is there an easy way to get, from the worker id, the process id? I could do # length(workers()) == 1039 \[remotecall\_fetch(getpid, w\_id) for w\_id in workers()\] but is there a way to do this on worker 1 without fetching…

---

## [Package server down or is it me?](https://discourse.julialang.org/t/package-server-down-or-is-it-me/122309)

<div class="topic-metadata">

**Author:** [@arinbasu](https://discourse.julialang.org/u/arinbasu)\
**Replies:** 2\
**Last updated:** [November 5, 2024, 11:35pm UTC](https://discourse.julialang.org/t/package-server-down-or-is-it-me/122309 "2024-11-05T23:35:20Z")

</div>

I accessed https://au.pkg.julialang.org/ and it seemed to be down. Is it me or is it down for everyone, as I could not update or install packages today, it returned an error that package registry is unreachable (timed …

---

## [Sorting a DataFrame based on a multi-column function](https://discourse.julialang.org/t/sorting-a-dataframe-based-on-a-multi-column-function/122301)

<div class="topic-metadata">

**Author:** [@alancummings](https://discourse.julialang.org/u/alancummings)\
**Replies:** 3\
**Last updated:** [November 5, 2024, 8:49pm UTC](https://discourse.julialang.org/t/sorting-a-dataframe-based-on-a-multi-column-function/122301 "2024-11-05T20:49:58Z")

</div>

Is there an easier way to do this? sort(transform(df, \[:b, :c\] =\> ByRow(max) =\> :\_\_max\_\_), :\_\_max\_\_, rev=true)\[:, names(df)\] I want to sort based on a function of more than one column (in this case the max of the selec…

---

## [Using Excel as a GUI for data entry](https://discourse.julialang.org/t/using-excel-as-a-gui-for-data-entry/122290)

<div class="topic-metadata">

**Author:** [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Replies:** 4\
**Last updated:** [November 5, 2024, 9:07pm UTC](https://discourse.julialang.org/t/using-excel-as-a-gui-for-data-entry/122290 "2024-11-05T21:07:48Z")

</div>

Can anyone tell me if the following is a ridiculous idea or not. For interactive manual data entry, Excel (or one of its free spreadsheet equivalents) seems like a very versatile kind of “GUI”. The following toy code w…

---

## [IJulia not recognizing the \`\]\` repl package command](https://discourse.julialang.org/t/ijulia-not-recognizing-the-repl-package-command/122302)

<div class="topic-metadata">

**Author:** [@erny123](https://discourse.julialang.org/u/erny123)\
**Replies:** 2\
**Last updated:** [November 5, 2024, 8:46pm UTC](https://discourse.julialang.org/t/ijulia-not-recognizing-the-repl-package-command/122302 "2024-11-05T20:46:47Z")

</div>

Using Julia 1.11.1 and just loaded, built, and created a kernel with: installkernel("Julia (24 threads)", "--depwarn=no",env=Dict("JULIA\_NUM\_THREADS"=\>"24")) Haven’t had this issue before but when entering: \] activate . …

---

## [Mysterious BinaryProvider error when installing FIGlet](https://discourse.julialang.org/t/mysterious-binaryprovider-error-when-installing-figlet/122279)

<div class="topic-metadata">

**Author:** [@hellemo](https://discourse.julialang.org/u/hellemo)\
**Replies:** 6\
**Last updated:** [November 5, 2024, 7:28pm UTC](https://discourse.julialang.org/t/mysterious-binaryprovider-error-when-installing-figlet/122279 "2024-11-05T19:28:29Z")

</div>

I get this mysterious error when trying to install FIGlet in v1.11 (works fine in v1.10), complaining about the version of BinaryProvider, however trying to look into it, everything works fine when dev-ing the package. A…

---

## [Are there any plans to improve the composability of @batch and/or reduce overhead of @threads?](https://discourse.julialang.org/t/are-there-any-plans-to-improve-the-composability-of-batch-and-or-reduce-overhead-of-threads/122213)

<div class="topic-metadata">

**Author:** [@Tetrakai](https://discourse.julialang.org/u/Tetrakai)\
**Replies:** 2\
**Last updated:** [November 5, 2024, 6:09pm UTC](https://discourse.julialang.org/t/are-there-any-plans-to-improve-the-composability-of-batch-and-or-reduce-overhead-of-threads/122213 "2024-11-05T18:09:06Z")

</div>

Does it only require a lot of work? Would it require julia 2.0? Etc. This would definitely be useful info when planning projects. Related to what I learned here:

---

## [How to overload the ==?](https://discourse.julialang.org/t/how-to-overload-the/6296)

<div class="topic-metadata">

**Author:** [@jwu](https://discourse.julialang.org/u/jwu)\
**Replies:** 10\
**Last updated:** [November 5, 2024, 4:17pm UTC](https://discourse.julialang.org/t/how-to-overload-the/6296 "2024-11-05T16:17:29Z")

</div>

I defined the Base.isequal function, but it do not work. \_ \_ \_ \_(\_)\_ | A fresh approach to technical computing (\_) | (\_) (\_) | Documentation: https://docs.julial…

---

## [Why is Diagonal Sign Convention in QR Factorization Not Enforced?](https://discourse.julialang.org/t/why-is-diagonal-sign-convention-in-qr-factorization-not-enforced/122283)

<div class="topic-metadata">

**Author:** [@mlouis9](https://discourse.julialang.org/u/mlouis9)\
**Replies:** 1\
**Last updated:** [November 5, 2024, 1:05pm UTC](https://discourse.julialang.org/t/why-is-diagonal-sign-convention-in-qr-factorization-not-enforced/122283 "2024-11-05T13:05:59Z")

</div>

When performing the QR factorization of a m x n matrix A with full column rank (i.e. rank(A)=n), the (reduced or “skinny”) QR factorization is unique only if we enforce the sign of the diagonal entries of R. The conventi…

---

## [Grouping geommetries by colums](https://discourse.julialang.org/t/grouping-geommetries-by-colums/122241)

<div class="topic-metadata">

**Author:** [@Daves\_Cordova](https://discourse.julialang.org/u/Daves_Cordova)\
**Replies:** 2\
**Last updated:** [November 5, 2024, 2:33pm UTC](https://discourse.julialang.org/t/grouping-geommetries-by-colums/122241 "2024-11-05T14:33:28Z")

</div>

I need to combine geometries for a shapefile. Initially, there is shapefile\_path\_cities that will form the layer behind, after theres is shapefile\_path\_highways: using GeoDataFrames using DataFrames using XLSX using Plo…

---

## [Faster conversion from boolean \`SparseMatrixCSC\` to \`BitMatrix\`](https://discourse.julialang.org/t/faster-conversion-from-boolean-sparsematrixcsc-to-bitmatrix/122016)

<div class="topic-metadata">

**Author:** [@JaredSchwartz](https://discourse.julialang.org/u/JaredSchwartz)\
**Replies:** 11\
**Last updated:** [November 5, 2024, 11:33am UTC](https://discourse.julialang.org/t/faster-conversion-from-boolean-sparsematrixcsc-to-bitmatrix/122016 "2024-11-05T11:33:04Z")

</div>

I’m running into a bottleneck in the conversion of boolean SparseMatrixCSC objects into BitMatrix objects. I’m using a view of the matrix to select the columns that need to be converted into a BitMatrix, so all rows will…

---

## [Find the smallest number in a file](https://discourse.julialang.org/t/find-the-smallest-number-in-a-file/122219)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 13\
**Last updated:** [November 5, 2024, 12:27pm UTC](https://discourse.julialang.org/t/find-the-smallest-number-in-a-file/122219 "2024-11-05T12:27:17Z")

</div>

Hello, I have a file like below: 1 -1 2 -2 3 4 -4 I want to find the smallest number in this file and I wrote the following program: function smaller() small = 0 for line in eachline("file.txt") if (s…

---

## [Best GUI package for beginners](https://discourse.julialang.org/t/best-gui-package-for-beginners/122230)

<div class="topic-metadata">

**Author:** [@deno1234](https://discourse.julialang.org/u/deno1234)\
**Replies:** 5\
**Last updated:** [November 5, 2024, 9:34am UTC](https://discourse.julialang.org/t/best-gui-package-for-beginners/122230 "2024-11-05T09:34:22Z")

</div>

Hey, I am trying to create a GUI which should be very basic in nature. I just want to have some input field for the parameters and a plot button, and when I click the plot button it should plot it on the GUI. I have bee…

---

## [How to prepare a large space for a 3d matrix in an hdf5 file](https://discourse.julialang.org/t/how-to-prepare-a-large-space-for-a-3d-matrix-in-an-hdf5-file/122234)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 1\
**Last updated:** [November 5, 2024, 7:29am UTC](https://discourse.julialang.org/t/how-to-prepare-a-large-space-for-a-3d-matrix-in-an-hdf5-file/122234 "2024-11-05T07:29:01Z")

</div>

Please Help! Unfortunately, AI doesn’t know how to do this. In the HDF5 file, I need to prepare space for a 3d matrix 4500x9000x10000 Int64 to dynamically write and read data in different planes. The most frequently rea…

---

## [Fragile type inference in custom getproperty()](https://discourse.julialang.org/t/fragile-type-inference-in-custom-getproperty/122268)

<div class="topic-metadata">

**Author:** [@bclyons12](https://discourse.julialang.org/u/bclyons12)\
**Replies:** 1\
**Last updated:** [November 5, 2024, 2:53am UTC](https://discourse.julialang.org/t/fragile-type-inference-in-custom-getproperty/122268 "2024-11-05T02:53:02Z")

</div>

In a much larger code, we’re having some issues with type inference in a custom getproperty() function. Here’s a minimal example demonstrating at least part of the problem: mutable struct MyElement{T} name :: String…

---

## [What's the best way to create a struct of arrays?](https://discourse.julialang.org/t/whats-the-best-way-to-create-a-struct-of-arrays/122238)

<div class="topic-metadata">

**Author:** [@hssn15](https://discourse.julialang.org/u/hssn15)\
**Replies:** 4\
**Last updated:** [November 4, 2024, 7:30pm UTC](https://discourse.julialang.org/t/whats-the-best-way-to-create-a-struct-of-arrays/122238 "2024-11-04T19:30:10Z")

</div>

I have another question which is about what is the best way to create structs. struct s1{V1\<:AbstractVector, V2\<:AbstractVector{Int}} X1::V1 X2::V1 X3::V1 State::V2 end or struct s2{T1} X1::Vector{…

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

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