# Latest

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

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

**Page:** 679

---

## [New to Jump and Julia](https://discourse.julialang.org/t/new-to-jump-and-julia/99823)

<div class="topic-metadata">

**Author:** [@A.Marx](https://discourse.julialang.org/u/A.Marx)\
**Replies:** 5\
**Last updated:** [June 7, 2023, 12:01am UTC](https://discourse.julialang.org/t/new-to-jump-and-julia/99823 "2023-06-07T00:01:30Z")

</div>

Hey all, I am trying to programm a simple optimization problem which minimizes the cost of a of an energy system with 4 suppliers subject to capacitiy constraints for 6 periods. The costs are for each period are: c…

---

## [How to use regularization in Mixed-effects models and Survival models with Julia?](https://discourse.julialang.org/t/how-to-use-regularization-in-mixed-effects-models-and-survival-models-with-julia/99858)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 3\
**Last updated:** [June 6, 2023, 11:32pm UTC](https://discourse.julialang.org/t/how-to-use-regularization-in-mixed-effects-models-and-survival-models-with-julia/99858 "2023-06-06T23:32:24Z")

</div>

I would like to perform a regression model with random effects and a Cox model, both with many covariates (20000). Then I need to include some kind of regularization such as lasso. But I haven’t found that option in Mi…

---

## [Tab width in print/println vs printstyled](https://discourse.julialang.org/t/tab-width-in-print-println-vs-printstyled/99917)

<div class="topic-metadata">

**Author:** [@pbal](https://discourse.julialang.org/u/pbal)\
**Replies:** 4\
**Last updated:** [June 6, 2023, 11:27pm UTC](https://discourse.julialang.org/t/tab-width-in-print-println-vs-printstyled/99917 "2023-06-06T23:27:16Z")

</div>

In Julia 1.9, the tab width is different in println() vs. printstyled(). Version: Version 1.9.0 (2023-05-07) print() and println() are consistent. printstyled() is a different width: julia\> println("123456789\\n\\t\*") …

---

## [Zygote limitations: getindex of a DataFrame while training a PINN](https://discourse.julialang.org/t/zygote-limitations-getindex-of-a-dataframe-while-training-a-pinn/99967)

<div class="topic-metadata">

**Author:** [@Ordens\_Ritter](https://discourse.julialang.org/u/Ordens_Ritter)\
**Replies:** 1\
**Last updated:** [June 6, 2023, 10:16pm UTC](https://discourse.julialang.org/t/zygote-limitations-getindex-of-a-dataframe-while-training-a-pinn/99967 "2023-06-06T22:16:41Z")

</div>

I want to train a PINN. I decided, that I want to estimate the physical loss term at static, independent sample times. For each of the sample times, I have to look up result of the previous sample point, to estimate t…

---

## [Toward a real and final solution to Julia’s variable scope issue](https://discourse.julialang.org/t/toward-a-real-and-final-solution-to-julia-s-variable-scope-issue/99908)

<div class="topic-metadata">

**Author:** [@anon98050359](https://discourse.julialang.org/u/anon98050359)\
**Replies:** 35\
**Last updated:** [June 6, 2023, 9:50pm UTC](https://discourse.julialang.org/t/toward-a-real-and-final-solution-to-julia-s-variable-scope-issue/99908 "2023-06-06T21:50:27Z")

</div>

I have been learning Julia lately and found it amazing. I was planning to make it one of my main tools, along Haskell and Rust. But the scope issues killed my enthusiasm. I read the documentation about it, but I am stil…

---

## [Transitioning an LP to stochastic version with InfiniteOpt.jl (+ feeding in samples ?)](https://discourse.julialang.org/t/transitioning-an-lp-to-stochastic-version-with-infiniteopt-jl-feeding-in-samples/99896)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 7\
**Last updated:** [June 6, 2023, 8:59pm UTC](https://discourse.julialang.org/t/transitioning-an-lp-to-stochastic-version-with-infiniteopt-jl-feeding-in-samples/99896 "2023-06-06T20:59:18Z")

</div>

Hello! I was searching to transition some of my deterministic ILP models to a stochastic version. I started investigating InfiniteOpt.jl and made a simple stochastic flavor of the JuMP LP example. I just modeled a para…

---

## [Unitful.jl without parametrizing types on units?](https://discourse.julialang.org/t/unitful-jl-without-parametrizing-types-on-units/99869)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 24\
**Last updated:** [June 6, 2023, 8:27pm UTC](https://discourse.julialang.org/t/unitful-jl-without-parametrizing-types-on-units/99869 "2023-06-06T20:27:05Z")

</div>

I am trying to add support for dimensional constraints in SymbolicRegression.jl: https://github.com/MilesCranmer/SymbolicRegression.jl/pull/220. However, I realize now this is going to be impossible with Unitful.jl due t…

---

## [Attaching a debugger to a running Julia program and printing local variables](https://discourse.julialang.org/t/attaching-a-debugger-to-a-running-julia-program-and-printing-local-variables/99961)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 1\
**Last updated:** [June 6, 2023, 7:57pm UTC](https://discourse.julialang.org/t/attaching-a-debugger-to-a-running-julia-program-and-printing-local-variables/99961 "2023-06-06T19:57:27Z")

</div>

I have a long-running Julia (nightly) script that seems to enter an infinite loop sometimes after running for several hours. Julia is started with ENABLE\_GDBLISTENER=1 and with -g2. Attaching with GDB (gdb -p PID) works…

---

## [Question about the multithreading usage](https://discourse.julialang.org/t/question-about-the-multithreading-usage/99955)

<div class="topic-metadata">

**Author:** [@jianqixi](https://discourse.julialang.org/u/jianqixi)\
**Replies:** 6\
**Last updated:** [June 6, 2023, 7:21pm UTC](https://discourse.julialang.org/t/question-about-the-multithreading-usage/99955 "2023-06-06T19:21:09Z")

</div>

Hi, I have one question related to the multithreading calculation in Julia. It seems like the @threads for loop is not always safe to get what I want. Here is one simple example of the code: ‘’’ julia A = Any B = Any …

---

## [\[CairoMakie\] Mirrored axis sharing](https://discourse.julialang.org/t/cairomakie-mirrored-axis-sharing/99939)

<div class="topic-metadata">

**Author:** [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Replies:** 1\
**Last updated:** [June 6, 2023, 6:57pm UTC](https://discourse.julialang.org/t/cairomakie-mirrored-axis-sharing/99939 "2023-06-06T18:57:27Z")

</div>

Hello, :smiley: Is it possible to do a “Mirrored axis sharing” in CairoMakie, like on this image for example? (from Axes review · Issue #206 · MakieOrg/Makie.jl (github.com) Thank you ! fdekerm

---

## [\[ANN\] Announcing MarginalLogDensities.jl](https://discourse.julialang.org/t/ann-announcing-marginallogdensities-jl/99958)

<div class="topic-metadata">

**Author:** [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)\
**Replies:** 0\
**Last updated:** [June 6, 2023, 6:28pm UTC](https://discourse.julialang.org/t/ann-announcing-marginallogdensities-jl/99958 "2023-06-06T18:28:22Z")

</div>

Hi all, I would like to announce a the initial release of a package that’s been in (sporadic) development for a while now, MarginalLogDensities.jl! This package was originally motivated by these discussions about a Juli…

---

## [How to add assumptions to the integrated function](https://discourse.julialang.org/t/how-to-add-assumptions-to-the-integrated-function/99912)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 4\
**Last updated:** [June 6, 2023, 5:43pm UTC](https://discourse.julialang.org/t/how-to-add-assumptions-to-the-integrated-function/99912 "2023-06-06T17:43:02Z")

</div>

I posted the question here because it seemed to me the least unrelated to the question. Of the following integral I am interested only in the real part. How can I force to consider a\>x\>0? Or, alternatively, how can I s…

---

## [Plotting inside a loop is extremely slow](https://discourse.julialang.org/t/plotting-inside-a-loop-is-extremely-slow/99948)

<div class="topic-metadata">

**Author:** [@Trandul](https://discourse.julialang.org/u/Trandul)\
**Replies:** 3\
**Last updated:** [June 6, 2023, 3:19pm UTC](https://discourse.julialang.org/t/plotting-inside-a-loop-is-extremely-slow/99948 "2023-06-06T15:19:27Z")

</div>

Greetings everyone. I am a new and young programmer coming from matlab and I am trying to understand the basics of Julia. I have come across the following problem. I used a function to make a loop and I would like to ma…

---

## [Issue with installing packages](https://discourse.julialang.org/t/issue-with-installing-packages/99941)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 8\
**Last updated:** [June 6, 2023, 3:16pm UTC](https://discourse.julialang.org/t/issue-with-installing-packages/99941 "2023-06-06T15:16:00Z")

</div>

I’m getting dependencies error after I updated the julia version I probably end up messing up with environment which may be causing issue now. How can I solve this ? Info Packages marked with ⌅ have new versions …

---

## [Is there any tutorial (easy) for PyJulia?](https://discourse.julialang.org/t/is-there-any-tutorial-easy-for-pyjulia/99935)

<div class="topic-metadata">

**Author:** [@cgotelli](https://discourse.julialang.org/u/cgotelli)\
**Replies:** 3\
**Last updated:** [June 6, 2023, 3:15pm UTC](https://discourse.julialang.org/t/is-there-any-tutorial-easy-for-pyjulia/99935 "2023-06-06T15:15:27Z")

</div>

Hello! I have been trying to run a function available in the Julia module “GeoStats” from Python with PyJulia. However, I can’t manage to do it. Is there any tutorial showing how to make PyJulia work with the most recen…

---

## [Is it possible to tune garbage collection for interactivity?](https://discourse.julialang.org/t/is-it-possible-to-tune-garbage-collection-for-interactivity/99841)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 6\
**Last updated:** [June 6, 2023, 2:41pm UTC](https://discourse.julialang.org/t/is-it-possible-to-tune-garbage-collection-for-interactivity/99841 "2023-06-06T14:41:47Z")

</div>

200-300 ms intervals of gc are very disruptive when interacting with plots in GLMakie, for example. It would be much better if GC ran more often but only for 5ms or so at a time so that the chance of dropping frames is l…

---

## [Find the last index that corresponds to a given condition](https://discourse.julialang.org/t/find-the-last-index-that-corresponds-to-a-given-condition/99942)

<div class="topic-metadata">

**Author:** [@RDuarte](https://discourse.julialang.org/u/RDuarte)\
**Replies:** 2\
**Last updated:** [June 6, 2023, 2:16pm UTC](https://discourse.julialang.org/t/find-the-last-index-that-corresponds-to-a-given-condition/99942 "2023-06-06T14:16:17Z")

</div>

Hello How can I find the last index that corresponds to a given condition? For example, in matlab i would do: find(f) \<= 1000,1,‘last’) Is there any correspondent function in julia? Thanks in advance

---

## [How to perform an Off-Policy reinforcement learning using \`ReinforcementLearning.jl\`?](https://discourse.julialang.org/t/how-to-perform-an-off-policy-reinforcement-learning-using-reinforcementlearning-jl/99940)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 0\
**Last updated:** [June 6, 2023, 1:46pm UTC](https://discourse.julialang.org/t/how-to-perform-an-off-policy-reinforcement-learning-using-reinforcementlearning-jl/99940 "2023-06-06T13:46:45Z")

</div>

I am a beginner of both Julia and RL. Now I’m trying to training a Q-based tabular policy with off-policy strategy using ReinforcementLearning.jl. Let behavior\_policy be a RandomPolicy (for example) to collect experience…

---

## [Colarbar: equal-sized color rectangles](https://discourse.julialang.org/t/colarbar-equal-sized-color-rectangles/99932)

<div class="topic-metadata">

**Author:** [@thunderclouds](https://discourse.julialang.org/u/thunderclouds)\
**Replies:** 3\
**Last updated:** [June 6, 2023, 1:47pm UTC](https://discourse.julialang.org/t/colarbar-equal-sized-color-rectangles/99932 "2023-06-06T13:47:26Z")

</div>

How do I create a color bar with the same height for each level? Default scales rectangles according to the levels. using CairoMakie xs = LinRange(0, 20, 50) ys = LinRange(0, 15, 50) zs = \[cos(x) \* sin(y) for x in …

---

## [Change distance between dots in \`linestyle=:dot\` plotting option](https://discourse.julialang.org/t/change-distance-between-dots-in-linestyle-dot-plotting-option/86592)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 6\
**Last updated:** [June 6, 2023, 1:14pm UTC](https://discourse.julialang.org/t/change-distance-between-dots-in-linestyle-dot-plotting-option/86592 "2023-06-06T13:14:36Z")

</div>

I am plotting something like: plot(x-\>x^2,lw=5,linestyle=:dot) Is there some way to modify the distance between the individual dots in the plot?

---

## [Inference in nested quadgk](https://discourse.julialang.org/t/inference-in-nested-quadgk/99937)

<div class="topic-metadata">

**Author:** [@lxvm](https://discourse.julialang.org/u/lxvm)\
**Replies:** 0\
**Last updated:** [June 6, 2023, 1:11pm UTC](https://discourse.julialang.org/t/inference-in-nested-quadgk/99937 "2023-06-06T13:11:48Z")

</div>

There have been a handful of threads on this forum regarding long compilation times for nested quadgk calls (e.g. here) and I was wondering what are some of the possible reasons that type inference may be failing in this…

---

## [Julia v1.8 -\> v1.9 makes this code 1000x slower](https://discourse.julialang.org/t/julia-v1-8-v1-9-makes-this-code-1000x-slower/99766)

<div class="topic-metadata">

**Author:** [@user664303](https://discourse.julialang.org/u/user664303)\
**Replies:** 6\
**Last updated:** [June 6, 2023, 12:55pm UTC](https://discourse.julialang.org/t/julia-v1-8-v1-9-makes-this-code-1000x-slower/99766 "2023-06-06T12:55:52Z")

</div>

On upgrading to Julia from 1.8.5. to 1.9.0 I noticed code in one of my packages slow down significantly. It has taken me a long time to get down to the simplest code which replicates the problem, but I have it now. After…

---

## [Generate function that calls sequence of functions in order to avoid recompilation](https://discourse.julialang.org/t/generate-function-that-calls-sequence-of-functions-in-order-to-avoid-recompilation/99919)

<div class="topic-metadata">

**Author:** [@heindelj](https://discourse.julialang.org/u/heindelj)\
**Replies:** 3\
**Last updated:** [June 6, 2023, 12:21pm UTC](https://discourse.julialang.org/t/generate-function-that-calls-sequence-of-functions-in-order-to-avoid-recompilation/99919 "2023-06-06T12:21:55Z")

</div>

I have a type which looks like this: mutable struct FQCTDipole{T\<:Function} \<: AbstractForceField terms::Vector{T} storage::FQCTDipoleStorage results::ForceFieldResults end The only part of this that matter…

---

## [Class imbalance in the predictors](https://discourse.julialang.org/t/class-imbalance-in-the-predictors/99927)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 3\
**Last updated:** [June 6, 2023, 12:12pm UTC](https://discourse.julialang.org/t/class-imbalance-in-the-predictors/99927 "2023-06-06T12:12:34Z")

</div>

Hello. I know we have to take care of class imbalance in the outcome variable. But what about class imbalance in the predictors? When is it important for our models?

---

## [Neovim terminal and @edit](https://discourse.julialang.org/t/neovim-terminal-and-edit/99822)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 11\
**Last updated:** [June 6, 2023, 11:24am UTC](https://discourse.julialang.org/t/neovim-terminal-and-edit/99822 "2023-06-06T11:24:51Z")

</div>

I often use julia inside the neovim terminal. One annoyance I have with this is that say @edit sin(1) will open that code in a new instance of neovim. Instead, I would prefer it to use the current instance. Is that possi…

---

## [\[ANN\] BioRecordsProcessing.jl - Process your biological records with ease](https://discourse.julialang.org/t/ann-biorecordsprocessing-jl-process-your-biological-records-with-ease/99929)

<div class="topic-metadata">

**Author:** [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Replies:** 0\
**Last updated:** [June 6, 2023, 9:36am UTC](https://discourse.julialang.org/t/ann-biorecordsprocessing-jl-process-your-biological-records-with-ease/99929 "2023-06-06T09:36:46Z")

</div>

BioRecordsProcessing.jl aims at processing files containing biological records using a minimum amount of boilerplate. It can be used in place of tools like samtools, vcftools, sektq, etc. Features : Read from disk, mod…

---

## [Disappointing benchmark results with AMD Threadripper PRO 3975WX 32 Cores](https://discourse.julialang.org/t/disappointing-benchmark-results-with-amd-threadripper-pro-3975wx-32-cores/99806)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 10\
**Last updated:** [June 6, 2023, 8:22am UTC](https://discourse.julialang.org/t/disappointing-benchmark-results-with-amd-threadripper-pro-3975wx-32-cores/99806 "2023-06-06T08:22:16Z")

</div>

Hello, I have the Lenovo ThinkStation P620 with the AMD Threadripper PRO 3975WX with 32 cores and 64 Threads. I installed Ubuntu 22.04.2, and I noticed that the performances are not so much improved with respect for exa…

---

## [Symbolic integration with SymPy.jl](https://discourse.julialang.org/t/symbolic-integration-with-sympy-jl/78624)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 6\
**Last updated:** [June 6, 2023, 8:14am UTC](https://discourse.julialang.org/t/symbolic-integration-with-sympy-jl/78624 "2023-06-06T08:14:57Z")

</div>

I ran into a problem with SymPy.jl for symbolic integration, using SymPy m = symbols(“m”, integer=true) n = symbols(“n”, integer=true) x = symbols(“x”, integer=true) integrate(diff(x^4,(x,2)),x) The output is 4\*…

---

## [Rasters, GDAL, ArchGDAL](https://discourse.julialang.org/t/rasters-gdal-archgdal/94004)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 3\
**Last updated:** [June 6, 2023, 8:03am UTC](https://discourse.julialang.org/t/rasters-gdal-archgdal/94004 "2023-06-06T08:03:21Z")

</div>

Dear all, I’ve tried installing Rasters.jl on both my office and home computers (Julia v 1.8). Both installations have failed because both gdal and archgdal fail to precompile. Does anyone experience the same problem?…

---

## [Question: Least square fitting method for non-linear function](https://discourse.julialang.org/t/question-least-square-fitting-method-for-non-linear-function/97595)

<div class="topic-metadata">

**Author:** [@manu\_han](https://discourse.julialang.org/u/manu_han)\
**Replies:** 2\
**Last updated:** [June 6, 2023, 6:47am UTC](https://discourse.julialang.org/t/question-least-square-fitting-method-for-non-linear-function/97595 "2023-06-06T06:47:32Z")

</div>

To fit the non-linear function with other data, I am trying to use the ‘LsqFit.curve\_fit’ which was introduced by the following link: GitHub - JuliaNLSolvers/LsqFit.jl: Simple curve fitting in Julia here is toy example…

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

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