# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=75

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

**Page:** 76

---

## [How to make the Optim.jl zero allocated?](https://discourse.julialang.org/t/how-to-make-the-optim-jl-zero-allocated/126375)

<div class="topic-metadata">

**Author:** [@Xu\_Shan](https://discourse.julialang.org/u/Xu_Shan)\
**Replies:** 1\
**Last updated:** [March 31, 2025, 6:27pm UTC](https://discourse.julialang.org/t/how-to-make-the-optim-jl-zero-allocated/126375 "2025-03-31T18:27:28Z")

</div>

Hi guys, Right now I am using Optim.jl to optimise my problem, however, @btime shows the whole script has around hundreds allocations…which is quite a lot. So is there any trick to reduce the allocations to zero? and al…

---

## [Using @filter of Tidier package inside a function](https://discourse.julialang.org/t/using-filter-of-tidier-package-inside-a-function/127540)

<div class="topic-metadata">

**Author:** [@Alf](https://discourse.julialang.org/u/Alf)\
**Replies:** 3\
**Last updated:** [March 31, 2025, 5:48pm UTC](https://discourse.julialang.org/t/using-filter-of-tidier-package-inside-a-function/127540 "2025-03-31T17:48:00Z")

</div>

Hi! I rencently discovered the package Tidier, but I having trouble to use it inside a function. For instance, using AlgebraOfGraphics using DataFrames # Example function that filters a DataFrame \`df\` for rows where t…

---

## [Function for directly getting minimum/maximum value of set?](https://discourse.julialang.org/t/function-for-directly-getting-minimum-maximum-value-of-set/127559)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 2\
**Last updated:** [March 31, 2025, 4:48pm UTC](https://discourse.julialang.org/t/function-for-directly-getting-minimum-maximum-value-of-set/127559 "2025-03-31T16:48:08Z")

</div>

Something I do somewhat frequently, do figured I should check if there is an easy way. If I have a set s, is there something equivalent to function get\_span(s) return (minimum(s), maximum(s)) end ?

---

## [Incorrect location of an error when the line is terminated by semicolon](https://discourse.julialang.org/t/incorrect-location-of-an-error-when-the-line-is-terminated-by-semicolon/127548)

<div class="topic-metadata">

**Author:** [@merement](https://discourse.julialang.org/u/merement)\
**Replies:** 2\
**Last updated:** [March 31, 2025, 3:28pm UTC](https://discourse.julialang.org/t/incorrect-location-of-an-error-when-the-line-is-terminated-by-semicolon/127548 "2025-03-31T15:28:36Z")

</div>

Possible bug? In the code, a = 1 b ::Dict{String =\> String} = Dict(); Julia reports an error in line 1. More precisely, in the previously executed line. Without the semicolon after Dict(), the error is correctly repor…

---

## [Make fastmath use optional in a package](https://discourse.julialang.org/t/make-fastmath-use-optional-in-a-package/127527)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 3\
**Last updated:** [March 31, 2025, 11:47am UTC](https://discourse.julialang.org/t/make-fastmath-use-optional-in-a-package/127527 "2025-03-31T11:47:47Z")

</div>

Suppose that I write a package in which I would like to give the user the option to use fast math inside the package, but not necessarily elsewhere. What would be the best way of accomplishing that? The following is on…

---

## [Determine date range given year and week number](https://discourse.julialang.org/t/determine-date-range-given-year-and-week-number/93878)

<div class="topic-metadata">

**Author:** [@isentropic](https://discourse.julialang.org/u/isentropic)\
**Replies:** 14\
**Last updated:** [March 30, 2025, 10:25pm UTC](https://discourse.julialang.org/t/determine-date-range-given-year-and-week-number/93878 "2025-03-30T22:25:50Z")

</div>

How can I get the date range (or just the Date of the Monday) of that week? For example, I have year = 2023 week=5, somehow I need to know that the Monday of that week is 2023-01-30. Using a relevant contructor from Da…

---

## [DiffEqArrayOperator is missing](https://discourse.julialang.org/t/diffeqarrayoperator-is-missing/127500)

<div class="topic-metadata">

**Author:** [@ultimatile](https://discourse.julialang.org/u/ultimatile)\
**Replies:** 3\
**Last updated:** [March 30, 2025, 4:42pm UTC](https://discourse.julialang.org/t/diffeqarrayoperator-is-missing/127500 "2025-03-30T16:42:08Z")

</div>

The code below is an example code taken from Problem Types / Non-autonomous Linear ODE / Lie Group Problems section in documentation of DifferentialEquations.jl (I cannot include the link). using DifferentialEquations f…

---

## [Counter-intuitive performance difference](https://discourse.julialang.org/t/counter-intuitive-performance-difference/127477)

<div class="topic-metadata">

**Author:** [@photor](https://discourse.julialang.org/u/photor)\
**Replies:** 7\
**Last updated:** [March 30, 2025, 4:35pm UTC](https://discourse.julialang.org/t/counter-intuitive-performance-difference/127477 "2025-03-30T16:35:14Z")

</div>

julia\> using BenchmarkTools julia\> for i=1000 A=randn(2i,2i) vA=@view A\[1:i,1:i\] C=randn(i,i) @btime @. $C+=$vA end 1.325 ms (0 allocations: 0 bytes) julia\> for i=10…

---

## [Issue with setting multiline text in textarea / Blink.jl](https://discourse.julialang.org/t/issue-with-setting-multiline-text-in-textarea-blink-jl/127512)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 0\
**Last updated:** [March 30, 2025, 1:04pm UTC](https://discourse.julialang.org/t/issue-with-setting-multiline-text-in-textarea-blink-jl/127512 "2025-03-30T13:04:03Z")

</div>

In my package PackageMaker.jl , I’m implementing saving/recalling configurations. The package uses Blink.jl to create GUI. Some of the inputs are intended to take an array of strings, and implemented as multiline textar…

---

## [Juliac on Windows](https://discourse.julialang.org/t/juliac-on-windows/127502)

<div class="topic-metadata">

**Author:** [@Ininterrompue](https://discourse.julialang.org/u/Ininterrompue)\
**Replies:** 1\
**Last updated:** [March 30, 2025, 6:52am UTC](https://discourse.julialang.org/t/juliac-on-windows/127502 "2025-03-30T06:52:38Z")

</div>

I’m trying to use juliac with --trim on Windows 11. Copying the code for reference: module HelloWorld Base.@ccallable function main()::Cint println(Core.stdout, "Hello world") return 0 end end Powershell inpu…

---

## [Preventing test error behavior](https://discourse.julialang.org/t/preventing-test-error-behavior/127460)

<div class="topic-metadata">

**Author:** [@Marco\_Antoniotti](https://discourse.julialang.org/u/Marco_Antoniotti)\
**Replies:** 6\
**Last updated:** [March 29, 2025, 8:50pm UTC](https://discourse.julialang.org/t/preventing-test-error-behavior/127460 "2025-03-29T20:50:33Z")

</div>

Hi Question about Test and its use; this is my setup. I have a runtests.jl file containing @test’s and @testset’s. I load it from the shell (don’t ask; that’s what I need and want). $ julia -e 'include(sometests/runt…

---

## [Exact reproducibility of mixed Julia/Python project](https://discourse.julialang.org/t/exact-reproducibility-of-mixed-julia-python-project/127491)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [March 29, 2025, 8:46pm UTC](https://discourse.julialang.org/t/exact-reproducibility-of-mixed-julia-python-project/127491 "2025-03-29T20:46:24Z")

</div>

What’s a smooth workflow to achieve exact reproducibility in a mixed Julia/Python project (not library), with either Julia or Python as the host language? I’d like to specify, i.e. lock, the versions of all the following…

---

## [Cuda kernel help](https://discourse.julialang.org/t/cuda-kernel-help/127488)

<div class="topic-metadata">

**Author:** [@yolhan\_mannes](https://discourse.julialang.org/u/yolhan_mannes)\
**Replies:** 2\
**Last updated:** [March 29, 2025, 4:23pm UTC](https://discourse.julialang.org/t/cuda-kernel-help/127488 "2025-03-29T16:23:52Z")

</div>

Hello, I’m somewhat new to kernel programing and I stuggle understanding why the two kernels bellow don’t do the same thing using CUDA f(x,y) = x+y function mykernel!(out,space) ig = blockIdx().x jg = blockIdx…

---

## [The Prospero Challenge](https://discourse.julialang.org/t/the-prospero-challenge/127342)

<div class="topic-metadata">

**Author:** [@maxfreu](https://discourse.julialang.org/u/maxfreu)\
**Replies:** 17\
**Last updated:** [March 29, 2025, 1:24pm UTC](https://discourse.julialang.org/t/the-prospero-challenge/127342 "2025-03-29T13:24:26Z")

</div>

I just found the “Prospero Challenge” on hackernews and thought it’s a really nice toy example to write a parser and to analyze compile times. Maybe it’s even possible to compile the entire document, the parent repo also…

---

## [Naming conventions for property/method/variable overlaps](https://discourse.julialang.org/t/naming-conventions-for-property-method-variable-overlaps/127474)

<div class="topic-metadata">

**Author:** [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Replies:** 5\
**Last updated:** [March 29, 2025, 12:25pm UTC](https://discourse.julialang.org/t/naming-conventions-for-property-method-variable-overlaps/127474 "2025-03-29T12:25:29Z")

</div>

Let’s suppose I have an object that has cooties. Potentially I may have all of the following at one place or another: A struct with a property called cooties. An access method called cooties(let’s limit ourselves to ge…

---

## [Is Julia good for game development?](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804)

<div class="topic-metadata">

**Author:** [@junux](https://discourse.julialang.org/u/junux)\
**Replies:** 20\
**Last updated:** [October 3, 2022, 10:58am UTC](https://discourse.julialang.org/t/is-julia-good-for-game-development/73804 "2022-10-03T10:58:21Z")

</div>

Hi there I want to develop server based games via Julia. It’s going to be awesome if you write about your honest experience and opinion. julia\_is\_ideal = readline() parse(bool, julia\_is\_ideal) if julia\_is\_ideal == 1 …

---

## [\`Optimization.LBFGS\` fails to converge while \`Optim.NelderMead()\` works](https://discourse.julialang.org/t/optimization-lbfgs-fails-to-converge-while-optim-neldermead-works/121016)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 11\
**Last updated:** [March 29, 2025, 2:42am UTC](https://discourse.julialang.org/t/optimization-lbfgs-fails-to-converge-while-optim-neldermead-works/121016 "2025-03-29T02:42:36Z")

</div>

Reproducer: MWE.converge.jl · GitHub

---

## [Matrix multiplication with Duals](https://discourse.julialang.org/t/matrix-multiplication-with-duals/127453)

<div class="topic-metadata">

**Author:** [@Luis\_Calderon](https://discourse.julialang.org/u/Luis_Calderon)\
**Replies:** 12\
**Last updated:** [March 28, 2025, 10:01pm UTC](https://discourse.julialang.org/t/matrix-multiplication-with-duals/127453 "2025-03-28T22:01:47Z")

</div>

I was wondering if I could make this function faster. XC\_dual would come in as a Dual with 10-100 Partials. Here is the MWE: using LinearAlgebra, Random, ForwardDiff, Test, BenchmarkTools # Set a seed for reproducibilit…

---

## [How does autocompletion work in pkg mode?](https://discourse.julialang.org/t/how-does-autocompletion-work-in-pkg-mode/127435)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 6\
**Last updated:** [March 28, 2025, 9:29pm UTC](https://discourse.julialang.org/t/how-does-autocompletion-work-in-pkg-mode/127435 "2025-03-28T21:29:18Z")

</div>

I’m confused by the autocompletion in REPL package manager mode: If I type pkg\> add Static then this completed (in gray) to “add StaticArrays”. However, if I hit TAB, then the completion disappears, presumably because …

---

## [Repeat and reshape vector into a matrix](https://discourse.julialang.org/t/repeat-and-reshape-vector-into-a-matrix/127451)

<div class="topic-metadata">

**Author:** [@Ju\_ska](https://discourse.julialang.org/u/Ju_ska)\
**Replies:** 9\
**Last updated:** [March 28, 2025, 9:13pm UTC](https://discourse.julialang.org/t/repeat-and-reshape-vector-into-a-matrix/127451 "2025-03-28T21:13:31Z")

</div>

Hi, this is a Python code I’m translating in Julia: import numpy as np val = \[1,2,3,4,5,6\] val\_length = len(val) rpt = 3 np.repeat(val, rpt).reshape((val\_length, rpt)) It gives: \>\>\> val = \[1,2,3,4,5,6\] \>\>\> val\_leng…

---

## [Parametric structures and Inner constructors that don't depend on the types](https://discourse.julialang.org/t/parametric-structures-and-inner-constructors-that-dont-depend-on-the-types/127459)

<div class="topic-metadata">

**Author:** [@Maucejo](https://discourse.julialang.org/u/Maucejo)\
**Replies:** 2\
**Last updated:** [March 28, 2025, 5:24pm UTC](https://discourse.julialang.org/t/parametric-structures-and-inner-constructors-that-dont-depend-on-the-types/127459 "2025-03-28T17:24:05Z")

</div>

Hi all, I apologize for the title which is not clear at all, but I don’t know how to properly express my need concisely. I currently try to define a parametric struct for which the inner constructor doesn’t depend on th…

---

## [How can a script determine the latest Julia version and latest pre-release in CI?](https://discourse.julialang.org/t/how-can-a-script-determine-the-latest-julia-version-and-latest-pre-release-in-ci/127446)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 5\
**Last updated:** [March 28, 2025, 4:04pm UTC](https://discourse.julialang.org/t/how-can-a-script-determine-the-latest-julia-version-and-latest-pre-release-in-ci/127446 "2025-03-28T16:04:08Z")

</div>

How can I determine: the latest stable Julia version the latest Julia release the latest Julia pre-release on github? I can do: ufechner@ufryzen:~$ juliaup list | grep release release 1.11.4+0.x64.linu…

---

## [How to isolate & report non-deterministic bug](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 16\
**Last updated:** [March 28, 2025, 8:12am UTC](https://discourse.julialang.org/t/how-to-isolate-report-non-deterministic-bug/127176 "2025-03-28T08:12:20Z")

</div>

I have a large (15k LOC) calculation that works fine in 1.10.9 but gives an error in 1.11.4 (nothing else changed, not even the manifest). I isolated the function where this happens and I can reproduce it (within my cod…

---

## [Does Julia support desktop software development?](https://discourse.julialang.org/t/does-julia-support-desktop-software-development/105040)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 9\
**Last updated:** [March 28, 2025, 8:24am UTC](https://discourse.julialang.org/t/does-julia-support-desktop-software-development/105040 "2025-03-28T08:24:45Z")

</div>

Can I use Julia to develop some executable desktop softwares on win10 computer? And how about developing mobile apps?

---

## [Assigning multiple values to a Dataframe row using broadcasting](https://discourse.julialang.org/t/assigning-multiple-values-to-a-dataframe-row-using-broadcasting/127102)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 12\
**Last updated:** [March 27, 2025, 11:56pm UTC](https://discourse.julialang.org/t/assigning-multiple-values-to-a-dataframe-row-using-broadcasting/127102 "2025-03-27T23:56:05Z")

</div>

I am having some trouble using a vectorized function and assigning the output to a DataFrames row. Here is a simple MWE below. The function computes multiple values as the output, and I wanted to assign each element of t…

---

## [Dependency not found after installing the package just fine](https://discourse.julialang.org/t/dependency-not-found-after-installing-the-package-just-fine/127407)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 4\
**Last updated:** [March 27, 2025, 3:37pm UTC](https://discourse.julialang.org/t/dependency-not-found-after-installing-the-package-just-fine/127407 "2025-03-27T15:37:16Z")

</div>

I don’t understand what is going on here: \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | \_ \_ \_| |\_ \_\_ \_ | Type "?" for help, "\]?" for Pkg help. | | | | | | |/ \_\` …

---

## [\`esc\` asymmetry between \`public\` and \`export\`](https://discourse.julialang.org/t/esc-asymmetry-between-public-and-export/127420)

<div class="topic-metadata">

**Author:** [@PatrickHaecker](https://discourse.julialang.org/u/PatrickHaecker)\
**Replies:** 2\
**Last updated:** [March 27, 2025, 3:08pm UTC](https://discourse.julialang.org/t/esc-asymmetry-between-public-and-export/127420 "2025-03-27T15:08:46Z")

</div>

I think I understood the semantic difference between export and public. However, besides this semantic difference I thought that I can always exchange them syntactically. However, this does not seem to be the case. In …

---

## [Confusion on performance when using the broadcasting macro @. vs explicit . operators](https://discourse.julialang.org/t/confusion-on-performance-when-using-the-broadcasting-macro-vs-explicit-operators/127380)

<div class="topic-metadata">

**Author:** [@PetrosStefanou](https://discourse.julialang.org/u/PetrosStefanou)\
**Replies:** 7\
**Last updated:** [March 27, 2025, 11:51am UTC](https://discourse.julialang.org/t/confusion-on-performance-when-using-the-broadcasting-macro-vs-explicit-operators/127380 "2025-03-27T11:51:29Z")

</div>

Hi everyone, I am confused about the performance of the following code when using the @. macro as opposed to manually adding . before each operator. Below is a MWE function get\_f(θ, ϕ) α0 = 1.5 θ1 = π/4 ϕ1…

---

## [ERROR: LoadError: could not load symbol "jl\_tag\_newly\_inferred\_enable"](https://discourse.julialang.org/t/error-loaderror-could-not-load-symbol-jl-tag-newly-inferred-enable/127356)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [March 27, 2025, 10:29am UTC](https://discourse.julialang.org/t/error-loaderror-could-not-load-symbol-jl-tag-newly-inferred-enable/127356 "2025-03-27T10:29:43Z")

</div>

I am bisecting the Julia repo for a bug, reproduced by a rather complex package that uses StaticArrays.jl. Around dbe19e49d9 (approximate, since I have been trying git bisect skip to get rid of this error, in vain) in th…

---

## [Cache misses when 'using' packages since upgrading to 1.11](https://discourse.julialang.org/t/cache-misses-when-using-packages-since-upgrading-to-1-11/121445)

<div class="topic-metadata">

**Author:** [@Eliassj](https://discourse.julialang.org/u/Eliassj)\
**Replies:** 14\
**Last updated:** [March 27, 2025, 9:23am UTC](https://discourse.julialang.org/t/cache-misses-when-using-packages-since-upgrading-to-1-11/121445 "2025-03-27T09:23:48Z")

</div>

Since upgrading to 1.11 I’ve been receiving messages about cache misses like this one: julia\> using GLMakie \[ Info: Precompiling GLMakie \[e9467ef8-e4e7-5192-8a1a-b1aee30e663a\] (cache misses: invalid header (8)) and thi…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=74)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=76)
