# General Usage

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

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

**Page:** 55

---

## [Should throw ERROR when if false?](https://discourse.julialang.org/t/should-throw-error-when-if-false/130401)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 1\
**Last updated:** [July 2, 2025, 7:27am UTC](https://discourse.julialang.org/t/should-throw-error-when-if-false/130401 "2025-07-02T07:27:41Z")

</div>

julia\> if false break end ERROR: syntax: break or continue outside loop Stacktrace: \[1\] top-level scope @ REPL\[1\]:1 I think this ERROR doesn’t have to be seen at REPL—it is distracting. When the c…

---

## [Donations link for sciml is broken](https://discourse.julialang.org/t/donations-link-for-sciml-is-broken/130389)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 6\
**Last updated:** [July 1, 2025, 8:17pm UTC](https://discourse.julialang.org/t/donations-link-for-sciml-is-broken/130389 "2025-07-01T20:17:01Z")

</div>

Wanted to contribute to: SciML Small Grants Program Current Project List But, the Donate link (see below) appears to be broken. Donate Is it adequately funded for now or working with the 1 month (“prevent sniping”) b…

---

## [What is the difference bewtween these two types? ::Vector{GMTdataset{\_A, 2} where \_A\<:Real} and ::Vector{\<:GMTdataset{T, 2}}; ...) where T\<:Real](https://discourse.julialang.org/t/what-is-the-difference-bewtween-these-two-types-vector-gmtdataset-a-2-where-a-real-and-vector-gmtdataset-t-2-where-t-real/130384)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 2\
**Last updated:** [July 1, 2025, 7:00pm UTC](https://discourse.julialang.org/t/what-is-the-difference-bewtween-these-two-types-vector-gmtdataset-a-2-where-a-real-and-vector-gmtdataset-t-2-where-t-real/130384 "2025-07-01T19:00:08Z")

</div>

Hi, I’m puzzled with this method failure. There must be one difference because it errors with, but I really can’t figure what. typeof(D) Vector{GMTdataset{\_A, 2} where \_A\<:Real} (alias for Array{GMTdataset{\_A, 2} where…

---

## [How to create lat/lon labels like “45°N” and “75°W” in GeoMakie?](https://discourse.julialang.org/t/how-to-create-lat-lon-labels-like-45-n-and-75-w-in-geomakie/130320)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 5\
**Last updated:** [July 1, 2025, 5:12pm UTC](https://discourse.julialang.org/t/how-to-create-lat-lon-labels-like-45-n-and-75-w-in-geomakie/130320 "2025-07-01T17:12:34Z")

</div>

Below is my code. No matter what I tried. I can only get the degree symbol “°” displayed, but not the N or W next to it. Does anyone know how to do it properly? using CairoMakie using GeoMakie # Create figure and geogr…

---

## [Error running Pluto](https://discourse.julialang.org/t/error-running-pluto/130382)

<div class="topic-metadata">

**Author:** [@Miguel](https://discourse.julialang.org/u/Miguel)\
**Replies:** 0\
**Last updated:** [July 1, 2025, 5:05pm UTC](https://discourse.julialang.org/t/error-running-pluto/130382 "2025-07-01T17:05:42Z")

</div>

After installing Plotly, I can no longer run Pluto in Firefox or Brave. The following error message appears in the console when loading Pluto: julia\> Pluto.run() Opening XXXXXXXXX in your default browser… ~ have fun! P…

---

## [How to organize code for a module + scripts](https://discourse.julialang.org/t/how-to-organize-code-for-a-module-scripts/130360)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [July 1, 2025, 8:47am UTC](https://discourse.julialang.org/t/how-to-organize-code-for-a-module-scripts/130360 "2025-07-01T08:47:40Z")

</div>

I am generating plots and tables for a paper. I want to organize the relevant code in a git repo, containing a module, eg Figures, in a single file, a bunch of scripts that I can run that call functionality from the mo…

---

## [How to plot a sympy.jl piecewise function?](https://discourse.julialang.org/t/how-to-plot-a-sympy-jl-piecewise-function/130310)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 11\
**Last updated:** [July 1, 2025, 12:34am UTC](https://discourse.julialang.org/t/how-to-plot-a-sympy-jl-piecewise-function/130310 "2025-07-01T00:34:09Z")

</div>

Hello, good afternoon. Im trying to plot a piecewise function using sympy.jl and plots.jl withou success. May someone help please? let @syms y C # Define os pontos do gráfico. Eles são necessários # para encontrar a…

---

## [Let x = 1 # ParseError](https://discourse.julialang.org/t/let-x-1-parseerror/130050)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 5\
**Last updated:** [June 20, 2025, 6:36am UTC](https://discourse.julialang.org/t/let-x-1-parseerror/130050 "2025-06-20T06:36:46Z")

</div>

I don’t know what’s going wrong here. PS K:\\uc24\> julia \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | \_ \_ \_| |\_ \_\_ \_ | Type "?" for help, "\]?" for…

---

## [\[ANN\] ColorVintner—utility to view plots of Colorbrewer palettes](https://discourse.julialang.org/t/ann-colorvintner-utility-to-view-plots-of-colorbrewer-palettes/130354)

<div class="topic-metadata">

**Author:** [@technocrat](https://discourse.julialang.org/u/technocrat)\
**Replies:** 0\
**Last updated:** [June 30, 2025, 11:49pm UTC](https://discourse.julialang.org/t/ann-colorvintner-utility-to-view-plots-of-colorbrewer-palettes/130354 "2025-06-30T23:49:58Z")

</div>

ColorVintner A Julia package for exploring and visualizing ColorBrewer color schemes using Makie. Features Comprehensive Color Scheme Access: Access to all ColorBrewer sequential, diverging, and qualitative color schem…

---

## [Zero-overhead numpy array with juliacall](https://discourse.julialang.org/t/zero-overhead-numpy-array-with-juliacall/130335)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 7\
**Last updated:** [June 30, 2025, 8:51pm UTC](https://discourse.julialang.org/t/zero-overhead-numpy-array-with-juliacall/130335 "2025-06-30T20:51:32Z")

</div>

I want to expose a Julia package to Python users via juliacall. The function in the Julia code returns a 2D array. How can this be converted to a 2D numpy array with minimal overhead, e.g. without the cost of converting …

---

## [Returning module from a macro: why do we need :toplevel?](https://discourse.julialang.org/t/returning-module-from-a-macro-why-do-we-need-toplevel/130346)

<div class="topic-metadata">

**Author:** [@moble](https://discourse.julialang.org/u/moble)\
**Replies:** 0\
**Last updated:** [June 30, 2025, 7:45pm UTC](https://discourse.julialang.org/t/returning-module-from-a-macro-why-do-we-need-toplevel/130346 "2025-06-30T19:45:18Z")

</div>

This may have worked in the early days, and as claimed here worked in Julia 1.4: macro mymodule(name) modname = esc(name) return :(module $modname end) end @mymodule MyMod But then it didn’t work in 1.5, and do…

---

## [Getting around the strict aliasing rule in Julia](https://discourse.julialang.org/t/getting-around-the-strict-aliasing-rule-in-julia/130140)

<div class="topic-metadata">

**Author:** [@nhz2](https://discourse.julialang.org/u/nhz2)\
**Replies:** 1\
**Last updated:** [June 30, 2025, 6:09pm UTC](https://discourse.julialang.org/t/getting-around-the-strict-aliasing-rule-in-julia/130140 "2025-06-30T18:09:19Z")

</div>

I am trying to better understand Julia’s equivalent of the strict aliasing rule from C. As background I would like to implement various decoding algorithms in Julia. Looking at the LZ4 C code, they are careful to use me…

---

## [Shuffle columns of a matrix](https://discourse.julialang.org/t/shuffle-columns-of-a-matrix/130334)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 8\
**Last updated:** [June 30, 2025, 4:36pm UTC](https://discourse.julialang.org/t/shuffle-columns-of-a-matrix/130334 "2025-06-30T16:36:22Z")

</div>

I want to shuffle (randomly rearrange) the columns of a large matrix. As much in place as possible, as the matrix is large; otherwise a naive M\[:, randperm(size(M, 2))\] would do. I thought of modifying Random.shuffle!,…

---

## [Struggling to use Mmap with ZipArchives](https://discourse.julialang.org/t/struggling-to-use-mmap-with-ziparchives/129839)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 20\
**Last updated:** [June 30, 2025, 4:31pm UTC](https://discourse.julialang.org/t/struggling-to-use-mmap-with-ziparchives/129839 "2025-06-30T16:31:42Z")

</div>

I’m struggling to get ZipArchives.jl and Mmap.jl to work together in the way I want - basically just following the docs. MWE looks like this: using ZipArchives using Mmap io=open("simpletest.zip") mm=Mmap.mmap(io) q =…

---

## [Stack via flatmap](https://discourse.julialang.org/t/stack-via-flatmap/130218)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 4\
**Last updated:** [June 30, 2025, 10:10am UTC](https://discourse.julialang.org/t/stack-via-flatmap/130218 "2025-06-30T10:10:03Z")

</div>

using CSV, DataManipulation, StructArrays, Tables julia\> @p begin """ Year,CountryName,Population!!Estimate,Population!!MarginOfError,GDP!!Estimate,GDP!!MarginOfError 2025,China,14000000…

---

## [Unstack via group\_vg;map](https://discourse.julialang.org/t/unstack-via-group-vg-map/130247)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 1\
**Last updated:** [June 30, 2025, 10:06am UTC](https://discourse.julialang.org/t/unstack-via-group-vg-map/130247 "2025-06-30T10:06:17Z")

</div>

using DataManipulation, StructArrays, PrettyTables julia\> let d = StructArray(a=\[1,1,2,2\], b=\[:x, :y, :x, :y\], c=\[10, 20, 30, 40\]) pretty\_table(d) @p begin d group\_vg((…

---

## [Distributed and logging](https://discourse.julialang.org/t/distributed-and-logging/66503)

<div class="topic-metadata">

**Author:** [@torgo](https://discourse.julialang.org/u/torgo)\
**Replies:** 1\
**Last updated:** [June 30, 2025, 9:51am UTC](https://discourse.julialang.org/t/distributed-and-logging/66503 "2025-06-30T09:51:53Z")

</div>

I am trying to add a timestamp to a logger using LoggingExtras. I would like that timestamp to be propagated across workers, but I haven’t been able to figure out how. Here’s my MWE: module TestParLogging using Di…

---

## [Should I start developing my ECS now or should I wait for the Julia ecosystem to be ready?](https://discourse.julialang.org/t/should-i-start-developing-my-ecs-now-or-should-i-wait-for-the-julia-ecosystem-to-be-ready/122710)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 22\
**Last updated:** [June 28, 2025, 6:50pm UTC](https://discourse.julialang.org/t/should-i-start-developing-my-ecs-now-or-should-i-wait-for-the-julia-ecosystem-to-be-ready/122710 "2025-06-28T18:50:48Z")

</div>

I’ve been posting several questions related to this, but basically, the planning is still incomplete. I’m thinking that the planning will never be complete if I only keep on planning, so maybe I should do what I could do…

---

## [Testing User Input in GitHub CI/Test Suites?](https://discourse.julialang.org/t/testing-user-input-in-github-ci-test-suites/130210)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 8\
**Last updated:** [June 28, 2025, 5:13pm UTC](https://discourse.julialang.org/t/testing-user-input-in-github-ci-test-suites/130210 "2025-06-28T17:13:47Z")

</div>

Hi folks! How do you test user input for readline() in GitHub CI or your local test suite? I have a snippet of code that asks for user input in my package and am trying to test the input – kinda like this: function fin…

---

## [How to use default attributes of existing plot type in recipe definition in Makie 0.24?](https://discourse.julialang.org/t/how-to-use-default-attributes-of-existing-plot-type-in-recipe-definition-in-makie-0-24/130290)

<div class="topic-metadata">

**Author:** [@fverdugo](https://discourse.julialang.org/u/fverdugo)\
**Replies:** 4\
**Last updated:** [June 28, 2025, 3:35pm UTC](https://discourse.julialang.org/t/how-to-use-default-attributes-of-existing-plot-type-in-recipe-definition-in-makie-0-24/130290 "2025-06-28T15:35:11Z")

</div>

Hi, I am trying to update some Makie recipes to Makie 0.24. I would like to know how to get the default attributes of an existing plot type in the recipe definition, and possibly combine these attributes with local attr…

---

## [Unexpected poor FOR loops performance](https://discourse.julialang.org/t/unexpected-poor-for-loops-performance/130276)

<div class="topic-metadata">

**Author:** [@andreasvarga](https://discourse.julialang.org/u/andreasvarga)\
**Replies:** 8\
**Last updated:** [June 28, 2025, 12:45pm UTC](https://discourse.julialang.org/t/unexpected-poor-for-loops-performance/130276 "2025-06-28T12:45:27Z")

</div>

It is generally accepted that Julia is for loops friendly, so generally no special care is required to vectorize code, because Julia will do a good job anyway. Let A and X be n x n matrices, with X symmetric. The followi…

---

## [Precompilation for almost every package that I use even though I used that package before](https://discourse.julialang.org/t/precompilation-for-almost-every-package-that-i-use-even-though-i-used-that-package-before/130265)

<div class="topic-metadata">

**Author:** [@Mend-Amar\_Badral](https://discourse.julialang.org/u/Mend-Amar_Badral)\
**Replies:** 5\
**Last updated:** [June 28, 2025, 8:21am UTC](https://discourse.julialang.org/t/precompilation-for-almost-every-package-that-i-use-even-though-i-used-that-package-before/130265 "2025-06-28T08:21:41Z")

</div>

So I use julia v1.10. I for example, open up julia session and then activate shared environment like so: (@geo) pkg\> activate --shared ml3d Activating project at \`~/.julia/environments/ml3d\` (@ml3d) pkg\> st Status \`~…

---

## [Why is \`promote\_type\` not applied by \`div\` with \`Int\` and \`Rational\`?](https://discourse.julialang.org/t/why-is-promote-type-not-applied-by-div-with-int-and-rational/130277)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 5\
**Last updated:** [June 27, 2025, 8:01pm UTC](https://discourse.julialang.org/t/why-is-promote-type-not-applied-by-div-with-int-and-rational/130277 "2025-06-27T20:01:39Z")

</div>

According to the docstring of promote\_type: promote\_type represents the default promotion behavior in Julia when operators (usually mathematical) are given arguments of differing types. And: julia\> promote\_type(Int,…

---

## [Can't use dependencies in apps?](https://discourse.julialang.org/t/cant-use-dependencies-in-apps/130280)

<div class="topic-metadata">

**Author:** [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Replies:** 2\
**Last updated:** [June 27, 2025, 4:49pm UTC](https://discourse.julialang.org/t/cant-use-dependencies-in-apps/130280 "2025-06-27T16:49:55Z")

</div>

I can not seem to get an app installed using the current julia 1.12 beta, if there are any Stdlibs in the dependencies. This works: src/PapisImport.jl: module PapisImport export main function (@main)(args) @info …

---

## [How to sort a column of cell arrays, using the same criteria as my table?](https://discourse.julialang.org/t/how-to-sort-a-column-of-cell-arrays-using-the-same-criteria-as-my-table/130278)

<div class="topic-metadata">

**Author:** [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Replies:** 6\
**Last updated:** [June 27, 2025, 4:28pm UTC](https://discourse.julialang.org/t/how-to-sort-a-column-of-cell-arrays-using-the-same-criteria-as-my-table/130278 "2025-06-27T16:28:54Z")

</div>

I have a table T1 with 1000 rows and 20 columns. I also have a column based cell array B with the size of 1000 x 1. Here is my code to sort the table: T1 = T1\[sortperm(T1\[:, 12\]; rev=true), :\]; # Sort by the depth val…

---

## [Dates: Strict parsing (DateFormat)](https://discourse.julialang.org/t/dates-strict-parsing-dateformat/130274)

<div class="topic-metadata">

**Author:** [@Parazetamol](https://discourse.julialang.org/u/Parazetamol)\
**Replies:** 1\
**Last updated:** [June 27, 2025, 10:55am UTC](https://discourse.julialang.org/t/dates-strict-parsing-dateformat/130274 "2025-06-27T10:55:54Z")

</div>

Hi there, is it possible to have the parsing of the specified DateFormat strict ? I don’t want to have a string like “1:2” parsed as Time when explicitly specifying dateformat"HH:MM:SS". Time("1:2",dateformat"HH:MM:SS…

---

## [TidierData.jl ― Apply transform across columns while retaining access to other variables in the row](https://discourse.julialang.org/t/tidierdata-jl-apply-transform-across-columns-while-retaining-access-to-other-variables-in-the-row/130115)

<div class="topic-metadata">

**Author:** [@lunafazio](https://discourse.julialang.org/u/lunafazio)\
**Replies:** 7\
**Last updated:** [June 27, 2025, 9:03am UTC](https://discourse.julialang.org/t/tidierdata-jl-apply-transform-across-columns-while-retaining-access-to-other-variables-in-the-row/130115 "2025-06-27T09:03:43Z")

</div>

My code is @chain df begin @mutate(across(startswith("β"), x -\> τ\*x)) end where τ is another column in df, but it complains that it can’t find it in the Main module. Is there a way to indicate that I want the v…

---

## [Faster \`div\`, \`rem\` and \`mod\` for small integers?](https://discourse.julialang.org/t/faster-div-rem-and-mod-for-small-integers/130264)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 4\
**Last updated:** [June 27, 2025, 1:55am UTC](https://discourse.julialang.org/t/faster-div-rem-and-mod-for-small-integers/130264 "2025-06-27T01:55:17Z")

</div>

I’ve played around with div, rem and mod for signed bit integers. I first noticed that these functions are faster for Int32 than for Int64 on amd64 processors. (This becomes clear if you look at the processor instruction…

---

## [Operation with struct parameter within struct definition](https://discourse.julialang.org/t/operation-with-struct-parameter-within-struct-definition/130261)

<div class="topic-metadata">

**Author:** [@JpDemarchi](https://discourse.julialang.org/u/JpDemarchi)\
**Replies:** 3\
**Last updated:** [June 27, 2025, 12:00am UTC](https://discourse.julialang.org/t/operation-with-struct-parameter-within-struct-definition/130261 "2025-06-27T00:00:59Z")

</div>

I want to make a struct where the second parameter used represents the dimensionality of the world, with scalar fields being N-dimensional arrays and vector fields being (N + 1)-dimensional arrays. Something like this: s…

---

## [Pkg.add("CustomGaussQuadrature") ERROR: Unsatisfiable requirements](https://discourse.julialang.org/t/pkg-add-customgaussquadrature-error-unsatisfiable-requirements/130147)

<div class="topic-metadata">

**Author:** [@pvkabaila](https://discourse.julialang.org/u/pvkabaila)\
**Replies:** 8\
**Last updated:** [June 26, 2025, 10:38pm UTC](https://discourse.julialang.org/t/pkg-add-customgaussquadrature-error-unsatisfiable-requirements/130147 "2025-06-26T22:38:34Z")

</div>

Resolving package versions… ERROR: Unsatisfiable requirements detected for package LinearAlgebra \[37e2e46d\]: LinearAlgebra \[37e2e46d\] log: ├─possible versions are: 1.10.9 or uninstalled (package in sysimage!) └─found…

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

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