# Latest

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

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

**Page:** 358

---

## [Code Generation with macro](https://discourse.julialang.org/t/code-generation-with-macro/117080)

<div class="topic-metadata">

**Author:** [@Andy\_Zhang](https://discourse.julialang.org/u/Andy_Zhang)\
**Replies:** 6\
**Last updated:** [July 22, 2024, 12:58pm UTC](https://discourse.julialang.org/t/code-generation-with-macro/117080 "2024-07-22T12:58:38Z")

</div>

Background I am writing a package that provides some structures of matrices, and I want them to have different properties. module MyModuleA export TypeA, properties # function interfaces properties(::Type{\<:Ab…

---

## [Create a custom @ccall](https://discourse.julialang.org/t/create-a-custom-ccall/117243)

<div class="topic-metadata">

**Author:** [@chkat](https://discourse.julialang.org/u/chkat)\
**Replies:** 4\
**Last updated:** [July 22, 2024, 12:20pm UTC](https://discourse.julialang.org/t/create-a-custom-ccall/117243 "2024-07-22T12:20:54Z")

</div>

I am trying to create a macro that replaces the @ccall in my code. My idea is to create something like this: macro my\_ccall(arg) custom\_function\_before\_ccall() @ccall arg end I am having trouble with the typ…

---

## [Variable Keword arguments should be Final](https://discourse.julialang.org/t/variable-keword-arguments-should-be-final/117338)

<div class="topic-metadata">

**Author:** [@Farouk](https://discourse.julialang.org/u/Farouk)\
**Replies:** 2\
**Last updated:** [July 22, 2024, 12:05pm UTC](https://discourse.julialang.org/t/variable-keword-arguments-should-be-final/117338 "2024-07-22T12:05:40Z")

</div>

Hello, I am using Julia 1.10.4 and I am confused about the variable keyword arguments place. According to this from the docs: The nature of keyword arguments makes it possible to specify the same argument more than on…

---

## [Different objective state functions for different stages SDDP.jl](https://discourse.julialang.org/t/different-objective-state-functions-for-different-stages-sddp-jl/116812)

<div class="topic-metadata">

**Author:** [@tumpelopumpelo](https://discourse.julialang.org/u/tumpelopumpelo)\
**Replies:** 3\
**Last updated:** [July 22, 2024, 7:31am UTC](https://discourse.julialang.org/t/different-objective-state-functions-for-different-stages-sddp-jl/116812 "2024-07-22T07:31:17Z")

</div>

Hi, I am quite new to optimization with SDDP so may be a silly question. I am working on optimising a bidding strategy for a wind power producer in consecutive markets (day ahead, Intraday, ancillary) using SDDP, with u…

---

## [Parquet: writing data as row groups](https://discourse.julialang.org/t/parquet-writing-data-as-row-groups/117247)

<div class="topic-metadata">

**Author:** [@kmiernik](https://discourse.julialang.org/u/kmiernik)\
**Replies:** 1\
**Last updated:** [July 22, 2024, 11:38am UTC](https://discourse.julialang.org/t/parquet-writing-data-as-row-groups/117247 "2024-07-22T11:38:52Z")

</div>

I would appreciate help with my problem. I have data that come in series. After processing raw input I have about 100 columns and about 10^8 rows per series (and about 100 series in total). So far I have been using HDF5 …

---

## [Cannot add package in super computer](https://discourse.julialang.org/t/cannot-add-package-in-super-computer/117224)

<div class="topic-metadata">

**Author:** [@0samuraiE](https://discourse.julialang.org/u/0samuraiE)\
**Replies:** 12\
**Last updated:** [July 22, 2024, 9:58am UTC](https://discourse.julialang.org/t/cannot-add-package-in-super-computer/117224 "2024-07-22T09:58:04Z")

</div>

Hi all. I am new to HPC, so I need your help. I encounted the following errors in super computer, Unfortunately the super computer does not support julia but permits manually installing. So I installed julia using jul…

---

## [Questions with building a chainrules for mutating array function](https://discourse.julialang.org/t/questions-with-building-a-chainrules-for-mutating-array-function/117237)

<div class="topic-metadata">

**Author:** [@chooron](https://discourse.julialang.org/u/chooron)\
**Replies:** 2\
**Last updated:** [July 22, 2024, 8:30am UTC](https://discourse.julialang.org/t/questions-with-building-a-chainrules-for-mutating-array-function/117237 "2024-07-22T08:30:42Z")

</div>

I want to build two functions for replacing values in a vector and an array, as shown below: function mutate\_vec(vec::AbstractVector{T}, new\_value::T, idx::Int) where {T} vec\[idx\] = new\_value vec end function m…

---

## [Universal differential equations with MTK](https://discourse.julialang.org/t/universal-differential-equations-with-mtk/103225)

<div class="topic-metadata">

**Author:** [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Replies:** 6\
**Last updated:** [July 22, 2024, 8:26am UTC](https://discourse.julialang.org/t/universal-differential-equations-with-mtk/103225 "2024-07-22T08:26:06Z")

</div>

The SciML documentation has this great tutorial on Automatically Discover Missing Physics by Embedding Machine Learning into Differential Equations In the tutorial the universal differential equation is defined as foll…

---

## [Findfirstsorted](https://discourse.julialang.org/t/findfirstsorted/117313)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 5\
**Last updated:** [July 22, 2024, 8:18am UTC](https://discourse.julialang.org/t/findfirstsorted/117313 "2024-07-22T08:18:49Z")

</div>

I’m looking for a predicate version of binary search. That is, a function that tests a predicate p(x) on elements of an array xs and finds the first index i for which p(xs\[i\]) returns true, assuming that i \< j implies (…

---

## [Understanding @connector in MTK](https://discourse.julialang.org/t/understanding-connector-in-mtk/117223)

<div class="topic-metadata">

**Author:** [@hexaeder](https://discourse.julialang.org/u/hexaeder)\
**Replies:** 2\
**Last updated:** [July 22, 2024, 8:09am UTC](https://discourse.julialang.org/t/understanding-connector-in-mtk/117223 "2024-07-22T08:09:38Z")

</div>

Hello, I have trouble understanding the modeling scheme of modern MTK with pins /connectors and so on. As a toy example, I try to implement this simple system of two coupled oscillators: I tried to model it using th…

---

## [Testing 3rd party package in my local environment](https://discourse.julialang.org/t/testing-3rd-party-package-in-my-local-environment/117325)

<div class="topic-metadata">

**Author:** [@Yannik](https://discourse.julialang.org/u/Yannik)\
**Replies:** 1\
**Last updated:** [July 22, 2024, 8:06am UTC](https://discourse.julialang.org/t/testing-3rd-party-package-in-my-local-environment/117325 "2024-07-22T08:06:19Z")

</div>

I am uncertain how to run the tests of the packages installed in my environment. When i write \] test package\_name It creates temporary project and manifest files. Is it possible to run the test files in the environmen…

---

## [UDE pre-fitting with collocation](https://discourse.julialang.org/t/ude-pre-fitting-with-collocation/117326)

<div class="topic-metadata">

**Author:** [@martincornejo](https://discourse.julialang.org/u/martincornejo)\
**Replies:** 0\
**Last updated:** [July 22, 2024, 7:58am UTC](https://discourse.julialang.org/t/ude-pre-fitting-with-collocation/117326 "2024-07-22T07:58:08Z")

</div>

Hi, I’d like to pre-train a UDE model using the collocation method from DiffEqFlux.jl: Smoothed Collocation · DiffEqFlux.jl My dataset is 10 days worth of temperature measurements and has around 45,000 points which are …

---

## [LoadError: ArgumentError: Package X does not have Y in its dependencies](https://discourse.julialang.org/t/loaderror-argumenterror-package-x-does-not-have-y-in-its-dependencies/117322)

<div class="topic-metadata">

**Author:** [@Jollywatt](https://discourse.julialang.org/u/Jollywatt)\
**Replies:** 2\
**Last updated:** [July 22, 2024, 7:44am UTC](https://discourse.julialang.org/t/loaderror-argumenterror-package-x-does-not-have-y-in-its-dependencies/117322 "2024-07-22T07:44:18Z")

</div>

I have been using Julia for years and dread this error because I have never been able to reliably fix it. I am developing packages A and B, where A uses B as a dependency. In Julia, in the main environment, using A err…

---

## [Question about when MiniZinc will return feasible solutions](https://discourse.julialang.org/t/question-about-when-minizinc-will-return-feasible-solutions/116595)

<div class="topic-metadata">

**Author:** [@slwu89](https://discourse.julialang.org/u/slwu89)\
**Replies:** 12\
**Last updated:** [July 22, 2024, 6:06am UTC](https://discourse.julialang.org/t/question-about-when-minizinc-will-return-feasible-solutions/116595 "2024-07-22T06:06:17Z")

</div>

Hi all. I have a question about the following MiniZinc model. I am able to give a feasible solution with primal\_feasibility\_report but nothing is found by the solver. I’m aware of the silliness of the presented model, t…

---

## [How to make RangeSlider larger in Pluto?](https://discourse.julialang.org/t/how-to-make-rangeslider-larger-in-pluto/117234)

<div class="topic-metadata">

**Author:** [@ultrapoci](https://discourse.julialang.org/u/ultrapoci)\
**Replies:** 3\
**Last updated:** [July 22, 2024, 5:51am UTC](https://discourse.julialang.org/t/how-to-make-rangeslider-larger-in-pluto/117234 "2024-07-22T05:51:19Z")

</div>

I’m using a RangeSlider in Pluto but it is way too small. I’ve found this reddit post where a user wrote that putting this inside a cell will make all sliders bigger: html""" \<style\> input\[type\*="range"\] { width: 100%;…

---

## [Automatic creating of PowerPoints using Julia](https://discourse.julialang.org/t/automatic-creating-of-powerpoints-using-julia/63274)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 3\
**Last updated:** [July 22, 2024, 4:20am UTC](https://discourse.julialang.org/t/automatic-creating-of-powerpoints-using-julia/63274 "2024-07-22T04:20:20Z")

</div>

I have data updated every month. at the end of the month, I use specific parts of that data to create tables, which I insert into a standard PowerPoint slide deck. Can I use Julia to automate such a process? If so, how? …

---

## [\[Makie\] \\widehat and \\widetilde in xlabel](https://discourse.julialang.org/t/makie-widehat-and-widetilde-in-xlabel/117277)

<div class="topic-metadata">

**Author:** [@Jeonghun\_Lee](https://discourse.julialang.org/u/Jeonghun_Lee)\
**Replies:** 2\
**Last updated:** [July 22, 2024, 3:26am UTC](https://discourse.julialang.org/t/makie-widehat-and-widetilde-in-xlabel/117277 "2024-07-22T03:26:24Z")

</div>

Here’s my code. using CairoMakie using LaTeXStrings fig = Figure() ax = Axis(fig\[1,1\], xlabel=L"\\widehat{EE}") fig I got the following error message. { "name": "MathTeXEngine.TeXParseError", "message": "TeXParseE…

---

## [Julia on ARM64 Windows?](https://discourse.julialang.org/t/julia-on-arm64-windows/117293)

<div class="topic-metadata">

**Author:** [@be5invis](https://discourse.julialang.org/u/be5invis)\
**Replies:** 4\
**Last updated:** [July 22, 2024, 2:14am UTC](https://discourse.julialang.org/t/julia-on-arm64-windows/117293 "2024-07-22T02:14:59Z")

</div>

I am wondering how hard is to support ARM64 Windows for Julia. Natively, not through emulation. Some information that I know: LLVM do have support for ARM64 Windows. The only Fortran compiler that could target ARM64 …

---

## [Best practices to add more than one bound to type parameters](https://discourse.julialang.org/t/best-practices-to-add-more-than-one-bound-to-type-parameters/117212)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 23\
**Last updated:** [July 21, 2024, 10:18pm UTC](https://discourse.julialang.org/t/best-practices-to-add-more-than-one-bound-to-type-parameters/117212 "2024-07-21T22:18:45Z")

</div>

MWE: julia\> const TwoOrThreeTuple{T} = Union{NTuple{2, T}, NTuple{3, T}} Union{Tuple{T, T}, Tuple{T, T, T}} where T julia\> struct myT{T, N, NTuple{N, T}\<:V\<:TwoOrThreeTuple{T}} a::V end julia\> myT((1,2))…

---

## [Using PETSc to solve Ax=rhs](https://discourse.julialang.org/t/using-petsc-to-solve-ax-rhs/117140)

<div class="topic-metadata">

**Author:** [@Van\_Sy\_Tnut](https://discourse.julialang.org/u/Van_Sy_Tnut)\
**Replies:** 2\
**Last updated:** [July 21, 2024, 9:32pm UTC](https://discourse.julialang.org/t/using-petsc-to-solve-ax-rhs/117140 "2024-07-21T21:32:44Z")

</div>

Hello everyone, I am trying to reduce the time for solving the system of linear equations: Ax=rhs. My method is to use factorization provided by “pkg:LinearAlgebra”. However, I know that if we can use PETSc it will be…

---

## [Parallel Computing with Threads.@threads in HPC is slow?](https://discourse.julialang.org/t/parallel-computing-with-threads-threads-in-hpc-is-slow/112591)

<div class="topic-metadata">

**Author:** [@Van\_Sy\_Tnut](https://discourse.julialang.org/u/Van_Sy_Tnut)\
**Replies:** 12\
**Last updated:** [July 21, 2024, 9:24pm UTC](https://discourse.julialang.org/t/parallel-computing-with-threads-threads-in-hpc-is-slow/112591 "2024-07-21T21:24:17Z")

</div>

Hello everyone! I am wondering why parallel computing with “Threads.@threads” in my own PC is faster than that in HPC? Although the maximum number of “Threads.nthreads()” I can set up in my PC is only 16 while in HPC I…

---

## [Vector field plotting of 2x2 matrix](https://discourse.julialang.org/t/vector-field-plotting-of-2x2-matrix/117304)

<div class="topic-metadata">

**Author:** [@Banan\_alkafri](https://discourse.julialang.org/u/Banan_alkafri)\
**Replies:** 1\
**Last updated:** [July 21, 2024, 8:30pm UTC](https://discourse.julialang.org/t/vector-field-plotting-of-2x2-matrix/117304 "2024-07-21T20:30:52Z")

</div>

I am trying to plot a vector field of a 2x2 polynomial matrix defined with DynamicPolynomials.jl. I’m trying CairoMakie but it’s not working. Can you please help me to plot it?

---

## [Subplotting incoherent behaviour](https://discourse.julialang.org/t/subplotting-incoherent-behaviour/117303)

<div class="topic-metadata">

**Author:** [@traincopter](https://discourse.julialang.org/u/traincopter)\
**Replies:** 3\
**Last updated:** [July 21, 2024, 6:51pm UTC](https://discourse.julialang.org/t/subplotting-incoherent-behaviour/117303 "2024-07-21T18:51:35Z")

</div>

Hello, I’m experiencing the following behavior, which confuses me a lot. First of all, let’s consider the following code: using Plots x = range(0, 10, length=100) y1 = @. exp(-0.1x) \* cos(4x) y2 = @. exp(-0.3x) \* cos(…

---

## [Primal-Dual Hybrid Gradient for L1 regularization](https://discourse.julialang.org/t/primal-dual-hybrid-gradient-for-l1-regularization/117201)

<div class="topic-metadata">

**Author:** [@aris](https://discourse.julialang.org/u/aris)\
**Replies:** 23\
**Last updated:** [July 21, 2024, 5:34pm UTC](https://discourse.julialang.org/t/primal-dual-hybrid-gradient-for-l1-regularization/117201 "2024-07-21T17:34:33Z")

</div>

Greetings everyone, I was looking for a way to solve the following problem using julia: min\_{f\\geq0} \\; ||Kf-s||\_2^2 +\\alpha ||f||\_1 There’s this paper (section 2.2 specifically), where the authors use a Primal-D…

---

## [Holy traits vs "boolean traits"](https://discourse.julialang.org/t/holy-traits-vs-boolean-traits/111954)

<div class="topic-metadata">

**Author:** [@marcpabst](https://discourse.julialang.org/u/marcpabst)\
**Replies:** 9\
**Last updated:** [July 21, 2024, 5:09pm UTC](https://discourse.julialang.org/t/holy-traits-vs-boolean-traits/111954 "2024-07-21T17:09:06Z")

</div>

I’ve been exploring how holy traits are typically implemented in Julia, often seeing patterns like the following: SomeTrait(x::Type) = B() SomeTrait(::Type{\<:T}) = A() somefunc(x::T) where {T} = somefunc(SomeTrait(T), …

---

## [PowerModels.jl multinetwork for Security Constrained AC-OPF](https://discourse.julialang.org/t/powermodels-jl-multinetwork-for-security-constrained-ac-opf/113511)

<div class="topic-metadata">

**Author:** [@lcharles](https://discourse.julialang.org/u/lcharles)\
**Replies:** 4\
**Last updated:** [July 21, 2024, 4:52pm UTC](https://discourse.julialang.org/t/powermodels-jl-multinetwork-for-security-constrained-ac-opf/113511 "2024-07-21T16:52:10Z")

</div>

Hi, I’m currently working on a project in which I use the PowerModels package. In the first part of my project, I used the ‘solve\_opf’ function with the different models of quadratic relaxations implemented in the pack…

---

## [Best way to implement and solve an ODE with a linearized RHS?](https://discourse.julialang.org/t/best-way-to-implement-and-solve-an-ode-with-a-linearized-rhs/117297)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 2\
**Last updated:** [July 21, 2024, 4:33pm UTC](https://discourse.julialang.org/t/best-way-to-implement-and-solve-an-ode-with-a-linearized-rhs/117297 "2024-07-21T16:33:22Z")

</div>

Say, I have a system \\dot{u} = f(u(t),t). I want to linearize the RHS at u(t\_{n}) and have \\dot{u} = f(u(t\_n),t\_n) + f\_{u}'(u(t\_n),t\_n)\\cdot(u(t)-u(t\_{n})). In terms of DifferentialEquations.jl I can define f(u,p,t) whe…

---

## [Specific function type](https://discourse.julialang.org/t/specific-function-type/117256)

<div class="topic-metadata">

**Author:** [@avetissargsian](https://discourse.julialang.org/u/avetissargsian)\
**Replies:** 20\
**Last updated:** [July 21, 2024, 12:15pm UTC](https://discourse.julialang.org/t/specific-function-type/117256 "2024-07-21T12:15:31Z")

</div>

Hello, I am coming from js/ts background. Can someone explain how this code would look like in Julia? Thanks :slight\_smile: function sayHello(f: (s: string) =\> string): string { return f("Hello,"); } sayHello((name: s…

---

## [Set custom colorbar tick-labels](https://discourse.julialang.org/t/set-custom-colorbar-tick-labels/69806)

<div class="topic-metadata">

**Author:** [@luraess](https://discourse.julialang.org/u/luraess)\
**Replies:** 6\
**Last updated:** [July 21, 2024, 3:56pm UTC](https://discourse.julialang.org/t/set-custom-colorbar-tick-labels/69806 "2024-07-21T15:56:46Z")

</div>

Hi, using Plots.jl and GR backend, how to set custom (text) colorbar tick-labels for each of the 5 color “bins” from this MWE using Plots.jl heatmap(rand(5,5), color=palette(:inferno, 5)) Thanks !

---

## [Mixed Python/ Julia package](https://discourse.julialang.org/t/mixed-python-julia-package/117299)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [July 21, 2024, 3:31pm UTC](https://discourse.julialang.org/t/mixed-python-julia-package/117299 "2024-07-21T15:31:29Z")

</div>

I try to package a software that contains of a Julia package and a Python wrapper. The wrapper uses http, so no PythonCall is used. Questions: would it be possible to package it such that it can be installed with pip?…

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

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