# Latest

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

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

**Page:** 184

---

## [Cart-pole trajectory optimization with ModelingToolkit, Multibody and JuliaSimCompiler model, how to improve performance? Constraints jacobian sparsity pattern issue?](https://discourse.julialang.org/t/cart-pole-trajectory-optimization-with-modelingtoolkit-multibody-and-juliasimcompiler-model-how-to-improve-performance-constraints-jacobian-sparsity-pattern-issue/127856)

<div class="topic-metadata">

**Author:** [@Odie](https://discourse.julialang.org/u/Odie)\
**Replies:** 7\
**Last updated:** [April 14, 2025, 2:15pm UTC](https://discourse.julialang.org/t/cart-pole-trajectory-optimization-with-modelingtoolkit-multibody-and-juliasimcompiler-model-how-to-improve-performance-constraints-jacobian-sparsity-pattern-issue/127856 "2025-04-14T14:15:30Z")

</div>

Hi! I’m trying to do a trajectory optimization problem with a direct collocation method on my own model. To begin with, I decided to reproduce a documented problem : the cart-pole. I used ModelingToolkit and Multibody …

---

## [Reusing random numbers in EnsembleProblem](https://discourse.julialang.org/t/reusing-random-numbers-in-ensembleproblem/127514)

<div class="topic-metadata">

**Author:** [@aleCombi](https://discourse.julialang.org/u/aleCombi)\
**Replies:** 6\
**Last updated:** [April 14, 2025, 2:13pm UTC](https://discourse.julialang.org/t/reusing-random-numbers-in-ensembleproblem/127514 "2025-04-14T14:13:46Z")

</div>

I am trying to take derivatives of Montecarlo expectations against parameters using DifferentialEquations.jl. I am doing it using geometric brownian motion, and I want to bump the sigma and reevaluate (later I will try A…

---

## [LoadError: MethodError: no method matching (::Colon)(::Int64, ::Nothing)](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-colon-int64-nothing/128052)

<div class="topic-metadata">

**Author:** [@Efstein](https://discourse.julialang.org/u/Efstein)\
**Replies:** 4\
**Last updated:** [April 14, 2025, 1:18pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-no-method-matching-colon-int64-nothing/128052 "2025-04-14T13:18:22Z")

</div>

Hi Everbody! I’m still quite new to Julia, so I hope I am not missing something obvious here… My task is to solve numerically a system of equations, my working example looks like this: using Optimization, Zygote, Symb…

---

## [Sending a logistic function to Gurobi.jl with JuMP](https://discourse.julialang.org/t/sending-a-logistic-function-to-gurobi-jl-with-jump/128027)

<div class="topic-metadata">

**Author:** [@votroto](https://discourse.julialang.org/u/votroto)\
**Replies:** 2\
**Last updated:** [April 14, 2025, 1:02pm UTC](https://discourse.julialang.org/t/sending-a-logistic-function-to-gurobi-jl-with-jump/128027 "2025-04-14T13:02:42Z")

</div>

JuMP and Gurobi seem to be able to accept nl functions via their new interface. But while I can see that Gurobi claims to accept :logistic as the “head” of a non-linear expression :logistic =\> GRB\_OPCODE\_LOGISTIC, I can’…

---

## [Design of efficient lazy broadcastable operator](https://discourse.julialang.org/t/design-of-efficient-lazy-broadcastable-operator/128049)

<div class="topic-metadata">

**Author:** [@Vitor\_Patricio\_Canta](https://discourse.julialang.org/u/Vitor_Patricio_Canta)\
**Replies:** 11\
**Last updated:** [April 14, 2025, 12:29pm UTC](https://discourse.julialang.org/t/design-of-efficient-lazy-broadcastable-operator/128049 "2025-04-14T12:29:09Z")

</div>

Hi, I am designing a bunch of operators I would like to evaluate lazily on sets of points (grid cells). The problem is that my design pattern still allocates a bit more when broadcasting, and involves me extending the b…

---

## [Memory usage increasing with each epoch](https://discourse.julialang.org/t/memory-usage-increasing-with-each-epoch/121798)

<div class="topic-metadata">

**Author:** [@JoshuaBillson](https://discourse.julialang.org/u/JoshuaBillson)\
**Replies:** 18\
**Last updated:** [April 14, 2025, 12:30pm UTC](https://discourse.julialang.org/t/memory-usage-increasing-with-each-epoch/121798 "2025-04-14T12:30:43Z")

</div>

I’m having a problem where memory usage is gradually increasing with each epoch when training large neural networks with Flux (v0.14.22) and CUDA (v5.5.2). At the same time, training appears to get progressively slower a…

---

## [\[ANN\] PawsomeTracker.jl](https://discourse.julialang.org/t/ann-pawsometracker-jl/127929)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 3\
**Last updated:** [April 14, 2025, 11:46am UTC](https://discourse.julialang.org/t/ann-pawsometracker-jl/127929 "2025-04-14T11:46:21Z")

</div>

I’m glad to share PawsomeTracker.jl, a simple, robust, and performant tracker used to track targets in video files. It uses a Difference of Gaussian (DoG) filter to detect the target in the frame. It works with co…

---

## [Implicit cast of a struct into a tuple](https://discourse.julialang.org/t/implicit-cast-of-a-struct-into-a-tuple/77014)

<div class="topic-metadata">

**Author:** [@whatsthecraic](https://discourse.julialang.org/u/whatsthecraic)\
**Replies:** 5\
**Last updated:** [April 14, 2025, 9:19am UTC](https://discourse.julialang.org/t/implicit-cast-of-a-struct-into-a-tuple/77014 "2025-04-14T09:19:11Z")

</div>

Hello! Is there a way to define an implicit cast of a struct into a tuple, such that the following syntax becomes valid: struct T ; x::String ; y::Integer ; end t = T("x", 1) a, b = t

---

## [NVIDIA Finally Adds Native Python Support to CUDA](https://discourse.julialang.org/t/nvidia-finally-adds-native-python-support-to-cuda/127943)

<div class="topic-metadata">

**Author:** [@paulmelis](https://discourse.julialang.org/u/paulmelis)\
**Replies:** 6\
**Last updated:** [April 14, 2025, 9:06am UTC](https://discourse.julialang.org/t/nvidia-finally-adds-native-python-support-to-cuda/127943 "2025-04-14T09:06:16Z")

</div>

At GTC, NVIDIA announced native support and full integration of Python in its CUDA toolkit. Developers will be able to use Python for direct execution of algorithmic-style computing on GPUs. “We’ve been working hard …

---

## [Function definition Expr that prints incorrectly but evals correctly](https://discourse.julialang.org/t/function-definition-expr-that-prints-incorrectly-but-evals-correctly/128038)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 1\
**Last updated:** [April 14, 2025, 6:29am UTC](https://discourse.julialang.org/t/function-definition-expr-that-prints-incorrectly-but-evals-correctly/128038 "2025-04-14T06:29:29Z")

</div>

@MilesCranmer and I have a discussion over whether MacroTools.longdef is correct or not. For reference, longdef is meant to take a short-form function definition and turn it into long-form julia\> MacroTools.longdef(:(f(…

---

## [ModelingToolkit -- can I use \`min\` and \`max\` functions?](https://discourse.julialang.org/t/modelingtoolkit-can-i-use-min-and-max-functions/127934)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 20\
**Last updated:** [April 14, 2025, 6:05am UTC](https://discourse.julialang.org/t/modelingtoolkit-can-i-use-min-and-max-functions/127934 "2025-04-14T06:05:26Z")

</div>

I have written a PID controller in ModelingToolkit (yes, I know it probably exists…). I need to clip the control output u to lie in the range \[u\_min, u\_max\]. So I try to do: # Constraining the unconstrained control sign…

---

## [Defining constraint over dense and sparse constraint](https://discourse.julialang.org/t/defining-constraint-over-dense-and-sparse-constraint/128030)

<div class="topic-metadata">

**Author:** [@danrib07](https://discourse.julialang.org/u/danrib07)\
**Replies:** 2\
**Last updated:** [April 13, 2025, 10:42pm UTC](https://discourse.julialang.org/t/defining-constraint-over-dense-and-sparse-constraint/128030 "2025-04-13T22:42:49Z")

</div>

Hi! I have a question regarding the definition of constraints including both dense and sparse variables. In the example below, I am trying to define the constraint x\_{ij} + y\_{ij} \\leq 0 \\quad \\forall \\quad i \\in \\mathca…

---

## [Finding the minimum of the Bellman operator inside SDDP iterations](https://discourse.julialang.org/t/finding-the-minimum-of-the-bellman-operator-inside-sddp-iterations/128031)

<div class="topic-metadata">

**Author:** [@Mathis\_3](https://discourse.julialang.org/u/Mathis_3)\
**Replies:** 5\
**Last updated:** [April 13, 2025, 10:23pm UTC](https://discourse.julialang.org/t/finding-the-minimum-of-the-bellman-operator-inside-sddp-iterations/128031 "2025-04-13T22:23:01Z")

</div>

Hello! I’m currently working on a multistage stochastic optimization problem using SDDP.jl. At each iteration (and each node), I would like to solve the following problem: inf\_{x \\in X} T(V^k)(x) where T is the Bellma…

---

## [I added 1 Million constraints to an LP unwittingly](https://discourse.julialang.org/t/i-added-1-million-constraints-to-an-lp-unwittingly/127668)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 36\
**Last updated:** [April 13, 2025, 8:59pm UTC](https://discourse.julialang.org/t/i-added-1-million-constraints-to-an-lp-unwittingly/127668 "2025-04-13T20:59:22Z")

</div>

This topic is sharing an experience, probably a noob has not seen before (me included). Put it simply, I’m solving a disjointed bilinear programming using RLT, and wasn’t realizing that the number of constraints will be…

---

## [JuMP IPOPT plugin can’t find or interface with LAPACK at runtime?](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 9\
**Last updated:** [April 13, 2025, 8:55pm UTC](https://discourse.julialang.org/t/jump-ipopt-plugin-can-t-find-or-interface-with-lapack-at-runtime/127809 "2025-04-13T20:55:12Z")

</div>

I am trying to solve a MIQP portfolio optimisation problem using JuMP and SCIP (tried Juniper before but it crashed Julia). There are repeated errors: Error: no BLAS/LAPACK library loaded for dsyev\_() \[nlpi\_ipopt.cpp:26…

---

## [How to get the eight bit values of a variable with UInt8?](https://discourse.julialang.org/t/how-to-get-the-eight-bit-values-of-a-variable-with-uint8/128022)

<div class="topic-metadata">

**Author:** [@dk-zen](https://discourse.julialang.org/u/dk-zen)\
**Replies:** 11\
**Last updated:** [April 13, 2025, 8:45pm UTC](https://discourse.julialang.org/t/how-to-get-the-eight-bit-values-of-a-variable-with-uint8/128022 "2025-04-13T20:45:20Z")

</div>

Now I’m reading a binary file. I have got a 8 bits namely “a”. According to the data description, each bit represents a different meaning, I want to read the value represented by 8 bit bits, how can I do it? a = 0x0c # …

---

## [Type conversion](https://discourse.julialang.org/t/type-conversion/128012)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [April 13, 2025, 7:45pm UTC](https://discourse.julialang.org/t/type-conversion/128012 "2025-04-13T19:45:50Z")

</div>

After reading an arrow file I get the following type: julia\> sl.heading 200-element Arrow.Primitive{Float32, Vector{Float32}}: -0.0023596277 -0.004771689 -0.0052604624 ⋮ -0.31095406 -0.33066812 -0.338615 If I w…

---

## [Can juliac increase julia adoption?](https://discourse.julialang.org/t/can-juliac-increase-julia-adoption/127838)

<div class="topic-metadata">

**Author:** [@Anil\_Beniwal](https://discourse.julialang.org/u/Anil_Beniwal)\
**Replies:** 60\
**Last updated:** [April 13, 2025, 6:46pm UTC](https://discourse.julialang.org/t/can-juliac-increase-julia-adoption/127838 "2025-04-13T18:46:44Z")

</div>

rust star history shows exponential trend while julia going towards logrithimic scale towards stagnation.

---

## [Gtk does not work well in VSCode](https://discourse.julialang.org/t/gtk-does-not-work-well-in-vscode/128024)

<div class="topic-metadata">

**Author:** [@gangchern](https://discourse.julialang.org/u/gangchern)\
**Replies:** 1\
**Last updated:** [April 13, 2025, 5:29pm UTC](https://discourse.julialang.org/t/gtk-does-not-work-well-in-vscode/128024 "2025-04-13T17:29:38Z")

</div>

Anybody try Gtk.jl, It works well in Jupyter . But when I try it in VSCode, it generate some errors. using Gtk Gtk.init() # Create a main window win = GtkWindow("TextField and Button Example", 300, 100) # Handle the…

---

## [\[ANN\] NumericalDistributions.jl: user-defined distributions](https://discourse.julialang.org/t/ann-numericaldistributions-jl-user-defined-distributions/128025)

<div class="topic-metadata">

**Author:** [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Replies:** 1\
**Last updated:** [April 13, 2025, 3:54pm UTC](https://discourse.julialang.org/t/ann-numericaldistributions-jl-user-defined-distributions/128025 "2025-04-13T15:54:50Z")

</div>

I’m happy to share NumericalDistributions.jl, a package for working with numerically defined univariate continuous distributions in Julia. It wraps user-defined PDF functions, numerically normalizes them, and provides sa…

---

## [Equivalent of Python's Inline script metadata (PEP 723) in Julia](https://discourse.julialang.org/t/equivalent-of-pythons-inline-script-metadata-pep-723-in-julia/127980)

<div class="topic-metadata">

**Author:** [@j-bowhay](https://discourse.julialang.org/u/j-bowhay)\
**Replies:** 4\
**Last updated:** [April 13, 2025, 3:39pm UTC](https://discourse.julialang.org/t/equivalent-of-pythons-inline-script-metadata-pep-723-in-julia/127980 "2025-04-13T15:39:49Z")

</div>

Hi all, I am interested to know if there is a Julia equivalent to the following in Python. Imagine you have a collection of scripts each with their own dependencies. In each script it is possible to declare metadata abo…

---

## [Help wanted with a music-related optimisation-ish problem](https://discourse.julialang.org/t/help-wanted-with-a-music-related-optimisation-ish-problem/128004)

<div class="topic-metadata">

**Author:** [@cjdoris](https://discourse.julialang.org/u/cjdoris)\
**Replies:** 4\
**Last updated:** [April 13, 2025, 3:14pm UTC](https://discourse.julialang.org/t/help-wanted-with-a-music-related-optimisation-ish-problem/128004 "2025-04-13T15:14:27Z")

</div>

In the UK we have a form of social dance called ceilidh dancing, which is super fun. A bit like contra dancing in the USA if you’re familiar with that. Ceilidhs are “called” by a “caller” whose job is to decide which da…

---

## [How to create interdependent widgets in Pluto](https://discourse.julialang.org/t/how-to-create-interdependent-widgets-in-pluto/127774)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 2\
**Last updated:** [April 13, 2025, 2:56pm UTC](https://discourse.julialang.org/t/how-to-create-interdependent-widgets-in-pluto/127774 "2025-04-13T14:56:53Z")

</div>

Hello, I am trying to make interdependent widgets based on the wind speeds example. Here is what I am trying to do: select a distribution from a Select menu and add a labeled NumberField to the right for each parameter.…

---

## [Local repo and security scanning](https://discourse.julialang.org/t/local-repo-and-security-scanning/128014)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 6\
**Last updated:** [April 13, 2025, 9:33am UTC](https://discourse.julialang.org/t/local-repo-and-security-scanning/128014 "2025-04-13T09:33:36Z")

</div>

Long story short: I convinced my institution to let my team use Julia for modelling. The catch is that I have to maintain a local repo of packages. How do I get started with that? Is that what LocalRegistry.jl does? I a…

---

## [How to differentiate functions involving arrays with one non-zero element in Zygote](https://discourse.julialang.org/t/how-to-differentiate-functions-involving-arrays-with-one-non-zero-element-in-zygote/127741)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 4\
**Last updated:** [April 13, 2025, 9:27am UTC](https://discourse.julialang.org/t/how-to-differentiate-functions-involving-arrays-with-one-non-zero-element-in-zygote/127741 "2025-04-13T09:27:15Z")

</div>

Hello, I need to differentiate using Zygote.jl a function like using LinearAlgebra function my\_fidelity2(p) ψg = zeros(ComplexF64, 2) ψg\[2\] = 1.0 ψe = zeros(ComplexF64, 2) ψe\[1\] = 1.0 ψgg = kron(ψg, ψg) ψ…

---

## [Font family 'Computer Modern' not found](https://discourse.julialang.org/t/font-family-computer-modern-not-found/93355)

<div class="topic-metadata">

**Author:** [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Replies:** 5\
**Last updated:** [April 13, 2025, 3:25am UTC](https://discourse.julialang.org/t/font-family-computer-modern-not-found/93355 "2025-04-13T03:25:40Z")

</div>

Defining “Computer Modern” as default font familly is very convenient when using Plots.jl default gr() backend, as per this other post. However, using the pyplot or pythonplot backends issues the warning message: find…

---

## [Type-instability, runtime dispatch, and heap allocations](https://discourse.julialang.org/t/type-instability-runtime-dispatch-and-heap-allocations/127985)

<div class="topic-metadata">

**Author:** [@StevenWhitaker](https://discourse.julialang.org/u/StevenWhitaker)\
**Replies:** 3\
**Last updated:** [April 12, 2025, 5:51am UTC](https://discourse.julialang.org/t/type-instability-runtime-dispatch-and-heap-allocations/127985 "2025-04-12T05:51:45Z")

</div>

I wanted to check/improve my understanding of allocations caused by type-instabilities. Consider the following: function f() x = g() y = h(x) z = b(x) end g() = Any\[1\]\[1\] h(::Int) = 1 h(::Any) = Any\[2\]\[1\]…

---

## [What does 0 allocations: #=nonzero=# bytes mean?](https://discourse.julialang.org/t/what-does-0-allocations-nonzero-bytes-mean/127997)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 6\
**Last updated:** [April 12, 2025, 6:03pm UTC](https://discourse.julialang.org/t/what-does-0-allocations-nonzero-bytes-mean/127997 "2025-04-12T18:03:36Z")

</div>

Sometimes BenchmarkTools reports 0 allocations but the number of bytes isn’t 0. It can vary between runs. What does that mean? julia\> using BenchmarkTools julia\> foo() = rand((1.3, 1)) foo (generic function with 1 meth…

---

## [Applying magnet model to a mesh shape](https://discourse.julialang.org/t/applying-magnet-model-to-a-mesh-shape/128009)

<div class="topic-metadata">

**Author:** [@Bkyro](https://discourse.julialang.org/u/Bkyro)\
**Replies:** 0\
**Last updated:** [April 12, 2025, 4:25pm UTC](https://discourse.julialang.org/t/applying-magnet-model-to-a-mesh-shape/128009 "2025-04-12T16:25:47Z")

</div>

I am brand new to julia. I have manged to create meshes with various packages but am really struggling to apply physcis to make a magnet. I have tried several packages and cannot get it to work. I gave used BEAST Nessie …

---

## [Drawing in tables data retrieved from DB](https://discourse.julialang.org/t/drawing-in-tables-data-retrieved-from-db/128007)

<div class="topic-metadata">

**Author:** [@FSUfan](https://discourse.julialang.org/u/FSUfan)\
**Replies:** 0\
**Last updated:** [April 12, 2025, 3:38pm UTC](https://discourse.julialang.org/t/drawing-in-tables-data-retrieved-from-db/128007 "2025-04-12T15:38:36Z")

</div>

I need to represent in various tables what I get from reading various DBs. I read the suggestions found here https://juliapackages.com/c/gui But so far I just have a lot of confusion in my head. Having experience wit…

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

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