# General Usage

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

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

**Page:** 242

---

## [How to write a unit test that checks whether a function is type stable](https://discourse.julialang.org/t/how-to-write-a-unit-test-that-checks-whether-a-function-is-type-stable/104587)

<div class="topic-metadata">

**Author:** [@CFBaptista](https://discourse.julialang.org/u/CFBaptista)\
**Replies:** 23\
**Last updated:** [October 6, 2023, 11:07am UTC](https://discourse.julialang.org/t/how-to-write-a-unit-test-that-checks-whether-a-function-is-type-stable/104587 "2023-10-06T11:07:18Z")

</div>

I want to write unit tests that check whether a function is type stable. What is currently the most recommendable way to do this? There is an old post on this subject which mentions the Traceur.jl and TraceCalls.jl pac…

---

## [Functions: What can I know? What may I hope for?](https://discourse.julialang.org/t/functions-what-can-i-know-what-may-i-hope-for/104628)

<div class="topic-metadata">

**Author:** [@laborg](https://discourse.julialang.org/u/laborg)\
**Replies:** 3\
**Last updated:** [October 5, 2023, 7:23pm UTC](https://discourse.julialang.org/t/functions-what-can-i-know-what-may-i-hope-for/104628 "2023-10-05T19:23:06Z")

</div>

In Julia many packages add methods to well known existing functions. My simple question: How to decide whether to reuse an existing name as to come up with a new one? An example: In DataStructures.jl there is a MutableL…

---

## [How to Create a 3D-Transparent Cylinder with GLMakie or Plots if possible?](https://discourse.julialang.org/t/how-to-create-a-3d-transparent-cylinder-with-glmakie-or-plots-if-possible/92099)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 9\
**Last updated:** [October 5, 2023, 6:57pm UTC](https://discourse.julialang.org/t/how-to-create-a-3d-transparent-cylinder-with-glmakie-or-plots-if-possible/92099 "2023-10-05T18:57:16Z")

</div>

Hi all, I created this sphere with GL Makie: using GLMakie n = 20 θ = \[0;(0.5:n-0.5)/n;1\] φ = \[(0:2n-2)\*2/(2n-1);2\] x = \[cospi(φ)\*sinpi(θ) for θ in θ, φ in φ\] y = \[sinpi(φ)\*sinpi(θ) for θ in θ, φ in φ\] z = \[cospi(θ)…

---

## [Mongoc and DataFrames](https://discourse.julialang.org/t/mongoc-and-dataframes/104622)

<div class="topic-metadata">

**Author:** [@ginger\_snaps](https://discourse.julialang.org/u/ginger_snaps)\
**Replies:** 0\
**Last updated:** [October 5, 2023, 5:48pm UTC](https://discourse.julialang.org/t/mongoc-and-dataframes/104622 "2023-10-05T17:48:24Z")

</div>

Hello, I work with mongo and financial data and I need to read data from csv write it to mongo get from mongo DataFrame dataframe as I just read it from csv file (types, etc) I wrote some function for that using Mong…

---

## [Strange allocation in loop when calling function](https://discourse.julialang.org/t/strange-allocation-in-loop-when-calling-function/104620)

<div class="topic-metadata">

**Author:** [@GrantHecht](https://discourse.julialang.org/u/GrantHecht)\
**Replies:** 2\
**Last updated:** [October 5, 2023, 5:35pm UTC](https://discourse.julialang.org/t/strange-allocation-in-loop-when-calling-function/104620 "2023-10-05T17:35:52Z")

</div>

Hello! I’ve been working on writing some very simple ODE solvers as an exercise to improve my understanding of Julia and how it can be used to write fast code. In doing so, I’ve arrived at some code that exhibits some s…

---

## [How to use the transform function on data frames](https://discourse.julialang.org/t/how-to-use-the-transform-function-on-data-frames/104582)

<div class="topic-metadata">

**Author:** [@RobertTalbert](https://discourse.julialang.org/u/RobertTalbert)\
**Replies:** 6\
**Last updated:** [October 5, 2023, 4:01pm UTC](https://discourse.julialang.org/t/how-to-use-the-transform-function-on-data-frames/104582 "2023-10-05T16:01:21Z")

</div>

I apologize for a very low-level question but I’ve just started learning the language and getting stumped. I am trying to take a dataframe and create a new column that’s the average of two other columns. I understand tha…

---

## [Micro-benchmark](https://discourse.julialang.org/t/micro-benchmark/104588)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 7\
**Last updated:** [October 5, 2023, 6:14am UTC](https://discourse.julialang.org/t/micro-benchmark/104588 "2023-10-05T06:14:06Z")

</div>

Here is a micro-benchmark of Julia, Nim, sbcl, Gambit-Scheme, and Racket for summing a vector of floating point values. Not really any feedback for Julia: this doesn’t warrant finding any extra performance tricks for Ju…

---

## [Struggling with creating a faster threaded version of a concurrent problem](https://discourse.julialang.org/t/struggling-with-creating-a-faster-threaded-version-of-a-concurrent-problem/104549)

<div class="topic-metadata">

**Author:** [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Replies:** 16\
**Last updated:** [October 5, 2023, 12:22pm UTC](https://discourse.julialang.org/t/struggling-with-creating-a-faster-threaded-version-of-a-concurrent-problem/104549 "2023-10-05T12:22:56Z")

</div>

Alright, I am so desperate that I call for some help from people experienced in concurrent/threaded programming in Julia since I am hitting a wall here. I can’t even provide a MWE but I am getting more and more desperate…

---

## [How to use BinaryBuilder.jl for non-Julia project?](https://discourse.julialang.org/t/how-to-use-binarybuilder-jl-for-non-julia-project/104560)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 5\
**Last updated:** [October 5, 2023, 12:06pm UTC](https://discourse.julialang.org/t/how-to-use-binarybuilder-jl-for-non-julia-project/104560 "2023-10-05T12:06:51Z")

</div>

I have a C++ project with no external dependencies other than GCC. I’m able to produce tarballs that work across different Linux distributions by compiling on CentOS 7 which has old versions of GCC and glibc. To build ta…

---

## [ChainRulesCore.rrule that just calls another rrule](https://discourse.julialang.org/t/chainrulescore-rrule-that-just-calls-another-rrule/104278)

<div class="topic-metadata">

**Author:** [@moble](https://discourse.julialang.org/u/moble)\
**Replies:** 13\
**Last updated:** [October 5, 2023, 11:18am UTC](https://discourse.julialang.org/t/chainrulescore-rrule-that-just-calls-another-rrule/104278 "2023-10-05T11:18:25Z")

</div>

I have defined a type Rotor{T} representing a unit quaternion. It’s possible to construct a Rotor{T} in terms of its components — which avoids the (very slightly) expensive step of normalization. There’s also a functio…

---

## [Creating a PNG-image of a VegaLite-diagram directly in memory?](https://discourse.julialang.org/t/creating-a-png-image-of-a-vegalite-diagram-directly-in-memory/104570)

<div class="topic-metadata">

**Author:** [@Miroslav-Stimac](https://discourse.julialang.org/u/Miroslav-Stimac)\
**Replies:** 1\
**Last updated:** [October 5, 2023, 8:59am UTC](https://discourse.julialang.org/t/creating-a-png-image-of-a-vegalite-diagram-directly-in-memory/104570 "2023-10-05T08:59:11Z")

</div>

Hello, I created the diagram fig with VegaLite.jl and want to send it via e-mail by using SMTPClient.jl without creating a temporary file, but using IOBuffer to do it directly in the memory. I tried this here, but it d…

---

## [How to convert a string to a symbolic expression?](https://discourse.julialang.org/t/how-to-convert-a-string-to-a-symbolic-expression/104527)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [October 5, 2023, 8:36am UTC](https://discourse.julialang.org/t/how-to-convert-a-string-to-a-symbolic-expression/104527 "2023-10-05T08:36:45Z")

</div>

How can I convert a string to a symbolic expression? The following code fails: using Symbolics @variables R a A Γ ρ U Q Q1 Q = 0.5A\*R\*a\*Γ\*ρ\*(U^2) Q\_string::String = repr(Q) # how to convert Q\_string back into a symb…

---

## [Issues found in OpenCV.jl](https://discourse.julialang.org/t/issues-found-in-opencv-jl/104426)

<div class="topic-metadata">

**Author:** [@Rakesh](https://discourse.julialang.org/u/Rakesh)\
**Replies:** 1\
**Last updated:** [October 5, 2023, 3:03am UTC](https://discourse.julialang.org/t/issues-found-in-opencv-jl/104426 "2023-10-05T03:03:14Z")

</div>

Hi, @Ashwani\_Rathee thanks for creating this package. I have found some issues in OpenCV.jl while I am recently using this package. Some array operations like findall slow and using high memory on OpenCV.Mat compared A…

---

## [Curried Broadcasting Comparison Operators](https://discourse.julialang.org/t/curried-broadcasting-comparison-operators/90613)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 5\
**Last updated:** [October 4, 2023, 8:18pm UTC](https://discourse.julialang.org/t/curried-broadcasting-comparison-operators/90613 "2023-10-04T20:18:19Z")

</div>

This is not what I expected: julia\> \>(2) === .\>(2) true julia\> .\>(1:4) 4-element Vector{Base.Fix2{typeof(\>), Int64}}: (::Base.Fix2{typeof(\>), Int64}) (generic function with 1 method) (::Base.Fix2{typeof(\>), Int64}) (…

---

## [Can't get CUDA.jl to see cuda in Ubuntu](https://discourse.julialang.org/t/cant-get-cuda-jl-to-see-cuda-in-ubuntu/101340)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 16\
**Last updated:** [October 4, 2023, 4:55pm UTC](https://discourse.julialang.org/t/cant-get-cuda-jl-to-see-cuda-in-ubuntu/101340 "2023-10-04T16:55:32Z")

</div>

I’m on a Dell Laptop with an NVIDIA RTX A2000 8GB Laptop. I’ve installed nvidia-driver-535, nvidia-cuda-toolkit, and cuda (and probably other things) via apt. I can’t seem to find a particular error. I run with JULIA\_DE…

---

## [Documenter.jl failed to build on a GitHub action, how can I run locally commit to gh-pages?](https://discourse.julialang.org/t/documenter-jl-failed-to-build-on-a-github-action-how-can-i-run-locally-commit-to-gh-pages/104579)

<div class="topic-metadata">

**Author:** [@haberdashPI](https://discourse.julialang.org/u/haberdashPI)\
**Replies:** 3\
**Last updated:** [October 4, 2023, 4:33pm UTC](https://discourse.julialang.org/t/documenter-jl-failed-to-build-on-a-github-action-how-can-i-run-locally-commit-to-gh-pages/104579 "2023-10-04T16:33:45Z")

</div>

What is the simplest way to build docs with Documenter.jl locally and push the appropriate updates to gh-pages? When I build locally I get ┌ Warning: Documenter could not auto-detect the building environment Skipping de…

---

## [Base.@ccallable blows chunks](https://discourse.julialang.org/t/base-ccallable-blows-chunks/104572)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 9\
**Last updated:** [October 4, 2023, 3:18pm UTC](https://discourse.julialang.org/t/base-ccallable-blows-chunks/104572 "2023-10-04T15:18:12Z")

</div>

Not much documentation out there I have found to help me with this. Do we not allow setting of references in the @ccallable function? I’ve had this problem with every function I tried to define as @ccallable for use in…

---

## [Toggle indefinite loop in Pluto Notebook](https://discourse.julialang.org/t/toggle-indefinite-loop-in-pluto-notebook/104495)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 2\
**Last updated:** [October 4, 2023, 1:21pm UTC](https://discourse.julialang.org/t/toggle-indefinite-loop-in-pluto-notebook/104495 "2023-10-04T13:21:49Z")

</div>

I knew that I could use observables from Makie to update plots without redrawing them. But I just discovered that when using WGLMakie, this also works in pluto notebooks. Sweet! So I want to use this functionality to pl…

---

## [Wrapping C++ class](https://discourse.julialang.org/t/wrapping-c-class/102573)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 11\
**Last updated:** [October 4, 2023, 12:08pm UTC](https://discourse.julialang.org/t/wrapping-c-class/102573 "2023-10-04T12:08:38Z")

</div>

Okay, I have a MWE that duplicates my issue: My wrapper correctly gives me the main application. The main application manages some other classes as members, but when I get those members back - they seem to not work. This…

---

## [How I can change script for speed up](https://discourse.julialang.org/t/how-i-can-change-script-for-speed-up/104136)

<div class="topic-metadata">

**Author:** [@Take1234](https://discourse.julialang.org/u/Take1234)\
**Replies:** 4\
**Last updated:** [October 4, 2023, 12:35pm UTC](https://discourse.julialang.org/t/how-i-can-change-script-for-speed-up/104136 "2023-10-04T12:35:46Z")

</div>

Hi Experts ,I’m just start studing Julia. But I’m in truble. Berrow 2D turblence simulation code is that I translated from Matlab. But It is not working well, very slow and use a lot of memory so I couldn’t run 3D versi…

---

## [Breakpoint/infiltrate inside a gradient calculation (Zygote or ReverseDiff)?](https://discourse.julialang.org/t/breakpoint-infiltrate-inside-a-gradient-calculation-zygote-or-reversediff/104568)

<div class="topic-metadata">

**Author:** [@Qfl3x](https://discourse.julialang.org/u/Qfl3x)\
**Replies:** 4\
**Last updated:** [October 4, 2023, 12:20pm UTC](https://discourse.julialang.org/t/breakpoint-infiltrate-inside-a-gradient-calculation-zygote-or-reversediff/104568 "2023-10-04T12:20:23Z")

</div>

I’m trying to debug why Zygote and ReverseDiff don’t work with MethodOfLines, however, I’m struggling to break inside the gradient calculation. Zygote and ReverseDiff are changing the types of some inputs. Breakpoints in…

---

## [Disable automatic Pkg Garbage Collection](https://discourse.julialang.org/t/disable-automatic-pkg-garbage-collection/104491)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 3\
**Last updated:** [October 4, 2023, 11:48am UTC](https://discourse.julialang.org/t/disable-automatic-pkg-garbage-collection/104491 "2023-10-04T11:48:50Z")

</div>

Once upon a time Pkg didn’t ever delete old versions of packages that were no longer in use. Now it periodically does so automatically when doing other operations. I would like that to stop, because I have so much hard…

---

## [Is there a package that performs first and second order conservative remapping?](https://discourse.julialang.org/t/is-there-a-package-that-performs-first-and-second-order-conservative-remapping/104563)

<div class="topic-metadata">

**Author:** [@k945](https://discourse.julialang.org/u/k945)\
**Replies:** 0\
**Last updated:** [October 4, 2023, 9:07am UTC](https://discourse.julialang.org/t/is-there-a-package-that-performs-first-and-second-order-conservative-remapping/104563 "2023-10-04T09:07:02Z")

</div>

In Daniel Sheas’ regridding overview, they advise that for discontinuous variables (eg, 3 hourly precipitation) it may be better to use First- and Second-Order Conservative Remapping. I need to interpolate some data and …

---

## [Julia on VSCode Notebook does not clean RAM and hangs if notebook restarted](https://discourse.julialang.org/t/julia-on-vscode-notebook-does-not-clean-ram-and-hangs-if-notebook-restarted/104535)

<div class="topic-metadata">

**Author:** [@Simone\_Gabbriellini](https://discourse.julialang.org/u/Simone_Gabbriellini)\
**Replies:** 1\
**Last updated:** [October 4, 2023, 8:37am UTC](https://discourse.julialang.org/t/julia-on-vscode-notebook-does-not-clean-ram-and-hangs-if-notebook-restarted/104535 "2023-10-04T08:37:12Z")

</div>

I have a notebook I use in VSCode, with a kernel Julia 1.9.3, that uses the package Agents. I launch a distributed simulation on 10 cores on my Ubuntu 18.04. The model loads a CSV file (50MB), then I launch, say, 30 simu…

---

## [Advice on gmail filters to deal with large amount of GitHub PR information](https://discourse.julialang.org/t/advice-on-gmail-filters-to-deal-with-large-amount-of-github-pr-information/104554)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 0\
**Last updated:** [October 4, 2023, 12:32am UTC](https://discourse.julialang.org/t/advice-on-gmail-filters-to-deal-with-large-amount-of-github-pr-information/104554 "2023-10-04T00:32:59Z")

</div>

I’m probably not the only one who uses g-mail and who get tons of messages like this: Do people have some clever filters to remove the less interesting GitHub mails from their repos (but keep the more interesting one…

---

## [How to use package extensions](https://discourse.julialang.org/t/how-to-use-package-extensions/104553)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 11\
**Last updated:** [October 3, 2023, 10:15pm UTC](https://discourse.julialang.org/t/how-to-use-package-extensions/104553 "2023-10-03T22:15:59Z")

</div>

A while back, I thought I figured out how to use the new package extensions feature. Unfortunately, I was wrong. I tried putting together a working example here. I added it to a new environment along with Distributions.j…

---

## [Genie: Basic API backend question](https://discourse.julialang.org/t/genie-basic-api-backend-question/104523)

<div class="topic-metadata">

**Author:** [@Ethan\_Leonard](https://discourse.julialang.org/u/Ethan_Leonard)\
**Replies:** 2\
**Last updated:** [October 3, 2023, 6:34pm UTC](https://discourse.julialang.org/t/genie-basic-api-backend-question/104523 "2023-10-03T18:34:46Z")

</div>

I keep getting this error : ######################### ERROR STACKTRACE ######################### Expected end of input Line: 0 Around: …11092×16 DataFrame Row… But when I run the code (excluding the routes) in …

---

## [GenieBuilder Fails to start new App](https://discourse.julialang.org/t/geniebuilder-fails-to-start-new-app/104546)

<div class="topic-metadata">

**Author:** [@Ravi\_Kumar\_Gubbala\_2](https://discourse.julialang.org/u/Ravi_Kumar_Gubbala_2)\
**Replies:** 0\
**Last updated:** [October 3, 2023, 5:09pm UTC](https://discourse.julialang.org/t/geniebuilder-fails-to-start-new-app/104546 "2023-10-03T17:09:46Z")

</div>

I have installed Julia Version 1.9.3, VS Code and GenieBuilder 0.4.11 successfully. I have created a App and started the App. It failed with the errors. Log pasted below. Please help. Thank you ┌ Info: 2023-10-03 22:…

---

## [Indexing an array with an array of indices](https://discourse.julialang.org/t/indexing-an-array-with-an-array-of-indices/104533)

<div class="topic-metadata">

**Author:** [@wosined](https://discourse.julialang.org/u/wosined)\
**Replies:** 5\
**Last updated:** [October 3, 2023, 2:21pm UTC](https://discourse.julialang.org/t/indexing-an-array-with-an-array-of-indices/104533 "2023-10-03T14:21:38Z")

</div>

I have a multidimensional array A = \[ 0 for x=1:5,y=1:5,z=1:5\] I also have an array of indices I = \[1,2,3\] I wish to get the element of A at the indices determined by I. For example I want to retrieve A\[1,2,3\] …

---

## [Zygote performances for simple function](https://discourse.julialang.org/t/zygote-performances-for-simple-function/104465)

<div class="topic-metadata">

**Author:** [@rcalxrc08](https://discourse.julialang.org/u/rcalxrc08)\
**Replies:** 14\
**Last updated:** [October 3, 2023, 9:19am UTC](https://discourse.julialang.org/t/zygote-performances-for-simple-function/104465 "2023-10-03T09:19:12Z")

</div>

Hi all, I have a the following example in Zygote for computing a single gradient, and I don’t understand why I get this performance regression over the following examples: using SpecialFunctions,BenchmarkTools,Zygote,I…

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

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