# General Usage

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

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

**Page:** 94

---

## [Experience with FunctionalCollections.jl](https://discourse.julialang.org/t/experience-with-functionalcollections-jl/124951)

<div class="topic-metadata">

**Author:** [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)\
**Replies:** 0\
**Last updated:** [January 20, 2025, 7:39am UTC](https://discourse.julialang.org/t/experience-with-functionalcollections-jl/124951 "2025-01-20T07:39:46Z")

</div>

Who has practical experience with the FunctionalCollections package, please? I like to adopt a persistent datastructure and it seems the most advanced. Still, it hasn’t gotten any update in years. Is it simply complet…

---

## [Why is BigFloat mutable?](https://discourse.julialang.org/t/why-is-bigfloat-mutable/124918)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 18\
**Last updated:** [January 20, 2025, 1:29am UTC](https://discourse.julialang.org/t/why-is-bigfloat-mutable/124918 "2025-01-20T01:29:33Z")

</div>

In adding more tests to BorrowChecker.jl, I ran into the weird cases of BigInt and BigFloat. Apparently these are actually mutable: julia\> x = big(1.0) 1.0 julia\> y = x 1.0 julia\> y.prec \*= 2 512 julia\> x # \[Origina…

---

## [@threads in for loop and push! in if statement](https://discourse.julialang.org/t/threads-in-for-loop-and-push-in-if-statement/124916)

<div class="topic-metadata">

**Author:** [@Stephen](https://discourse.julialang.org/u/Stephen)\
**Replies:** 6\
**Last updated:** [January 20, 2025, 1:19am UTC](https://discourse.julialang.org/t/threads-in-for-loop-and-push-in-if-statement/124916 "2025-01-20T01:19:21Z")

</div>

Hello there, I’m using @threads to accelerate my for loop, I don’t know how to push! a variable in if , I ask ChatGPT, it gives the code as following: # Initialize an empty array to store symbols, shared across threads …

---

## [Environment variables, debugging, globals, etcetera](https://discourse.julialang.org/t/environment-variables-debugging-globals-etcetera/124928)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 2\
**Last updated:** [January 19, 2025, 11:49pm UTC](https://discourse.julialang.org/t/environment-variables-debugging-globals-etcetera/124928 "2025-01-19T23:49:12Z")

</div>

Suppose that I want to use a global switch to turn certain activity on or off. An example activity would be to save a large amount of state information to disk after an iteration (or not). There are several ways of ach…

---

## [Any way to do asymmetric tolerances in Julia?](https://discourse.julialang.org/t/any-way-to-do-asymmetric-tolerances-in-julia/124933)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 4\
**Last updated:** [January 19, 2025, 11:28pm UTC](https://discourse.julialang.org/t/any-way-to-do-asymmetric-tolerances-in-julia/124933 "2025-01-19T23:28:11Z")

</div>

Hello! Suppose I have: LowerTolerance = 1 UpperTolerance = 3 Could I then have an assymmetric tolerance such that if I have a value of x = 10, its lower bound would be 9 and upper bound 13? Measurements.jl seems inca…

---

## [Tidier ! ! interpolation of external variables](https://discourse.julialang.org/t/tidier-interpolation-of-external-variables/124776)

<div class="topic-metadata">

**Author:** [@hatmatrix](https://discourse.julialang.org/u/hatmatrix)\
**Replies:** 8\
**Last updated:** [January 19, 2025, 11:23pm UTC](https://discourse.julialang.org/t/tidier-interpolation-of-external-variables/124776 "2025-01-19T23:23:16Z")

</div>

Invoking the @filter function in the TidierData package, I’m trying to use the the !! syntax to refer to a variable not in the data frame as described here: If you want to refer to an object a that is defined outside o…

---

## [Type instability when broadcasting anonymous function](https://discourse.julialang.org/t/type-instability-when-broadcasting-anonymous-function/124924)

<div class="topic-metadata">

**Author:** [@Eliassj](https://discourse.julialang.org/u/Eliassj)\
**Replies:** 3\
**Last updated:** [January 19, 2025, 11:06pm UTC](https://discourse.julialang.org/t/type-instability-when-broadcasting-anonymous-function/124924 "2025-01-19T23:06:45Z")

</div>

I found the following behavior a bit strange. When defining a function anonymously, broadcasting it introduces type instability? julia\> f = x -\> x^2 # Simple function #1 (generic function with 1 method) julia\> @code\_wa…

---

## [Contour plot on Structured grid using Meshes.jl](https://discourse.julialang.org/t/contour-plot-on-structured-grid-using-meshes-jl/123854)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 4\
**Last updated:** [January 19, 2025, 6:18pm UTC](https://discourse.julialang.org/t/contour-plot-on-structured-grid-using-meshes-jl/123854 "2025-01-19T18:18:18Z")

</div>

In Julia i am using Meshes.jl and GLMakie.jl . I am using x , z, alfsurf and psi variables of size (109,50) each. I input them to StructuredGrid() function which creates a structured grid of size (108,49). using Meshe…

---

## [App compilation](https://discourse.julialang.org/t/app-compilation/122374)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 5\
**Last updated:** [January 19, 2025, 3:27pm UTC](https://discourse.julialang.org/t/app-compilation/122374 "2025-01-19T15:27:47Z")

</div>

I’m currently trying to make a docker image from Julia code. So far, I tested two approaches, making a sysimage and making an app. In either case a sysimage is created in the process. My question is: What do I need to do…

---

## [Median of complex numbers different from Matlab output](https://discourse.julialang.org/t/median-of-complex-numbers-different-from-matlab-output/117352)

<div class="topic-metadata">

**Author:** [@shindelr](https://discourse.julialang.org/u/shindelr)\
**Replies:** 15\
**Last updated:** [December 2, 2024, 2:14pm UTC](https://discourse.julialang.org/t/median-of-complex-numbers-different-from-matlab-output/117352 "2024-12-02T14:14:36Z")

</div>

Hi there everyone! This is my first ever post in the Julia community and since I’m unfamiliar with the various tags and categories on here, I just put this question in General. I’m currently in the process of porting a …

---

## [Julia can only run as root--- why](https://discourse.julialang.org/t/julia-can-only-run-as-root-why/124905)

<div class="topic-metadata">

**Author:** [@MatFi](https://discourse.julialang.org/u/MatFi)\
**Replies:** 1\
**Last updated:** [January 18, 2025, 7:45pm UTC](https://discourse.julialang.org/t/julia-can-only-run-as-root-why/124905 "2025-01-18T19:45:40Z")

</div>

Hi, after some time I wanted to do something in Julia again, how ever I observe the following error when I start julia as normal user; ERROR: Unable to load dependent library /home/matfi/.julia/julia-1.11.2/bin/../lib/j…

---

## [What is the elegant way to use julia (or/and juliaup) portably?](https://discourse.julialang.org/t/what-is-the-elegant-way-to-use-julia-or-and-juliaup-portably/124899)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 0\
**Last updated:** [January 18, 2025, 4:08pm UTC](https://discourse.julialang.org/t/what-is-the-elegant-way-to-use-julia-or-and-juliaup-portably/124899 "2025-01-18T16:08:33Z")

</div>

If I want to use julia on a portable drive, and keep all the user settings (e.g., the startup.jl file) along with the installation path, and, I also want to update julia and manage its different versions conveniently, th…

---

## [Fine grained control of \_\_precompile\_\_(false)?](https://discourse.julialang.org/t/fine-grained-control-of-precompile-false/124811)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 3\
**Last updated:** [January 18, 2025, 3:28pm UTC](https://discourse.julialang.org/t/fine-grained-control-of-precompile-false/124811 "2025-01-18T15:28:35Z")

</div>

I am mostly using Julia 1.11.2 but sometimes 1.10.7. I have some code where a few function definitions cause a precompile warning and then the precompile fails. I have not been able to figure out a way to fix these fun…

---

## [Ispublic returns wrong result for types](https://discourse.julialang.org/t/ispublic-returns-wrong-result-for-types/124850)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 11\
**Last updated:** [January 18, 2025, 3:30am UTC](https://discourse.julialang.org/t/ispublic-returns-wrong-result-for-types/124850 "2025-01-18T03:30:20Z")

</div>

Even though I have types declared as public, the function Base.ispublic returns false for them. MWE: Creating a minimal package: module PubEx hiworld() = println("Hello World") struct PubStr foo end struct ExpSt…

---

## [Revise doesn't work with macros?](https://discourse.julialang.org/t/revise-doesnt-work-with-macros/124826)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 3\
**Last updated:** [January 18, 2025, 12:25am UTC](https://discourse.julialang.org/t/revise-doesnt-work-with-macros/124826 "2025-01-18T00:25:00Z")

</div>

Can it be true that Revise doesn’t work with macros. I experienced the problem when developing a package that has functions that use a macro. Then when I change the macro, the functions are not updated. But a similar m…

---

## [How to concatenate TypstStrings in Typstry.jl?](https://discourse.julialang.org/t/how-to-concatenate-typststrings-in-typstry-jl/124886)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 2\
**Last updated:** [January 18, 2025, 12:16am UTC](https://discourse.julialang.org/t/how-to-concatenate-typststrings-in-typstry-jl/124886 "2025-01-18T00:16:42Z")

</div>

I’m trying to make a custom string macro that effectively adds some initial boilerplate to the start of a Typst string. The effect would be julia\> T"important" == typst""" #set \`some pretty rule\` important """ true I …

---

## [LU factorisation of a block tridiagonal square matrix](https://discourse.julialang.org/t/lu-factorisation-of-a-block-tridiagonal-square-matrix/124852)

<div class="topic-metadata">

**Author:** [@eveningsilverfox](https://discourse.julialang.org/u/eveningsilverfox)\
**Replies:** 3\
**Last updated:** [January 17, 2025, 8:55pm UTC](https://discourse.julialang.org/t/lu-factorisation-of-a-block-tridiagonal-square-matrix/124852 "2025-01-17T20:55:56Z")

</div>

Following up on Fastest way to perform A \* B \* A’ Given a block tridiagonal matrix X with size NxN, having blocks of size MxM (M\<N and N%M=0), I define A = inv(I-X). I also define B having the same size as A, and it is …

---

## [Efficient tuple concatenation](https://discourse.julialang.org/t/efficient-tuple-concatenation/5398)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 16\
**Last updated:** [January 17, 2025, 7:42pm UTC](https://discourse.julialang.org/t/efficient-tuple-concatenation/5398 "2025-01-17T19:42:51Z")

</div>

I was needing a way to concatenate an undefined number of tuples. I came up with tuplejoin(t1::Tuple, t2::Tuple, t3...) = tuplejoin((t1..., t2...), t3...) tuplejoin(t::Tuple) = t This works julia\> tuplejoin((1,2),(3,4…

---

## [Using MTH229 and SymPy to Convolve 2 Probability Distribution Functions](https://discourse.julialang.org/t/using-mth229-and-sympy-to-convolve-2-probability-distribution-functions/124879)

<div class="topic-metadata">

**Author:** [@PazzyBoardman449](https://discourse.julialang.org/u/PazzyBoardman449)\
**Replies:** 0\
**Last updated:** [January 17, 2025, 2:47pm UTC](https://discourse.julialang.org/t/using-mth229-and-sympy-to-convolve-2-probability-distribution-functions/124879 "2025-01-17T14:47:19Z")

</div>

Hi there, I am trying to plot a probability distribution (PDF) which can only be calculated using integration. Essentially I’m trying to plot the function: P(y) = \\int\_{-\\infty}^{\\infty} P(y|x) P(x) dx Where P(y|x) is…

---

## [Is @fastmath less accurate on M-series macs?](https://discourse.julialang.org/t/is-fastmath-less-accurate-on-m-series-macs/124875)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 7\
**Last updated:** [January 17, 2025, 2:31pm UTC](https://discourse.julialang.org/t/is-fastmath-less-accurate-on-m-series-macs/124875 "2025-01-17T14:31:09Z")

</div>

I have a repo where the CI fails for macOS-latest but succeeds for windows-latest and ubuntu-lastest. The failed tests are accuracy tests. I have yet to write up an isolated minimal working example. Has anyone encountere…

---

## [Redirect \`@time\` output into a string](https://discourse.julialang.org/t/redirect-time-output-into-a-string/124872)

<div class="topic-metadata">

**Author:** [@alex180500](https://discourse.julialang.org/u/alex180500)\
**Replies:** 2\
**Last updated:** [January 17, 2025, 1:47pm UTC](https://discourse.julialang.org/t/redirect-time-output-into-a-string/124872 "2025-01-17T13:47:53Z")

</div>

Hello! working in a for loop I want to time a long computation with @time and I want to output the stdout into a string (that i’m using later in the for loop). for \_ in 1:num\_loops @time myvar = longcomputation() en…

---

## [REPL hangs](https://discourse.julialang.org/t/repl-hangs/124410)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 4\
**Last updated:** [January 17, 2025, 1:35pm UTC](https://discourse.julialang.org/t/repl-hangs/124410 "2025-01-17T13:35:14Z")

</div>

Hi all I am having issues with a code snipped in REPL. As seen in the video the REPL hangs (or at least it is VERY slow) at two lines. Surprisingly the first line is a comment line. The other line with the issue is th…

---

## [Does Juliaup have a portable version?](https://discourse.julialang.org/t/does-juliaup-have-a-portable-version/124699)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 3\
**Last updated:** [January 17, 2025, 10:27am UTC](https://discourse.julialang.org/t/does-juliaup-have-a-portable-version/124699 "2025-01-17T10:27:23Z")

</div>

We know that julia has corresponding portable version, but does Juliaup also have a portable version?

---

## [Broadcast matrix valued function, output into existing array](https://discourse.julialang.org/t/broadcast-matrix-valued-function-output-into-existing-array/124831)

<div class="topic-metadata">

**Author:** [@eveningsilverfox](https://discourse.julialang.org/u/eveningsilverfox)\
**Replies:** 7\
**Last updated:** [January 17, 2025, 6:42am UTC](https://discourse.julialang.org/t/broadcast-matrix-valued-function-output-into-existing-array/124831 "2025-01-17T06:42:50Z")

</div>

How do I broadcast the function matop below such that the output car1 resembles car, i.e., car1 is an array which can be accessed as car1\[:,1,2\]? Presently, car1 looks like a vector, with size (N,), instead of (N,2,2). …

---

## [Poor parallel speedup](https://discourse.julialang.org/t/poor-parallel-speedup/124782)

<div class="topic-metadata">

**Author:** [@billmclean](https://discourse.julialang.org/u/billmclean)\
**Replies:** 2\
**Last updated:** [January 17, 2025, 3:14am UTC](https://discourse.julialang.org/t/poor-parallel-speedup/124782 "2025-01-17T03:14:49Z")

</div>

I want to understand why some code exhibits fairly poor parallel speedup. In simplified form, I am just computing a discrete Laplacian over a 3D grid: function discrete\_laplacian!(AU::Array{T,3}, U::OffsetArray{T,3}) w…

---

## [Evaluate symbol passed to macro](https://discourse.julialang.org/t/evaluate-symbol-passed-to-macro/124810)

<div class="topic-metadata">

**Author:** [@Mikhail\_Kagalenko](https://discourse.julialang.org/u/Mikhail_Kagalenko)\
**Replies:** 7\
**Last updated:** [January 17, 2025, 12:32am UTC](https://discourse.julialang.org/t/evaluate-symbol-passed-to-macro/124810 "2025-01-17T00:32:37Z")

</div>

I have a macro that builds some Expr from a string passed to it, a simplified MWE is module MyExpr export @my\_expr macro my\_expr(s::String) Symbol.(eachsplit(s)) end end So I can call it like this julia\> @my\_ex…

---

## [Create executable file to be used in another julia project](https://discourse.julialang.org/t/create-executable-file-to-be-used-in-another-julia-project/124777)

<div class="topic-metadata">

**Author:** [@Sandy45](https://discourse.julialang.org/u/Sandy45)\
**Replies:** 8\
**Last updated:** [January 16, 2025, 9:37pm UTC](https://discourse.julialang.org/t/create-executable-file-to-be-used-in-another-julia-project/124777 "2025-01-16T21:37:47Z")

</div>

I am trying to create executable file(probably .so file) that can be used in my another julia project to access methods in it. I have tried to do it so using package compiler but getting below errors while using methods …

---

## [Interface FunSQL with LibPQ using DBInterface](https://discourse.julialang.org/t/interface-funsql-with-libpq-using-dbinterface/99635)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 9\
**Last updated:** [January 16, 2025, 8:10pm UTC](https://discourse.julialang.org/t/interface-funsql-with-libpq-using-dbinterface/99635 "2025-01-16T20:10:47Z")

</div>

I am using LibPQ.jl to interface Julia with Postgres as follows: using FunSQL using DBInterface dbread = "Test2" user = "postgres" password = "password" conn = LibPQ.Connection("dbname=$dbread user=$DATABASE\_USER passwo…

---

## [Why is a const binding not always a type alias?](https://discourse.julialang.org/t/why-is-a-const-binding-not-always-a-type-alias/61884)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 10\
**Last updated:** [January 16, 2025, 7:38pm UTC](https://discourse.julialang.org/t/why-is-a-const-binding-not-always-a-type-alias/61884 "2025-01-16T19:38:27Z")

</div>

With this struct A{T} end const Dog = A{String} const Cat = A{Int} I have julia\> Dog Dog (alias for A{String}) julia\> Cat Cat (alias for A{Int64}) But with this struct A{T} end const Dog = A{String} const Cat = A…

---

## [Julia stopped working](https://discourse.julialang.org/t/julia-stopped-working/124834)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 7\
**Last updated:** [January 16, 2025, 3:47pm UTC](https://discourse.julialang.org/t/julia-stopped-working/124834 "2025-01-16T15:47:34Z")

</div>

Julia stopped working. I came back ot my computer today (it was fine yesterday), and now it won’t start in vscode (latest version on ubuntu 24.04). I tried in terminal but get this: loman@famous-fred:~$ julia Error: The…

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

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