# Latest

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

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

**Page:** 750

---

## [Group by criteria](https://discourse.julialang.org/t/group-by-criteria/96246)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 17\
**Last updated:** [March 19, 2023, 8:10am UTC](https://discourse.julialang.org/t/group-by-criteria/96246 "2023-03-19T08:10:38Z")

</div>

How would you solve the following problem? Given the following array of strings we want to find all groups whose group leader starts with “AT”. All the elements that are found before the first one starting with “AT” fo…

---

## [Accessing json file from CoolProp.jl c interface](https://discourse.julialang.org/t/accessing-json-file-from-coolprop-jl-c-interface/96292)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 1\
**Last updated:** [March 19, 2023, 5:41am UTC](https://discourse.julialang.org/t/accessing-json-file-from-coolprop-jl-c-interface/96292 "2023-03-19T05:41:19Z")

</div>

hi. i’m trying to make a port of some CoolProp functions in julia. The idea is to use the same CoolProp JSON files that have component properties, but read those in the julia side. One problem i see is that the current C…

---

## [Debugging Julia script on SSH connection (no GUI)](https://discourse.julialang.org/t/debugging-julia-script-on-ssh-connection-no-gui/96284)

<div class="topic-metadata">

**Author:** [@iabraham](https://discourse.julialang.org/u/iabraham)\
**Replies:** 4\
**Last updated:** [March 19, 2023, 4:44am UTC](https://discourse.julialang.org/t/debugging-julia-script-on-ssh-connection-no-gui/96284 "2023-03-19T04:44:29Z")

</div>

Is there anything remotely like/similar to pudb for Julia? It is easily one of my favorite ways to debug code when logged into a HPC/cluster node without GUI or X window forwarding. The TUI approach performs extremely w…

---

## [Tracking allocations lost its way?](https://discourse.julialang.org/t/tracking-allocations-lost-its-way/96280)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 5\
**Last updated:** [March 19, 2023, 1:43am UTC](https://discourse.julialang.org/t/tracking-allocations-lost-its-way/96280 "2023-03-19T01:43:53Z")

</div>

I get a @time report: 92.505464 seconds (20.12 M allocations: 2.683 GiB, 0.29% gc time) . When I look at the code with --track-allocations=all, the following (abbreviated) file is obtained. All lines with any allocati…

---

## [Why does \`strip\` function return a SubString instead of a String? Can one return a String type from \`strip\`?](https://discourse.julialang.org/t/why-does-strip-function-return-a-substring-instead-of-a-string-can-one-return-a-string-type-from-strip/96282)

<div class="topic-metadata">

**Author:** [@curious](https://discourse.julialang.org/u/curious)\
**Replies:** 5\
**Last updated:** [March 18, 2023, 11:19pm UTC](https://discourse.julialang.org/t/why-does-strip-function-return-a-substring-instead-of-a-string-can-one-return-a-string-type-from-strip/96282 "2023-03-18T23:19:10Z")

</div>

I was experiencing a strange error in my code (strange because of my fault of not reading the return type of the strip function). strip returns a SubString instead of a String type and this was throwing error when using B…

---

## [PureFun.jl: implementations from Okasaki's \*Purely Functional Data Structures\*](https://discourse.julialang.org/t/purefun-jl-implementations-from-okasakis-purely-functional-data-structures/91815)

<div class="topic-metadata">

**Author:** [@tarakc02](https://discourse.julialang.org/u/tarakc02)\
**Replies:** 7\
**Last updated:** [March 18, 2023, 10:15pm UTC](https://discourse.julialang.org/t/purefun-jl-implementations-from-okasakis-purely-functional-data-structures/91815 "2023-03-18T22:15:19Z")

</div>

Hello, I’ve been implementing the data structures presented in Chris Okasaki’s book Purely Functional Data Structures in Julia, and wanted to share what I’ve got with you: PureFun.jl. It’s not quite every structure prese…

---

## [Can't train simple net what am I doing wrong?](https://discourse.julialang.org/t/cant-train-simple-net-what-am-i-doing-wrong/96094)

<div class="topic-metadata">

**Author:** [@Fabrice\_Rosay](https://discourse.julialang.org/u/Fabrice_Rosay)\
**Replies:** 1\
**Last updated:** [March 18, 2023, 10:19pm UTC](https://discourse.julialang.org/t/cant-train-simple-net-what-am-i-doing-wrong/96094 "2023-03-18T22:19:25Z")

</div>

Here is a minimal working example: function ResNetBlock(n::Int) return Chain( Conv((3, 3), n =\> n, relu; pad=1, stride=1), BatchNorm(n, relu), Conv((3, 3), n =\> n; pad=1, stride=1), B…

---

## [Simple Model for CIFAR-10 using Flux not converging](https://discourse.julialang.org/t/simple-model-for-cifar-10-using-flux-not-converging/96168)

<div class="topic-metadata">

**Author:** [@iskyd](https://discourse.julialang.org/u/iskyd)\
**Replies:** 1\
**Last updated:** [March 18, 2023, 10:10pm UTC](https://discourse.julialang.org/t/simple-model-for-cifar-10-using-flux-not-converging/96168 "2023-03-18T22:10:14Z")

</div>

I’m trying to train a simple model on the CIFAR-10 dataset. I’m using the model proposed by the flux documentation on cifar-10 found here: Deep Learning with Julia & Flux: A 60 Minute Blitz · Flux This is my code. Whe…

---

## [Why is there a large range in evaluation time when using map?](https://discourse.julialang.org/t/why-is-there-a-large-range-in-evaluation-time-when-using-map/96286)

<div class="topic-metadata">

**Author:** [@maxdrohde](https://discourse.julialang.org/u/maxdrohde)\
**Replies:** 1\
**Last updated:** [March 18, 2023, 9:53pm UTC](https://discourse.julialang.org/t/why-is-there-a-large-range-in-evaluation-time-when-using-map/96286 "2023-03-18T21:53:26Z")

</div>

When I was trying to practice benchmarking some code, I ran into an unexpected result. I ran @benchmark map(x -\> x^2, 1:10^6) and obtained the following results. BenchmarkTools.Trial: 3230 samples with 1 evaluation. …

---

## [NeuralODE Loss function constrain optimization](https://discourse.julialang.org/t/neuralode-loss-function-constrain-optimization/94883)

<div class="topic-metadata">

**Author:** [@Antonino\_Gandolfo](https://discourse.julialang.org/u/Antonino_Gandolfo)\
**Replies:** 19\
**Last updated:** [March 18, 2023, 1:26pm UTC](https://discourse.julialang.org/t/neuralode-loss-function-constrain-optimization/94883 "2023-03-18T13:26:01Z")

</div>

Hello everybody I’m searchig to train my NeuraODE to create a surrogate model of a mechanical device. Could you help me to figure out how can I constrain the Loss function in order to take in consideration the non linea…

---

## [Need for speed: looping over subdataframes to construct lags](https://discourse.julialang.org/t/need-for-speed-looping-over-subdataframes-to-construct-lags/96258)

<div class="topic-metadata">

**Author:** [@moshi](https://discourse.julialang.org/u/moshi)\
**Replies:** 6\
**Last updated:** [March 18, 2023, 11:25am UTC](https://discourse.julialang.org/t/need-for-speed-looping-over-subdataframes-to-construct-lags/96258 "2023-03-18T11:25:51Z")

</div>

I have a very large DataFrame with columns j, t, b, b\_t. I am creating a new column s by df.s = df.b and then I am making changes to the values in s depending on certain conditions of whether b\_t and t differ, for each…

---

## [Should closures be avoided?](https://discourse.julialang.org/t/should-closures-be-avoided/96073)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 15\
**Last updated:** [March 18, 2023, 10:52am UTC](https://discourse.julialang.org/t/should-closures-be-avoided/96073 "2023-03-18T10:52:32Z")

</div>

There seem to be several performance-related issues with closures (boxed variables) that can be tricky to understand when they will arise. Should closures be avoided as a rule? What is an alternative design pattern? They…

---

## [RNG in DiscreteProblem solver](https://discourse.julialang.org/t/rng-in-discreteproblem-solver/95929)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 3\
**Last updated:** [March 18, 2023, 10:48am UTC](https://discourse.julialang.org/t/rng-in-discreteproblem-solver/95929 "2023-03-18T10:48:46Z")

</div>

Hi everyone, I have a DiscreteProblem that uses a random number generator, and I’d like to make it reproducible. In the solver for SDEProblems, I can specify a seed (if not an RNG) - do I need to compose a new init/step!…

---

## [Error: Failed to precompile IJulia v1.24.0](https://discourse.julialang.org/t/error-failed-to-precompile-ijulia-v1-24-0/96270)

<div class="topic-metadata">

**Author:** [@JaydevSR](https://discourse.julialang.org/u/JaydevSR)\
**Replies:** 2\
**Last updated:** [March 18, 2023, 10:36am UTC](https://discourse.julialang.org/t/error-failed-to-precompile-ijulia-v1-24-0/96270 "2023-03-18T10:36:04Z")

</div>

I have been trying to run a particular jupyter notebook using IJulia but I get an error. A few things to note: I can run jupyter and then create a new julia notebook for which the kernel gets connected, and it is usabl…

---

## [Best way to check if a folder is empty on MacOS given ".DS\_Store" files](https://discourse.julialang.org/t/best-way-to-check-if-a-folder-is-empty-on-macos-given-ds-store-files/96276)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 0\
**Last updated:** [March 18, 2023, 9:23am UTC](https://discourse.julialang.org/t/best-way-to-check-if-a-folder-is-empty-on-macos-given-ds-store-files/96276 "2023-03-18T09:23:07Z")

</div>

Just wondering what the best way to check if a folder is empty on MacOs? Given that there always seems to be a “.DS\_Store” file is empty("folder") returns false even when there are no files in the folder. The only way…

---

## [Solving ODEs in parallel on a supercomputer](https://discourse.julialang.org/t/solving-odes-in-parallel-on-a-supercomputer/95637)

<div class="topic-metadata">

**Author:** [@Nick1](https://discourse.julialang.org/u/Nick1)\
**Replies:** 8\
**Last updated:** [March 18, 2023, 4:01am UTC](https://discourse.julialang.org/t/solving-odes-in-parallel-on-a-supercomputer/95637 "2023-03-18T04:01:01Z")

</div>

Hi everyone, I would like to solve ODEs in parallel on a supercomputer. I can use one or more nodes and multiple cores per node. There is also the option for node sharing. The job scheduler for the supercomputer is slur…

---

## [Error in DiffEqSensitivity: no method for similar of Duals](https://discourse.julialang.org/t/error-in-diffeqsensitivity-no-method-for-similar-of-duals/92457)

<div class="topic-metadata">

**Author:** [@AndreaRH](https://discourse.julialang.org/u/AndreaRH)\
**Replies:** 5\
**Last updated:** [March 17, 2023, 8:55pm UTC](https://discourse.julialang.org/t/error-in-diffeqsensitivity-no-method-for-similar-of-duals/92457 "2023-03-17T20:55:10Z")

</div>

Hello! I’m trying to understand how to use DiffEqSensitivity.jl and started with a toy example but ran into trouble when defining a ODEForwardSensitivityProblem. My cost functional is the average of a filtered (low-pass…

---

## [\[ANN\] Julia for VS Code 1.5 released](https://discourse.julialang.org/t/ann-julia-for-vs-code-1-5-released/71365)

<div class="topic-metadata">

**Author:** [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)\
**Replies:** 57\
**Last updated:** [March 18, 2023, 12:23am UTC](https://discourse.julialang.org/t/ann-julia-for-vs-code-1-5-released/71365 "2023-03-18T00:23:41Z")

</div>

Hey folks, we’ve just released version 1.5 of the Julia extension for VS Code. Here are some of the highlights in this (and the unannounced 1.4) release, but feel free to check out the changelog anyways. Runtime diagno…

---

## [Flux.jl changes in api](https://discourse.julialang.org/t/flux-jl-changes-in-api/96263)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 2\
**Last updated:** [March 17, 2023, 10:47pm UTC](https://discourse.julialang.org/t/flux-jl-changes-in-api/96263 "2023-03-17T22:47:26Z")

</div>

Hello, good evening. I had an example of xor problem solving in Flux.jl, and recently I noticed that it is not working anymore because of library updates. I tryed to migrate the example but the loss is not converging to…

---

## [Does anyone know how to solve MI-SDP problem in Julia?](https://discourse.julialang.org/t/does-anyone-know-how-to-solve-mi-sdp-problem-in-julia/9725)

<div class="topic-metadata">

**Author:** [@Sharabh\_Shukla](https://discourse.julialang.org/u/Sharabh_Shukla)\
**Replies:** 13\
**Last updated:** [March 17, 2023, 9:59pm UTC](https://discourse.julialang.org/t/does-anyone-know-how-to-solve-mi-sdp-problem-in-julia/9725 "2023-03-17T21:59:04Z")

</div>

I am working on an MI-SDP model and I have no idea how to solve it using Julia. I tried solving the model in convex using MOSEK as a solver, it turns out it failed, throwing some nasty error. Any ideas on solving Mixed …

---

## [Ways to save and load JuMP models from/to disk or memory](https://discourse.julialang.org/t/ways-to-save-and-load-jump-models-from-to-disk-or-memory/33465)

<div class="topic-metadata">

**Author:** [@Diego](https://discourse.julialang.org/u/Diego)\
**Replies:** 31\
**Last updated:** [March 17, 2023, 9:58pm UTC](https://discourse.julialang.org/t/ways-to-save-and-load-jump-models-from-to-disk-or-memory/33465 "2023-03-17T21:58:32Z")

</div>

Dear team, Is there a way to save JuMP models to disk and then load them back and then just perform some modifications? Thank you!

---

## [1.9-rc1 and threads](https://discourse.julialang.org/t/1-9-rc1-and-threads/96119)

<div class="topic-metadata">

**Author:** [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Replies:** 3\
**Last updated:** [March 17, 2023, 7:57pm UTC](https://discourse.julialang.org/t/1-9-rc1-and-threads/96119 "2023-03-17T19:57:59Z")

</div>

On Win 64, I have noticed that 1.9-rc1 Threads.@threads fails to keep my CPU busy (usage goes down to what you expect from single-threaded mode) in long computations. Clearly different from 1.8.5. Has anyone else notice…

---

## [Treating Union as multiple types](https://discourse.julialang.org/t/treating-union-as-multiple-types/96241)

<div class="topic-metadata">

**Author:** [@putianyi888](https://discourse.julialang.org/u/putianyi888)\
**Replies:** 9\
**Last updated:** [March 17, 2023, 8:27pm UTC](https://discourse.julialang.org/t/treating-union-as-multiple-types/96241 "2023-03-17T20:27:47Z")

</div>

This can happen quite often. f(a::AbstractVecOrMat, b::Number) = 1 f(a::AbstractVector, b::Any) = 2 julia\> f(\[1\],1) ERROR: MethodError: f(::Vector{Int64}, ::Int64) is ambiguous. Candidates: f(a::AbstractVecOrMat, b::…

---

## [Julia is not using my local OpenMPI installation but asks to install MPICH](https://discourse.julialang.org/t/julia-is-not-using-my-local-openmpi-installation-but-asks-to-install-mpich/96155)

<div class="topic-metadata">

**Author:** [@wadedl](https://discourse.julialang.org/u/wadedl)\
**Replies:** 3\
**Last updated:** [March 17, 2023, 8:27pm UTC](https://discourse.julialang.org/t/julia-is-not-using-my-local-openmpi-installation-but-asks-to-install-mpich/96155 "2023-03-17T20:27:33Z")

</div>

I am new to Julia but not new to building from source code. After building a Julia ( which passes its make test ) I am trying to use MPIPreferences to set use my installed OpenMPI. The following commands seem to have …

---

## [Compiler optimization inside MetaProgramming? (precompile Expression)](https://discourse.julialang.org/t/compiler-optimization-inside-metaprogramming-precompile-expression/96256)

<div class="topic-metadata">

**Author:** [@FireCrumb](https://discourse.julialang.org/u/FireCrumb)\
**Replies:** 5\
**Last updated:** [March 17, 2023, 7:00pm UTC](https://discourse.julialang.org/t/compiler-optimization-inside-metaprogramming-precompile-expression/96256 "2023-03-17T19:00:12Z")

</div>

Hi, I have a function expression (as input), and it is greatly simplified by the time it becomes LLVM code. How can I get the optimized simplified version back as an Expression? Origin expression: ex = :( function…

---

## [Problem using map. with Expr.args](https://discourse.julialang.org/t/problem-using-map-with-expr-args/96257)

<div class="topic-metadata">

**Author:** [@jls](https://discourse.julialang.org/u/jls)\
**Replies:** 2\
**Last updated:** [March 17, 2023, 6:57pm UTC](https://discourse.julialang.org/t/problem-using-map-with-expr-args/96257 "2023-03-17T18:57:40Z")

</div>

Hi, I am strugling with a strange behavior of map.() applied to the args part of an expression (I’m writing a code parser and need to recurse on Expressions) Here is a small piece of code to illustrate the problem: Le…

---

## [Easy way to scale model in JuMP?](https://discourse.julialang.org/t/easy-way-to-scale-model-in-jump/96212)

<div class="topic-metadata">

**Author:** [@shakedregev](https://discourse.julialang.org/u/shakedregev)\
**Replies:** 2\
**Last updated:** [March 17, 2023, 5:34pm UTC](https://discourse.julialang.org/t/easy-way-to-scale-model-in-jump/96212 "2023-03-17T17:34:20Z")

</div>

I’m developing a linear solver for an optimization solver that requires a scaled constraint matrix. I am solving an LP, so the constraint matrix is constant. I would like to be able to scale the constraints within the op…

---

## [CxxWrap and finalizers for specific instances](https://discourse.julialang.org/t/cxxwrap-and-finalizers-for-specific-instances/96254)

<div class="topic-metadata">

**Author:** [@peremato](https://discourse.julialang.org/u/peremato)\
**Replies:** 0\
**Last updated:** [March 17, 2023, 5:06pm UTC](https://discourse.julialang.org/t/cxxwrap-and-finalizers-for-specific-instances/96254 "2023-03-17T17:06:02Z")

</div>

I am using CxxWrap.jl and need to relinquish ownership for some particular instances, but not all, which is transferred to some other objects. CxxWrap has the possibility to disable the finalizer by adding the argument f…

---

## [Help. New to Julia. Error using dev command](https://discourse.julialang.org/t/help-new-to-julia-error-using-dev-command/95950)

<div class="topic-metadata">

**Author:** [@armel3](https://discourse.julialang.org/u/armel3)\
**Replies:** 9\
**Last updated:** [March 17, 2023, 4:59pm UTC](https://discourse.julialang.org/t/help-new-to-julia-error-using-dev-command/95950 "2023-03-17T16:59:39Z")

</div>

So I am trying to use replicate an example Dubin’s car problem (source:Danylo Malyuta Research Works) based on the SCP toolbox on github but I keep getting errors and I have been struggling to find the solution. Here is …

---

## [How to center the horizontal axis to the graph in Plots.jl](https://discourse.julialang.org/t/how-to-center-the-horizontal-axis-to-the-graph-in-plots-jl/96252)

<div class="topic-metadata">

**Author:** [@KZ-Spectra](https://discourse.julialang.org/u/KZ-Spectra)\
**Replies:** 2\
**Last updated:** [March 17, 2023, 4:29pm UTC](https://discourse.julialang.org/t/how-to-center-the-horizontal-axis-to-the-graph-in-plots-jl/96252 "2023-03-17T16:29:41Z")

</div>

using NonlinearSolve, LinearAlgebra, Plots N₂=14 g₂(u,p) = p\[1\]\*Tridiagonal(fill(1,N₂), fill(-2,N₂+1), fill(1,N₂))\*u - u.^3 - p\[2\]\*u probg₂ = NonlinearProblem{false}(g₂, \[0.1; fill(0.3, N₂-1); 0.1\], \[0.6, 1\]) solver₂…

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

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