# General Usage

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

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

**Page:** 138

---

## [Struggling with defining a good factorization rule in SymbolicUtils.jl](https://discourse.julialang.org/t/struggling-with-defining-a-good-factorization-rule-in-symbolicutils-jl/111522)

<div class="topic-metadata">

**Author:** [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Replies:** 8\
**Last updated:** [August 29, 2024, 11:07pm UTC](https://discourse.julialang.org/t/struggling-with-defining-a-good-factorization-rule-in-symbolicutils-jl/111522 "2024-08-29T23:07:03Z")

</div>

I started playing with Symbolics.jl but started needing more rewriting rules than what’s currently proposed. Taking a quick look at the rewrite docs, I don’t understand why some of the examples below don’t work. using S…

---

## [Why keyword \`struct\` is used instead of \`type\` for type definition?](https://discourse.julialang.org/t/why-keyword-struct-is-used-instead-of-type-for-type-definition/118774)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 3\
**Last updated:** [August 29, 2024, 9:23pm UTC](https://discourse.julialang.org/t/why-keyword-struct-is-used-instead-of-type-for-type-definition/118774 "2024-08-29T21:23:45Z")

</div>

basically the word “type” is used everywhere in docs and function names like typeof(). So, why use the keyword struct but not type in type definition??

---

## [How can I find out why julia crashed?](https://discourse.julialang.org/t/how-can-i-find-out-why-julia-crashed/118467)

<div class="topic-metadata">

**Author:** [@maxfreu](https://discourse.julialang.org/u/maxfreu)\
**Replies:** 14\
**Last updated:** [August 29, 2024, 7:47pm UTC](https://discourse.julialang.org/t/how-can-i-find-out-why-julia-crashed/118467 "2024-08-29T19:47:37Z")

</div>

Hi! I’m working with julia in vscode. A couple of times a day it crashes. By crashing I mean the julia repl closes and I’m dropped into the terminal. Sometimes I get a short glimpse of some error printout from the linux …

---

## [Simple use of Geodesy.jl to get euclidean distances?](https://discourse.julialang.org/t/simple-use-of-geodesy-jl-to-get-euclidean-distances/118680)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 23\
**Last updated:** [August 29, 2024, 6:35pm UTC](https://discourse.julialang.org/t/simple-use-of-geodesy-jl-to-get-euclidean-distances/118680 "2024-08-29T18:35:22Z")

</div>

Hey Geo-computing experts. I’m working on a project involving migration of people between locations. We started with German data, where coordinates were already taken care of for me, and now I’ve got data from US Census …

---

## [How to concatenate matrices views without copying memory?](https://discourse.julialang.org/t/how-to-concatenate-matrices-views-without-copying-memory/118760)

<div class="topic-metadata">

**Author:** [@Blumenkranz](https://discourse.julialang.org/u/Blumenkranz)\
**Replies:** 3\
**Last updated:** [August 29, 2024, 1:08pm UTC](https://discourse.julialang.org/t/how-to-concatenate-matrices-views-without-copying-memory/118760 "2024-08-29T13:08:21Z")

</div>

Using vcat to catenate views leads to memory allocation which is contrary to the original intent of @views. CatViews.jl can address the issue to some extent, but it is only applicable to vectors. I wonder if there is a w…

---

## [Structure inheritance](https://discourse.julialang.org/t/structure-inheritance/118699)

<div class="topic-metadata">

**Author:** [@mesonepigreco](https://discourse.julialang.org/u/mesonepigreco)\
**Replies:** 6\
**Last updated:** [August 29, 2024, 2:19am UTC](https://discourse.julialang.org/t/structure-inheritance/118699 "2024-08-29T02:19:30Z")

</div>

Hi, I have defined an abstract type AbstractQuantumParticle, and then a specific structure QuantumParticle \<: AbstractQuantumParticle which has some fields like position and momentum. Let us say now I want to add an ex…

---

## [Using automatic differentiation to compute the Taylor expansion coefficients for ODE systems](https://discourse.julialang.org/t/using-automatic-differentiation-to-compute-the-taylor-expansion-coefficients-for-ode-systems/118726)

<div class="topic-metadata">

**Author:** [@Bingwei\_Zhang](https://discourse.julialang.org/u/Bingwei_Zhang)\
**Replies:** 3\
**Last updated:** [August 28, 2024, 10:35pm UTC](https://discourse.julialang.org/t/using-automatic-differentiation-to-compute-the-taylor-expansion-coefficients-for-ode-systems/118726 "2024-08-28T22:35:37Z")

</div>

I am looking for a Julia package that can provide high-order Taylor expansion coefficients of the solution for a given ODE system and initial conditions using automatic differentiation. It does not need to solve the ODE.…

---

## [PrettyTables display for StructArray](https://discourse.julialang.org/t/prettytables-display-for-structarray/118732)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 5\
**Last updated:** [August 28, 2024, 9:34pm UTC](https://discourse.julialang.org/t/prettytables-display-for-structarray/118732 "2024-08-28T21:34:26Z")

</div>

I like how DataFrame displays with PrettyTables.pretty\_table by default. If I want the same behavior for StructArray , can I make that happen without bad consequences?

---

## [Distributed arrays in for loop](https://discourse.julialang.org/t/distributed-arrays-in-for-loop/118728)

<div class="topic-metadata">

**Author:** [@clempe](https://discourse.julialang.org/u/clempe)\
**Replies:** 2\
**Last updated:** [August 28, 2024, 9:17pm UTC](https://discourse.julialang.org/t/distributed-arrays-in-for-loop/118728 "2024-08-28T21:17:15Z")

</div>

Hi, I’m trying to get distributed arrays to work correctly for my distributed for loop. I’m getting this weird outcome where not all workers do their task always, even though I know they’ve been assigned correctly (using…

---

## [CUDA Profiler](https://discourse.julialang.org/t/cuda-profiler/118683)

<div class="topic-metadata">

**Author:** [@Jason\_Meziere](https://discourse.julialang.org/u/Jason_Meziere)\
**Replies:** 4\
**Last updated:** [August 28, 2024, 7:51pm UTC](https://discourse.julialang.org/t/cuda-profiler/118683 "2024-08-28T19:51:20Z")

</div>

I was running CUDA.@profile on one of my functions and noticed a large portion of time is missing from the report. I don’t have an MWE, but I would like to still ask. In general, what are the usual sources or suspects in…

---

## [Accessing properties/fields that are multiple properties/fields "deep"](https://discourse.julialang.org/t/accessing-properties-fields-that-are-multiple-properties-fields-deep/118731)

<div class="topic-metadata">

**Author:** [@mgalenb](https://discourse.julialang.org/u/mgalenb)\
**Replies:** 3\
**Last updated:** [August 28, 2024, 7:39pm UTC](https://discourse.julialang.org/t/accessing-properties-fields-that-are-multiple-properties-fields-deep/118731 "2024-08-28T19:39:18Z")

</div>

Not sure exactly the best way to phrase the question. I have a bunch of custom types that get stacked together and I am trying use getproperty to get at things buried in these types. struct Foo a::Integer b::Integer end…

---

## [Isapprox in tests and a more precise result / reason for failure](https://discourse.julialang.org/t/isapprox-in-tests-and-a-more-precise-result-reason-for-failure/89648)

<div class="topic-metadata">

**Author:** [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Replies:** 5\
**Last updated:** [November 2, 2022, 1:05pm UTC](https://discourse.julialang.org/t/isapprox-in-tests-and-a-more-precise-result-reason-for-failure/89648 "2022-11-02T13:05:29Z")

</div>

I am currently working on some tests. And fore some algorithms I compare the result to a known (analytical or via another algorithm) solution. Now when trying to optimise for example speed of an algorithm, it might suff…

---

## [Timescalecalculus pkg in Julia](https://discourse.julialang.org/t/timescalecalculus-pkg-in-julia/118718)

<div class="topic-metadata">

**Author:** [@khaledharizb](https://discourse.julialang.org/u/khaledharizb)\
**Replies:** 0\
**Last updated:** [August 28, 2024, 3:05pm UTC](https://discourse.julialang.org/t/timescalecalculus-pkg-in-julia/118718 "2024-08-28T15:05:05Z")

</div>

There is a way to deal with the continuous and the discrete calculus simultaneously by the-so called time scale calculus (TSC) I found a python library for TSC https://timescalewiki.org/index.php/Timescalecalculus\_pyth…

---

## [Warnings when pre-compiling GLMakie](https://discourse.julialang.org/t/warnings-when-pre-compiling-glmakie/118615)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 11\
**Last updated:** [August 27, 2024, 10:41pm UTC](https://discourse.julialang.org/t/warnings-when-pre-compiling-glmakie/118615 "2024-08-27T22:41:31Z")

</div>

If I freshly install GLMakie I get the following warnings: ┌ GLMakie │ \[pid 70482\] waiting for IO to finish: │ Handle type uv\_handle\_t-\>data │ timer 0x60503c7f60f0-\>0x714926932110 │ This means …

---

## [@code\_warntype in CUDA](https://discourse.julialang.org/t/code-warntype-in-cuda/118679)

<div class="topic-metadata">

**Author:** [@Jason\_Meziere](https://discourse.julialang.org/u/Jason_Meziere)\
**Replies:** 1\
**Last updated:** [August 27, 2024, 5:38pm UTC](https://discourse.julialang.org/t/code-warntype-in-cuda/118679 "2024-08-27T17:38:18Z")

</div>

I am working on profiling my code, and have run into some trouble when trying to ensure type stability of some code that uses CuArrays. When using mapreduce, if I pass in two multidimensional CuArrays, @code\_warntype fai…

---

## [Significantly different parameter estimates when using Static Array (MVector) as initial guess](https://discourse.julialang.org/t/significantly-different-parameter-estimates-when-using-static-array-mvector-as-initial-guess/118645)

<div class="topic-metadata">

**Author:** [@DylanEsguerra](https://discourse.julialang.org/u/DylanEsguerra)\
**Replies:** 5\
**Last updated:** [August 27, 2024, 5:19pm UTC](https://discourse.julialang.org/t/significantly-different-parameter-estimates-when-using-static-array-mvector-as-initial-guess/118645 "2024-08-27T17:19:41Z")

</div>

Hello I am ODE model fitting using autodiff with Optimization.jl and was looking to improve my code with the use of StaticArrays. The code runs slower than I hoped and has a lot of memory allocations (initially 4G befo…

---

## [Capture docstring using Macrotools](https://discourse.julialang.org/t/capture-docstring-using-macrotools/118670)

<div class="topic-metadata">

**Author:** [@aramend](https://discourse.julialang.org/u/aramend)\
**Replies:** 0\
**Last updated:** [August 27, 2024, 2:57pm UTC](https://discourse.julialang.org/t/capture-docstring-using-macrotools/118670 "2024-08-27T14:57:01Z")

</div>

Hoping this is trivial, but let’s see. The task is to extract documentation from a parsed struct definition using MacroTools. I also checked that splitstructdef fails in this case. using MacroTools sexpr = Meta.parse("…

---

## [Manage tasks from Threads.@spawn without using map()](https://discourse.julialang.org/t/manage-tasks-from-threads-spawn-without-using-map/118493)

<div class="topic-metadata">

**Author:** [@felipe\_1](https://discourse.julialang.org/u/felipe_1)\
**Replies:** 16\
**Last updated:** [August 27, 2024, 2:55pm UTC](https://discourse.julialang.org/t/manage-tasks-from-threads-spawn-without-using-map/118493 "2024-08-27T14:55:57Z")

</div>

Hi, I need to analyze a long vector and calculate the occurrences of certain letters, as it will be very long it will be better to use parallel processing for this. The thing is, I can do this with map(), storing tasks…

---

## [Weird problem: Symbolics crashes on first import then works on second](https://discourse.julialang.org/t/weird-problem-symbolics-crashes-on-first-import-then-works-on-second/118633)

<div class="topic-metadata">

**Author:** [@AronT](https://discourse.julialang.org/u/AronT)\
**Replies:** 4\
**Last updated:** [August 27, 2024, 2:39pm UTC](https://discourse.julialang.org/t/weird-problem-symbolics-crashes-on-first-import-then-works-on-second/118633 "2024-08-27T14:39:04Z")

</div>

I just start playing around with Symbolics. Great package! So I added it using pkg and now every time I enter the REPL and issue the command using Symbolics the first time round I get the stack trace below. And even thou…

---

## [Change fonts using GLMakie](https://discourse.julialang.org/t/change-fonts-using-glmakie/118619)

<div class="topic-metadata">

**Author:** [@NaSi](https://discourse.julialang.org/u/NaSi)\
**Replies:** 2\
**Last updated:** [August 27, 2024, 8:01am UTC](https://discourse.julialang.org/t/change-fonts-using-glmakie/118619 "2024-08-27T08:01:31Z")

</div>

Hello :slight\_smile: I am trying to change the font style of my plot (I use GLMakie for plotting). I would like to change all (labels, titles …). I tried that but it doesn’t work :confused: # Figure : f = Figure(fon…

---

## [PythonCall.jl style regarding type conversion](https://discourse.julialang.org/t/pythoncall-jl-style-regarding-type-conversion/117626)

<div class="topic-metadata">

**Author:** [@JordiBolibar](https://discourse.julialang.org/u/JordiBolibar)\
**Replies:** 6\
**Last updated:** [July 31, 2024, 8:48am UTC](https://discourse.julialang.org/t/pythoncall-jl-style-regarding-type-conversion/117626 "2024-07-31T08:48:40Z")

</div>

I’m migrating some code from PyCall.jl to PythonCall.jl. While so far I’m loving the integration with CondaPkg.jl to handle the Python environment, I’m finding the lack of automatic type conversion quite cumbersome. I un…

---

## [Trying to understand performance of closure from @code\_llvm](https://discourse.julialang.org/t/trying-to-understand-performance-of-closure-from-code-llvm/49361)

<div class="topic-metadata">

**Author:** [@tomohiro\_soejima](https://discourse.julialang.org/u/tomohiro_soejima)\
**Replies:** 2\
**Last updated:** [August 26, 2024, 8:17pm UTC](https://discourse.julialang.org/t/trying-to-understand-performance-of-closure-from-code-llvm/49361 "2024-08-26T20:17:55Z")

</div>

Hi, I am trying to better understand how closure works. I’ve inspected captured variable section of the manual, and tried inspecting the following functions. function abmult(r::Int) if r \< 0 r = -r end …

---

## [Closure not shipping to remote workers except from Main?](https://discourse.julialang.org/t/closure-not-shipping-to-remote-workers-except-from-main/38831)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 0\
**Last updated:** [May 5, 2020, 8:45pm UTC](https://discourse.julialang.org/t/closure-not-shipping-to-remote-workers-except-from-main/38831 "2020-05-05T20:45:39Z")

</div>

Consider the following code which generates a closure via an @eval (needed in my non-MWE), and then ships it to a remote worker to evaluate: module Foo using Distributed make\_closure(x) = @eval let x=$x; () -\> x; end …

---

## [Why Random.jl is fixed to version 0.0.0?](https://discourse.julialang.org/t/why-random-jl-is-fixed-to-version-0-0-0/105957)

<div class="topic-metadata">

**Author:** [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Replies:** 8\
**Last updated:** [August 26, 2024, 7:17pm UTC](https://discourse.julialang.org/t/why-random-jl-is-fixed-to-version-0-0-0/105957 "2024-08-26T19:17:59Z")

</div>

I’m trying to explicitly specify the compatibilities of some standard packages as recently required by the General registry. I added Random = "1.9" (or "1", I tried both, resulting in the same error) to Project.toml of N…

---

## [Current solution for reading Fixed Width files (2024)](https://discourse.julialang.org/t/current-solution-for-reading-fixed-width-files-2024/118635)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 3\
**Last updated:** [August 26, 2024, 5:37pm UTC](https://discourse.julialang.org/t/current-solution-for-reading-fixed-width-files-2024/118635 "2024-08-26T17:37:22Z")

</div>

I’ve done the due diligence searching the forum for solutions to read fixed width files, but found mostly things from 2017, 2019, 2020… and referencing packages that don’t seem to exist anymore (FWF.jl). Julia has been m…

---

## [@inbounds for getindex not working](https://discourse.julialang.org/t/inbounds-for-getindex-not-working/118631)

<div class="topic-metadata">

**Author:** [@Andy\_Zhang](https://discourse.julialang.org/u/Andy_Zhang)\
**Replies:** 2\
**Last updated:** [August 26, 2024, 4:24pm UTC](https://discourse.julialang.org/t/inbounds-for-getindex-not-working/118631 "2024-08-26T16:24:32Z")

</div>

Here is the example code and output. struct Minij{T\<:Number} \<: AbstractMatrix{T} n::Integer function Minij{T}(n::Integer) where {T\<:Number} n \>= 0 || throw(ArgumentError("$n \< 0")) return new{T…

---

## [How to access the variable accessible by a closure?](https://discourse.julialang.org/t/how-to-access-the-variable-accessible-by-a-closure/118628)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 1\
**Last updated:** [August 26, 2024, 3:41pm UTC](https://discourse.julialang.org/t/how-to-access-the-variable-accessible-by-a-closure/118628 "2024-08-26T15:41:24Z")

</div>

in the following a is accessible by gun(): function fun() a = 2.0 function gun(b) return a + b end end g = fun() g(3.0) julia\> g = fun() (::var"#gun#10"{Float64}) (generic function with 1 method) …

---

## [Unexpected behavior of CUDA kernel](https://discourse.julialang.org/t/unexpected-behavior-of-cuda-kernel/118625)

<div class="topic-metadata">

**Author:** [@0samuraiE](https://discourse.julialang.org/u/0samuraiE)\
**Replies:** 2\
**Last updated:** [August 26, 2024, 2:48pm UTC](https://discourse.julialang.org/t/unexpected-behavior-of-cuda-kernel/118625 "2024-08-26T14:48:58Z")

</div>

Hello all. I hit an unexpected error writing CUDA kernel. Somehow the variable b seems to be in conflict. When I removed b=sum(A), this function worked. Is it a spec or a bug? using CUDA function main() function…

---

## [How to solve an ODEProblem with u0 in the format of vector{vector} and be able to use it for Zygote differentiation](https://discourse.julialang.org/t/how-to-solve-an-odeproblem-with-u0-in-the-format-of-vector-vector-and-be-able-to-use-it-for-zygote-differentiation/118606)

<div class="topic-metadata">

**Author:** [@chooron](https://discourse.julialang.org/u/chooron)\
**Replies:** 1\
**Last updated:** [August 26, 2024, 1:21pm UTC](https://discourse.julialang.org/t/how-to-solve-an-odeproblem-with-u0-in-the-format-of-vector-vector-and-be-able-to-use-it-for-zygote-differentiation/118606 "2024-08-26T13:21:14Z")

</div>

Hello, I am currently facing an ode problem. The format of u0 in this problem is vector{vector}, for example \[\[1,2\], \[1,2,3\], \[1\]\], the particularity of this u0 is that the length of each element is different, and I cann…

---

## [Could not download registries](https://discourse.julialang.org/t/could-not-download-registries/118486)

<div class="topic-metadata">

**Author:** [@Stephen](https://discourse.julialang.org/u/Stephen)\
**Replies:** 7\
**Last updated:** [August 26, 2024, 12:46pm UTC](https://discourse.julialang.org/t/could-not-download-registries/118486 "2024-08-26T12:46:08Z")

</div>

Installing known registries into \`~/.julia\` ERROR: could not download https://pkg.julialang.org/registry/23338594-aafe-5451-b93e-139f81909106/b39454141b62a8b7203e96a34b9ba6cd7f79815d Exception: RequestError: HTTP/2 30…

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

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