# General Usage

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

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

**Page:** 336

---

## [Isusefulnumber()](https://discourse.julialang.org/t/isusefulnumber/93795)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 2\
**Last updated:** [January 30, 2023, 10:24pm UTC](https://discourse.julialang.org/t/isusefulnumber/93795 "2023-01-30T22:24:45Z")

</div>

Is there a function available to check in a large vector, if one of the following occurs in a vector: missing nothing Inf NaN ? Here is my snippet to investigate a vector for such elements: a = \[1.3, NaN, Inf, missi…

---

## [How to fetch a generator of @spawn correctly?](https://discourse.julialang.org/t/how-to-fetch-a-generator-of-spawn-correctly/93670)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 3\
**Last updated:** [January 30, 2023, 10:02pm UTC](https://discourse.julialang.org/t/how-to-fetch-a-generator-of-spawn-correctly/93670 "2023-01-30T22:02:41Z")

</div>

I have the below MWE for a simple function test\_serial(). I tried to parallelize its p1!()&p2!() functions. However, it seems I am not using the fetch correctly. Could you please guide me here? function p1!(x) x .+= 1…

---

## [Why is there a \`sleep\` in ODBC.jl](https://discourse.julialang.org/t/why-is-there-a-sleep-in-odbc-jl/93562)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 14\
**Last updated:** [January 30, 2023, 9:26pm UTC](https://discourse.julialang.org/t/why-is-there-a-sleep-in-odbc-jl/93562 "2023-01-30T21:26:10Z")

</div>

Hi all :slight\_smile: Just reposting this here # By removing the sleep - query executes much faster #360 Does anyone know why there is an sleep? Does something horrible happen if I remove it? Cheers

---

## [Dispatch over element type](https://discourse.julialang.org/t/dispatch-over-element-type/93769)

<div class="topic-metadata">

**Author:** [@iago-lito](https://discourse.julialang.org/u/iago-lito)\
**Replies:** 14\
**Last updated:** [January 30, 2023, 8:54pm UTC](https://discourse.julialang.org/t/dispatch-over-element-type/93769 "2023-01-30T20:54:02Z")

</div>

I find the following code too restrictive: function f(collection::Vector{Int64}) for i in collection println("Integer: $i") end end function f(collection::Vector{String}) for s in collection …

---

## [Visualize long pmap process using Gtk.ProgressBarLeaf](https://discourse.julialang.org/t/visualize-long-pmap-process-using-gtk-progressbarleaf/93792)

<div class="topic-metadata">

**Author:** [@abbe](https://discourse.julialang.org/u/abbe)\
**Replies:** 0\
**Last updated:** [January 30, 2023, 8:51pm UTC](https://discourse.julialang.org/t/visualize-long-pmap-process-using-gtk-progressbarleaf/93792 "2023-01-30T20:51:53Z")

</div>

Hey all, I was wondering if it is possible to view the progress of the pmap function using GtkProgressBar when pmap is running on multiple (or all) processes. using Distributed, Statistics id = addprocs() @everywhere b…

---

## [@fastmath for library functions? (2x slowdown of binary search because of NaN checks in Base)](https://discourse.julialang.org/t/fastmath-for-library-functions-2x-slowdown-of-binary-search-because-of-nan-checks-in-base/93487)

<div class="topic-metadata">

**Author:** [@Az9DBvyVLWBjs8g](https://discourse.julialang.org/u/Az9DBvyVLWBjs8g)\
**Replies:** 14\
**Last updated:** [January 30, 2023, 7:15pm UTC](https://discourse.julialang.org/t/fastmath-for-library-functions-2x-slowdown-of-binary-search-because-of-nan-checks-in-base/93487 "2023-01-30T19:15:52Z")

</div>

Hello everyone, I’ve benchmarked Julia’s implementation of binary search (searchsortedlast) to test whether Julia can match C performance (spoiler: it can). However, I found that isnan checks within isless lead to a 1.5…

---

## [Julia 1.9.0-beta2 precompilation taking almost twice as long](https://discourse.julialang.org/t/julia-1-9-0-beta2-precompilation-taking-almost-twice-as-long/92498)

<div class="topic-metadata">

**Author:** [@M-PERSIC](https://discourse.julialang.org/u/M-PERSIC)\
**Replies:** 38\
**Last updated:** [January 30, 2023, 5:19pm UTC](https://discourse.julialang.org/t/julia-1-9-0-beta2-precompilation-taking-almost-twice-as-long/92498 "2023-01-30T17:19:46Z")

</div>

I’ve been testing out the new Docker image for Julia 1.9-beta2. I do indeed notice the FFTX improvements, however I’m also noticing that precompilation of every package now takes on average between 1.5x-2x as long. versi…

---

## [Are circular references problematic?](https://discourse.julialang.org/t/are-circular-references-problematic/93767)

<div class="topic-metadata">

**Author:** [@mariok90](https://discourse.julialang.org/u/mariok90)\
**Replies:** 3\
**Last updated:** [January 30, 2023, 2:36pm UTC](https://discourse.julialang.org/t/are-circular-references-problematic/93767 "2023-01-30T14:36:13Z")

</div>

I have this structure in my code: abstract type SystemComponent end mutable struct System components::Dict{String, \<:SystemComponent} function System() new(Dict{String, Component}()) end end mutab…

---

## [Vector of upper triangle](https://discourse.julialang.org/t/vector-of-upper-triangle/7764)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [January 30, 2023, 4:17pm UTC](https://discourse.julialang.org/t/vector-of-upper-triangle/7764 "2023-01-30T16:17:13Z")

</div>

Is there an elegant way of extracting the upper triangle of a matrix as a vector using Base? Besides, of course, writing something like function vec\_triu(M::AbstractMatrix{T}) where T m, n = size(M) m == n || th…

---

## [Compare and swap operation on mmap/shared-memory](https://discourse.julialang.org/t/compare-and-swap-operation-on-mmap-shared-memory/93425)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 7\
**Last updated:** [January 30, 2023, 4:13pm UTC](https://discourse.julialang.org/t/compare-and-swap-operation-on-mmap-shared-memory/93425 "2023-01-30T16:13:05Z")

</div>

Hi all :slight\_smile: How can I do an cas (compare and swap operation) on memory mapped arrays in Julia. julia\> v = SharedArray{UInt8}(abspath("test.bytes"), (1000,)); julia\> using SharedArrays julia\> v = SharedArray…

---

## [Vim plugin for Jupyter notebooks?](https://discourse.julialang.org/t/vim-plugin-for-jupyter-notebooks/31500)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 8\
**Last updated:** [January 30, 2023, 3:57pm UTC](https://discourse.julialang.org/t/vim-plugin-for-jupyter-notebooks/31500 "2023-01-30T15:57:59Z")

</div>

Is it possible to make a VIM plugin to view and edit Jupyter notebooks? When somebody sends me a Jupyter notebook, I always dread opening up my browser to view it. A much simpler solution would be to just open it from V…

---

## [Re-using compiled code](https://discourse.julialang.org/t/re-using-compiled-code/93524)

<div class="topic-metadata">

**Author:** [@simsurace](https://discourse.julialang.org/u/simsurace)\
**Replies:** 23\
**Last updated:** [January 30, 2023, 2:05pm UTC](https://discourse.julialang.org/t/re-using-compiled-code/93524 "2023-01-30T14:05:19Z")

</div>

I’m trying to reduce the latency of an application by using precompilation. I went through most of the steps described in the SnoopCompile manual. It seems that I’m running into the issue which is mentioned there, namely…

---

## [Using Serialization to store then load a lambdified function?](https://discourse.julialang.org/t/using-serialization-to-store-then-load-a-lambdified-function/85884)

<div class="topic-metadata">

**Author:** [@pluie](https://discourse.julialang.org/u/pluie)\
**Replies:** 7\
**Last updated:** [January 30, 2023, 11:08am UTC](https://discourse.julialang.org/t/using-serialization-to-store-then-load-a-lambdified-function/85884 "2023-01-30T11:08:26Z")

</div>

I have a lengthy symbolic expression that I find and lambdify in one function once. I hope to use this lambdified function repeatedly in a different function. It takes about a minute for lambdify to execute, so I do not …

---

## [Plotting in VSCode on two or more plot windows](https://discourse.julialang.org/t/plotting-in-vscode-on-two-or-more-plot-windows/93746)

<div class="topic-metadata">

**Author:** [@bionicinnovations](https://discourse.julialang.org/u/bionicinnovations)\
**Replies:** 3\
**Last updated:** [January 30, 2023, 9:47am UTC](https://discourse.julialang.org/t/plotting-in-vscode-on-two-or-more-plot-windows/93746 "2023-01-30T09:47:11Z")

</div>

I am analysing large data sets, with each analysis generating 10s of plots (Plots.jl with the plotly() backend). I want to compare these plots but generated under a separate condition. On VS Code it puts the plots in a …

---

## [Problems with SpecialFunctions.jl](https://discourse.julialang.org/t/problems-with-specialfunctions-jl/93705)

<div class="topic-metadata">

**Author:** [@fda-tome](https://discourse.julialang.org/u/fda-tome)\
**Replies:** 8\
**Last updated:** [January 30, 2023, 2:08am UTC](https://discourse.julialang.org/t/problems-with-specialfunctions-jl/93705 "2023-01-30T02:08:50Z")

</div>

Hey guys, im having trouble using BigFloat variables on spherical bessel functions given by the SpecialFunctions,jl package. I’m using the following code and receiving the error below. Thanks beforehand :slight\_smile: f…

---

## [Interesting comments on someone's journey from R to Julia posted in hacker news](https://discourse.julialang.org/t/interesting-comments-on-someones-journey-from-r-to-julia-posted-in-hacker-news/93740)

<div class="topic-metadata">

**Author:** [@1153dent](https://discourse.julialang.org/u/1153dent)\
**Replies:** 4\
**Last updated:** [January 29, 2023, 7:55pm UTC](https://discourse.julialang.org/t/interesting-comments-on-someones-journey-from-r-to-julia-posted-in-hacker-news/93740 "2023-01-29T19:55:24Z")

</div>

I was reading the comments section. the article is interesting but the comments more so

---

## [How to create the rotated cube with Makie.jl and GeometryBasics.jl](https://discourse.julialang.org/t/how-to-create-the-rotated-cube-with-makie-jl-and-geometrybasics-jl/93720)

<div class="topic-metadata">

**Author:** [@Mizu49](https://discourse.julialang.org/u/Mizu49)\
**Replies:** 3\
**Last updated:** [January 29, 2023, 12:44pm UTC](https://discourse.julialang.org/t/how-to-create-the-rotated-cube-with-makie-jl-and-geometrybasics-jl/93720 "2023-01-29T12:44:13Z")

</div>

I want to create the rotated cube with Makie.jl and GeometryBasics.jl. I made the following code, but it did not work well. using GLMakie, GeometryBasics # rotation matrix theta = pi/4 C = \[ 1 0 …

---

## [Using @parameters with DataDrivenDiffEq](https://discourse.julialang.org/t/using-parameters-with-datadrivendiffeq/91520)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 4\
**Last updated:** [January 29, 2023, 12:33pm UTC](https://discourse.julialang.org/t/using-parameters-with-datadrivendiffeq/91520 "2023-01-29T12:33:15Z")

</div>

I have figured out how to fit functions defined by arrays of number using a Basis defined with ModelToolkit.jl and DataDrivenDiffEq.jl. However, I still do not understand the use of @parameters. I initially thought that …

---

## [Lux.jl demo with Lotka-Voltera with UODE](https://discourse.julialang.org/t/lux-jl-demo-with-lotka-voltera-with-uode/91538)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 25\
**Last updated:** [January 29, 2023, 12:24pm UTC](https://discourse.julialang.org/t/lux-jl-demo-with-lotka-voltera-with-uode/91538 "2023-01-29T12:24:15Z")

</div>

@ChrisRackauckas Is there a tutorial or example of a universal differential equation which is mixture of deterministic and neural networks in the RHS, something like the Lotka-Volterra equations where the nonlinear term…

---

## [Reinterpret to existing vector](https://discourse.julialang.org/t/reinterpret-to-existing-vector/93706)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 16\
**Last updated:** [January 29, 2023, 9:55am UTC](https://discourse.julialang.org/t/reinterpret-to-existing-vector/93706 "2023-01-29T09:55:50Z")

</div>

Lets say I have a byte (UInt8) array that looks like this: source = reinterpret(UInt8, Int64\[10,11\]) 0x0a 0x00 0x00 0x00 .... And an existing allocated array of two integers target = zeros(Int64, 2) I basically w…

---

## [Missing coverage data](https://discourse.julialang.org/t/missing-coverage-data/93715)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 1\
**Last updated:** [January 29, 2023, 12:04am UTC](https://discourse.julialang.org/t/missing-coverage-data/93715 "2023-01-29T00:04:54Z")

</div>

I’m having trouble with figuring out why I’m not getting coverage data on a package I’m trying to get ready for submission to the General registry. This is what I’m doing: % git clone https://github.com/JuliaQuantumCon…

---

## [Macro to make a nested loop with threads](https://discourse.julialang.org/t/macro-to-make-a-nested-loop-with-threads/93717)

<div class="topic-metadata">

**Author:** [@mkoculak](https://discourse.julialang.org/u/mkoculak)\
**Replies:** 0\
**Last updated:** [January 29, 2023, 12:55am UTC](https://discourse.julialang.org/t/macro-to-make-a-nested-loop-with-threads/93717 "2023-01-29T00:55:09Z")

</div>

This is a reoccurring question, but with a twist that I can’t figure out (as this is my first time fiddling with macros). I have gone through most of the threads here and on SO concerning using macro to conditionally us…

---

## [Vararg (sub)type parameter undocumented dispatch weirdness](https://discourse.julialang.org/t/vararg-sub-type-parameter-undocumented-dispatch-weirdness/87110)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 7\
**Last updated:** [January 29, 2023, 12:02am UTC](https://discourse.julialang.org/t/vararg-sub-type-parameter-undocumented-dispatch-weirdness/87110 "2023-01-29T00:02:59Z")

</div>

a1(::Integer...) = nothing a2(::I...) where {I \<: Integer} = nothing a3(::Vararg{Integer}) = nothing a4(::Vararg{\<:Integer}) = nothing a5(::Vararg{I}) where {I \<: Integer} = nothing b3(::NTuple{n, Integer}) where {n} = n…

---

## [UndefVarError: .\* not defined when grouping with DataframesMeta](https://discourse.julialang.org/t/undefvarerror-not-defined-when-grouping-with-dataframesmeta/93115)

<div class="topic-metadata">

**Author:** [@a.frist](https://discourse.julialang.org/u/a.frist)\
**Replies:** 5\
**Last updated:** [January 28, 2023, 11:45pm UTC](https://discourse.julialang.org/t/undefvarerror-not-defined-when-grouping-with-dataframesmeta/93115 "2023-01-28T23:45:38Z")

</div>

Hello all, I ran into a problem when running a Julia script. The following code produces an error: UndefVarError: .\* not defined The offending Code: group = groupby(my\_dataframe, \[:COLUMN\_1, :COLUMN\_2\]) bet…

---

## [@df not defined](https://discourse.julialang.org/t/df-not-defined/44897)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 6\
**Last updated:** [January 28, 2023, 5:52pm UTC](https://discourse.julialang.org/t/df-not-defined/44897 "2023-01-28T17:52:28Z")

</div>

Hiya, this is the example given by Plots.jl for plotting with dataframe (Tutorial · Plots). But everytime I tried, it reported ERROR: LoadError: UndefVarError: @df not defined Is there anything I missed causing this er…

---

## [Calling repl from Julia code?](https://discourse.julialang.org/t/calling-repl-from-julia-code/7263)

<div class="topic-metadata">

**Author:** [@Gyslain](https://discourse.julialang.org/u/Gyslain)\
**Replies:** 4\
**Last updated:** [January 28, 2023, 4:46pm UTC](https://discourse.julialang.org/t/calling-repl-from-julia-code/7263 "2023-01-28T16:46:03Z")

</div>

Hey, I would like to launch the REPL from a script in order to have an interactive session at a point of execution of my Julia program. Base.\_start() start the REPL, but after that, the program is stuck in the loop of t…

---

## [R2 utility function for glm GeneralizedLinearModel](https://discourse.julialang.org/t/r2-utility-function-for-glm-generalizedlinearmodel/93694)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 6\
**Last updated:** [January 28, 2023, 3:36pm UTC](https://discourse.julialang.org/t/r2-utility-function-for-glm-generalizedlinearmodel/93694 "2023-01-28T15:36:19Z")

</div>

Hello, good afternoon. There are a r2 utility function for glm GeneralizedLinearModel? r2 only works with LinearModel. Also, the coefficients from sklearn had some value differences from glm. Someone knows if sklear d…

---

## [Forecasting time series with NeuralODE, Lux, DiffEqFlux](https://discourse.julialang.org/t/forecasting-time-series-with-neuralode-lux-diffeqflux/93613)

<div class="topic-metadata">

**Author:** [@ASe](https://discourse.julialang.org/u/ASe)\
**Replies:** 2\
**Last updated:** [January 28, 2023, 2:56pm UTC](https://discourse.julialang.org/t/forecasting-time-series-with-neuralode-lux-diffeqflux/93613 "2023-01-28T14:56:05Z")

</div>

Dear all, First of all, thank you very much for this supportive environment here. As suggested, I moved my question to a separate thread. Unfortunately, I am neither very familiar with neural nets nor with details in J…

---

## [Address the error "BoundsError: attempt to access 0-element Vector{Float64} at index \[1\]"](https://discourse.julialang.org/t/address-the-error-boundserror-attempt-to-access-0-element-vector-float64-at-index-1/93683)

<div class="topic-metadata">

**Author:** [@Kanishk](https://discourse.julialang.org/u/Kanishk)\
**Replies:** 3\
**Last updated:** [January 28, 2023, 1:28pm UTC](https://discourse.julialang.org/t/address-the-error-boundserror-attempt-to-access-0-element-vector-float64-at-index-1/93683 "2023-01-28T13:28:53Z")

</div>

Hello I am using the “IntervalArithmetic.jl” package in Pluto.jl notebook. While executing the code code I am getting the following error BoundsError: attempt to access 0-element Vector{Float64} at index \[1\] getindex(:…

---

## [Wrong kwarg in docstring for Pkg.add?](https://discourse.julialang.org/t/wrong-kwarg-in-docstring-for-pkg-add/93688)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 0\
**Last updated:** [January 28, 2023, 1:05pm UTC](https://discourse.julialang.org/t/wrong-kwarg-in-docstring-for-pkg-add/93688 "2023-01-28T13:05:58Z")

</div>

The following example from the doctring for Pkg.add must be wrong: Pkg.add(url="/remote/mycompany/juliapackages/OurPackage") # From path to local gitrepo Surely the kwarg should be path, right?

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

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