# Latest

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

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

**Page:** 604

---

## [Trait definitions: type level vs instance level](https://discourse.julialang.org/t/trait-definitions-type-level-vs-instance-level/103587)

<div class="topic-metadata">

**Author:** [@joaquinpelle](https://discourse.julialang.org/u/joaquinpelle)\
**Replies:** 3\
**Last updated:** [September 7, 2023, 1:30pm UTC](https://discourse.julialang.org/t/trait-definitions-type-level-vs-instance-level/103587 "2023-09-07T13:30:29Z")

</div>

Hi there, I’ve been thinking about trait-based dispatch, particularly from this book excerpt. The example there defines traits at the type level as follows # Default behavior is illiquid LiquidityStyle(::Type) = IsIlli…

---

## [How to evaluate symbol as a "variable" inside a macro?](https://discourse.julialang.org/t/how-to-evaluate-symbol-as-a-variable-inside-a-macro/103607)

<div class="topic-metadata">

**Author:** [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Replies:** 12\
**Last updated:** [September 7, 2023, 1:23pm UTC](https://discourse.julialang.org/t/how-to-evaluate-symbol-as-a-variable-inside-a-macro/103607 "2023-09-07T13:23:25Z")

</div>

Hello, I’m currently trying to implement merge on ComponentArrays. I’ve taken inspiration from NamedTuples in the stdlib here, and wrote a macro and a function: (instead of the Expr) using ComponentArrays c1 = Component…

---

## [Internal Error: UndefVarError: \`includet\` not defined](https://discourse.julialang.org/t/internal-error-undefvarerror-includet-not-defined/103601)

<div class="topic-metadata">

**Author:** [@ZhanHuijia](https://discourse.julialang.org/u/ZhanHuijia)\
**Replies:** 2\
**Last updated:** [September 7, 2023, 12:32pm UTC](https://discourse.julialang.org/t/internal-error-undefvarerror-includet-not-defined/103601 "2023-09-07T12:32:34Z")

</div>

Internal Error: UndefVarError: includet not defined

---

## [Understanding output of @time and @btime under cgroup CPUQuota constrains](https://discourse.julialang.org/t/understanding-output-of-time-and-btime-under-cgroup-cpuquota-constrains/103571)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 6\
**Last updated:** [September 7, 2023, 9:38am UTC](https://discourse.julialang.org/t/understanding-output-of-time-and-btime-under-cgroup-cpuquota-constrains/103571 "2023-09-07T09:38:09Z")

</div>

Hello, I was testing cgroup CPU/ Memory quota in a Ubuntu 22.04 system and realised that while @time reacts to changes I do in terms of CPUQuota (and indeed the whole system does slow down, meaning the limit is enforced)…

---

## [GLMakie + 4K displays](https://discourse.julialang.org/t/glmakie-4k-displays/103590)

<div class="topic-metadata">

**Author:** [@lgmendesDynamics](https://discourse.julialang.org/u/lgmendesDynamics)\
**Replies:** 1\
**Last updated:** [September 7, 2023, 5:57am UTC](https://discourse.julialang.org/t/glmakie-4k-displays/103590 "2023-09-07T05:57:24Z")

</div>

Is there a correspondent option in GLMakie for the px\_per\_unit in the CairoMakie? To have good quality images (sharper) in a 4K display, I need to set px\_per\_unit=4 in CairoMakie. Currently (default configuration) the…

---

## [How to compute the last column of Hessian (over and over) with autodiff without computing entire Hessian?](https://discourse.julialang.org/t/how-to-compute-the-last-column-of-hessian-over-and-over-with-autodiff-without-computing-entire-hessian/103588)

<div class="topic-metadata">

**Author:** [@biona001](https://discourse.julialang.org/u/biona001)\
**Replies:** 5\
**Last updated:** [September 7, 2023, 5:27am UTC](https://discourse.julialang.org/t/how-to-compute-the-last-column-of-hessian-over-and-over-with-autodiff-without-computing-entire-hessian/103588 "2023-09-07T05:27:41Z")

</div>

Hi community, I have an extended question from this post. I have a loss function f(y, X, β)::Number which requires data y and X. Matrix X changes often and I want to compute: The last column of the Hessian of f with r…

---

## [Earthquake Forecasting Post-doc in ML at the USGS (remote)](https://discourse.julialang.org/t/earthquake-forecasting-post-doc-in-ml-at-the-usgs-remote/103597)

<div class="topic-metadata">

**Author:** [@Morgan\_Page](https://discourse.julialang.org/u/Morgan_Page)\
**Replies:** 0\
**Last updated:** [September 7, 2023, 3:24am UTC](https://discourse.julialang.org/t/earthquake-forecasting-post-doc-in-ml-at-the-usgs-remote/103597 "2023-09-07T03:24:16Z")

</div>

The U.S. Geological Survey invites applications to a Mendenhall research post-doctoral fellowship opportunity to apply machine learning techniques to earthquake forecasting. The goal of this opportunity is to develop mac…

---

## [How to express one type related to another](https://discourse.julialang.org/t/how-to-express-one-type-related-to-another/103416)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 8\
**Last updated:** [September 7, 2023, 12:58am UTC](https://discourse.julialang.org/t/how-to-express-one-type-related-to-another/103416 "2023-09-07T00:58:49Z")

</div>

I am trying to express something like this: struct C{T} foo::SomeTypeThatDependsOnT end In C++ one could just do T::FavoriteType but I’m not sure what the analogue is in julia. I can write a function that returns …

---

## [Is there any package/function equivalent to the pcg() in MATLAB?](https://discourse.julialang.org/t/is-there-any-package-function-equivalent-to-the-pcg-in-matlab/103593)

<div class="topic-metadata">

**Author:** [@Nova](https://discourse.julialang.org/u/Nova)\
**Replies:** 1\
**Last updated:** [September 6, 2023, 11:43pm UTC](https://discourse.julialang.org/t/is-there-any-package-function-equivalent-to-the-pcg-in-matlab/103593 "2023-09-06T23:43:14Z")

</div>

Is there any package/function equivalent to the pcg() in MATLAB?

---

## [Why does Theads.foreach only take Channels?](https://discourse.julialang.org/t/why-does-theads-foreach-only-take-channels/103592)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 1\
**Last updated:** [September 6, 2023, 10:18pm UTC](https://discourse.julialang.org/t/why-does-theads-foreach-only-take-channels/103592 "2023-09-06T22:18:55Z")

</div>

Below you can find some confusion I had earlier. Is there a reason that Threads.foreach can’t take an array? Previous confusion Can someone explain why this code isn’t printing each element of the array? julia\> functio…

---

## [LLVM Bitcode for Graal](https://discourse.julialang.org/t/llvm-bitcode-for-graal/103581)

<div class="topic-metadata">

**Author:** [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)\
**Replies:** 1\
**Last updated:** [September 6, 2023, 10:14pm UTC](https://discourse.julialang.org/t/llvm-bitcode-for-graal/103581 "2023-09-06T22:14:40Z")

</div>

Hi there. I know, there is already an old thread open, that explains how to evaluate a single function as llvm bitcode. I would like to translate a whole program to it - in order to run it on Graal.

---

## [Startup.jl not loading](https://discourse.julialang.org/t/startup-jl-not-loading/29798)

<div class="topic-metadata">

**Author:** [@mpf01](https://discourse.julialang.org/u/mpf01)\
**Replies:** 2\
**Last updated:** [September 6, 2023, 8:56pm UTC](https://discourse.julialang.org/t/startup-jl-not-loading/29798 "2023-09-06T20:56:48Z")

</div>

Running julia from the terminal (Mac), doesn’t seem to read startup.jl. Below I confirm that the startup file exists in the correct place, I think. Can someone spot what I’m doing wrong? Thanks! \[~\]$ cat .julia/config/…

---

## [Requests for comments](https://discourse.julialang.org/t/requests-for-comments/103551)

<div class="topic-metadata">

**Author:** [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)\
**Replies:** 5\
**Last updated:** [September 6, 2023, 8:18pm UTC](https://discourse.julialang.org/t/requests-for-comments/103551 "2023-09-06T20:18:33Z")

</div>

So far as I can tell, has Julia no system to develop the language, akin to RFC’s in other languages. This has worked superb for Rust, F#, Kotlin, and Python. Is this intentional, and do you see sense in them, potential…

---

## [How to modularize my code like a pro](https://discourse.julialang.org/t/how-to-modularize-my-code-like-a-pro/103174)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 7\
**Last updated:** [September 6, 2023, 6:38pm UTC](https://discourse.julialang.org/t/how-to-modularize-my-code-like-a-pro/103174 "2023-09-06T18:38:07Z")

</div>

Hi guys, I work with numerical sampling methods that evolve some vectorial parameter \\boldsymbol{x} and associated momentum \\boldsymbol{p} via a force function \\boldsymbol{F}(\\boldsymbol{x}) that comes from an underlyin…

---

## [How to use ParentScope with arrays](https://discourse.julialang.org/t/how-to-use-parentscope-with-arrays/103579)

<div class="topic-metadata">

**Author:** [@contradict](https://discourse.julialang.org/u/contradict)\
**Replies:** 2\
**Last updated:** [September 6, 2023, 5:49pm UTC](https://discourse.julialang.org/t/how-to-use-parentscope-with-arrays/103579 "2023-09-06T17:49:10Z")

</div>

This used to work in ModelingToolkit 8.65.0 but stopped in 8.66.0. Was it ever supposed to work? Is there a way to move array variables up the hierarchy? @parameters a\[1:2\]=\[1, 2\] b=4 c=1 @variables t x(t)=ParentScope(a…

---

## [What are the advantages of using ModelingToolkit to make and solve ODEProblems?](https://discourse.julialang.org/t/what-are-the-advantages-of-using-modelingtoolkit-to-make-and-solve-odeproblems/103563)

<div class="topic-metadata">

**Author:** [@markjholmes](https://discourse.julialang.org/u/markjholmes)\
**Replies:** 7\
**Last updated:** [September 6, 2023, 5:07pm UTC](https://discourse.julialang.org/t/what-are-the-advantages-of-using-modelingtoolkit-to-make-and-solve-odeproblems/103563 "2023-09-06T17:07:42Z")

</div>

For context, I come from an R background using the deSolve package. The first examples for ModelingToolkit make use of a specific structure of model definition, using the @parameters, @variables, @named macros. The gene…

---

## [Sorting a Table / DataFrame](https://discourse.julialang.org/t/sorting-a-table-dataframe/103475)

<div class="topic-metadata">

**Author:** [@Dan\_Micsa](https://discourse.julialang.org/u/Dan_Micsa)\
**Replies:** 12\
**Last updated:** [September 6, 2023, 4:54pm UTC](https://discourse.julialang.org/t/sorting-a-table-dataframe/103475 "2023-09-06T16:54:01Z")

</div>

I have a table like this: \* A B C A 1 2 3 B 2 3 4 C 3 4 5 And I want to sort descending both on columns and rows after the sum something like this: \* C B A S C 5 4 3 12 B 4 3 2 9 A 3 2 1 6 S 12 9 6 \* How can …

---

## [Quantum Computer Programmer](https://discourse.julialang.org/t/quantum-computer-programmer/103577)

<div class="topic-metadata">

**Author:** [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Replies:** 0\
**Last updated:** [September 6, 2023, 4:52pm UTC](https://discourse.julialang.org/t/quantum-computer-programmer/103577 "2023-09-06T16:52:50Z")

</div>

My team is looking to hire a quantum computer programer. Previous quantum computing experience is welcome but not required. Julia coding experience is a desired skill for this role. Additional details are available here…

---

## [Fixing red bars at top of flame profile](https://discourse.julialang.org/t/fixing-red-bars-at-top-of-flame-profile/103316)

<div class="topic-metadata">

**Author:** [@ilanggear](https://discourse.julialang.org/u/ilanggear)\
**Replies:** 12\
**Last updated:** [September 6, 2023, 4:14pm UTC](https://discourse.julialang.org/t/fixing-red-bars-at-top-of-flame-profile/103316 "2023-09-06T16:14:41Z")

</div>

I’ve attached a screenshot of my flame profile. I’ve read that red bars near the top signal a problem with type instability. But I have specified the type of every struct member and the vast majority of my code relies …

---

## [Question about "in place" operations](https://discourse.julialang.org/t/question-about-in-place-operations/103573)

<div class="topic-metadata">

**Author:** [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Replies:** 1\
**Last updated:** [September 6, 2023, 3:50pm UTC](https://discourse.julialang.org/t/question-about-in-place-operations/103573 "2023-09-06T15:50:16Z")

</div>

Hello, At the moment I’m studying a little bit of code optimisation. I don’t understand why in case with sample() we have 16 bytes allocated and in the second case 0 (with the in place operation “sample!()”). Isn’t it p…

---

## [Lines outside the box of Axis3 CairoMakie](https://discourse.julialang.org/t/lines-outside-the-box-of-axis3-cairomakie/103566)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 3\
**Last updated:** [September 6, 2023, 3:38pm UTC](https://discourse.julialang.org/t/lines-outside-the-box-of-axis3-cairomakie/103566 "2023-09-06T15:38:56Z")

</div>

Hello, i have image: I using xlims and ylims and get image: How can i fix lines which outside the box? Thank you for helps

---

## [VSCode -- export of Jupyter Notebook & LaTeX math](https://discourse.julialang.org/t/vscode-export-of-jupyter-notebook-latex-math/103568)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 4\
**Last updated:** [September 6, 2023, 2:49pm UTC](https://discourse.julialang.org/t/vscode-export-of-jupyter-notebook-latex-math/103568 "2023-09-06T14:49:57Z")

</div>

I managed to install Python so that I can export HTML-files from VSCode/Jupyter Notebook to HTML – but export to PDF fails. I can get around this by opening the HTML file in MS Edge, and print to PDF from Edge – that see…

---

## [Macro to crate a struct and its external constructor](https://discourse.julialang.org/t/macro-to-crate-a-struct-and-its-external-constructor/103565)

<div class="topic-metadata">

**Author:** [@CrisCool](https://discourse.julialang.org/u/CrisCool)\
**Replies:** 5\
**Last updated:** [September 6, 2023, 2:49pm UTC](https://discourse.julialang.org/t/macro-to-crate-a-struct-and-its-external-constructor/103565 "2023-09-06T14:49:53Z")

</div>

Hi there. I’m new to metaprogramming and I’m running into trouble when trying to create a macro for replacing some bolier plate code. The code creates a series of structs and their corresponding external constructors. …

---

## [Same code but different values of simulation from two computers](https://discourse.julialang.org/t/same-code-but-different-values-of-simulation-from-two-computers/103562)

<div class="topic-metadata">

**Author:** [@Zerosum](https://discourse.julialang.org/u/Zerosum)\
**Replies:** 3\
**Last updated:** [September 6, 2023, 2:27pm UTC](https://discourse.julialang.org/t/same-code-but-different-values-of-simulation-from-two-computers/103562 "2023-09-06T14:27:59Z")

</div>

I have a laptop and a desktop. Both are Mac with M1 chip. I wrote down my codes in my desktop and transferred to my laptop. However, if I run my codes, I get different results. I run several times in both computers …

---

## [New user of Images.jl ... trouble saving grayscale PNG](https://discourse.julialang.org/t/new-user-of-images-jl-trouble-saving-grayscale-png/103553)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 4\
**Last updated:** [September 6, 2023, 1:28pm UTC](https://discourse.julialang.org/t/new-user-of-images-jl-trouble-saving-grayscale-png/103553 "2023-09-06T13:28:06Z")

</div>

I am getting a copy of the red channel of an image from the graphics card as a Float32. What I get back has a range of 0 to 1.865 (granted, I may have done something wrong, I would have figured it was supposed to be from…

---

## [XOR when indexing arrays](https://discourse.julialang.org/t/xor-when-indexing-arrays/103557)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 7\
**Last updated:** [September 6, 2023, 12:57pm UTC](https://discourse.julialang.org/t/xor-when-indexing-arrays/103557 "2023-09-06T12:57:49Z")

</div>

In a tutorial about computer hardware (https://viralinstruction.com/posts/hardware/), I came across the following Julia code: function foo(x) s = zero(eltype(x)) @inbounds for i in eachindex(x) s = x\[i ⊻…

---

## [JuliaUserGroupMunich: Extra - Best of JuliaCon (online)](https://discourse.julialang.org/t/juliausergroupmunich-extra-best-of-juliacon-online/103147)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 2\
**Last updated:** [September 6, 2023, 9:07am UTC](https://discourse.julialang.org/t/juliausergroupmunich-extra-best-of-juliacon-online/103147 "2023-09-06T09:07:28Z")

</div>

Join me online :spiral\_calendar: Monday 4. September 2023 :clock630: 18:30 CEST organized via meetup Extra: Best of JuliaCon (online) ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Hi there, JuliaCon is over and hundreds of talks took place. I…

---

## [Is there a Julia function that returns h5 group structures à la h5dump?](https://discourse.julialang.org/t/is-there-a-julia-function-that-returns-h5-group-structures-a-la-h5dump/102778)

<div class="topic-metadata">

**Author:** [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)\
**Replies:** 10\
**Last updated:** [September 6, 2023, 8:18am UTC](https://discourse.julialang.org/t/is-there-a-julia-function-that-returns-h5-group-structures-a-la-h5dump/102778 "2023-09-06T08:18:21Z")

</div>

I’m looking for a function that maps h5 data structures, i.e. variable paths, names and Types, and attribute paths, names and Types. This would be similar to h5dump.

---

## [Custom Flux Layer Connect](https://discourse.julialang.org/t/custom-flux-layer-connect/36262)

<div class="topic-metadata">

**Author:** [@TobiS](https://discourse.julialang.org/u/TobiS)\
**Replies:** 3\
**Last updated:** [September 6, 2023, 7:56am UTC](https://discourse.julialang.org/t/custom-flux-layer-connect/36262 "2023-09-06T07:56:19Z")

</div>

Hello everyone, I would like to implement the architecture of N-BEATS network (https://arxiv.org/pdf/1905.10437.pdf) in julia Flux. A simple example of a part of the architecture is shown in the following figure. Is…

---

## [Short-form printing not working in vectors](https://discourse.julialang.org/t/short-form-printing-not-working-in-vectors/103520)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 6\
**Last updated:** [September 6, 2023, 4:31am UTC](https://discourse.julialang.org/t/short-form-printing-not-working-in-vectors/103520 "2023-09-06T04:31:51Z")

</div>

I’m trying to define short-form and long-form printing for a custom type. It seems to work as expected except when I put objects of the custom type in a vector. Here’s the code: struct Foo x::Int y::Int end fun…

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

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