# General Usage

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

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

**Page:** 298

---

## [Correct way to ccall a Fortran subroutine requiring pointers](https://discourse.julialang.org/t/correct-way-to-ccall-a-fortran-subroutine-requiring-pointers/98191)

<div class="topic-metadata">

**Author:** [@lucifer1004](https://discourse.julialang.org/u/lucifer1004)\
**Replies:** 3\
**Last updated:** [May 2, 2023, 11:27am UTC](https://discourse.julialang.org/t/correct-way-to-ccall-a-fortran-subroutine-requiring-pointers/98191 "2023-05-02T11:27:01Z")

</div>

Given the following Fortran code: MODULE PTR IMPLICIT NONE REAL, SAVE, TARGET, ALLOCATABLE :: A(:, :), B(:, :) CONTAINS SUBROUTINE INIT(AP, BP) REAL, POINTER :: AP(:, :), BP(:, :) ALLOCATE(A(6, 6…

---

## [PlutoNoteBook realtime data, web page is it possible or do we head for python?](https://discourse.julialang.org/t/plutonotebook-realtime-data-web-page-is-it-possible-or-do-we-head-for-python/98126)

<div class="topic-metadata">

**Author:** [@1153dent](https://discourse.julialang.org/u/1153dent)\
**Replies:** 6\
**Last updated:** [May 2, 2023, 10:11am UTC](https://discourse.julialang.org/t/plutonotebook-realtime-data-web-page-is-it-possible-or-do-we-head-for-python/98126 "2023-05-02T10:11:50Z")

</div>

Hi there we have had a goal of 1 getting a real time data feed to update a data structure in a reliable manner. 2 use a notebook UI to effect the graphical representation of the the datastructure contents 3 allow 1 -…

---

## [Computation termination](https://discourse.julialang.org/t/computation-termination/98046)

<div class="topic-metadata">

**Author:** [@mst](https://discourse.julialang.org/u/mst)\
**Replies:** 18\
**Last updated:** [May 2, 2023, 9:35am UTC](https://discourse.julialang.org/t/computation-termination/98046 "2023-05-02T09:35:08Z")

</div>

Hello, Say I run f(g(x)) where f has no method for a Nothing data type and where g is defined as: function g(x) if condition on x is true return a computed valid type for f end end f, therefore, will t…

---

## [Aqua.jl tests failing because Aqua not a dependency of root project](https://discourse.julialang.org/t/aqua-jl-tests-failing-because-aqua-not-a-dependency-of-root-project/83590)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 7\
**Last updated:** [May 2, 2023, 9:09am UTC](https://discourse.julialang.org/t/aqua-jl-tests-failing-because-aqua-not-a-dependency-of-root-project/83590 "2023-05-02T09:09:55Z")

</div>

I’m trying to add Aqua.jl to my project. As suggested in the Aqua.jl documentation, I have placed Aqua in the test/Project.toml file to fix its version to 0.5. But now the Aqua tests fail if I call julia --project from m…

---

## [How to fit ODE system only on one @variables](https://discourse.julialang.org/t/how-to-fit-ode-system-only-on-one-variables/97910)

<div class="topic-metadata">

**Author:** [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Replies:** 3\
**Last updated:** [May 2, 2023, 5:59am UTC](https://discourse.julialang.org/t/how-to-fit-ode-system-only-on-one-variables/97910 "2023-05-02T05:59:52Z")

</div>

Hello, :grin: I have a small system of 2 differential equations whose @variables are N1 and N2, with 3 @parameters a, b, c. I have evolution data (experimental measurements) for the variable N1 only, named (time, data). …

---

## [Better way for plotting millions of scatter points in GLMakie](https://discourse.julialang.org/t/better-way-for-plotting-millions-of-scatter-points-in-glmakie/98127)

<div class="topic-metadata">

**Author:** [@Gavin\_Held](https://discourse.julialang.org/u/Gavin_Held)\
**Replies:** 3\
**Last updated:** [May 2, 2023, 12:05am UTC](https://discourse.julialang.org/t/better-way-for-plotting-millions-of-scatter-points-in-glmakie/98127 "2023-05-02T00:05:41Z")

</div>

Hello, I’ve been using Makie/GLMakie for about 2 years now, and am by no means an expert. I am mostly employing makie for its 3D plotting capabilities. Currently, I am trying to make 3D plots of plasma turbulence data …

---

## [How to multiply differential of complex function with imaginary unit](https://discourse.julialang.org/t/how-to-multiply-differential-of-complex-function-with-imaginary-unit/98180)

<div class="topic-metadata">

**Author:** [@Philip\_Stuckey](https://discourse.julialang.org/u/Philip_Stuckey)\
**Replies:** 0\
**Last updated:** [May 1, 2023, 11:30pm UTC](https://discourse.julialang.org/t/how-to-multiply-differential-of-complex-function-with-imaginary-unit/98180 "2023-05-01T23:30:08Z")

</div>

I’m using Julia Version 1.8.5 Symbolics 5.3.1 and Pluto v0.19.25 version infoCommit 17cfb8e65ea (2023-01-08 06:45 UTC) Platform Info: OS: Linux (x86\_64-linux-gnu) CPU: 16 × AMD Ryzen 7 5800X 8-Core Processor WO…

---

## [Evaluating a MvNormal density with a sparse covariance matrix](https://discourse.julialang.org/t/evaluating-a-mvnormal-density-with-a-sparse-covariance-matrix/98173)

<div class="topic-metadata">

**Author:** [@schwob](https://discourse.julialang.org/u/schwob)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 9:09pm UTC](https://discourse.julialang.org/t/evaluating-a-mvnormal-density-with-a-sparse-covariance-matrix/98173 "2023-05-01T21:09:55Z")

</div>

Suppose that Q is a sparse covariance matrix, and I want to evaluate \\mathbf{y} \\sim N(\\boldsymbol{0},Q). Can I leverage the sparsity of Q? Right now, I have Q as a SparseMatrixCSC{Float64, Int64}. Roughly 97% of the mat…

---

## [Export function-like objects](https://discourse.julialang.org/t/export-function-like-objects/98174)

<div class="topic-metadata">

**Author:** [@rkube](https://discourse.julialang.org/u/rkube)\
**Replies:** 4\
**Last updated:** [May 1, 2023, 8:19pm UTC](https://discourse.julialang.org/t/export-function-like-objects/98174 "2023-05-01T20:19:43Z")

</div>

Hi, in a custom module I’m defining function-like objects like this: export trf\_standardize struct trf\_standardize means stds end function (t::trf\_standardize)(x) (x .- t.means) ./ (t.stds) end How would…

---

## [Unblocking auto-merge in general registry](https://discourse.julialang.org/t/unblocking-auto-merge-in-general-registry/40358)

<div class="topic-metadata">

**Author:** [@krcools](https://discourse.julialang.org/u/krcools)\
**Replies:** 3\
**Last updated:** [May 1, 2023, 8:08pm UTC](https://discourse.julialang.org/t/unblocking-auto-merge-in-general-registry/40358 "2023-05-01T20:08:18Z")

</div>

I have released a new version of a package using Registrator (web interface). One of the checks on JuliaRegistries failed (I needed to specify a compat range). In order for the PR not to be auto-merged in the meantime, I…

---

## [How to stringify a recursively constructed type](https://discourse.julialang.org/t/how-to-stringify-a-recursively-constructed-type/98143)

<div class="topic-metadata">

**Author:** [@Niall](https://discourse.julialang.org/u/Niall)\
**Replies:** 2\
**Last updated:** [May 1, 2023, 6:19pm UTC](https://discourse.julialang.org/t/how-to-stringify-a-recursively-constructed-type/98143 "2023-05-01T18:19:31Z")

</div>

I have defined a type representing a node in an execution tree. Sometimes it only contains a variable, sometimes it contains an operator and 1 or 2 arguments. Now I want to display it as a string by recursing down the tr…

---

## [How to remove margin in single Makie plot](https://discourse.julialang.org/t/how-to-remove-margin-in-single-makie-plot/98169)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 2\
**Last updated:** [May 1, 2023, 6:17pm UTC](https://discourse.julialang.org/t/how-to-remove-margin-in-single-makie-plot/98169 "2023-05-01T18:17:53Z")

</div>

I would like to get rid of the surrounding white margin in the following Makie Plot. Any Idea ? using GLMakie nx,ny = 500,500 fig = Figure(resolution = (nx, ny), fontsize = 22) ax = Axis(fig\[1, 1\]; aspect = DataAspec…

---

## [Passing DataFrameRow to transform in split-apply-combine](https://discourse.julialang.org/t/passing-dataframerow-to-transform-in-split-apply-combine/98118)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 4\
**Last updated:** [May 1, 2023, 4:18pm UTC](https://discourse.julialang.org/t/passing-dataframerow-to-transform-in-split-apply-combine/98118 "2023-05-01T16:18:59Z")

</div>

Hello, I want to apply a function (my\_func) to the DataFrameRow object, so I can access all the column-names from within the function, independently of the col\_names declared in the transform. I can’t find the way of a…

---

## [Error: "all-underscore identifier used as rvalue"](https://discourse.julialang.org/t/error-all-underscore-identifier-used-as-rvalue/97944)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 3:25pm UTC](https://discourse.julialang.org/t/error-all-underscore-identifier-used-as-rvalue/97944 "2023-05-01T15:25:01Z")

</div>

I am trying to understand why the following error is thrown: julia\> function foo1(x, \_, y; z) @show x, y, z end ERROR: syntax: all-underscore identifier used as rvalue around REPL\[2\]:1 Stacktrace: \[1\] t…

---

## [Type-stability of recursive functions](https://discourse.julialang.org/t/type-stability-of-recursive-functions/78946)

<div class="topic-metadata">

**Author:** [@nchisholm](https://discourse.julialang.org/u/nchisholm)\
**Replies:** 6\
**Last updated:** [May 1, 2023, 1:05pm UTC](https://discourse.julialang.org/t/type-stability-of-recursive-functions/78946 "2023-05-01T13:05:12Z")

</div>

I have challenged myself to write a (ideally type-stable) function that computes the determinant of (small) matricies using the O(n!) recursive expansion formula without resorting to @generated. I ended up with the fol…

---

## [Question on Dependency-Related Best Practice for Packages](https://discourse.julialang.org/t/question-on-dependency-related-best-practice-for-packages/98146)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 5\
**Last updated:** [May 1, 2023, 12:09pm UTC](https://discourse.julialang.org/t/question-on-dependency-related-best-practice-for-packages/98146 "2023-05-01T12:09:38Z")

</div>

Hello, I don’t know which of the following is the better option or what should be done. I am hoping someone can help me decide. I am developing PackageA. I have PackageB currently as a dependency of PackageA. Separatel…

---

## [Why almost all package be re-precompiling after a new package installed?](https://discourse.julialang.org/t/why-almost-all-package-be-re-precompiling-after-a-new-package-installed/98151)

<div class="topic-metadata">

**Author:** [@tiZ](https://discourse.julialang.org/u/tiZ)\
**Replies:** 2\
**Last updated:** [May 1, 2023, 11:43am UTC](https://discourse.julialang.org/t/why-almost-all-package-be-re-precompiling-after-a-new-package-installed/98151 "2023-05-01T11:43:39Z")

</div>

Hi Julia-ers, I found that adding a new package in Julia can be quite troublesome. Each time I do this, there will be also a long precompilation process that involves almost all the packages in the current project envi…

---

## [Pkg.build("PyCall") errors. Need help](https://discourse.julialang.org/t/pkg-build-pycall-errors-need-help/98145)

<div class="topic-metadata">

**Author:** [@armel3](https://discourse.julialang.org/u/armel3)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 6:59am UTC](https://discourse.julialang.org/t/pkg-build-pycall-errors-need-help/98145 "2023-05-01T06:59:21Z")

</div>

Hi, Does anyone know how I can use Pkg.build(“PyCall”) without errors in Windows? It keeps failing and I am not sure how to fix it. Any help appreciated julia\> Pkg.build("PyCall") INFO: Building Conda INFO: Building Py…

---

## [Questions about testing and PkgEval, e.g. why only 63% of ecosystem tested, rest "skipped"?](https://discourse.julialang.org/t/questions-about-testing-and-pkgeval-e-g-why-only-63-of-ecosystem-tested-rest-skipped/98138)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 1\
**Last updated:** [May 1, 2023, 1:31am UTC](https://discourse.julialang.org/t/questions-about-testing-and-pkgeval-e-g-why-only-63-of-ecosystem-tested-rest-skipped/98138 "2023-05-01T01:31:44Z")

</div>

In short is PkgEval/master in worse state than usual? Before people start panic, the process seems to be working as intended, except maybe the skipped packages. I’m still curious about some of the (other) failures I’m se…

---

## [What are different types of functions in Julia and what are the differences between them?](https://discourse.julialang.org/t/what-are-different-types-of-functions-in-julia-and-what-are-the-differences-between-them/98113)

<div class="topic-metadata">

**Author:** [@meet.saiya](https://discourse.julialang.org/u/meet.saiya)\
**Replies:** 3\
**Last updated:** [April 30, 2023, 6:25pm UTC](https://discourse.julialang.org/t/what-are-different-types-of-functions-in-julia-and-what-are-the-differences-between-them/98113 "2023-04-30T18:25:01Z")

</div>

I’m trying to replicate a code of Sigmoidal programming for my optimization problem. The example uses a code where they pass in a list of functions. fs = fill(logistic, nvar) dfs = fill(logistic\_prime, nvar) The output…

---

## [Tree \<: Collection? Looking for API feedback in DynamicExpressions](https://discourse.julialang.org/t/tree-collection-looking-for-api-feedback-in-dynamicexpressions/98109)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 1\
**Last updated:** [April 30, 2023, 4:31pm UTC](https://discourse.julialang.org/t/tree-collection-looking-for-api-feedback-in-dynamicexpressions/98109 "2023-04-30T16:31:18Z")

</div>

Intro I am wondering if I could others’ opinions on a potential interface for traversing expressions in DynamicExpressions.jl. To give you a sense of what the package does, the original announcement thread for this pack…

---

## [Is there a faster alternative to \`hcat(xx...)\`?](https://discourse.julialang.org/t/is-there-a-faster-alternative-to-hcat-xx/98112)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 16\
**Last updated:** [April 30, 2023, 12:01pm UTC](https://discourse.julialang.org/t/is-there-a-faster-alternative-to-hcat-xx/98112 "2023-04-30T12:01:27Z")

</div>

Hello, I have this piece of code in a function: triangles = Matrix{Int}(undef, 3, 0) for i in 1:ntriangles a, b, c = triangle = ∂₂₀(i) nkeep = tokeep\[a\] + tokeep\[b\] + tokeep\[c\] if nkeep \> 0 push!(…

---

## [Add methods to function from another module](https://discourse.julialang.org/t/add-methods-to-function-from-another-module/98083)

<div class="topic-metadata">

**Author:** [@iskyd](https://discourse.julialang.org/u/iskyd)\
**Replies:** 2\
**Last updated:** [April 30, 2023, 9:53am UTC](https://discourse.julialang.org/t/add-methods-to-function-from-another-module/98083 "2023-04-30T09:53:01Z")

</div>

Hi everyone, I have a module A that simply define a function module A """ f(config::ConnectionConfiguration) Connects to the database using the given configuration. """ function connect end end Now from modul…

---

## [Probability Outcomes Plot with JULIA for Fair Coin Tossing](https://discourse.julialang.org/t/probability-outcomes-plot-with-julia-for-fair-coin-tossing/94663)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 28\
**Last updated:** [April 30, 2023, 8:52am UTC](https://discourse.julialang.org/t/probability-outcomes-plot-with-julia-for-fair-coin-tossing/94663 "2023-04-30T08:52:03Z")

</div>

Hi all, I want to plot the possible outcomes of tossing a fair coin for n times. If three times tossed then it should be like this graph: Which package in Julia can make this kind of graph?

---

## [How to convert Symbolics.jl expressions to functions while keeping speed?](https://discourse.julialang.org/t/how-to-convert-symbolics-jl-expressions-to-functions-while-keeping-speed/98111)

<div class="topic-metadata">

**Author:** [@Tony\_Zhang](https://discourse.julialang.org/u/Tony_Zhang)\
**Replies:** 2\
**Last updated:** [April 30, 2023, 5:16am UTC](https://discourse.julialang.org/t/how-to-convert-symbolics-jl-expressions-to-functions-while-keeping-speed/98111 "2023-04-30T05:16:34Z")

</div>

Hello! I’m using Symbolics.jl to perform some symbolic computations and then convert the resulting expressions to functions for further use. However, when I use build\_function to generate functions, the speed is only a …

---

## [Multithreading broadcast/map calls](https://discourse.julialang.org/t/multithreading-broadcast-map-calls/97956)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 7\
**Last updated:** [April 30, 2023, 1:34am UTC](https://discourse.julialang.org/t/multithreading-broadcast-map-calls/97956 "2023-04-30T01:34:38Z")

</div>

I’m working on improving the performance of code and one simple step is making broadcast calls multithreaded. After seeing that Threads.@threads macro doesn’t work for broadcast lines, I started converting code like b …

---

## [How to omit type assertion from compiled output](https://discourse.julialang.org/t/how-to-omit-type-assertion-from-compiled-output/98090)

<div class="topic-metadata">

**Author:** [@ColinCaine](https://discourse.julialang.org/u/ColinCaine)\
**Replies:** 8\
**Last updated:** [April 30, 2023, 12:34am UTC](https://discourse.julialang.org/t/how-to-omit-type-assertion-from-compiled-output/98090 "2023-04-30T00:34:16Z")

</div>

Hello! I have a struct S that contains a Union{Some{String}, Nothing} and I’m accessing the value at a time when it’s guaranteed to be a Some{String} (unless someone accesses the private fields of the struct). Can I acc…

---

## [Resizing GLMakie figure to display window](https://discourse.julialang.org/t/resizing-glmakie-figure-to-display-window/98103)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 1\
**Last updated:** [April 29, 2023, 10:21pm UTC](https://discourse.julialang.org/t/resizing-glmakie-figure-to-display-window/98103 "2023-04-29T22:21:17Z")

</div>

For the following figure, using GLMakie fig = Figure(fontsize = 27) sl = Slider(fig\[1, 0\]) \[Axis(fig\[i, j\], width = 600, height = 300, title = "i,j") for i in 1:2, j in 1:3\] le = LineElement(color=:red,linewidth=2,line…

---

## [How do I get an error in a try catch to end all running tasks](https://discourse.julialang.org/t/how-do-i-get-an-error-in-a-try-catch-to-end-all-running-tasks/97830)

<div class="topic-metadata">

**Author:** [@Zentrik](https://discourse.julialang.org/u/Zentrik)\
**Replies:** 1\
**Last updated:** [April 29, 2023, 8:15am UTC](https://discourse.julialang.org/t/how-do-i-get-an-error-in-a-try-catch-to-end-all-running-tasks/97830 "2023-04-29T08:15:01Z")

</div>

In the code below when the first task throws an error I want it to kill the second task immediately and then go to the catch block. I think the code currently ends the first task and then just runs the second task, and i…

---

## [Volume integral in Julia?](https://discourse.julialang.org/t/volume-integral-in-julia/98085)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 3\
**Last updated:** [April 29, 2023, 2:21pm UTC](https://discourse.julialang.org/t/volume-integral-in-julia/98085 "2023-04-29T14:21:14Z")

</div>

Hello! Is something like this possible in Julia, here an example from Matlab: Where it is possible to perform a volume integral using non-constant values in the limits? EDIT: Just to make it a bit easier I pasted …

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

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