# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1015

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

**Page:** 1016

---

## [\[ANN\] DLMReader: the most versatile Julia package for reading delimited files yet](https://discourse.julialang.org/t/ann-dlmreader-the-most-versatile-julia-package-for-reading-delimited-files-yet/81899)

<div class="topic-metadata">

**Author:** [@sl-solution](https://discourse.julialang.org/u/sl-solution)\
**Replies:** 19\
**Last updated:** [June 9, 2022, 7:32am UTC](https://discourse.julialang.org/t/ann-dlmreader-the-most-versatile-julia-package-for-reading-delimited-files-yet/81899 "2022-06-09T07:32:26Z")

</div>

I am excited to announce DLMReader, a Julia package for reading delimited files. Introduction DLMReader.jl is a multithreaded package for reading delimited files, and it is designed for Julia 1.6+ (64bit OS). The packag…

---

## [Dispatch on function itself](https://discourse.julialang.org/t/dispatch-on-function-itself/82449)

<div class="topic-metadata">

**Author:** [@Brian1](https://discourse.julialang.org/u/Brian1)\
**Replies:** 5\
**Last updated:** [June 9, 2022, 7:29am UTC](https://discourse.julialang.org/t/dispatch-on-function-itself/82449 "2022-06-09T07:29:15Z")

</div>

Can Julia dispatch on the function itself? test\_func1(i::Int)=i+1 test\_func2(i::Int)=i-1 (x::U{typeof(test\_func1),typeof(test\_func2)})(g::V)=println("ddd") So the twos functions can do this: test\_func1(\[1,2,3\]) "ddd"…

---

## [OutOfMemoryError() instead of allocating too much resources in the job scheduler](https://discourse.julialang.org/t/outofmemoryerror-instead-of-allocating-too-much-resources-in-the-job-scheduler/45575)

<div class="topic-metadata">

**Author:** [@fgerick](https://discourse.julialang.org/u/fgerick)\
**Replies:** 5\
**Last updated:** [June 9, 2022, 7:27am UTC](https://discourse.julialang.org/t/outofmemoryerror-instead-of-allocating-too-much-resources-in-the-job-scheduler/45575 "2022-06-09T07:27:27Z")

</div>

Hi everyone, I’ve encountered a few times that my code running interactively on an LSF cluster reaches the maximum of the (by me) allocated memory. This memory is not the memory limit of the node and instead of Julia th…

---

## [How to fix the x axis for a histogram in Julia](https://discourse.julialang.org/t/how-to-fix-the-x-axis-for-a-histogram-in-julia/82453)

<div class="topic-metadata">

**Author:** [@Xavier\_Gonzalez](https://discourse.julialang.org/u/Xavier_Gonzalez)\
**Replies:** 5\
**Last updated:** [June 9, 2022, 6:13am UTC](https://discourse.julialang.org/t/how-to-fix-the-x-axis-for-a-histogram-in-julia/82453 "2022-06-09T06:13:10Z")

</div>

I’m trying to make a histogram in Julia using hist command from Makie, as detailed here: I would like to control the xlimits, i.e. force the x range to go from 0 to 5. I can’t seem to find anywhere how to do this onl…

---

## [How to use the built-in InvalidStateException](https://discourse.julialang.org/t/how-to-use-the-built-in-invalidstateexception/82408)

<div class="topic-metadata">

**Author:** [@Atiyah](https://discourse.julialang.org/u/Atiyah)\
**Replies:** 1\
**Last updated:** [June 9, 2022, 5:31am UTC](https://discourse.julialang.org/t/how-to-use-the-built-in-invalidstateexception/82408 "2022-06-09T05:31:19Z")

</div>

What would be a typical use case for employing the built-in InvalidStateException? Can this exception be employed for inconsistent values of different variables during runtime, i.e. invalid states or inconsistencies…

---

## [Test of expand and substitute in Symbolics.jl, SymEngine.jl and Mathematica](https://discourse.julialang.org/t/test-of-expand-and-substitute-in-symbolics-jl-symengine-jl-and-mathematica/77470)

<div class="topic-metadata">

**Author:** [@gangchern](https://discourse.julialang.org/u/gangchern)\
**Replies:** 18\
**Last updated:** [June 9, 2022, 2:38am UTC](https://discourse.julialang.org/t/test-of-expand-and-substitute-in-symbolics-jl-symengine-jl-and-mathematica/77470 "2022-06-09T02:38:24Z")

</div>

My computer is Mac Pro M1, 2020. General Comments: for expand, SymEngine is nearly as good as Mathematica, Symbolics‘s “expand” function still needs to be greatly improved. substitute are similar for the three CAS in pe…

---

## [How can I determine the name of an enum value?](https://discourse.julialang.org/t/how-can-i-determine-the-name-of-an-enum-value/82394)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 3\
**Last updated:** [June 9, 2022, 1:55am UTC](https://discourse.julialang.org/t/how-can-i-determine-the-name-of-an-enum-value/82394 "2022-06-09T01:55:53Z")

</div>

How can I get the name of an enum value? @enum Animal dog cat Int(cat) # works String(cat) # not working How can I get the string representation of a variable of type Animal? I want to get the string “cat” or “dog”…

---

## [Extending broadcasts to matrix exponentials?](https://discourse.julialang.org/t/extending-broadcasts-to-matrix-exponentials/80384)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 7\
**Last updated:** [June 8, 2022, 11:18pm UTC](https://discourse.julialang.org/t/extending-broadcasts-to-matrix-exponentials/80384 "2022-06-08T23:18:07Z")

</div>

I’m fairly new to Julia and I have not yet looked at Julia’s source code. I’m wondering whether extending broadcasts to approximate matrix exponentials would be an improvement to the language, and whether the code chan…

---

## [Drop phase of Factor?](https://discourse.julialang.org/t/drop-phase-of-factor/80913)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 15\
**Last updated:** [June 8, 2022, 9:18pm UTC](https://discourse.julialang.org/t/drop-phase-of-factor/80913 "2022-06-08T21:18:03Z")

</div>

How can I reserve the symb. phase?

---

## [ModelingToolkit.jl performance for large models with similar components](https://discourse.julialang.org/t/modelingtoolkit-jl-performance-for-large-models-with-similar-components/82442)

<div class="topic-metadata">

**Author:** [@Sciemon](https://discourse.julialang.org/u/Sciemon)\
**Replies:** 4\
**Last updated:** [June 8, 2022, 8:59pm UTC](https://discourse.julialang.org/t/modelingtoolkit-jl-performance-for-large-models-with-similar-components/82442 "2022-06-08T20:59:37Z")

</div>

I cannot make sense of conflicting information about the performance of ModelingToolkit.jl for very large models. On the one hand, it seems to be performant according to the workshop at JuliaCon for example. On the other…

---

## [How to remove columns from Dataframe](https://discourse.julialang.org/t/how-to-remove-columns-from-dataframe/82459)

<div class="topic-metadata">

**Author:** [@bicepjai](https://discourse.julialang.org/u/bicepjai)\
**Replies:** 1\
**Last updated:** [June 8, 2022, 7:37pm UTC](https://discourse.julialang.org/t/how-to-remove-columns-from-dataframe/82459 "2022-06-08T19:37:33Z")

</div>

I have a parquet dataset with 32 million rows read using read\_parquet Complex processing gets completed in seconds. But when I try to ignore some columns using select!(data, Not(\[:column1, :column2\])) This does not c…

---

## [Any easy way to debug when a function is compiled?](https://discourse.julialang.org/t/any-easy-way-to-debug-when-a-function-is-compiled/82456)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 2\
**Last updated:** [June 8, 2022, 6:45pm UTC](https://discourse.julialang.org/t/any-easy-way-to-debug-when-a-function-is-compiled/82456 "2022-06-08T18:45:06Z")

</div>

A typical pattern in Jax to check when a function gets compiled (useful for debugging excessive recompliation) is, @jax.jit def f(): print("compiling") return 0 f() # prints "compiling" f() # doesnt print anyth…

---

## [Debugging julia code](https://discourse.julialang.org/t/debugging-julia-code/21246)

<div class="topic-metadata">

**Author:** [@Suraj\_Pawar](https://discourse.julialang.org/u/Suraj_Pawar)\
**Replies:** 27\
**Last updated:** [June 8, 2022, 6:34pm UTC](https://discourse.julialang.org/t/debugging-julia-code/21246 "2022-06-08T18:34:27Z")

</div>

What are good strategies for debugging Julia code? Can I debug the Julia code using gdb? I mainly want to see the variables at various points in the program. Thank you.

---

## [Converting and applying MATLAB lsqnonlin function in Julia with multiple function arguments](https://discourse.julialang.org/t/converting-and-applying-matlab-lsqnonlin-function-in-julia-with-multiple-function-arguments/82440)

<div class="topic-metadata">

**Author:** [@JannisHoch](https://discourse.julialang.org/u/JannisHoch)\
**Replies:** 1\
**Last updated:** [June 8, 2022, 6:05pm UTC](https://discourse.julialang.org/t/converting-and-applying-matlab-lsqnonlin-function-in-julia-with-multiple-function-arguments/82440 "2022-06-08T18:05:57Z")

</div>

I am trying to convert some MATLAB code into Julia. For the largest part this went pretty smooth, but I am now stuck with converting the MATLAB \[lsqnonlin\]\[1\] function. After scanning available options, I think that the…

---

## [Best way to compute eigenvalues of As + i Bs where As and Bs are symmetric?](https://discourse.julialang.org/t/best-way-to-compute-eigenvalues-of-as-i-bs-where-as-and-bs-are-symmetric/82428)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [June 8, 2022, 5:41pm UTC](https://discourse.julialang.org/t/best-way-to-compute-eigenvalues-of-as-i-bs-where-as-and-bs-are-symmetric/82428 "2022-06-08T17:41:58Z")

</div>

I’m trying to compute the eigenvalues of a matrix M = As + im \* Bs, where As and Bs are real, symmetric matrices (and don’t commute in general). I realize that the eigenvalues will be complex in general, with the real pa…

---

## [Cholesky factorization in JuMP](https://discourse.julialang.org/t/cholesky-factorization-in-jump/82227)

<div class="topic-metadata">

**Author:** [@horvetz](https://discourse.julialang.org/u/horvetz)\
**Replies:** 2\
**Last updated:** [June 8, 2022, 3:31pm UTC](https://discourse.julialang.org/t/cholesky-factorization-in-jump/82227 "2022-06-08T15:31:30Z")

</div>

I want to solve a SDP optimization problem using a nonlinear solver. Specifically I want to use Cholesky factorization to enforce positive definiteness of some decision variable A. That is I want to find a lower triangu…

---

## [How can I debug an "include("file")'d script?](https://discourse.julialang.org/t/how-can-i-debug-an-include-file-d-script/25143)

<div class="topic-metadata">

**Author:** [@j4ksch](https://discourse.julialang.org/u/j4ksch)\
**Replies:** 3\
**Last updated:** [June 8, 2022, 3:18pm UTC](https://discourse.julialang.org/t/how-can-i-debug-an-include-file-d-script/25143 "2022-06-08T15:18:04Z")

</div>

Hi there, thanks for all of your great work. I love the fact that there is a debugger now and I’m trying to use it to debug a file that I would normally run via $ julia "script.jl" Lets assume the content of the file …

---

## [\[AlgebraOfGraphics.jl\] place legend inside figure](https://discourse.julialang.org/t/algebraofgraphics-jl-place-legend-inside-figure/81991)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 9\
**Last updated:** [June 8, 2022, 3:07pm UTC](https://discourse.julialang.org/t/algebraofgraphics-jl-place-legend-inside-figure/81991 "2022-06-08T15:07:44Z")

</div>

Is it possible to place legends inside figures with AlgebraOfGraphics.jl? I am looking for a functionality similar to what Makie.jl’s axislegend function provides.

---

## [Question about JuMP?](https://discourse.julialang.org/t/question-about-jump/82432)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 5\
**Last updated:** [June 8, 2022, 2:46pm UTC](https://discourse.julialang.org/t/question-about-jump/82432 "2022-06-08T14:46:29Z")

</div>

What’s wrong with this problem? julia\> using JuMP julia\> using Ipopt julia\> model = Model(Ipopt.Optimizer) A JuMP Model Feasibility problem with: Variables: 0 Model mode: AUTOMATIC CachingOptimizer state: EMPTY\_OPTIMI…

---

## [Statsplots dendrogram - how to have clustered coloring](https://discourse.julialang.org/t/statsplots-dendrogram-how-to-have-clustered-coloring/50768)

<div class="topic-metadata">

**Author:** [@alailink](https://discourse.julialang.org/u/alailink)\
**Replies:** 12\
**Last updated:** [June 8, 2022, 2:32pm UTC](https://discourse.julialang.org/t/statsplots-dendrogram-how-to-have-clustered-coloring/50768 "2022-06-08T14:32:13Z")

</div>

I’m new to Julia, but already impressed by it’s syntax and by statsplots. However, some functionality is still missing that I miss from Python/R. Specifically for this post, I would like to color-code the output of clus…

---

## [How to retrieve gradient value in custom Flux training loop?](https://discourse.julialang.org/t/how-to-retrieve-gradient-value-in-custom-flux-training-loop/82435)

<div class="topic-metadata">

**Author:** [@BatyLeo](https://discourse.julialang.org/u/BatyLeo)\
**Replies:** 3\
**Last updated:** [June 8, 2022, 2:16pm UTC](https://discourse.julialang.org/t/how-to-retrieve-gradient-value-in-custom-flux-training-loop/82435 "2022-06-08T14:16:42Z")

</div>

Hello, I have a few questions about custom training loops in Flux. According to the documentation, I should write something like that : function my\_custom\_train!(loss, ps, data, opt) ps = Params(ps) for d in data …

---

## [Simple BinaryBuilder use](https://discourse.julialang.org/t/simple-binarybuilder-use/82434)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 1\
**Last updated:** [June 8, 2022, 2:02pm UTC](https://discourse.julialang.org/t/simple-binarybuilder-use/82434 "2022-06-08T14:02:38Z")

</div>

I would like to create a DLL package from some C code and headers. The code in question, from the cgranges repository, consists of a simple C source file, with no exotic dependencies, and two header files. (This code i…

---

## [How to use lm inside a for loop for different variables](https://discourse.julialang.org/t/how-to-use-lm-inside-a-for-loop-for-different-variables/82391)

<div class="topic-metadata">

**Author:** [@Juan\_Mac\_Donagh](https://discourse.julialang.org/u/Juan_Mac_Donagh)\
**Replies:** 2\
**Last updated:** [June 8, 2022, 1:34pm UTC](https://discourse.julialang.org/t/how-to-use-lm-inside-a-for-loop-for-different-variables/82391 "2022-06-08T13:34:51Z")

</div>

Hi all, I’ve been trying to work around this problem, and I need a little bit of help. I have a datarme that looks something like this: |Y|X1|X2|X3|X4|X5| |----------------| |1|22|23|25|98|23| |8|52|23|15|28|63| And s…

---

## [Step response error for delayed system](https://discourse.julialang.org/t/step-response-error-for-delayed-system/82425)

<div class="topic-metadata">

**Author:** [@lukasdos](https://discourse.julialang.org/u/lukasdos)\
**Replies:** 7\
**Last updated:** [June 8, 2022, 12:31pm UTC](https://discourse.julialang.org/t/step-response-error-for-delayed-system/82425 "2022-06-08T12:31:26Z")

</div>

Hi, I am trying to understand to basic functions from ControlSystems package. Especially step() is mystery for me. In some cases this function predicts the simulation time to plot the whole response well, in others it si…

---

## [Reinterpret to non bits type](https://discourse.julialang.org/t/reinterpret-to-non-bits-type/82307)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 41\
**Last updated:** [June 8, 2022, 11:38am UTC](https://discourse.julialang.org/t/reinterpret-to-non-bits-type/82307 "2022-06-08T11:38:58Z")

</div>

I have a Vector{UInt8} and I want to get a Vector{T} for an arbitrary type T without or with minimal runtime penalty and without allocating. The actual contents of the input and output are unspecified. The use case is i…

---

## [Gradient of sum of singular values of a matrix with CUDA.jl](https://discourse.julialang.org/t/gradient-of-sum-of-singular-values-of-a-matrix-with-cuda-jl/55390)

<div class="topic-metadata">

**Author:** [@ymtoo](https://discourse.julialang.org/u/ymtoo)\
**Replies:** 7\
**Last updated:** [June 8, 2022, 10:19am UTC](https://discourse.julialang.org/t/gradient-of-sum-of-singular-values-of-a-matrix-with-cuda-jl/55390 "2022-06-08T10:19:16Z")

</div>

Any idea on why it doesn’t work with CUDA julia\> using Flux, LinearAlgebra julia\> x = randn(10, 10); julia\> xgpu = gpu(x); julia\> gradient(x -\> sum(svd(x).S), xgpu) ERROR: MethodError: no method matching svd\_rev(::CU…

---

## [How to add values to vector with repeated indices?](https://discourse.julialang.org/t/how-to-add-values-to-vector-with-repeated-indices/82422)

<div class="topic-metadata">

**Author:** [@Minimum-Pollution-96](https://discourse.julialang.org/u/Minimum-Pollution-96)\
**Replies:** 4\
**Last updated:** [June 8, 2022, 10:31am UTC](https://discourse.julialang.org/t/how-to-add-values-to-vector-with-repeated-indices/82422 "2022-06-08T10:31:42Z")

</div>

I’ll explain my need with an example. a = \[1:5;\] indices = \[1,1,3,3\]; values = \[2,3,4,5\]; I need to add values to the original vector a as per the indices. The solution for above example should be, \>\>\> \[6,2,12,4,5\] I…

---

## [Malformed UTF-8 (category Ma: Malformed, bad data)](https://discourse.julialang.org/t/malformed-utf-8-category-ma-malformed-bad-data/82421)

<div class="topic-metadata">

**Author:** [@Daniel\_Lewis](https://discourse.julialang.org/u/Daniel_Lewis)\
**Replies:** 5\
**Last updated:** [June 8, 2022, 10:13am UTC](https://discourse.julialang.org/t/malformed-utf-8-category-ma-malformed-bad-data/82421 "2022-06-08T10:13:14Z")

</div>

Hi, I have an issue with Malformed UTF-8 (category Ma: Malformed, bad data) when reading input data from a serial port, instead of receiving an Hex data like “0xec” I get “\\xec”. I don’t fully understand way I get the d…

---

## [Is there any preference between \`iszero\` and \`==0\` for simple numbers?](https://discourse.julialang.org/t/is-there-any-preference-between-iszero-and-0-for-simple-numbers/82410)

<div class="topic-metadata">

**Author:** [@numberMX](https://discourse.julialang.org/u/numberMX)\
**Replies:** 3\
**Last updated:** [June 8, 2022, 10:02am UTC](https://discourse.julialang.org/t/is-there-any-preference-between-iszero-and-0-for-simple-numbers/82410 "2022-06-08T10:02:56Z")

</div>

I noticed that there are functions like iszero that are meant for arrays, but also work on integers. When writing Julia code, is it preferred Julia “style” to use iszero for checking whether an integer is equal to zero, …

---

## [Large number of @variables in ModelingToolkit](https://discourse.julialang.org/t/large-number-of-variables-in-modelingtoolkit/82399)

<div class="topic-metadata">

**Author:** [@QuantumWorm](https://discourse.julialang.org/u/QuantumWorm)\
**Replies:** 1\
**Last updated:** [June 8, 2022, 10:01am UTC](https://discourse.julialang.org/t/large-number-of-variables-in-modelingtoolkit/82399 "2022-06-08T10:01:38Z")

</div>

https://neuralpde.sciml.ai/stable/pinn/system/ When I need several variables I can write @parameters t, x @variables u1(…), u2(…), u3(…) and in solver use @named pde\_system = PDESystem(eqs,bcs,domains,\[t,x\],\[u1(t, x…

[Previous page](https://discourse.julialang.org/latest.md?page=1014)

[Next page](https://discourse.julialang.org/latest.md?page=1016)
