# General Usage

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

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

**Page:** 261

---

## [Plots.jl and (Cairo)Makie not compatible?](https://discourse.julialang.org/t/plots-jl-and-cairo-makie-not-compatible/102509)

<div class="topic-metadata">

**Author:** [@arinbasu](https://discourse.julialang.org/u/arinbasu)\
**Replies:** 3\
**Last updated:** [August 5, 2023, 2:56pm UTC](https://discourse.julialang.org/t/plots-jl-and-cairo-makie-not-compatible/102509 "2023-08-05T14:56:06Z")

</div>

It seems I cannot have both Plots.jl and CairoMakie.jl or Makie.jl at the same time, or install them. I installed CairoMakie.jl with libfreetype 2.13 and it installed with no issues. Then when I tried to install Plots.jl…

---

## [Callback on Internal Stages of TSIT5](https://discourse.julialang.org/t/callback-on-internal-stages-of-tsit5/102415)

<div class="topic-metadata">

**Author:** [@yoshi](https://discourse.julialang.org/u/yoshi)\
**Replies:** 20\
**Last updated:** [August 5, 2023, 1:55pm UTC](https://discourse.julialang.org/t/callback-on-internal-stages-of-tsit5/102415 "2023-08-05T13:55:28Z")

</div>

When I step through my simulation, I can see that there are some internal stages in TSIT5 are giving values that are too large. This is to say – the variable is constrained to give values between 0 and 1 but the internal…

---

## [Tracking memory allocation overhead in @time on mutable struct code](https://discourse.julialang.org/t/tracking-memory-allocation-overhead-in-time-on-mutable-struct-code/102519)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 0\
**Last updated:** [August 5, 2023, 11:56am UTC](https://discourse.julialang.org/t/tracking-memory-allocation-overhead-in-time-on-mutable-struct-code/102519 "2023-08-05T11:56:10Z")

</div>

I was making some experiments with the code mentioned in this StackOverflow thread In julia, why is the memory allocated the same, but the number of allocations vastly different? - Stack Overflow It relates to this blog…

---

## [Why do I get consistently worse performance running as a script than from REPL?](https://discourse.julialang.org/t/why-do-i-get-consistently-worse-performance-running-as-a-script-than-from-repl/102496)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 4\
**Last updated:** [August 5, 2023, 5:15am UTC](https://discourse.julialang.org/t/why-do-i-get-consistently-worse-performance-running-as-a-script-than-from-repl/102496 "2023-08-05T05:15:57Z")

</div>

julia\_ma\_dot\_bench.jl: using LinearAlgebra, BenchmarkTools import MutableArithmetics const MA = MutableArithmetics; setprecision(128); sleep(2) @btime MA.buffered\_operate\_to!(b, o, dot, x, y) setup=(o=BigFloat(); n=50; …

---

## [Alternative URLs for one package in a Registry](https://discourse.julialang.org/t/alternative-urls-for-one-package-in-a-registry/102500)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 3\
**Last updated:** [August 4, 2023, 10:40pm UTC](https://discourse.julialang.org/t/alternative-urls-for-one-package-in-a-registry/102500 "2023-08-04T22:40:18Z")

</div>

Can a Registry store multiple (alternative) URLs for the same package? The assumption being that all the URLs have the same content but Pkg should try the next one if one fails. The motivation is to store both HTTPS and…

---

## [Looping over struct fieldnames in a type-stable way](https://discourse.julialang.org/t/looping-over-struct-fieldnames-in-a-type-stable-way/102508)

<div class="topic-metadata">

**Author:** [@elenev](https://discourse.julialang.org/u/elenev)\
**Replies:** 3\
**Last updated:** [August 5, 2023, 1:10am UTC](https://discourse.julialang.org/t/looping-over-struct-fieldnames-in-a-type-stable-way/102508 "2023-08-05T01:10:52Z")

</div>

I have a function that updates all fields of a struct in a field-specific way. Here an MWE: julia\> mutable struct Foo a b end julia\> calc\_new\_value(x, y) = x\*y calc\_new\_value (generic function wit…

---

## [How can I make an in-place swap function?](https://discourse.julialang.org/t/how-can-i-make-an-in-place-swap-function/102489)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 9\
**Last updated:** [August 4, 2023, 8:30pm UTC](https://discourse.julialang.org/t/how-can-i-make-an-in-place-swap-function/102489 "2023-08-04T20:30:58Z")

</div>

Suppose I have two arrays A, B of different sizes. Then A .+ B broadcasts them to a common size (if possible) and sums them. Suppose A here is “larger” (in the sense that all(size(B) .== size(A) .|| size(B) .== 1) is tru…

---

## [Higher-order function works in REPL but not in batch execution](https://discourse.julialang.org/t/higher-order-function-works-in-repl-but-not-in-batch-execution/102473)

<div class="topic-metadata">

**Author:** [@pao](https://discourse.julialang.org/u/pao)\
**Replies:** 5\
**Last updated:** [August 4, 2023, 7:48pm UTC](https://discourse.julialang.org/t/higher-order-function-works-in-repl-but-not-in-batch-execution/102473 "2023-08-04T19:48:56Z")

</div>

Hi guys, I was amazed to discover Julia working also as a true functional language with true Higher-order functions. Now, in writing small excerpts of Julia code to be included in a book sources, I found an inconsiste…

---

## [Apply Matrix Order of Operations on Scalars](https://discourse.julialang.org/t/apply-matrix-order-of-operations-on-scalars/102499)

<div class="topic-metadata">

**Author:** [@TicTac](https://discourse.julialang.org/u/TicTac)\
**Replies:** 1\
**Last updated:** [August 4, 2023, 7:29pm UTC](https://discourse.julialang.org/t/apply-matrix-order-of-operations-on-scalars/102499 "2023-08-04T19:29:02Z")

</div>

Is there a way to make variables defined by Symbolics (Or any symbolic module I suppose) to be treated with the algebraic rules and order of operations for matrices, while still displaying as scalars? I am using Symboli…

---

## [Can I avoid allocations when broadcasting over slices?](https://discourse.julialang.org/t/can-i-avoid-allocations-when-broadcasting-over-slices/102501)

<div class="topic-metadata">

**Author:** [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Replies:** 3\
**Last updated:** [August 4, 2023, 7:22pm UTC](https://discourse.julialang.org/t/can-i-avoid-allocations-when-broadcasting-over-slices/102501 "2023-08-04T19:22:19Z")

</div>

I was a little surprised to find that broadcasting over slices allocates, even when using view. Here’s a MWE. u = randn(10, 100) ids = reshape(1:100, 10, 10) out = similar(u\[ids\]) function foo1!(out, u, ids) @. out…

---

## [Symbolics: simplifying an equation whose RHS is zero](https://discourse.julialang.org/t/symbolics-simplifying-an-equation-whose-rhs-is-zero/102453)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 3\
**Last updated:** [August 4, 2023, 5:58pm UTC](https://discourse.julialang.org/t/symbolics-simplifying-an-equation-whose-rhs-is-zero/102453 "2023-08-04T17:58:31Z")

</div>

I’m using the Symbolics package. Suppose I’ve got an expression in several real variables, let’s call it expr, and I equate it with zero, e.g. expr ~ false. I’d like some simple automatic simplifications of that equation…

---

## [Best practice for not requiring users to load package for package extensions?](https://discourse.julialang.org/t/best-practice-for-not-requiring-users-to-load-package-for-package-extensions/102316)

<div class="topic-metadata">

**Author:** [@M-PERSIC](https://discourse.julialang.org/u/M-PERSIC)\
**Replies:** 3\
**Last updated:** [August 4, 2023, 3:33pm UTC](https://discourse.julialang.org/t/best-practice-for-not-requiring-users-to-load-package-for-package-extensions/102316 "2023-08-04T15:33:07Z")

</div>

I am looking to make loading package extensions transparent to the user of a package, meaning they would not have to manually include the conditional dependency to their environment. For example, if the user calls a func…

---

## [PSA: Inserting a new line in the REPL](https://discourse.julialang.org/t/psa-inserting-a-new-line-in-the-repl/3524)

<div class="topic-metadata">

**Author:** [@joshbode](https://discourse.julialang.org/u/joshbode)\
**Replies:** 15\
**Last updated:** [August 4, 2023, 2:35pm UTC](https://discourse.julialang.org/t/psa-inserting-a-new-line-in-the-repl/3524 "2023-08-04T14:35:45Z")

</div>

This tip may help someone - I’ve found it useful myself :slight\_smile: Ever wanted to insert a new blank line into something you’re working on at the REPL? Just pressing \<Enter\> is going to execute the command! TL;DR …

---

## [Store dataframes in structure and storing multiple database connection in connection pool](https://discourse.julialang.org/t/store-dataframes-in-structure-and-storing-multiple-database-connection-in-connection-pool/102467)

<div class="topic-metadata">

**Author:** [@Sandy45](https://discourse.julialang.org/u/Sandy45)\
**Replies:** 3\
**Last updated:** [August 4, 2023, 2:14pm UTC](https://discourse.julialang.org/t/store-dataframes-in-structure-and-storing-multiple-database-connection-in-connection-pool/102467 "2023-08-04T14:14:19Z")

</div>

Q1 - I am working with multiple dataframes and trying to create structure with dataframes in it so that they can be accessed easily. I’ve created struct like below and when I try to assign the data to it I got an error “…

---

## [Error in precompiling FFMPEG and Cairo and CairoMakie](https://discourse.julialang.org/t/error-in-precompiling-ffmpeg-and-cairo-and-cairomakie/102461)

<div class="topic-metadata">

**Author:** [@arinbasu](https://discourse.julialang.org/u/arinbasu)\
**Replies:** 3\
**Last updated:** [August 4, 2023, 2:10pm UTC](https://discourse.julialang.org/t/error-in-precompiling-ffmpeg-and-cairo-and-cairomakie/102461 "2023-08-04T14:10:49Z")

</div>

Hi All, Using Mac Big Sur (11.7.7; Intel Mac), I failed to precompile FFMPEG, Cairo, and CairoMakie. Julia version 1.9.2 The error message returned Failed to precompile FFMPEG \[c87230d0-a227-11e9-1b43-d7ebe4e7570a\] t…

---

## [Interacting with current and next iterator](https://discourse.julialang.org/t/interacting-with-current-and-next-iterator/102487)

<div class="topic-metadata">

**Author:** [@astro-kevin](https://discourse.julialang.org/u/astro-kevin)\
**Replies:** 2\
**Last updated:** [August 4, 2023, 2:10pm UTC](https://discourse.julialang.org/t/interacting-with-current-and-next-iterator/102487 "2023-08-04T14:10:38Z")

</div>

Say a is an iterator (not a vector or anything that can be indexed). I have function f(x,y) = x+y, and I want to have the function act on successive values of a. Say for our example a is an iterator for all odd numbers …

---

## [@edit files read only?](https://discourse.julialang.org/t/edit-files-read-only/102469)

<div class="topic-metadata">

**Author:** [@Alec\_Loudenback](https://discourse.julialang.org/u/Alec_Loudenback)\
**Replies:** 4\
**Last updated:** [August 4, 2023, 1:00pm UTC](https://discourse.julialang.org/t/edit-files-read-only/102469 "2023-08-04T13:00:28Z")

</div>

In th REPL if I add a package, and then use it, is there a way to have @edit let me Revise the file? Without deving the package, it opens up a read only editor for a file in, e.g. .julia/packages/PkgName/hash/src/file.jl …

---

## [Private registry](https://discourse.julialang.org/t/private-registry/68291)

<div class="topic-metadata">

**Author:** [@rvignolo](https://discourse.julialang.org/u/rvignolo)\
**Replies:** 11\
**Last updated:** [August 4, 2023, 11:51am UTC](https://discourse.julialang.org/t/private-registry/68291 "2023-08-04T11:51:59Z")

</div>

Hi, I would like to be able to run CI/CD using GitHub Actions in private packages. Let’s say I have two private packages, PkgA and PkgB, with PkgB depending on PkgA. I would like to be able to set up a private registr…

---

## [Can I "unescape" a variable name within an \`esc(..)\` node?](https://discourse.julialang.org/t/can-i-unescape-a-variable-name-within-an-esc-node/102396)

<div class="topic-metadata">

**Author:** [@iago-lito](https://discourse.julialang.org/u/iago-lito)\
**Replies:** 6\
**Last updated:** [August 4, 2023, 9:41am UTC](https://discourse.julialang.org/t/can-i-unescape-a-variable-name-within-an-esc-node/102396 "2023-08-04T09:41:48Z")

</div>

Hello, I’m curious whether it is possible to individually pick expressions within an esc()aped node to make them hygienic again. For instance: macro f(...) xp = esc(:(...)) unescape!(xp.args\[2\]) # or something …

---

## [Package-Compiler stops compile process because of arguments missing](https://discourse.julialang.org/t/package-compiler-stops-compile-process-because-of-arguments-missing/102472)

<div class="topic-metadata">

**Author:** [@Miroslav-Stimac](https://discourse.julialang.org/u/Miroslav-Stimac)\
**Replies:** 0\
**Last updated:** [August 4, 2023, 7:51am UTC](https://discourse.julialang.org/t/package-compiler-stops-compile-process-because-of-arguments-missing/102472 "2023-08-04T07:51:16Z")

</div>

Hello, I developed a program that requires a few arguments and when the program starts, it checks whether the correct arguments were given and if not, then it raises an exception. For example: # Read the arguments give…

---

## [How to call a macro with ::Second as argument?](https://discourse.julialang.org/t/how-to-call-a-macro-with-second-as-argument/102457)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 4\
**Last updated:** [August 4, 2023, 6:24am UTC](https://discourse.julialang.org/t/how-to-call-a-macro-with-second-as-argument/102457 "2023-08-04T06:24:53Z")

</div>

Hi all :slight\_smile: Just a quick question. How would I call the following macro? macro a(s::Second) ...do stuff end Thanks :slight\_smile:

---

## [Error thrown when attempting Parameter Identifiability](https://discourse.julialang.org/t/error-thrown-when-attempting-parameter-identifiability/102440)

<div class="topic-metadata">

**Author:** [@CurioMath](https://discourse.julialang.org/u/CurioMath)\
**Replies:** 2\
**Last updated:** [August 4, 2023, 5:29am UTC](https://discourse.julialang.org/t/error-thrown-when-attempting-parameter-identifiability/102440 "2023-08-04T05:29:06Z")

</div>

Hi, I’m really excited to dig around the Parameter Identifiability in ODE Models, that I came across in ModelingToolkit.jl as well as in Overview of Julia’s SciML documentation. I have tried the same on my ODE model, bu…

---

## [Iterating structs of different types efficiently](https://discourse.julialang.org/t/iterating-structs-of-different-types-efficiently/102321)

<div class="topic-metadata">

**Author:** [@adrian](https://discourse.julialang.org/u/adrian)\
**Replies:** 15\
**Last updated:** [August 4, 2023, 5:02am UTC](https://discourse.julialang.org/t/iterating-structs-of-different-types-efficiently/102321 "2023-08-04T05:02:21Z")

</div>

I am writing code that will involve solving an ODE that is composed of heterogeneous components. This requires evaluating the right hand side by iterating over those heterogeneous components. For this, I use a struct De…

---

## [Why is the return type of the following inplace broadcast operation not inferred?](https://discourse.julialang.org/t/why-is-the-return-type-of-the-following-inplace-broadcast-operation-not-inferred/102449)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 5\
**Last updated:** [August 3, 2023, 9:52pm UTC](https://discourse.julialang.org/t/why-is-the-return-type-of-the-following-inplace-broadcast-operation-not-inferred/102449 "2023-08-03T21:52:20Z")

</div>

julia\> @descend\_code\_warntype (Y -\> Y .+= Any\[rand(size(Y))\]\[1\])(rand(2)) (::var"#3#4")(Y) @ Main REPL\[4\]:1 ┌ Warning: couldn't retrieve source of (::var"#3#4")(Y) @ Main REPL\[4\]:1 └ @ TypedSyntax ~/.julia/packages/Typed…

---

## [Access to undefined reference: But not always](https://discourse.julialang.org/t/access-to-undefined-reference-but-not-always/102441)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 9\
**Last updated:** [August 3, 2023, 11:19pm UTC](https://discourse.julialang.org/t/access-to-undefined-reference-but-not-always/102441 "2023-08-03T23:19:10Z")

</div>

why in the case of the setindex!() function does the error not arise? That is, I understand why this behavior was established, but I’m curious to understand how, behind the scenes, the two situations are distinguished. …

---

## [Constructing a Switching Function on the Fly](https://discourse.julialang.org/t/constructing-a-switching-function-on-the-fly/102454)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 5\
**Last updated:** [August 3, 2023, 11:00pm UTC](https://discourse.julialang.org/t/constructing-a-switching-function-on-the-fly/102454 "2023-08-03T23:00:25Z")

</div>

In ExpandNestedData, I have a module for composing many nested iterators. It works by boiling down repeat and cycle into some callable structs that do division and modulo functions (respectively) on a provided index to r…

---

## [How to evaluate a complex function between complex bounds](https://discourse.julialang.org/t/how-to-evaluate-a-complex-function-between-complex-bounds/102460)

<div class="topic-metadata">

**Author:** [@AkchurinDA](https://discourse.julialang.org/u/AkchurinDA)\
**Replies:** 2\
**Last updated:** [August 3, 2023, 10:43pm UTC](https://discourse.julialang.org/t/how-to-evaluate-a-complex-function-between-complex-bounds/102460 "2023-08-03T22:43:21Z")

</div>

I’m having trouble evaluating the following expression that contains an integral with a complex function with complex bounds. In this expression, \\phi() is the PDF of a standard normal distribution, \\beta is a number…

---

## [Using a DrWatson project in a new Julia version](https://discourse.julialang.org/t/using-a-drwatson-project-in-a-new-julia-version/102459)

<div class="topic-metadata">

**Author:** [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Replies:** 9\
**Last updated:** [August 3, 2023, 10:25pm UTC](https://discourse.julialang.org/t/using-a-drwatson-project-in-a-new-julia-version/102459 "2023-08-03T22:25:53Z")

</div>

This is probably not a smart question. But I am not knowledgable about the inner workings of versions of projects and Julia etc. I have a DrWatson project on Julia 1.7, and I am now thinking about upgrading to Julia 1.9…

---

## [How do you label each timeseries on DifferentialEquations.jl plot?](https://discourse.julialang.org/t/how-do-you-label-each-timeseries-on-differentialequations-jl-plot/102456)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 4\
**Last updated:** [August 3, 2023, 8:24pm UTC](https://discourse.julialang.org/t/how-do-you-label-each-timeseries-on-differentialequations-jl-plot/102456 "2023-08-03T20:24:34Z")

</div>

I’ve got the solution to a differential equation, and i want to plot it, and I want each timeseries to have its own label in the legend: p1 = plot(soln; xlim=(0,0.2), ylim=(0,100), title="Organisms vs Time", xlab="Time …

---

## [Julia (and VSCode Language Server) Launching Failure](https://discourse.julialang.org/t/julia-and-vscode-language-server-launching-failure/102363)

<div class="topic-metadata">

**Author:** [@jeffeuxMartin](https://discourse.julialang.org/u/jeffeuxMartin)\
**Replies:** 1\
**Last updated:** [August 2, 2023, 9:19pm UTC](https://discourse.julialang.org/t/julia-and-vscode-language-server-launching-failure/102363 "2023-08-02T21:19:43Z")

</div>

I’ve been trying to install Julia and its VSCode environment on a new Windows computer for a few days, but I can’t launch it. To figure out where the problem may be, I’ve been trying for about 5 days, knowing that: Fir…

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

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