# Latest

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

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

**Page:** 686

---

## [How clear the printed content in terminal and print to the same line?](https://discourse.julialang.org/t/how-clear-the-printed-content-in-terminal-and-print-to-the-same-line/19549)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 9\
**Last updated:** [May 30, 2023, 10:05am UTC](https://discourse.julialang.org/t/how-clear-the-printed-content-in-terminal-and-print-to-the-same-line/19549 "2023-05-30T10:05:28Z")

</div>

I can print(1) to print to the terminal. But I want clear the 1 that I just printed and on the same line in the terminal print(2). Is that possible?

---

## [Is it possible to generate widgets based on an other widget ? JSServe](https://discourse.julialang.org/t/is-it-possible-to-generate-widgets-based-on-an-other-widget-jsserve/99591)

<div class="topic-metadata">

**Author:** [@Ludovic\_Dumoulin](https://discourse.julialang.org/u/Ludovic_Dumoulin)\
**Replies:** 0\
**Last updated:** [May 30, 2023, 8:37am UTC](https://discourse.julialang.org/t/is-it-possible-to-generate-widgets-based-on-an-other-widget-jsserve/99591 "2023-05-30T08:37:51Z")

</div>

Hello, I am still new to Julia and use it mainly for physics simulations. I am generating a dahboard from a csv file. The idea is to explore the csv file using widgets (to get the value of the last collumn at a specifi…

---

## [Choosing a numerical programming language for economic research: Julia,](https://discourse.julialang.org/t/choosing-a-numerical-programming-language-for-economic-research-julia/85697)

<div class="topic-metadata">

**Author:** [@y.lin](https://discourse.julialang.org/u/y.lin)\
**Replies:** 135\
**Last updated:** [May 30, 2023, 8:19am UTC](https://discourse.julialang.org/t/choosing-a-numerical-programming-language-for-economic-research-julia/85697 "2023-05-30T08:19:21Z")

</div>

Hi all, We wrote a new blog post about comparing Julia with MATLAB, Python, and R. Comments and suggestions are welcome!

---

## [Multi-physics simulation](https://discourse.julialang.org/t/multi-physics-simulation/88651)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 18\
**Last updated:** [May 30, 2023, 7:40am UTC](https://discourse.julialang.org/t/multi-physics-simulation/88651 "2023-05-30T07:40:10Z")

</div>

As far as I know, for multi-physics simulations often software packages like Ansys or COMSOL are used. Can Julia also be used for this kind of simulations? Or can Julia be used together with these commercial SW packages…

---

## [Discussion on the future for performant programming in Julia](https://discourse.julialang.org/t/discussion-on-the-future-for-performant-programming-in-julia/99509)

<div class="topic-metadata">

**Author:** [@jt1](https://discourse.julialang.org/u/jt1)\
**Replies:** 5\
**Last updated:** [May 30, 2023, 6:02am UTC](https://discourse.julialang.org/t/discussion-on-the-future-for-performant-programming-in-julia/99509 "2023-05-30T06:02:02Z")

</div>

Edit for future readers, the respones of @ChrisRackauckas in this thread, together with the response of @tim.holy here (which I missed) gives a clear enough plan. The following gives an explanation as to why roadmaps a…

---

## [\[RFC\] ExtensionsExt.jl : boilerplate for 1.9 extensions](https://discourse.julialang.org/t/rfc-extensionsext-jl-boilerplate-for-1-9-extensions/99586)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 1\
**Last updated:** [May 30, 2023, 5:56am UTC](https://discourse.julialang.org/t/rfc-extensionsext-jl-boilerplate-for-1-9-extensions/99586 "2023-05-30T05:56:57Z")

</div>

Hi, i just made this package while porting some packages to use the new extensions feature of julia 1.9. The package has utilities to port pkgs to the new extension system, it tries to catch all the current cases (exte…

---

## [Package compiler and module global variable](https://discourse.julialang.org/t/package-compiler-and-module-global-variable/99585)

<div class="topic-metadata">

**Author:** [@xgdgsc](https://discourse.julialang.org/u/xgdgsc)\
**Replies:** 1\
**Last updated:** [May 30, 2023, 5:18am UTC](https://discourse.julialang.org/t/package-compiler-and-module-global-variable/99585 "2023-05-30T05:18:14Z")

</div>

module JModel mutable struct JStruct path::String # other fields end jstruct = JStruct("") Base.@ccallable function init\_model(conf\_path::Cstring)::Cint global jstruct jstruct = JStruct(unsafe\_string(conf\_…

---

## [Allocations when using multiple dispatch, but not with specialized functions](https://discourse.julialang.org/t/allocations-when-using-multiple-dispatch-but-not-with-specialized-functions/99535)

<div class="topic-metadata">

**Author:** [@james3](https://discourse.julialang.org/u/james3)\
**Replies:** 4\
**Last updated:** [May 30, 2023, 4:42am UTC](https://discourse.julialang.org/t/allocations-when-using-multiple-dispatch-but-not-with-specialized-functions/99535 "2023-05-30T04:42:53Z")

</div>

Hello, I am trying to understand why I obtain allocations when using a multiple dispatch version of a function, compared to specialized functions. In the code below, I define different two structs that contain a number …

---

## [Heap-size-hint usage recommendations](https://discourse.julialang.org/t/heap-size-hint-usage-recommendations/98697)

<div class="topic-metadata">

**Author:** [@rssdev10](https://discourse.julialang.org/u/rssdev10)\
**Replies:** 3\
**Last updated:** [May 30, 2023, 3:20am UTC](https://discourse.julialang.org/t/heap-size-hint-usage-recommendations/98697 "2023-05-30T03:20:55Z")

</div>

Julia 1.9 got a new CLI option --heap-size-hint. See #45369 for details and Julia execution inside a container with restricted RAM This option allows to set a soft limit of memory consumption when the garbage collector …

---

## [SegmentAnalytics.jl](https://discourse.julialang.org/t/segmentanalytics-jl/99582)

<div class="topic-metadata">

**Author:** [@rssdev10](https://discourse.julialang.org/u/rssdev10)\
**Replies:** 0\
**Last updated:** [May 30, 2023, 2:54am UTC](https://discourse.julialang.org/t/segmentanalytics-jl/99582 "2023-05-30T02:54:30Z")

</div>

SegmentAnalytics.jl is a client library implementation for the Twilio Segment platform written in pure Julia. The package was inspired by segmentio / analytics-ruby and copies some of architectural approaches. For now…

---

## [Should I add type annotation to keyword arguments?](https://discourse.julialang.org/t/should-i-add-type-annotation-to-keyword-arguments/99231)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 10\
**Last updated:** [May 30, 2023, 1:32am UTC](https://discourse.julialang.org/t/should-i-add-type-annotation-to-keyword-arguments/99231 "2023-05-30T01:32:17Z")

</div>

Old versions of Julia’s performance tips https://docs.julialang.org/en/v1/manual/performance-tips advised annotating the types of keyword arguments, but this is no longer mentioned in the current version. Do I still ne…

---

## [How to calculate the statistics/ percentile in julia](https://discourse.julialang.org/t/how-to-calculate-the-statistics-percentile-in-julia/99580)

<div class="topic-metadata">

**Author:** [@RDuarte](https://discourse.julialang.org/u/RDuarte)\
**Replies:** 5\
**Last updated:** [May 29, 2023, 11:52pm UTC](https://discourse.julialang.org/t/how-to-calculate-the-statistics-percentile-in-julia/99580 "2023-05-29T23:52:48Z")

</div>

Hello, I’m new in Julia and I would like to do some statistics. How can I calculate a percentile of a matrix? I installed the using StatsBase package and I’m doing: percentile(mymatrix, 25), however I get an error

---

## [What strategy to allocate resources while respecting many constraints](https://discourse.julialang.org/t/what-strategy-to-allocate-resources-while-respecting-many-constraints/99484)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 16\
**Last updated:** [May 29, 2023, 10:22pm UTC](https://discourse.julialang.org/t/what-strategy-to-allocate-resources-while-respecting-many-constraints/99484 "2023-05-29T22:22:46Z")

</div>

Suppose we have a table with 8 rows and 30 (or 31) columns. We have to label each cell with G and N, respecting the following rules (sometimes some other constraint is added :slight\_smile: ) Each column (i.e. each day…

---

## [3D surface plot with GR backend error from certain camera angles](https://discourse.julialang.org/t/3d-surface-plot-with-gr-backend-error-from-certain-camera-angles/99564)

<div class="topic-metadata">

**Author:** [@bast](https://discourse.julialang.org/u/bast)\
**Replies:** 1\
**Last updated:** [May 29, 2023, 4:51pm UTC](https://discourse.julialang.org/t/3d-surface-plot-with-gr-backend-error-from-certain-camera-angles/99564 "2023-05-29T16:51:35Z")

</div>

Hi, I am trying to do a surface plot on data with missing/NaN values but the camera angle that I want gives me the error: “GKS: Colour index is invalid in routine SET\_FILL\_COLOR\_INDEX” and the coloring is all black. Us…

---

## [After using DynamicalSystems, I don't have "lyapunovx"](https://discourse.julialang.org/t/after-using-dynamicalsystems-i-dont-have-lyapunovx/99533)

<div class="topic-metadata">

**Author:** [@axelwang](https://discourse.julialang.org/u/axelwang)\
**Replies:** 2\
**Last updated:** [May 29, 2023, 9:40pm UTC](https://discourse.julialang.org/t/after-using-dynamicalsystems-i-dont-have-lyapunovx/99533 "2023-05-29T21:40:16Z")

</div>

Hey, I just set up my Julia environment (1.9.0) and installed some packages. I tried using DynamicalSystems lorenz = ContinuousDynamicalSystem(lorenz\_rule, u₀, p₀) lyapunovs(lorenz,50) and get the error: UndefVarError…

---

## [SciML Optimization - algorithms and convergence speed](https://discourse.julialang.org/t/sciml-optimization-algorithms-and-convergence-speed/99170)

<div class="topic-metadata">

**Author:** [@sob](https://discourse.julialang.org/u/sob)\
**Replies:** 10\
**Last updated:** [May 29, 2023, 9:20pm UTC](https://discourse.julialang.org/t/sciml-optimization-algorithms-and-convergence-speed/99170 "2023-05-29T21:20:44Z")

</div>

I’m currently working on a minimization problem where the loss function is of dimensions n by p, with both n and p ~100 (but not necessarily equal, although in some cases they may be). I started with a naive implementati…

---

## [CairoMakie cant plot with plot function and range problem](https://discourse.julialang.org/t/cairomakie-cant-plot-with-plot-function-and-range-problem/99404)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 2\
**Last updated:** [May 29, 2023, 9:08pm UTC](https://discourse.julialang.org/t/cairomakie-cant-plot-with-plot-function-and-range-problem/99404 "2023-05-29T21:08:47Z")

</div>

I am trying to plot using below code and it is the same as tutorials. at first it couldnt recognize plot individually so i added CairoMakie at the function initials. but then it gives me the error of range couldnt be zer…

---

## [Is http\_listen blocking further call execution in my ccall program](https://discourse.julialang.org/t/is-http-listen-blocking-further-call-execution-in-my-ccall-program/99542)

<div class="topic-metadata">

**Author:** [@AbhimanyuAryan](https://discourse.julialang.org/u/AbhimanyuAryan)\
**Replies:** 2\
**Last updated:** [May 29, 2023, 8:46pm UTC](https://discourse.julialang.org/t/is-http-listen-blocking-further-call-execution-in-my-ccall-program/99542 "2023-05-29T20:46:12Z")

</div>

Given the C Code #include "http.h" void on\_request(http\_s \*request); FIOBJ HTTP\_HEADER\_X\_DATA; int main(void) { HTTP\_HEADER\_X\_DATA = fiobj\_str\_new("X-Data", 6); http\_listen("3000", NULL, .on\_request = on\_request,…

---

## [Pluto: Error: Failed to relay log // Pluto unresponsive](https://discourse.julialang.org/t/pluto-error-failed-to-relay-log-pluto-unresponsive/75584)

<div class="topic-metadata">

**Author:** [@maajdl](https://discourse.julialang.org/u/maajdl)\
**Replies:** 1\
**Last updated:** [May 29, 2023, 8:18pm UTC](https://discourse.julialang.org/t/pluto-error-failed-to-relay-log-pluto-unresponsive/75584 "2023-05-29T20:18:27Z")

</div>

Hello, I get this error message below when plotting things with Plots. Do you the know cause of this message, if it matters, and if I can do something about it? Thanks, Michel ┌ Error: Failed to relay log │ except…

---

## [Package registrator](https://discourse.julialang.org/t/package-registrator/98941)

<div class="topic-metadata">

**Author:** [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Replies:** 4\
**Last updated:** [May 29, 2023, 6:03am UTC](https://discourse.julialang.org/t/package-registrator/98941 "2023-05-29T06:03:45Z")

</div>

Dearests, I am in the process of registering this package using the web interface of Registrator.jl. I set up the name of the repo and asked to register the v1.0.1 of the package. Everything was going smoothly until I…

---

## [Troubleshooting Instability for Tsit5](https://discourse.julialang.org/t/troubleshooting-instability-for-tsit5/99572)

<div class="topic-metadata">

**Author:** [@yoshi](https://discourse.julialang.org/u/yoshi)\
**Replies:** 3\
**Last updated:** [May 29, 2023, 5:27pm UTC](https://discourse.julialang.org/t/troubleshooting-instability-for-tsit5/99572 "2023-05-29T17:27:35Z")

</div>

I’m running Tsit5 on a system of equations and it is returning an instability warning and terminating the computation. I can see that there are NaN’s in one of the internal stages of the last value. I don’t know too much…

---

## [Threading race condition when pushing to arrays](https://discourse.julialang.org/t/threading-race-condition-when-pushing-to-arrays/99567)

<div class="topic-metadata">

**Author:** [@jagot](https://discourse.julialang.org/u/jagot)\
**Replies:** 6\
**Last updated:** [May 29, 2023, 5:07pm UTC](https://discourse.julialang.org/t/threading-race-condition-when-pushing-to-arrays/99567 "2023-05-29T17:07:47Z")

</div>

I’m trying to populate a sparse matrix in a multithreaded loop, along the lines of the below code: function build\_matrix(fun::Function, ::Type{T}, m, n) where T # Allocate thread-local arrays, which we will later co…

---

## [GC improvements ideas/progress](https://discourse.julialang.org/t/gc-improvements-ideas-progress/99537)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 5\
**Last updated:** [May 29, 2023, 3:44pm UTC](https://discourse.julialang.org/t/gc-improvements-ideas-progress/99537 "2023-05-29T15:44:40Z")

</div>

Julia’s GC still has a long way to go. ideas/information on the state of Julia’s GC appreciated. I know some of these ideas will add LOTS of works. This is not supposed to be a list of things that MUST be done, but thin…

---

## [Help Requested: Understanding cause of allocations for dynamic dispatch returning \`nothing\`, which vary based on argument type](https://discourse.julialang.org/t/help-requested-understanding-cause-of-allocations-for-dynamic-dispatch-returning-nothing-which-vary-based-on-argument-type/99517)

<div class="topic-metadata">

**Author:** [@NHDaly](https://discourse.julialang.org/u/NHDaly)\
**Replies:** 6\
**Last updated:** [May 29, 2023, 3:23pm UTC](https://discourse.julialang.org/t/help-requested-understanding-cause-of-allocations-for-dynamic-dispatch-returning-nothing-which-vary-based-on-argument-type/99517 "2023-05-29T15:23:39Z")

</div>

Can someone help me understand why passing a Ptr{UInt} to this dynamic dispatch leads to allocations, whereas passing a Ref{UInt} does not? I have tried the Allocation Profiler, Cthulhu, and @code\_\*, and I can’t figure …

---

## [Do I have to add a \`global\` before the counting variable in the \`while\` loop?](https://discourse.julialang.org/t/do-i-have-to-add-a-global-before-the-counting-variable-in-the-while-loop/99549)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 8\
**Last updated:** [May 29, 2023, 3:15pm UTC](https://discourse.julialang.org/t/do-i-have-to-add-a-global-before-the-counting-variable-in-the-while-loop/99549 "2023-05-29T15:15:02Z")

</div>

i = 0 while i \<= 100 println(i) i += 1 end Write the above code in a julia script Test.jl and run it, in the REPL it reports the following error: ┌ Warning: Assignment to \`i\` in soft scope is ambiguous because …

---

## [Install testing 1.9.1 through juliaup?](https://discourse.julialang.org/t/install-testing-1-9-1-through-juliaup/99560)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 2\
**Last updated:** [May 29, 2023, 3:13pm UTC](https://discourse.julialang.org/t/install-testing-1-9-1-through-juliaup/99560 "2023-05-29T15:13:43Z")

</div>

Is it possible to install the upcoming 1.9.1 with juliaup, for testing? (I guess “no”, since the there aren’t binaries available).

---

## [2D diffusion and crank nicolson](https://discourse.julialang.org/t/2d-diffusion-and-crank-nicolson/99528)

<div class="topic-metadata">

**Author:** [@jtgreen](https://discourse.julialang.org/u/jtgreen)\
**Replies:** 0\
**Last updated:** [May 28, 2023, 7:57pm UTC](https://discourse.julialang.org/t/2d-diffusion-and-crank-nicolson/99528 "2023-05-28T19:57:02Z")

</div>

I’m trying to solve 2D diffusion using the crank nicolson method and seem to be screwing it up. For one, Ax=b should be solved with A\\b, but gives nonsensical results. Oddly, b\\A seems to give something approximating wha…

---

## [Lots of lines! in Makie](https://discourse.julialang.org/t/lots-of-lines-in-makie/99553)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [May 29, 2023, 2:51pm UTC](https://discourse.julialang.org/t/lots-of-lines-in-makie/99553 "2023-05-29T14:51:32Z")

</div>

I am making a plot of a dataset using semi-transparent lines connecting a bunch of measurements. MWE: using CairoMakie, Colors CairoMakie.activate!(type = "svg") a = √.abs.(randn(500)) b = a .\* 0.5 .+ randn() / 10 c = …

---

## [How to extract priors from a Turing model](https://discourse.julialang.org/t/how-to-extract-priors-from-a-turing-model/99568)

<div class="topic-metadata">

**Author:** [@DominiqueMakowski](https://discourse.julialang.org/u/DominiqueMakowski)\
**Replies:** 0\
**Last updated:** [May 29, 2023, 2:29pm UTC](https://discourse.julialang.org/t/how-to-extract-priors-from-a-turing-model/99568 "2023-05-29T14:29:26Z")

</div>

Assuming the following model: # Bayesian linear regression. @model function linear\_regression(x, y) # Set variance prior. σ² ~ truncated(Normal(0, 100); lower=0) # Set intercept prior. intercept ~ Norma…

---

## [Axis-generating functions in Makie](https://discourse.julialang.org/t/axis-generating-functions-in-makie/99558)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [May 29, 2023, 2:23pm UTC](https://discourse.julialang.org/t/axis-generating-functions-in-makie/99558 "2023-05-29T14:23:30Z")

</div>

I would like to organize some commonly used plots into functions. Eg function makie\_plot\_posterior\_check(figure, label, data, predicted; scatter\_color = alphacolor(colorant"black", 0.…

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

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