# Latest

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

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

**Page:** 353

---

## [Metaprogramming - Variable scope in macros combined with closures](https://discourse.julialang.org/t/metaprogramming-variable-scope-in-macros-combined-with-closures/117594)

<div class="topic-metadata">

**Author:** [@nietzsche](https://discourse.julialang.org/u/nietzsche)\
**Replies:** 4\
**Last updated:** [July 29, 2024, 2:54pm UTC](https://discourse.julialang.org/t/metaprogramming-variable-scope-in-macros-combined-with-closures/117594 "2024-07-29T14:54:48Z")

</div>

Hi, this is my first post. I have a question about macros and closures. The example is from the Book “LetOverLambda” Chapter 5.7. The author called it DLambda. The following source is a easy counter closure function c…

---

## [UDE: Estimating multiple parameters with NN and choosing best optimizers](https://discourse.julialang.org/t/ude-estimating-multiple-parameters-with-nn-and-choosing-best-optimizers/116444)

<div class="topic-metadata">

**Author:** [@MINimal-Code](https://discourse.julialang.org/u/MINimal-Code)\
**Replies:** 6\
**Last updated:** [July 29, 2024, 1:22pm UTC](https://discourse.julialang.org/t/ude-estimating-multiple-parameters-with-nn-and-choosing-best-optimizers/116444 "2024-07-29T13:22:47Z")

</div>

Hello, I am currently trying to implement a UDE to help me create a formulation for 2 parameters in a lung model. The code is based on the tutorial https://docs.sciml.ai/Overview/dev/showcase/missing\_physics/#Visualizing…

---

## [Is it possible to use Makie in CImGui?](https://discourse.julialang.org/t/is-it-possible-to-use-makie-in-cimgui/45844)

<div class="topic-metadata">

**Author:** [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Replies:** 8\
**Last updated:** [July 29, 2024, 12:45pm UTC](https://discourse.julialang.org/t/is-it-possible-to-use-makie-in-cimgui/45844 "2024-07-29T12:45:12Z")

</div>

Is there a way to render with Makie.jl directly into an existing OpenGL context? My goal is to render into a CImGui.jl widget using Makie.

---

## [Bar plot proportions with same bar height = 1](https://discourse.julialang.org/t/bar-plot-proportions-with-same-bar-height-1/117566)

<div class="topic-metadata">

**Author:** [@elisadonati23](https://discourse.julialang.org/u/elisadonati23)\
**Replies:** 6\
**Last updated:** [July 29, 2024, 10:52am UTC](https://discourse.julialang.org/t/bar-plot-proportions-with-same-bar-height-1/117566 "2024-07-29T10:52:45Z")

</div>

Hi all! Quite new into julia and struggling a lot with plots. I am moving from R and I cannot find a way to do a similar plot (using ggplot2) ggplot(propdf, aes(x = date, y = prop, fill = age\_year)) + geom\_bar(stat = …

---

## [Why step function doesn't recognise local model initialisation inside a function?](https://discourse.julialang.org/t/why-step-function-doesnt-recognise-local-model-initialisation-inside-a-function/117586)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 3\
**Last updated:** [July 29, 2024, 9:33am UTC](https://discourse.julialang.org/t/why-step-function-doesnt-recognise-local-model-initialisation-inside-a-function/117586 "2024-07-29T09:33:45Z")

</div>

Here is my function where I try to run ABM model inside a function. Now inside this function when I initialise model it works and also prints model but while using step!() it says model is not defined. Can someone shed …

---

## [Running EBM model in a function](https://discourse.julialang.org/t/running-ebm-model-in-a-function/117512)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 1\
**Last updated:** [July 29, 2024, 9:28am UTC](https://discourse.julialang.org/t/running-ebm-model-in-a-function/117512 "2024-07-29T09:28:25Z")

</div>

Hello everyone, Im running EBM model inside a function which is causing issue with calling model properties values. Is there a way to extract them inside function? General Idea of my function: model = model\_initiate()…

---

## [Does Julia support Chinese characters when plotting graph?](https://discourse.julialang.org/t/does-julia-support-chinese-characters-when-plotting-graph/81806)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 2\
**Last updated:** [July 29, 2024, 7:42am UTC](https://discourse.julialang.org/t/does-julia-support-chinese-characters-when-plotting-graph/81806 "2024-07-29T07:42:04Z")

</div>

Dear all , How to dispaly Chinese characters in the graph? julia\> y = rand(10); julia\> t = 1:10; julia\> plot(t, y, xlabel = "时间") GKS: glyph missing from current font: 26102 GKS: glyph missing from current font: 3838…

---

## [Use multiple output neural network in NeuralPDE](https://discourse.julialang.org/t/use-multiple-output-neural-network-in-neuralpde/117225)

<div class="topic-metadata">

**Author:** [@gradureau](https://discourse.julialang.org/u/gradureau)\
**Replies:** 2\
**Last updated:** [July 29, 2024, 8:39am UTC](https://discourse.julialang.org/t/use-multiple-output-neural-network-in-neuralpde/117225 "2024-07-29T08:39:41Z")

</div>

Hey everyone, I am trying out neural PDE to solve Euler’s equations in 1D. In my problem, I have two inputs : t and x, and I have three outputs : density ρ, velocity v and pressure p. Here are the equations: \\partial\_t…

---

## [Obtaining a projection onto the range of a matrix through its QR decomposition](https://discourse.julialang.org/t/obtaining-a-projection-onto-the-range-of-a-matrix-through-its-qr-decomposition/117334)

<div class="topic-metadata">

**Author:** [@cgois](https://discourse.julialang.org/u/cgois)\
**Replies:** 4\
**Last updated:** [July 29, 2024, 8:26am UTC](https://discourse.julialang.org/t/obtaining-a-projection-onto-the-range-of-a-matrix-through-its-qr-decomposition/117334 "2024-07-29T08:26:42Z")

</div>

Given a matrix A, I want to compute a matrix with rank(A) column vectors that span the range of A. With an SVD, this can be done with: import LinearAlgebra as LA function ortr\_svd(A::AbstractMatrix{T}) where {T\<:Number}…

---

## [Artifacts folder not empty - error when installing Plots.jl](https://discourse.julialang.org/t/artifacts-folder-not-empty-error-when-installing-plots-jl/117289)

<div class="topic-metadata">

**Author:** [@c\_sell](https://discourse.julialang.org/u/c_sell)\
**Replies:** 5\
**Last updated:** [July 29, 2024, 8:05am UTC](https://discourse.julialang.org/t/artifacts-folder-not-empty-error-when-installing-plots-jl/117289 "2024-07-29T08:05:32Z")

</div>

Hi, I’m getting the same error for different packages in Julia. For example, when I try to install Plots, I get the error. IOError: rm("C:\\\\Users\\\\\_\_\_\\\\.julia\\\\artifacts\\\\jl\_6eeUjb\\\\bin"): directory not empty (ENOTEMPT…

---

## [Simple Algebra in MTK](https://discourse.julialang.org/t/simple-algebra-in-mtk/117327)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 5\
**Last updated:** [July 29, 2024, 7:16am UTC](https://discourse.julialang.org/t/simple-algebra-in-mtk/117327 "2024-07-29T07:16:10Z")

</div>

Another beginner question… To what extent can I solve equations in MTK? using ModelingToolKit @mtkmodel Scratch begin @variables begin x(t) y(t) end @equations begin x ~ 3y + 10 y ~ 2x - 5 end e…

---

## [How to achieve Non blocking IO with Julia](https://discourse.julialang.org/t/how-to-achieve-non-blocking-io-with-julia/117503)

<div class="topic-metadata">

**Author:** [@Chamika\_Kasun](https://discourse.julialang.org/u/Chamika_Kasun)\
**Replies:** 3\
**Last updated:** [July 29, 2024, 6:48am UTC](https://discourse.julialang.org/t/how-to-achieve-non-blocking-io-with-julia/117503 "2024-07-29T06:48:23Z")

</div>

I have a function that is executed through a Julia thread. In this function, there is a execute\_psql\_string\_await function that performs a PostgreSQL stored procedure call using the LibPQ library. Currently, while this q…

---

## [Wrapping Unitful macros](https://discourse.julialang.org/t/wrapping-unitful-macros/95171)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 2\
**Last updated:** [March 18, 2023, 9:44pm UTC](https://discourse.julialang.org/t/wrapping-unitful-macros/95171 "2023-03-18T21:44:54Z")

</div>

Inspired by a commenter on Unitful.jl I’m trying to do unitful calculations with bookshelves: how many books do I have in 10 book cases? (20book / shelf) \* (8shelf / case) \* (10case) == 1600book I would like to replace…

---

## [Why isn't \`Vector{\<:Float64}\` reduced to \`Vector{Float64}\`?](https://discourse.julialang.org/t/why-isnt-vector-float64-reduced-to-vector-float64/117555)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 16\
**Last updated:** [July 28, 2024, 10:25pm UTC](https://discourse.julialang.org/t/why-isnt-vector-float64-reduced-to-vector-float64/117555 "2024-07-28T22:25:38Z")

</div>

I’m not sure if I misremembered, but I thought when applying \<: to a type parameter that represents a concrete type, \<: would automatically be removed. However, it seems that in Julia 1.10 and 1.11, that’s not the case,…

---

## [LaTeX Support for Interactive Plotting](https://discourse.julialang.org/t/latex-support-for-interactive-plotting/117565)

<div class="topic-metadata">

**Author:** [@ckawa](https://discourse.julialang.org/u/ckawa)\
**Replies:** 11\
**Last updated:** [July 28, 2024, 7:45pm UTC](https://discourse.julialang.org/t/latex-support-for-interactive-plotting/117565 "2024-07-28T19:45:39Z")

</div>

Just jumped into Julia from MATLAB so I’ve been spoiled with nice plotting experience, but I want to transition workflows into Julia for academic research. For plotting, I noticed that using LaTeXStrings works well for …

---

## [Code review: parser and error propagation](https://discourse.julialang.org/t/code-review-parser-and-error-propagation/117563)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 3\
**Last updated:** [July 28, 2024, 3:07pm UTC](https://discourse.julialang.org/t/code-review-parser-and-error-propagation/117563 "2024-07-28T15:07:24Z")

</div>

I need to write parsers for ad-hoc data formats from time to time. I’ve always wondered if I’m propagating errors in a “Julian” way. I don’t know if it’s the best to represent errors by nothing as in Base.tryparse, a cus…

---

## [\[ANN\] StrucRev - revise type definitions as you go](https://discourse.julialang.org/t/ann-strucrev-revise-type-definitions-as-you-go/109959)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 17\
**Last updated:** [July 28, 2024, 3:06pm UTC](https://discourse.julialang.org/t/ann-strucrev-revise-type-definitions-as-you-go/109959 "2024-07-28T15:06:50Z")

</div>

The package is intended to enable redefining structs within Revise.jl based workflow. It exports the macro @strev which (temporarily) wraps your struct like this @strev struct S0 x end becomes module StrucRev\_S0 …

---

## [Pmap over large dataset](https://discourse.julialang.org/t/pmap-over-large-dataset/116338)

<div class="topic-metadata">

**Author:** [@ditfurth](https://discourse.julialang.org/u/ditfurth)\
**Replies:** 2\
**Last updated:** [July 28, 2024, 1:15pm UTC](https://discourse.julialang.org/t/pmap-over-large-dataset/116338 "2024-07-28T13:15:00Z")

</div>

Hi all, I am trying to parallelize an operation over an index of a dataframe. list\_of\_dts = \[begin date = first(unique(dt\[dt.market\_ids .== id, :quarter\])) dma = first(unique(dt\[dt.market\_ids …

---

## [Access to the documentation while working offline](https://discourse.julialang.org/t/access-to-the-documentation-while-working-offline/117536)

<div class="topic-metadata">

**Author:** [@indymnv](https://discourse.julialang.org/u/indymnv)\
**Replies:** 6\
**Last updated:** [July 28, 2024, 10:18am UTC](https://discourse.julialang.org/t/access-to-the-documentation-while-working-offline/117536 "2024-07-28T10:18:21Z")

</div>

Hi community! For a couple of weeks, I will have limited access to the internet, and I would like to know if there is a way to get full access to the package documentation offline, especially packages related to DataFram…

---

## [Julia nightly CI errors](https://discourse.julialang.org/t/julia-nightly-ci-errors/117541)

<div class="topic-metadata">

**Author:** [@luke98](https://discourse.julialang.org/u/luke98)\
**Replies:** 6\
**Last updated:** [July 28, 2024, 9:17am UTC](https://discourse.julialang.org/t/julia-nightly-ci-errors/117541 "2024-07-28T09:17:36Z")

</div>

Hi All, I am new to Julia and I am trying to understand the usage of julia nightly and why it is giving me errors. I am working with someone else’s code repository and CI jobs work well on julia 1.6 and 1.8 but not on …

---

## [How do I sort a dictionary by its keys?](https://discourse.julialang.org/t/how-do-i-sort-a-dictionary-by-its-keys/37848)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 10\
**Last updated:** [July 28, 2024, 8:59am UTC](https://discourse.julialang.org/t/how-do-i-sort-a-dictionary-by-its-keys/37848 "2024-07-28T08:59:15Z")

</div>

I want to sort this by its keys: 5-element Dictionaries.HashDictionary{Int64,Any} 4 │ 0.2199244 2 │ 0.2000908 3 │ 0.19014 5 │ 0.2099752 1 │ 0.1798696

---

## [How to extract type parameters that are used as upper bounds in \`UnionAll\`?](https://discourse.julialang.org/t/how-to-extract-type-parameters-that-are-used-as-upper-bounds-in-unionall/117557)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 1\
**Last updated:** [July 28, 2024, 7:30am UTC](https://discourse.julialang.org/t/how-to-extract-type-parameters-that-are-used-as-upper-bounds-in-unionall/117557 "2024-07-28T07:30:05Z")

</div>

MWE: julia\> const DictPar{T, V} = Dict{T, \<:V} Dict{T, \<:V} where {T, V} julia\> getPar(::Type{D}) where {T, V, D\<:DictPar{T, V}} = (T, V) getPar (generic function with 1 method) julia\> d = DictPar{Int, Real} Dict{Int6…

---

## [How to add IJulia](https://discourse.julialang.org/t/how-to-add-ijulia/117560)

<div class="topic-metadata">

**Author:** [@chenchen](https://discourse.julialang.org/u/chenchen)\
**Replies:** 2\
**Last updated:** [July 28, 2024, 7:22am UTC](https://discourse.julialang.org/t/how-to-add-ijulia/117560 "2024-07-28T07:22:45Z")

</div>

This is a beginner who has just started working with Julia and encountered some issues during installation. I hope everyone can help more. I am using macOS system and currently have Julia and Anaconda installed. However…

---

## [\`include\` calls in a Julia package](https://discourse.julialang.org/t/include-calls-in-a-julia-package/117558)

<div class="topic-metadata">

**Author:** [@Santiago\_Lopez](https://discourse.julialang.org/u/Santiago_Lopez)\
**Replies:** 2\
**Last updated:** [July 28, 2024, 3:58am UTC](https://discourse.julialang.org/t/include-calls-in-a-julia-package/117558 "2024-07-28T03:58:59Z")

</div>

Assume we are developing a package called MyPkg. Step 3 of this tutorial states that, in order to export our package functions, we should add the following to our src/MyPkg.jl file: A statement export my\_function A sta…

---

## [Create Generic Function Without Macros From String and Symbolic Variable](https://discourse.julialang.org/t/create-generic-function-without-macros-from-string-and-symbolic-variable/117535)

<div class="topic-metadata">

**Author:** [@brombo](https://discourse.julialang.org/u/brombo)\
**Replies:** 13\
**Last updated:** [July 28, 2024, 12:15am UTC](https://discourse.julialang.org/t/create-generic-function-without-macros-from-string-and-symbolic-variable/117535 "2024-07-28T00:15:57Z")

</div>

I know you can create a function, say f(t) where t is a symbolic variable with a macro. How can you do it without using a macro where I have previously defined t. More specifically I wish to define several different fu…

---

## [Julia 1.7 sort issue?](https://discourse.julialang.org/t/julia-1-7-sort-issue/117531)

<div class="topic-metadata">

**Author:** [@danny.s](https://discourse.julialang.org/u/danny.s)\
**Replies:** 5\
**Last updated:** [July 28, 2024, 12:03am UTC](https://discourse.julialang.org/t/julia-1-7-sort-issue/117531 "2024-07-28T00:03:02Z")

</div>

I was trying to do some lexicographic sorting and came up with this “simple” code (sorry for the kinda long matrix, everything seems to work fine for the full slice): final\_pts = \[0.5 0.1127016653792583 0.61169334321448…

---

## [Gtk4.jl open\_dialog warning](https://discourse.julialang.org/t/gtk4-jl-open-dialog-warning/117553)

<div class="topic-metadata">

**Author:** [@janonime](https://discourse.julialang.org/u/janonime)\
**Replies:** 0\
**Last updated:** [July 27, 2024, 10:09pm UTC](https://discourse.julialang.org/t/gtk4-jl-open-dialog-warning/117553 "2024-07-27T22:09:26Z")

</div>

Minimal working example of the problem: using Gtk4 win = GtkWindow("Plasmatrace") open\_dialog("Pick a file to open", win) do filename println(filename) end destroy(win) Storing this script in a file called test.j…

---

## [Handling large values correctly](https://discourse.julialang.org/t/handling-large-values-correctly/117537)

<div class="topic-metadata">

**Author:** [@vh94](https://discourse.julialang.org/u/vh94)\
**Replies:** 4\
**Last updated:** [July 27, 2024, 9:27pm UTC](https://discourse.julialang.org/t/handling-large-values-correctly/117537 "2024-07-27T21:27:35Z")

</div>

I repeatedly run into issues handling large values (values beyond 1e+15), and couldn’t find a clear answer on how to address those. Consider following comparison: (1.0e+16 + 1 + 1 + 1) \> 1.0e+16 will wrongfully return…

---

## [How to create a struct from a dict](https://discourse.julialang.org/t/how-to-create-a-struct-from-a-dict/117550)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 7\
**Last updated:** [July 27, 2024, 9:32pm UTC](https://discourse.julialang.org/t/how-to-create-a-struct-from-a-dict/117550 "2024-07-27T21:32:08Z")

</div>

I have a Dict from parsing a JSON message, and want to convert it into a struct. This works: using StaticArrays const MyFloat = Float64 sys\_state\_dict = Dict(:time =\> 0, :t\_sim =\> 0, :sys\_state =\> 0,…

---

## [Tips for handling large Datasets with a lot of preprocessing](https://discourse.julialang.org/t/tips-for-handling-large-datasets-with-a-lot-of-preprocessing/117551)

<div class="topic-metadata">

**Author:** [@felix12123](https://discourse.julialang.org/u/felix12123)\
**Replies:** 1\
**Last updated:** [July 27, 2024, 8:24pm UTC](https://discourse.julialang.org/t/tips-for-handling-large-datasets-with-a-lot-of-preprocessing/117551 "2024-07-27T20:24:50Z")

</div>

Hello, i am currently trying to machine learn a local relation between two 2D arrays. Consider the two 2D CircularArrays A and B of the same size. I want to predict the value of B\[x,y\] with the region A\[x-r:x+r, y-r:y+…

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

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