# Latest

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

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

**Page:** 640

---

## [How to check if Julia is running in a vscode notebook?](https://discourse.julialang.org/t/how-to-check-if-julia-is-running-in-a-vscode-notebook/101863)

<div class="topic-metadata">

**Author:** [@BenjaminDoran](https://discourse.julialang.org/u/BenjaminDoran)\
**Replies:** 3\
**Last updated:** [July 21, 2023, 5:05pm UTC](https://discourse.julialang.org/t/how-to-check-if-julia-is-running-in-a-vscode-notebook/101863 "2023-07-21T17:05:32Z")

</div>

I’ve noticed a few issues using packages like ProgressMeter and Bio3Dview in the VS code notebook. ProgressMeter keeps appending the progress bar to new lines. It shows repeated output in VScode · Issue #231 · timholy/Pr…

---

## [What kinds of runtime dispatch are "problematic" for performance?](https://discourse.julialang.org/t/what-kinds-of-runtime-dispatch-are-problematic-for-performance/101895)

<div class="topic-metadata">

**Author:** [@loonatick-src](https://discourse.julialang.org/u/loonatick-src)\
**Replies:** 0\
**Last updated:** [July 21, 2023, 3:20pm UTC](https://discourse.julialang.org/t/what-kinds-of-runtime-dispatch-are-problematic-for-performance/101895 "2023-07-21T15:20:45Z")

</div>

My understanding is that runtime dispatch is not always problematic. E.g. exceptions result in runtime-dispatch, but that should not affect performance as long as the exception is not raised. Then there are runtime dispa…

---

## [Chunk an array](https://discourse.julialang.org/t/chunk-an-array/101878)

<div class="topic-metadata">

**Author:** [@tommy\_J](https://discourse.julialang.org/u/tommy_J)\
**Replies:** 5\
**Last updated:** [July 21, 2023, 3:12pm UTC](https://discourse.julialang.org/t/chunk-an-array/101878 "2023-07-21T15:12:02Z")

</div>

Hello to all, I would like to know how the most efficient way to chunk a multi-dimensional array in julia. arr = rand(Float64, (10, 100)) How can split it into chunks of size 30 so that I get 3 (10, 30) and 1 (10,10) …

---

## [Correct way to declare and use vector parameters in ModelingToolkit and PDE](https://discourse.julialang.org/t/correct-way-to-declare-and-use-vector-parameters-in-modelingtoolkit-and-pde/92714)

<div class="topic-metadata">

**Author:** [@Philippe\_Peeters](https://discourse.julialang.org/u/Philippe_Peeters)\
**Replies:** 3\
**Last updated:** [July 21, 2023, 2:24pm UTC](https://discourse.julialang.org/t/correct-way-to-declare-and-use-vector-parameters-in-modelingtoolkit-and-pde/92714 "2023-07-21T14:24:52Z")

</div>

Hi, I’m experimenting with PDE and the MethodOfLines.jl. I’m trying to figuring out how to correctly declare and use a parameter which is a float64 vector of variable size. Here is very basic (and useless) code sample …

---

## [“using PyMNE“ crashes Julia](https://discourse.julialang.org/t/using-pymne-crashes-julia/101799)

<div class="topic-metadata">

**Author:** [@nathanweisz](https://discourse.julialang.org/u/nathanweisz)\
**Replies:** 8\
**Last updated:** [July 21, 2023, 12:52pm UTC](https://discourse.julialang.org/t/using-pymne-crashes-julia/101799 "2023-07-21T12:52:06Z")

</div>

Hi, I work with M/EEG data and would like to check out some things in Julia. To load data etc I would need PyMNE: “using PyMNE“ seems to install some Python packages however crashes Julia at some point. See message be…

---

## [Separating stderr based on task](https://discourse.julialang.org/t/separating-stderr-based-on-task/101841)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 1\
**Last updated:** [July 21, 2023, 12:28pm UTC](https://discourse.julialang.org/t/separating-stderr-based-on-task/101841 "2023-07-21T12:28:04Z")

</div>

Say I have: a background task BT which may write to stderr a main task MT which may also write to stderr I care about stderr from (MT) but not from (BT) and would like to hide things that come from (BT) as they’re unr…

---

## [Writeshortest error](https://discourse.julialang.org/t/writeshortest-error/92764)

<div class="topic-metadata">

**Author:** [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Replies:** 14\
**Last updated:** [July 21, 2023, 12:25pm UTC](https://discourse.julialang.org/t/writeshortest-error/92764 "2023-07-21T12:25:27Z")

</div>

I keep getting this error as below, after I upgraded my DIVAnd.jl package. Not sure if they are realted, but I was able to run scripts like CSV.write without any issues even yesterday. “UndefVarError: writeshortest not …

---

## [Mutating function-like objects, enforcing "!"?](https://discourse.julialang.org/t/mutating-function-like-objects-enforcing/101825)

<div class="topic-metadata">

**Author:** [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Replies:** 6\
**Last updated:** [July 21, 2023, 11:38am UTC](https://discourse.julialang.org/t/mutating-function-like-objects-enforcing/101825 "2023-07-21T11:38:28Z")

</div>

For many users, this is probably a minor bike-shed thing but I wanted to dump it ;) maybe it’s even a bug or let’s say, design flaw (see at the end), no idea. I use function-like objects a lot in my packages and I const…

---

## [Font Unavailable in JuliaHub's Pluto](https://discourse.julialang.org/t/font-unavailable-in-juliahubs-pluto/101881)

<div class="topic-metadata">

**Author:** [@guoyongzhi](https://discourse.julialang.org/u/guoyongzhi)\
**Replies:** 0\
**Last updated:** [July 21, 2023, 10:16am UTC](https://discourse.julialang.org/t/font-unavailable-in-juliahubs-pluto/101881 "2023-07-21T10:16:34Z")

</div>

I recently uploaded my first notebook to JuliaHub. However, I’ve encountered an issue where, due to the absence of font files on the cloud machine, I cannot perform my visualizations. Any advice to rectify this would be …

---

## [Unclear documentation of \`collect\`? (similarity and difference with brackets)](https://discourse.julialang.org/t/unclear-documentation-of-collect-similarity-and-difference-with-brackets/101843)

<div class="topic-metadata">

**Author:** [@pierre-haessig](https://discourse.julialang.org/u/pierre-haessig)\
**Replies:** 2\
**Last updated:** [July 21, 2023, 9:10am UTC](https://discourse.julialang.org/t/unclear-documentation-of-collect-similarity-and-difference-with-brackets/101843 "2023-07-21T09:10:25Z")

</div>

Hello, I just came across the docstring of collect (Collections and Data Structures · The Julia Language) and I’ve got the feeling that the second usage example would need some more explanation, or is it just me? julia\>…

---

## [Fail to navigate in VSCode](https://discourse.julialang.org/t/fail-to-navigate-in-vscode/101874)

<div class="topic-metadata">

**Author:** [@baizhan](https://discourse.julialang.org/u/baizhan)\
**Replies:** 0\
**Last updated:** [July 21, 2023, 8:32am UTC](https://discourse.julialang.org/t/fail-to-navigate-in-vscode/101874 "2023-07-21T08:32:26Z")

</div>

I have a small julia file: module Parent module sub1 module subsub export f f(x)=x end using .subsub export f end module sub2 export g using ..sub1 g(x)=f(x)^2 end us…

---

## [Intersection and area of non-convex polygons](https://discourse.julialang.org/t/intersection-and-area-of-non-convex-polygons/101856)

<div class="topic-metadata">

**Author:** [@ferrolho](https://discourse.julialang.org/u/ferrolho)\
**Replies:** 1\
**Last updated:** [July 21, 2023, 6:25am UTC](https://discourse.julialang.org/t/intersection-and-area-of-non-convex-polygons/101856 "2023-07-21T06:25:26Z")

</div>

I am trying to use Julia for visualising instances of the moving sofa problem. I would like to be able to calculate the intersection between non-convex shapes and to also calculate the area of the resulting shapes. Howev…

---

## [Why repeat precompilation when running 'test DifferentialEquations'?](https://discourse.julialang.org/t/why-repeat-precompilation-when-running-test-differentialequations/101831)

<div class="topic-metadata">

**Author:** [@Henri\_Laurie](https://discourse.julialang.org/u/Henri_Laurie)\
**Replies:** 1\
**Last updated:** [July 21, 2023, 5:58am UTC](https://discourse.julialang.org/t/why-repeat-precompilation-when-running-test-differentialequations/101831 "2023-07-21T05:58:36Z")

</div>

I’ve just installed v1.9.2 (became available for Manjaro), and reinstalled the DifferentialEquations package. Out of curiosity, ran Pkg.test on it (actually just from Pkg manager prompt) and it repeated the precompilatio…

---

## [At what stage of package development do you write docstrings?](https://discourse.julialang.org/t/at-what-stage-of-package-development-do-you-write-docstrings/101816)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 11\
**Last updated:** [July 21, 2023, 3:20am UTC](https://discourse.julialang.org/t/at-what-stage-of-package-development-do-you-write-docstrings/101816 "2023-07-21T03:20:46Z")

</div>

When I develop a package, I eventually write docstrings of functions so that the users can find the meanings and usages of the functions easily by help?\>. However, I wait until the package gets matured, because I tend t…

---

## [DSSS encoding/ decoding](https://discourse.julialang.org/t/dsss-encoding-decoding/101857)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [July 20, 2023, 11:47pm UTC](https://discourse.julialang.org/t/dsss-encoding-decoding/101857 "2023-07-20T23:47:49Z")

</div>

Hello, I am trying to implement DSSS encoding/ decoding in Julia. Any hints how to start? Encoding: input: low frequent signal input: digital secret sequence filter: bandwidth filter output: analog (sampled) spread …

---

## [Adding set of equations in ModelingToolkit](https://discourse.julialang.org/t/adding-set-of-equations-in-modelingtoolkit/100019)

<div class="topic-metadata">

**Author:** [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)\
**Replies:** 1\
**Last updated:** [June 7, 2023, 7:55pm UTC](https://discourse.julialang.org/t/adding-set-of-equations-in-modelingtoolkit/100019 "2023-06-07T19:55:05Z")

</div>

I have several sets of differential equations, and to reduce the time of implementation I try to implement each set of equations by for loop as below (just for example): @variable (x(t))\[1:n\] (y(t))\[1:n\] eq1 = \[0 ~ D(x\[…

---

## [Advice for wrapping c++ library that throws exceptions?](https://discourse.julialang.org/t/advice-for-wrapping-c-library-that-throws-exceptions/101855)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 0\
**Last updated:** [July 20, 2023, 9:27pm UTC](https://discourse.julialang.org/t/advice-for-wrapping-c-library-that-throws-exceptions/101855 "2023-07-20T21:27:11Z")

</div>

I have a vendor library that throws exceptions, which makes wrapping them a bit more miserable. I only have access to headers and shared libraries, and I couldn’t figure out a way to link the libraries and prevent except…

---

## [Inspection Feature in Agents.jl only showing position of agents](https://discourse.julialang.org/t/inspection-feature-in-agents-jl-only-showing-position-of-agents/101854)

<div class="topic-metadata">

**Author:** [@daler6](https://discourse.julialang.org/u/daler6)\
**Replies:** 0\
**Last updated:** [July 20, 2023, 9:17pm UTC](https://discourse.julialang.org/t/inspection-feature-in-agents-jl-only-showing-position-of-agents/101854 "2023-07-20T21:17:26Z")

</div>

I have worked through the tutorials for Agent.jl, as well as recreating the schelling.jl model. I have run into a problem with the Agent Inspection feature. I have no problem being able to inspect the agents, but rather …

---

## [SLOW\_PROGRESS error and an unusual bug](https://discourse.julialang.org/t/slow-progress-error-and-an-unusual-bug/101700)

<div class="topic-metadata">

**Author:** [@selvi-aras](https://discourse.julialang.org/u/selvi-aras)\
**Replies:** 4\
**Last updated:** [July 20, 2023, 8:51pm UTC](https://discourse.julialang.org/t/slow-progress-error-and-an-unusual-bug/101700 "2023-07-20T20:51:31Z")

</div>

Dear JuMP Community, I have previously asked a question where Huber regression gave slow progress error in MOSEK. I am now facing similar (and even bigger) issues in logistic regression and I would like to understand if…

---

## [Equality constrain to NLopt](https://discourse.julialang.org/t/equality-constrain-to-nlopt/101852)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 2\
**Last updated:** [July 20, 2023, 8:44pm UTC](https://discourse.julialang.org/t/equality-constrain-to-nlopt/101852 "2023-07-20T20:44:54Z")

</div>

Hi, I am doing topology optimization. I have seen some tutorials. I want to add volume constrain to my model as below: v/v0=f which v is material volume and v0 is domain volume and f is volume fraction. could you plea…

---

## [How does julia downscale from 16 bit to 8 bit?](https://discourse.julialang.org/t/how-does-julia-downscale-from-16-bit-to-8-bit/101838)

<div class="topic-metadata">

**Author:** [@JmsChf](https://discourse.julialang.org/u/JmsChf)\
**Replies:** 2\
**Last updated:** [July 20, 2023, 8:30pm UTC](https://discourse.julialang.org/t/how-does-julia-downscale-from-16-bit-to-8-bit/101838 "2023-07-20T20:30:20Z")

</div>

I am attempting to revamp an old script that I found that converts a TIF format 16 bit image into a 8 bit JPG format image. I was wondering how Julia handles the downscaling of 16 bit images. It seems like this code is r…

---

## [Lasso and Ridge regularization](https://discourse.julialang.org/t/lasso-and-ridge-regularization/101851)

<div class="topic-metadata">

**Author:** [@T\_J](https://discourse.julialang.org/u/T_J)\
**Replies:** 1\
**Last updated:** [July 20, 2023, 8:06pm UTC](https://discourse.julialang.org/t/lasso-and-ridge-regularization/101851 "2023-07-20T20:06:54Z")

</div>

Hello to all, How can I include Lasso and Ridge Regularization in SciML? I am using the Lotka-Volterra case as an example. Original loss function loss(θ) X̂ = predict(θ) mean(abs2, Xₙ .- X̂) end Is this corr…

---

## [Multithreaded program hangs without explict GC.gc()](https://discourse.julialang.org/t/multithreaded-program-hangs-without-explict-gc-gc/99452)

<div class="topic-metadata">

**Author:** [@hayk](https://discourse.julialang.org/u/hayk)\
**Replies:** 6\
**Last updated:** [July 20, 2023, 7:35pm UTC](https://discourse.julialang.org/t/multithreaded-program-hangs-without-explict-gc-gc/99452 "2023-07-20T19:35:54Z")

</div>

I have the following code that uses Julia’s atomic variables and hangs if I do not use gc. I run the program with julia -t 6. I set two atomic variables to false, then spawn two threads that wait in a while loop for the…

---

## [Modified the neural network to capture nonlinear system](https://discourse.julialang.org/t/modified-the-neural-network-to-capture-nonlinear-system/101789)

<div class="topic-metadata">

**Author:** [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)\
**Replies:** 4\
**Last updated:** [July 20, 2023, 7:07pm UTC](https://discourse.julialang.org/t/modified-the-neural-network-to-capture-nonlinear-system/101789 "2023-07-20T19:07:52Z")

</div>

I tried to use NeuralPDE to solve ODE problem and my code is below: domains = \[t ∈ Interval(0.0,25.0)\] chain =\[Lux.Chain(Dense(1,10,Lux.tanh),Dense(10,20,Lux.tanh),Dense(20,10,Lux.tanh),Dense(10,1)) for \_ in 1:12\] dv…

---

## [Composing Lux with Optim Algorithms](https://discourse.julialang.org/t/composing-lux-with-optim-algorithms/101846)

<div class="topic-metadata">

**Author:** [@George\_Stepaniants](https://discourse.julialang.org/u/George_Stepaniants)\
**Replies:** 3\
**Last updated:** [July 20, 2023, 7:05pm UTC](https://discourse.julialang.org/t/composing-lux-with-optim-algorithms/101846 "2023-07-20T19:05:27Z")

</div>

Is there a way to use optimization algorithms from Optim to train Lux neural networks and neural ODEs? In particular, I would like to use LBFGS to train a Lux neural network but don’t see a simple way to do this. There i…

---

## [Types in \`:foreigncall\` nodes](https://discourse.julialang.org/t/types-in-foreigncall-nodes/101830)

<div class="topic-metadata">

**Author:** [@willtebbutt](https://discourse.julialang.org/u/willtebbutt)\
**Replies:** 2\
**Last updated:** [July 20, 2023, 6:45pm UTC](https://discourse.julialang.org/t/types-in-foreigncall-nodes/101830 "2023-07-20T18:45:35Z")

</div>

Consider: julia\> @code\_warntype Base.unsafe\_convert(Ptr{Float64}, randn(10)) MethodInstance for Base.unsafe\_convert(::Type{Ptr{Float64}}, ::Vector{Float64}) from unsafe\_convert(::Type{Ptr{T}}, a::Array{T}) where T @ B…

---

## [Zero allocation: tuple subsetting?](https://discourse.julialang.org/t/zero-allocation-tuple-subsetting/23122)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 9\
**Last updated:** [July 20, 2023, 6:42pm UTC](https://discourse.julialang.org/t/zero-allocation-tuple-subsetting/23122 "2023-07-20T18:42:56Z")

</div>

The following function allocates: function h() tup = (:a,:b,:c) return (getfield(tup, 1), getfield(tup, 3)) end; See: julia\> @btime h() 6.637 ns (1 allocation: 32 bytes) (:a, :c) I can’t workout how to m…

---

## [Status of SearchLight.jl](https://discourse.julialang.org/t/status-of-searchlight-jl/101815)

<div class="topic-metadata">

**Author:** [@Dreycen\_Foiles](https://discourse.julialang.org/u/Dreycen_Foiles)\
**Replies:** 1\
**Last updated:** [July 20, 2023, 5:14pm UTC](https://discourse.julialang.org/t/status-of-searchlight-jl/101815 "2023-07-20T17:14:25Z")

</div>

I’m in the process of setting up a database for my research team and since I’ve come to like Julia, I was really happy to see that the Genie.jl framework has SearchLight.jl to interface with databases. From the explanati…

---

## [Push! vs. pushfirst! performance issue with BitArrays](https://discourse.julialang.org/t/push-vs-pushfirst-performance-issue-with-bitarrays/101845)

<div class="topic-metadata">

**Author:** [@tradler](https://discourse.julialang.org/u/tradler)\
**Replies:** 1\
**Last updated:** [July 20, 2023, 5:28pm UTC](https://discourse.julialang.org/t/push-vs-pushfirst-performance-issue-with-bitarrays/101845 "2023-07-20T17:28:12Z")

</div>

push! seems to have equal speed as pushfirst! for non-bit vectors. In addition, for bit and non-bit vectors push! is equally fast. For bit and non-bit vectors pushfirst! is ~10Kx slower. Does this seem like an issue, or …

---

## [CssMakieLayout.jl - reactive frontends with Makie](https://discourse.julialang.org/t/cssmakielayout-jl-reactive-frontends-with-makie/101842)

<div class="topic-metadata">

**Author:** [@adrianariton](https://discourse.julialang.org/u/adrianariton)\
**Replies:** 1\
**Last updated:** [July 20, 2023, 5:19pm UTC](https://discourse.julialang.org/t/cssmakielayout-jl-reactive-frontends-with-makie/101842 "2023-07-20T17:19:09Z")

</div>

CssMakieLayout.jl Makie is great for plotting, and WGLMakie goes one step further by making the plots interactive. However, both of them lack a styling freedom that can make the science simulations and plots more user-f…

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

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