# Latest

**URL:** https://discourse.julialang.org/latest.md?page=833

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

**Page:** 834

---

## [Is there a generic way to remove the unit from a number?](https://discourse.julialang.org/t/is-there-a-generic-way-to-remove-the-unit-from-a-number/33277)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 8\
**Last updated:** [December 19, 2022, 10:31pm UTC](https://discourse.julialang.org/t/is-there-a-generic-way-to-remove-the-unit-from-a-number/33277 "2022-12-19T22:31:46Z")

</div>

Is there a generic way to remove the unit from a number? Note that x / oneunit(x) sometimes doesn’t work. For instance, if you look at the Furlongs testing example defined in https://github.com/JuliaLang/julia/blob/mast…

---

## [Ccall c++ sort vector of String](https://discourse.julialang.org/t/ccall-c-sort-vector-of-string/74635)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 36\
**Last updated:** [December 19, 2022, 9:58pm UTC](https://discourse.julialang.org/t/ccall-c-sort-vector-of-string/74635 "2022-12-19T21:58:29Z")

</div>

Hi, Would someone be able to provide an example on how to : 1/ pass a vector of strings to ccall 2/ sort the vector of strings using c++ std::sort 3/ get the sorted string vector back in Julia Thank you

---

## [Access docstring within a macro](https://discourse.julialang.org/t/access-docstring-within-a-macro/90362)

<div class="topic-metadata">

**Author:** [@nandoconde](https://discourse.julialang.org/u/nandoconde)\
**Replies:** 5\
**Last updated:** [December 19, 2022, 9:26pm UTC](https://discourse.julialang.org/t/access-docstring-within-a-macro/90362 "2022-12-19T21:26:24Z")

</div>

Hello Is there any way to access the docstring accompanying a macro at call place? It would be something like this: macro MyMacro(arg) # Do something with my docs # It does not mean that I want to append the outer doc …

---

## [Using the Intel VTune Profiler with julia](https://discourse.julialang.org/t/using-the-intel-vtune-profiler-with-julia/34327)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 27\
**Last updated:** [December 19, 2022, 9:14pm UTC](https://discourse.julialang.org/t/using-the-intel-vtune-profiler-with-julia/34327 "2022-12-19T21:14:43Z")

</div>

Hi all, I’m trying to profile the following piece of Julia code, taken from ProfileView.jl, using the external Intel VTune Profiler. Concretely, the code is # vtune.jl function profile\_test(n) for i = 1:n A…

---

## [Question about garbage collection, AD, and CUDA](https://discourse.julialang.org/t/question-about-garbage-collection-ad-and-cuda/91718)

<div class="topic-metadata">

**Author:** [@kcqpo](https://discourse.julialang.org/u/kcqpo)\
**Replies:** 1\
**Last updated:** [December 19, 2022, 9:05pm UTC](https://discourse.julialang.org/t/question-about-garbage-collection-ad-and-cuda/91718 "2022-12-19T21:05:40Z")

</div>

I encountered an issue that is in this thread Allocator very slow to reclaim memory after running for sufficiently long · Issue #137 · JuliaGPU/CUDA.jl · GitHub. For a machine learning workload, I noticed that if I don’t…

---

## [Creating and evaluating multivariate polynomials](https://discourse.julialang.org/t/creating-and-evaluating-multivariate-polynomials/91870)

<div class="topic-metadata">

**Author:** [@ZV314](https://discourse.julialang.org/u/ZV314)\
**Replies:** 4\
**Last updated:** [December 19, 2022, 8:48pm UTC](https://discourse.julialang.org/t/creating-and-evaluating-multivariate-polynomials/91870 "2022-12-19T20:48:08Z")

</div>

Newbie here, I seek to create a multivariable polynomial and evaluate it. In greater detail, I’d like to start by defining an array of monomials, say for example \[1, x1, x1^2, x2, x2^2, x1\*x2\] . With that established,…

---

## [Dirac delta in boundary conditions for MethodOfLines.jl](https://discourse.julialang.org/t/dirac-delta-in-boundary-conditions-for-methodoflines-jl/80567)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 15\
**Last updated:** [December 19, 2022, 8:28pm UTC](https://discourse.julialang.org/t/dirac-delta-in-boundary-conditions-for-methodoflines-jl/80567 "2022-12-19T20:28:49Z")

</div>

As a basis for more complex models, I’m trying to get a simplified version of the Von Foerster equation - Wikipedia discretized and running in MethodOfLines.jl. Here’s my model: using ModelingToolkit using MethodOfLine…

---

## [Numerically stable "cumulative variance" function in O(n)](https://discourse.julialang.org/t/numerically-stable-cumulative-variance-function-in-o-n/91872)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 5\
**Last updated:** [December 19, 2022, 8:12pm UTC](https://discourse.julialang.org/t/numerically-stable-cumulative-variance-function-in-o-n/91872 "2022-12-19T20:12:43Z")

</div>

I’m posting this in off-topic because my question is about algorithmic complexity and not about Julia performance. I’m trying to write a function that computes the cumulative variance of a vector x–that is, the vector y …

---

## [How to self reference a struct](https://discourse.julialang.org/t/how-to-self-reference-a-struct/91795)

<div class="topic-metadata">

**Author:** [@Ray\_Walker](https://discourse.julialang.org/u/Ray_Walker)\
**Replies:** 3\
**Last updated:** [December 19, 2022, 8:11pm UTC](https://discourse.julialang.org/t/how-to-self-reference-a-struct/91795 "2022-12-19T20:11:24Z")

</div>

How do you define an array in a struct of itself? julia\> mutable struct node level::Int candidate::Int children::Array{node, 3} end ERROR: invalid redefinition of constant node Stacktrace: \[1\] top-level scope @ …

---

## [Reading HTML file for parsing](https://discourse.julialang.org/t/reading-html-file-for-parsing/91873)

<div class="topic-metadata">

**Author:** [@edas](https://discourse.julialang.org/u/edas)\
**Replies:** 1\
**Last updated:** [December 19, 2022, 8:10pm UTC](https://discourse.julialang.org/t/reading-html-file-for-parsing/91873 "2022-12-19T20:10:20Z")

</div>

I want to read html file and then parse it (not sure if use word “parse” correctly). I saved example.com to file example.html Also using EzXML library using Cascadia, Gumbo, HTTP,AbstractTrees using EzXML r = EzXML.r…

---

## [Julia learning material for high school students](https://discourse.julialang.org/t/julia-learning-material-for-high-school-students/35982)

<div class="topic-metadata">

**Author:** [@Benoit9](https://discourse.julialang.org/u/Benoit9)\
**Replies:** 17\
**Last updated:** [December 19, 2022, 7:35pm UTC](https://discourse.julialang.org/t/julia-learning-material-for-high-school-students/35982 "2022-12-19T19:35:47Z")

</div>

Hello, With schools closed, my daughters are interested in (or at least willing to try :wink: learning a programming language. I had initially thought of Racket after seeing Matthias Felleisen’s video but I believe Juli…

---

## [Increase the ‘aggressiveness’ of the garbage collection?](https://discourse.julialang.org/t/increase-the-aggressiveness-of-the-garbage-collection/91750)

<div class="topic-metadata">

**Author:** [@Mikhail\_Kagalenko](https://discourse.julialang.org/u/Mikhail_Kagalenko)\
**Replies:** 9\
**Last updated:** [December 19, 2022, 6:39pm UTC](https://discourse.julialang.org/t/increase-the-aggressiveness-of-the-garbage-collection/91750 "2022-12-19T18:39:48Z")

</div>

I am working with large arrays, and repeatedly resort to calling GC.gc() manually in cases like this: A = load\_large\_array(); do\_stuff\_with\_large\_array!(A) save\_results(A) A = nothing GC.gc() A = load\_another\_large\_arr…

---

## [Makie recipe for creating a scatter plot with points colored by value](https://discourse.julialang.org/t/makie-recipe-for-creating-a-scatter-plot-with-points-colored-by-value/91754)

<div class="topic-metadata">

**Author:** [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)\
**Replies:** 6\
**Last updated:** [December 19, 2022, 6:15pm UTC](https://discourse.julialang.org/t/makie-recipe-for-creating-a-scatter-plot-with-points-colored-by-value/91754 "2022-12-19T18:15:04Z")

</div>

Does anyone have a simple example of how to make a scatter plot using Makie.jl where the points are colored by value? The same questions was posed more generally here: But I’m looking for a Makie specific solution.

---

## [Necro-post prevention](https://discourse.julialang.org/t/necro-post-prevention/91853)

<div class="topic-metadata">

**Author:** [@devel-chm](https://discourse.julialang.org/u/devel-chm)\
**Replies:** 3\
**Last updated:** [December 19, 2022, 5:37pm UTC](https://discourse.julialang.org/t/necro-post-prevention/91853 "2022-12-19T17:37:30Z")

</div>

I consistently see posts added to threads that can be 6-months to years old. It seems to me that the best way to pick up and out-of-date/old thread would be to start a new thread with a link to the old discussion fol…

---

## [Julia not finding it's own artifacts](https://discourse.julialang.org/t/julia-not-finding-its-own-artifacts/91863)

<div class="topic-metadata">

**Author:** [@ndusek](https://discourse.julialang.org/u/ndusek)\
**Replies:** 3\
**Last updated:** [December 19, 2022, 5:29pm UTC](https://discourse.julialang.org/t/julia-not-finding-its-own-artifacts/91863 "2022-12-19T17:29:16Z")

</div>

I am trying to run Circuitscape using Julia (v1.7.2) via the JuliaCall package in R and am getting the following error (as reported from within R): Error: Error happens in Julia. InitError: could not load library "/home…

---

## [Should I use broadcasting or write the function directly for higher dimensional input?](https://discourse.julialang.org/t/should-i-use-broadcasting-or-write-the-function-directly-for-higher-dimensional-input/91861)

<div class="topic-metadata">

**Author:** [@Lighfe](https://discourse.julialang.org/u/Lighfe)\
**Replies:** 2\
**Last updated:** [December 19, 2022, 4:25pm UTC](https://discourse.julialang.org/t/should-i-use-broadcasting-or-write-the-function-directly-for-higher-dimensional-input/91861 "2022-12-19T16:25:06Z")

</div>

Let’s say I have a 1000×3 Matrix{Int64}. I want to loop over each row and execute some function that doesn’t return anything. My intuitive approach was to write a function that takes a 3-element vector and later broadca…

---

## [A comparison operator (\>, \<, ==...) as a function argument?](https://discourse.julialang.org/t/a-comparison-operator-as-a-function-argument/91858)

<div class="topic-metadata">

**Author:** [@Fred](https://discourse.julialang.org/u/Fred)\
**Replies:** 3\
**Last updated:** [December 19, 2022, 3:29pm UTC](https://discourse.julialang.org/t/a-comparison-operator-as-a-function-argument/91858 "2022-12-19T15:29:40Z")

</div>

Hi ! Is there a way to use a a comparison operator (\>, \<, ==…) as a function argument ? for example f(2,5,\>=) function compare(x,y, operator)::Bool return x operator y # 2\>=5, return false Thanks !

---

## [Is there a Julia package similar to the R package htmlwidgets?](https://discourse.julialang.org/t/is-there-a-julia-package-similar-to-the-r-package-htmlwidgets/91857)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 0\
**Last updated:** [December 19, 2022, 2:19pm UTC](https://discourse.julialang.org/t/is-there-a-julia-package-similar-to-the-r-package-htmlwidgets/91857 "2022-12-19T14:19:16Z")

</div>

Hello, The R package htmlwidgets allows to pass some R objects to a JavaScript file (with the help of JSON), and then this JavaScript file creates a HTML widget which is then rendered in a HTML file. It is often used to…

---

## [For CalculusWithJulia, is there Riemann' Midpoint method?](https://discourse.julialang.org/t/for-calculuswithjulia-is-there-riemann-midpoint-method/91001)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 10\
**Last updated:** [December 19, 2022, 1:47pm UTC](https://discourse.julialang.org/t/for-calculuswithjulia-is-there-riemann-midpoint-method/91001 "2022-12-19T13:47:34Z")

</div>

I read this: https://docs.juliahub.com/CalculusWithJulia/AZHbv/0.0.5/integrals/area.html and I want to calculate Riemann sum for several functions, comparing the Left Right Midpoint methods. Is the midpoint method a…

---

## [Symbol(String($symbol)) in quotes](https://discourse.julialang.org/t/symbol-string-symbol-in-quotes/91855)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 1\
**Last updated:** [December 19, 2022, 1:36pm UTC](https://discourse.julialang.org/t/symbol-string-symbol-in-quotes/91855 "2022-12-19T13:36:15Z")

</div>

Hi all :slight\_smile: I need the following: quote :symbol end is there a better way for doing this: julia\> symbol = :symbol :symbol julia\> quote Symbol(String($symbol)) end quote Symbol(St…

---

## [Is there a Package that can Help Us Plot a 3-Dimensional Object or just 2-D object from a JPG input?](https://discourse.julialang.org/t/is-there-a-package-that-can-help-us-plot-a-3-dimensional-object-or-just-2-d-object-from-a-jpg-input/91852)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 0\
**Last updated:** [December 19, 2022, 1:20pm UTC](https://discourse.julialang.org/t/is-there-a-package-that-can-help-us-plot-a-3-dimensional-object-or-just-2-d-object-from-a-jpg-input/91852 "2022-12-19T13:20:28Z")

</div>

Hi all, I actually want to create a plot of this Lightning’ weapon from FF XIII. With Plots, PyPlot, GLMakie, whatever possible. Thus, with the plot if possible the 3-dimensional one (integralling the 2-D input or an…

---

## [Convert serialized objects to a newer package version](https://discourse.julialang.org/t/convert-serialized-objects-to-a-newer-package-version/91847)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 2\
**Last updated:** [December 19, 2022, 1:19pm UTC](https://discourse.julialang.org/t/convert-serialized-objects-to-a-newer-package-version/91847 "2022-12-19T13:19:15Z")

</div>

I have a file with serialized structs that were slightly changed between package versions: type parameter change & field rename. So, they can only be deserialized using the old package version. After deserializing, I’d …

---

## [Why can't some functions (CSV.File()) be precompiled?](https://discourse.julialang.org/t/why-cant-some-functions-csv-file-be-precompiled/91851)

<div class="topic-metadata">

**Author:** [@bertulli](https://discourse.julialang.org/u/bertulli)\
**Replies:** 0\
**Last updated:** [December 19, 2022, 1:17pm UTC](https://discourse.julialang.org/t/why-cant-some-functions-csv-file-be-precompiled/91851 "2022-12-19T13:17:48Z")

</div>

Hi all! I’m using PackageCompiler to speed up my Julia initialization time. I first run the code I usually run in a session with --trace-compile=~/Julia/trace-compilation.jl, then I create the sysimage with using Pack…

---

## [Documention around Julia build](https://discourse.julialang.org/t/documention-around-julia-build/91806)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 7\
**Last updated:** [December 19, 2022, 12:26pm UTC](https://discourse.julialang.org/t/documention-around-julia-build/91806 "2022-12-19T12:26:02Z")

</div>

Hi, I was wondering if there is documentation on how Julia is built. I am not referring on how to build Juliawhich is already done here: I am thinking more about documenting what really happens when you run “make” I …

---

## [Building Julia from source](https://discourse.julialang.org/t/building-julia-from-source/91747)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 20\
**Last updated:** [December 19, 2022, 11:02am UTC](https://discourse.julialang.org/t/building-julia-from-source/91747 "2022-12-19T11:02:42Z")

</div>

Hi, I have the following questions regarding building Julia from source: 1/ Is there a way to build a “light” version of Julia, for example without the documentation or even the REPL? If yes, how? 2/ Is there an optio…

---

## [Why does \`==\` for custom types not compare field equality by default](https://discourse.julialang.org/t/why-does-for-custom-types-not-compare-field-equality-by-default/91730)

<div class="topic-metadata">

**Author:** [@GoodDayToYouAll](https://discourse.julialang.org/u/GoodDayToYouAll)\
**Replies:** 5\
**Last updated:** [December 19, 2022, 10:52am UTC](https://discourse.julialang.org/t/why-does-for-custom-types-not-compare-field-equality-by-default/91730 "2022-12-19T10:52:51Z")

</div>

Hi everyone, so this is less of a question how this works, but more of why it is implemented that way (I am trying to get into the Julia way of thinking and sometimes language designs seem counter intuitive). So I know…

---

## [Using a (computed) function in DataFrames with multiple arguments](https://discourse.julialang.org/t/using-a-computed-function-in-dataframes-with-multiple-arguments/91833)

<div class="topic-metadata">

**Author:** [@mreichMPI-BGC](https://discourse.julialang.org/u/mreichMPI-BGC)\
**Replies:** 11\
**Last updated:** [December 19, 2022, 10:26am UTC](https://discourse.julialang.org/t/using-a-computed-function-in-dataframes-with-multiple-arguments/91833 "2022-12-19T10:26:31Z")

</div>

In Julia I can do: meanratio(x,y) = mean(x) / mean(y) function calc(fun, vbl) fun(vbl...) end julia\> x1=rand(10); x2=rand(10);calc(meanratio, (x1, x2)) 0.8271083961061552 I want fun to be flexible in term of how…

---

## [Convert struct fields and their values to DataFrames](https://discourse.julialang.org/t/convert-struct-fields-and-their-values-to-dataframes/91828)

<div class="topic-metadata">

**Author:** [@sajjad\_khan](https://discourse.julialang.org/u/sajjad_khan)\
**Replies:** 4\
**Last updated:** [December 19, 2022, 9:39am UTC](https://discourse.julialang.org/t/convert-struct-fields-and-their-values-to-dataframes/91828 "2022-12-19T09:39:22Z")

</div>

Hi, I want to convert following struct to DataFrames: struct MyStruct x::Vector{Float64} y::Vector{Float64} end I have written following function to convert MyStruct fields and their values to DataFrame: function s…

---

## [Subscripts and superscripts in VS Code | Windows 11](https://discourse.julialang.org/t/subscripts-and-superscripts-in-vs-code-windows-11/91834)

<div class="topic-metadata">

**Author:** [@Audrius-St](https://discourse.julialang.org/u/Audrius-St)\
**Replies:** 1\
**Last updated:** [December 19, 2022, 7:51am UTC](https://discourse.julialang.org/t/subscripts-and-superscripts-in-vs-code-windows-11/91834 "2022-12-19T07:51:35Z")

</div>

Hello, I am wondering if my setup is missing subscripts / superscripts. For example, I would expect \_y and \_z to be available, but this does not seem to be the case. OS: Windows 11; UTF-8 enabled Running VS Code Ve…

---

## [Is there something in Julia similar to the as-patterns in Haskell?](https://discourse.julialang.org/t/is-there-something-in-julia-similar-to-the-as-patterns-in-haskell/91785)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 10\
**Last updated:** [December 19, 2022, 8:45am UTC](https://discourse.julialang.org/t/is-there-something-in-julia-similar-to-the-as-patterns-in-haskell/91785 "2022-12-19T08:45:29Z")

</div>

Hello, In Haskell we can write an argument of a function as pair@(x,y). That means that pair is the pair with the two elements x and y. Is there something similar in Julia? For example if I have a list of pairs, I would…

[Previous page](https://discourse.julialang.org/latest.md?page=832)

[Next page](https://discourse.julialang.org/latest.md?page=834)
