# Latest

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

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

**Page:** 248

---

## [How to optimize neural network parameters with non-gradient algorithms?](https://discourse.julialang.org/t/how-to-optimize-neural-network-parameters-with-non-gradient-algorithms/124186)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [December 26, 2024, 7:41pm UTC](https://discourse.julialang.org/t/how-to-optimize-neural-network-parameters-with-non-gradient-algorithms/124186 "2024-12-26T19:41:58Z")

</div>

Is there any simple example code for optimizing neural network (e.g. from Flux.jl) parameters using non-gradient algorithms such as simulated annealing and genetic algorithms?

---

## [An easy way to parse escaped newline character?](https://discourse.julialang.org/t/an-easy-way-to-parse-escaped-newline-character/124188)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 2\
**Last updated:** [December 26, 2024, 6:09pm UTC](https://discourse.julialang.org/t/an-easy-way-to-parse-escaped-newline-character/124188 "2024-12-26T18:09:18Z")

</div>

I have a text file in which I specify some Makie plot labels and some of those labels have newline characters in them. I’ve attempted a few different ways to read that text file so that the two character “\\n” gets transl…

---

## [How to use time-dependant parameters in InfiniteOpt](https://discourse.julialang.org/t/how-to-use-time-dependant-parameters-in-infiniteopt/124092)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 8\
**Last updated:** [December 26, 2024, 5:16pm UTC](https://discourse.julialang.org/t/how-to-use-time-dependant-parameters-in-infiniteopt/124092 "2024-12-26T17:16:24Z")

</div>

I am using InfiniteOpt and I would like to have a parameter time-dependent. For example, in their “eating the cake” optimal consumption model, I would like to define the utility function with a multiplier that change wi…

---

## [PythonCall.pyimport opencv on Windows](https://discourse.julialang.org/t/pythoncall-pyimport-opencv-on-windows/124146)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 4\
**Last updated:** [December 26, 2024, 3:42pm UTC](https://discourse.julialang.org/t/pythoncall-pyimport-opencv-on-windows/124146 "2024-12-26T15:42:22Z")

</div>

I’m trying to PythonCall.pyimport opencv on Windows: const cv2 = PythonCall.pynew() function \_\_init\_\_() PythonCall.pycopy!(cv2, pyimport("cv2")) end but I run into Python: ImportError: DLL load failed while import…

---

## [Coloring similar entries in a matrix with the same color](https://discourse.julialang.org/t/coloring-similar-entries-in-a-matrix-with-the-same-color/124160)

<div class="topic-metadata">

**Author:** [@Shuvomoy\_Das\_Gupta](https://discourse.julialang.org/u/Shuvomoy_Das_Gupta)\
**Replies:** 10\
**Last updated:** [December 26, 2024, 2:45pm UTC](https://discourse.julialang.org/t/coloring-similar-entries-in-a-matrix-with-the-same-color/124160 "2024-12-26T14:45:50Z")

</div>

I have a matrix A with many entries but many of them are very close to each other. A small example of A could be: A = \[1.0001 2.0003 1.0; 2.0 3.0001 2.0004; 1.0001 2.0002 1.0\] The actual matrix A is quite…

---

## [Packages for inline tests: Which one I should use?](https://discourse.julialang.org/t/packages-for-inline-tests-which-one-i-should-use/124132)

<div class="topic-metadata">

**Author:** [@linwaytin](https://discourse.julialang.org/u/linwaytin)\
**Replies:** 6\
**Last updated:** [December 26, 2024, 2:34pm UTC](https://discourse.julialang.org/t/packages-for-inline-tests-which-one-i-should-use/124132 "2024-12-26T14:34:19Z")

</div>

I always like to put short tests along with the code, but the built-in Test does not support this. There are at least two packages: ReTest.jl and TestItems.jl can do this. If I understand correctly, TestItems.jl is devel…

---

## [Chairmarks supports comparative benchmarking!](https://discourse.julialang.org/t/chairmarks-supports-comparative-benchmarking/124166)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 1\
**Last updated:** [December 26, 2024, 2:02pm UTC](https://discourse.julialang.org/t/chairmarks-supports-comparative-benchmarking/124166 "2024-12-26T14:02:05Z")

</div>

Chairmarks version 1.3.0 supports benchmarking two (or more) functions at the same time. Simply provide the functions separated by commas: julia\> @b rand(3) objectid 4.257 ns julia\> @b rand(3) hash 7.360 ns julia\> @b …

---

## [Removing dependencies from versioned package](https://discourse.julialang.org/t/removing-dependencies-from-versioned-package/124164)

<div class="topic-metadata">

**Author:** [@phma](https://discourse.julialang.org/u/phma)\
**Replies:** 4\
**Last updated:** [December 26, 2024, 12:58pm UTC](https://discourse.julialang.org/t/removing-dependencies-from-versioned-package/124164 "2024-12-26T12:58:46Z")

</div>

I wrote a package WringTwistree, which is a cipher and hash function. When I wrote it, I didn’t know how to use startup.jl, so it depends on Debugger, ProfileView, and Revise, which it doesn’t need but I found useful whe…

---

## [How to generate values after training with Lux.LayerNorm and Lux.BatchNorm](https://discourse.julialang.org/t/how-to-generate-values-after-training-with-lux-layernorm-and-lux-batchnorm/102227)

<div class="topic-metadata">

**Author:** [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)\
**Replies:** 5\
**Last updated:** [December 26, 2024, 10:50am UTC](https://discourse.julialang.org/t/how-to-generate-values-after-training-with-lux-layernorm-and-lux-batchnorm/102227 "2024-12-26T10:50:15Z")

</div>

I tried to use Lux.LayerNorm and Dense to train the ODE system on NeuralPDE as follows: domains = \[t ∈ Interval(0.0,25.0)\] chain =\[Lux.Chain(Lux.LayerNorm((1,),Lux.relu),Dense(1,10,Lux.tanh),Dense(10,20,Lux.tanh),Dense…

---

## [Problem installing packages using Julia 1.11.2](https://discourse.julialang.org/t/problem-installing-packages-using-julia-1-11-2/123601)

<div class="topic-metadata">

**Author:** [@Science\_Mohammad](https://discourse.julialang.org/u/Science_Mohammad)\
**Replies:** 19\
**Last updated:** [December 25, 2024, 4:42pm UTC](https://discourse.julialang.org/t/problem-installing-packages-using-julia-1-11-2/123601 "2024-12-25T16:42:25Z")

</div>

I don’t know why 65% of pkgs can not be installed on my computer. Please explain why?. I’m using Julia version 1.11.2, I used julia version 1,10.6 Thank you so much

---

## [\[ANN\] RollingWindowArrays.jl - flexible and efficient rolling window operations](https://discourse.julialang.org/t/ann-rollingwindowarrays-jl-flexible-and-efficient-rolling-window-operations/122682)

<div class="topic-metadata">

**Author:** [@simeonschaub](https://discourse.julialang.org/u/simeonschaub)\
**Replies:** 4\
**Last updated:** [December 25, 2024, 4:08pm UTC](https://discourse.julialang.org/t/ann-rollingwindowarrays-jl-flexible-and-efficient-rolling-window-operations/122682 "2024-12-25T16:08:59Z")

</div>

Wanted to announce RollingWindowArrays.jl, a small package I have been working on for rolling winow operations on arrays, in case anyone finds it useful: julia\> x = rand(6) 6-element Vector{Float64}: 0.2026703034775777…

---

## [How does Any actually work?](https://discourse.julialang.org/t/how-does-any-actually-work/124135)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 46\
**Last updated:** [December 25, 2024, 3:16pm UTC](https://discourse.julialang.org/t/how-does-any-actually-work/124135 "2024-12-25T15:16:49Z")

</div>

Earlier I posted an example function which has very poor runtime performance. function demo( dict::Dict{Symbol, Vector}, datetime\_first::DateTime, datetime\_last::DateTime, ) time = dict\[:time\] data =…

---

## ["can not merge projects" error when \`dev\`ing sister package from test project](https://discourse.julialang.org/t/can-not-merge-projects-error-when-dev-ing-sister-package-from-test-project/115575)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 7\
**Last updated:** [December 25, 2024, 2:57pm UTC](https://discourse.julialang.org/t/can-not-merge-projects-error-when-dev-ing-sister-package-from-test-project/115575 "2024-12-25T14:57:37Z")

</div>

I have run into an issue in trying to apply a project structure I have seen in some successful projects. Similar to StaticArrays.jl and StaticArraysCore.jl, I have MyProject.jl and MyProjectCore.jl, each with their own G…

---

## [Building julia tarball from specific commit](https://discourse.julialang.org/t/building-julia-tarball-from-specific-commit/124154)

<div class="topic-metadata">

**Author:** [@Lior\_Assouline](https://discourse.julialang.org/u/Lior_Assouline)\
**Replies:** 7\
**Last updated:** [December 25, 2024, 7:06am UTC](https://discourse.julialang.org/t/building-julia-tarball-from-specific-commit/124154 "2024-12-25T07:06:27Z")

</div>

Hi All, Is there a documentation regarding the exact script that build the julia tarballs on specific releases? Specifically, I would like to build a tarball which has the same structure as if it was a 1.11.2 release b…

---

## [Pluto.jl - How do I dispatch to a subtype created in a notebook?](https://discourse.julialang.org/t/pluto-jl-how-do-i-dispatch-to-a-subtype-created-in-a-notebook/124162)

<div class="topic-metadata">

**Author:** [@g-gundam](https://discourse.julialang.org/u/g-gundam)\
**Replies:** 2\
**Last updated:** [December 25, 2024, 1:18am UTC](https://discourse.julialang.org/t/pluto-jl-how-do-i-dispatch-to-a-subtype-created-in-a-notebook/124162 "2024-12-25T01:18:30Z")

</div>

I created a small package called ProblematicAnimals.jl to demonstrate a problem I’m having with Pluto.jl notebooks. I sincerely hope a solution to this can be found. Defined outside of Pluto abstract type AbstractAnima…

---

## [Gridap & Richards equation](https://discourse.julialang.org/t/gridap-richards-equation/123961)

<div class="topic-metadata">

**Author:** [@Fabio\_Zottele](https://discourse.julialang.org/u/Fabio_Zottele)\
**Replies:** 5\
**Last updated:** [December 24, 2024, 10:58pm UTC](https://discourse.julialang.org/t/gridap-richards-equation/123961 "2024-12-24T22:58:30Z")

</div>

Hi all. I am rather new to julia and totally new to Gridap. Before starting a new time and energy consuming project I would like to know if Gridap is suitable for solving “highly non linear problem” (the Richards equatio…

---

## [How do I find the number of bytes for a character?](https://discourse.julialang.org/t/how-do-i-find-the-number-of-bytes-for-a-character/124144)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 3\
**Last updated:** [December 24, 2024, 4:48pm UTC](https://discourse.julialang.org/t/how-do-i-find-the-number-of-bytes-for-a-character/124144 "2024-12-24T16:48:46Z")

</div>

Hello, Please take a look at the following text: Consider the following: julia\> grk = “β+θ” “β+θ” julia\> length(grk) 3 julia\> sizeof(grk) 5 Since β and θ occupy two bytes each, the valid indices into grk are 1 …

---

## [Why doesn't this return statement return?](https://discourse.julialang.org/t/why-doesnt-this-return-statement-return/124142)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 4\
**Last updated:** [December 24, 2024, 3:53pm UTC](https://discourse.julialang.org/t/why-doesnt-this-return-statement-return/124142 "2024-12-24T15:53:55Z")

</div>

When attempting to return out of a function’s loop, the following return statement instead behaves like a break statement: breaking out of the loop but not returning from the function. function mweret() # write temp fi…

---

## [Cumulative sum on GPUArray using KernelAbstractions](https://discourse.julialang.org/t/cumulative-sum-on-gpuarray-using-kernelabstractions/124098)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 4\
**Last updated:** [December 24, 2024, 3:16pm UTC](https://discourse.julialang.org/t/cumulative-sum-on-gpuarray-using-kernelabstractions/124098 "2024-12-24T15:16:37Z")

</div>

Hello, I need to implement the cumulative sum (cumsum) on a GPU array (CUDA.jl or Metal.jl). Looking at the CUDA.jl repository, I found this definition function cumsum!(sums) shift = 1 while shift \< length(sum…

---

## [Accelerating calling a Julia function from Python via juliacall and ctypes](https://discourse.julialang.org/t/accelerating-calling-a-julia-function-from-python-via-juliacall-and-ctypes/124143)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 7\
**Last updated:** [December 24, 2024, 2:27pm UTC](https://discourse.julialang.org/t/accelerating-calling-a-julia-function-from-python-via-juliacall-and-ctypes/124143 "2024-12-24T14:27:54Z")

</div>

I was creating an example of using a Julia function from Python via pyjuliacall, but I noticed the overhead was quite high. Below I outline how to reduce the overhead of calling the Julia function from Python by using Ju…

---

## [How to setup a user defined type to work in arithmetical expressions when the type acts as a vector](https://discourse.julialang.org/t/how-to-setup-a-user-defined-type-to-work-in-arithmetical-expressions-when-the-type-acts-as-a-vector/124101)

<div class="topic-metadata">

**Author:** [@David\_Sagan](https://discourse.julialang.org/u/David_Sagan)\
**Replies:** 1\
**Last updated:** [December 24, 2024, 10:33am UTC](https://discourse.julialang.org/t/how-to-setup-a-user-defined-type-to-work-in-arithmetical-expressions-when-the-type-acts-as-a-vector/124101 "2024-12-24T10:33:11Z")

</div>

Setting up a struct to act as a scalar in arithmetical expressions is easy. For example: mutable struct D \<: Number; v; end Base.promote\_rule(::Type{D}, ::Type{T}) where T = T Base.convert(::Type{T}, d::D) where T \<: Nu…

---

## [How to code a type-flexible model that is type stable?](https://discourse.julialang.org/t/how-to-code-a-type-flexible-model-that-is-type-stable/124138)

<div class="topic-metadata">

**Author:** [@jmgnve](https://discourse.julialang.org/u/jmgnve)\
**Replies:** 2\
**Last updated:** [December 24, 2024, 9:30am UTC](https://discourse.julialang.org/t/how-to-code-a-type-flexible-model-that-is-type-stable/124138 "2024-12-24T09:30:34Z")

</div>

Hi. I want to write a model where I can swap between different number formats (Float32, Float64…), and at the same time achieve type stability. I have been looking at ShallowWaters.jl for hints how to do this best. I wou…

---

## [Why did I get IO error when broadcasting higher precision (bits \>= 98) ArbFloat variables to workers?](https://discourse.julialang.org/t/why-did-i-get-io-error-when-broadcasting-higher-precision-bits-98-arbfloat-variables-to-workers/124025)

<div class="topic-metadata">

**Author:** [@Edsnowden233](https://discourse.julialang.org/u/Edsnowden233)\
**Replies:** 6\
**Last updated:** [December 24, 2024, 7:43am UTC](https://discourse.julialang.org/t/why-did-i-get-io-error-when-broadcasting-higher-precision-bits-98-arbfloat-variables-to-workers/124025 "2024-12-24T07:43:49Z")

</div>

I used the following code to test the data allocation on distributed workers. I found that broadcasting an ArbFloat variable to workers with precision equal to or higher than 98 bits will cause the IO error. Code: usi…

---

## [How to apply fft to an array of static arrays?](https://discourse.julialang.org/t/how-to-apply-fft-to-an-array-of-static-arrays/124127)

<div class="topic-metadata">

**Author:** [@marcsgil](https://discourse.julialang.org/u/marcsgil)\
**Replies:** 4\
**Last updated:** [December 24, 2024, 6:58am UTC](https://discourse.julialang.org/t/how-to-apply-fft-to-an-array-of-static-arrays/124127 "2024-12-24T06:58:54Z")

</div>

I’d like to be able to do something like using StaticArrays, FFTW A = \[@SVector rand(ComplexF64, 3) for m ∈ 1:512\] fft(A) but FFTW.jl throws an error when I try it. Due to performance and ergonomic reasons, I really w…

---

## [JuliaGeo: Combine 2 files with points into one and export to shapefile](https://discourse.julialang.org/t/juliageo-combine-2-files-with-points-into-one-and-export-to-shapefile/124003)

<div class="topic-metadata">

**Author:** [@alecStewart1](https://discourse.julialang.org/u/alecStewart1)\
**Replies:** 4\
**Last updated:** [December 24, 2024, 3:12am UTC](https://discourse.julialang.org/t/juliageo-combine-2-files-with-points-into-one-and-export-to-shapefile/124003 "2024-12-24T03:12:27Z")

</div>

Hello friends, I’ve been trying to combine 2 shapefiles that have point data. I have put in an issue with GeoDataFrames here but I’ll detail my issues here. Initially I tried with a shapefile and a CSV file, but now I…

---

## [Scaling of Bessel Function Y for small x in SpecialFunctions](https://discourse.julialang.org/t/scaling-of-bessel-function-y-for-small-x-in-specialfunctions/124141)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 3\
**Last updated:** [December 24, 2024, 2:30am UTC](https://discourse.julialang.org/t/scaling-of-bessel-function-y-for-small-x-in-specialfunctions/124141 "2024-12-24T02:30:03Z")

</div>

Normally, there is a scaled version of the Bessel functions J\_m(x) and Y\_m(x) for large x. Nevertheless, the Y\_m functions also diverge quickly for x close to zero, and I would like to ask if there is an analogous scaled…

---

## [Curve fitting with NonlinearSolve.jl](https://discourse.julialang.org/t/curve-fitting-with-nonlinearsolve-jl/119238)

<div class="topic-metadata">

**Author:** [@garrek](https://discourse.julialang.org/u/garrek)\
**Replies:** 9\
**Last updated:** [December 24, 2024, 1:34am UTC](https://discourse.julialang.org/t/curve-fitting-with-nonlinearsolve-jl/119238 "2024-12-24T01:34:14Z")

</div>

I am trying to familiarize myself with the NonlinearSolve ecosystem for curve fitting and am having difficulty getting a simple fit to an exponential function. I have seen other discussions on doing this here, but I’m no…

---

## [Looking for Some Best Practices for Optimizing Julia Code Performance?](https://discourse.julialang.org/t/looking-for-some-best-practices-for-optimizing-julia-code-performance/124117)

<div class="topic-metadata">

**Author:** [@danielljose](https://discourse.julialang.org/u/danielljose)\
**Replies:** 5\
**Last updated:** [December 23, 2024, 10:14pm UTC](https://discourse.julialang.org/t/looking-for-some-best-practices-for-optimizing-julia-code-performance/124117 "2024-12-23T22:14:46Z")

</div>

Hi everyone, I am new to Julia and absolutely loving its speed and simplicity so far. However, as I start working on more complex projects…, I would like to ensure my code is as efficient as possible. I have read about …

---

## [How to respond to necroposts by newcomers?](https://discourse.julialang.org/t/how-to-respond-to-necroposts-by-newcomers/123164)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 11\
**Last updated:** [December 23, 2024, 9:51pm UTC](https://discourse.julialang.org/t/how-to-respond-to-necroposts-by-newcomers/123164 "2024-12-23T21:51:33Z")

</div>

While I do not necessarily agree on the opportunity to revive the topic with the insights expressed of this comment, it is also true that, if the text hasn’t changed compared to those received on my email notification, t…

---

## [Artifact at pole of 3D shape with makie shading](https://discourse.julialang.org/t/artifact-at-pole-of-3d-shape-with-makie-shading/124083)

<div class="topic-metadata">

**Author:** [@aligurbu](https://discourse.julialang.org/u/aligurbu)\
**Replies:** 5\
**Last updated:** [December 23, 2024, 9:43pm UTC](https://discourse.julialang.org/t/artifact-at-pole-of-3d-shape-with-makie-shading/124083 "2024-12-23T21:43:36Z")

</div>

Hello everyone, I’m plotting a 3D red blood cell (RBC) shape using Makie and encountered a shading artifact—a black patch appears at the top pole of the shape. Here’s a minimal reproducible example: using GLMakie GLMak…

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

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