# General Usage

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

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

**Page:** 346

---

## [Benign data races?](https://discourse.julialang.org/t/benign-data-races/92424)

<div class="topic-metadata">

**Author:** [@pitsianis](https://discourse.julialang.org/u/pitsianis)\
**Replies:** 2\
**Last updated:** [January 10, 2023, 5:52pm UTC](https://discourse.julialang.org/t/benign-data-races/92424 "2023-01-10T17:52:59Z")

</div>

Somebody, please elaborate on the dangers alluded to by the manual in section “Data-race freedom” Julia is not memory safe in the presence of a data race. Be very careful about reading any data if another thread might …

---

## [Should a macro throw an error, or return expression that throws an error?](https://discourse.julialang.org/t/should-a-macro-throw-an-error-or-return-expression-that-throws-an-error/92720)

<div class="topic-metadata">

**Author:** [@bbejanov](https://discourse.julialang.org/u/bbejanov)\
**Replies:** 6\
**Last updated:** [January 10, 2023, 3:55pm UTC](https://discourse.julialang.org/t/should-a-macro-throw-an-error-or-return-expression-that-throws-an-error/92720 "2023-01-10T15:55:03Z")

</div>

I have a macro that in some circumstances must throw an error. Is there a recommended way of doing that? For example, I can throw the error directly from the macro, or return code that throws the error. macro A() i…

---

## [Getting the original name of structs](https://discourse.julialang.org/t/getting-the-original-name-of-structs/92757)

<div class="topic-metadata">

**Author:** [@lklein](https://discourse.julialang.org/u/lklein)\
**Replies:** 2\
**Last updated:** [January 10, 2023, 3:01pm UTC](https://discourse.julialang.org/t/getting-the-original-name-of-structs/92757 "2023-01-10T15:01:17Z")

</div>

I want to write a function get\_original\_name(::DataType) that returns the original name used when declaring a struct. Is there any way to do this? Is the original name even distinguishable from names that were added late…

---

## [Processing RTK GPS data in Julia?](https://discourse.julialang.org/t/processing-rtk-gps-data-in-julia/92753)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 0\
**Last updated:** [January 10, 2023, 11:10am UTC](https://discourse.julialang.org/t/processing-rtk-gps-data-in-julia/92753 "2023-01-10T11:10:52Z")

</div>

Hi everyone, At work we installed two gps, one fixed and a rover, in order to geo-located the optical fibre. I would like to just correct the rover position according to the fixed antenna. Is there a package for this …

---

## [Incremental compilation broken](https://discourse.julialang.org/t/incremental-compilation-broken/71944)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 7\
**Last updated:** [January 10, 2023, 2:17am UTC](https://discourse.julialang.org/t/incremental-compilation-broken/71944 "2023-01-10T02:17:39Z")

</div>

I get this: WARNING: Method definition (::Type{Float32})(Base.Irrational{:loghalf}) in module IrrationalConstants at irrationals.jl:190 overwritten in module StatsFuns on the same line (check for duplicate calls to \`inc…

---

## [GLMakie and Plots fail to precompile under Julia 1.8.4](https://discourse.julialang.org/t/glmakie-and-plots-fail-to-precompile-under-julia-1-8-4/92087)

<div class="topic-metadata">

**Author:** [@tt1234567](https://discourse.julialang.org/u/tt1234567)\
**Replies:** 56\
**Last updated:** [January 10, 2023, 10:34am UTC](https://discourse.julialang.org/t/glmakie-and-plots-fail-to-precompile-under-julia-1-8-4/92087 "2023-01-10T10:34:34Z")

</div>

Today I updated to Julia 1.8.4 but GLMakie and Plots bothe fail to precompile. The first error that occurs is similar in both cases and refers to \\libcairo-2.dll, eg: using GLMakie \[ Info: Precompiling GLMakie \[e9467ef8…

---

## [How to add Visitor Counter in a website made by Franklin.jl package?](https://discourse.julialang.org/t/how-to-add-visitor-counter-in-a-website-made-by-franklin-jl-package/92746)

<div class="topic-metadata">

**Author:** [@raman\_kumar](https://discourse.julialang.org/u/raman_kumar)\
**Replies:** 1\
**Last updated:** [January 10, 2023, 8:05am UTC](https://discourse.julialang.org/t/how-to-add-visitor-counter-in-a-website-made-by-franklin-jl-package/92746 "2023-01-10T08:05:56Z")

</div>

How to add Visitor Counter in Franklin.jl Website in footer ? What codes should be added ?

---

## [How to Convert Computation Result in Julia in pi terms?](https://discourse.julialang.org/t/how-to-convert-computation-result-in-julia-in-pi-terms/92700)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 4\
**Last updated:** [January 10, 2023, 7:22am UTC](https://discourse.julialang.org/t/how-to-convert-computation-result-in-julia-in-pi-terms/92700 "2023-01-10T07:22:35Z")

</div>

Hi all, I want to show the result of my computation in pi terms, instead of float with lots of decimal numbers. Is it possible? Here is my code: using Plots, LaTeXStrings; gr() #= # To plot a curve starting at (0, 0) …

---

## [\[CONTROL SYSTEMS\] - MIMO system through array of SISO](https://discourse.julialang.org/t/control-systems-mimo-system-through-array-of-siso/92718)

<div class="topic-metadata">

**Author:** [@pyKuga](https://discourse.julialang.org/u/pyKuga)\
**Replies:** 5\
**Last updated:** [January 10, 2023, 6:06am UTC](https://discourse.julialang.org/t/control-systems-mimo-system-through-array-of-siso/92718 "2023-01-10T06:06:39Z")

</div>

Greetings. I would like to know if it’s possible, in ControlSystems.jl, to reach an MIMO system through an array of TransferFunctions. Let’s suppose that we have a matrix H, which is related to a Y = H\*U, where Y is a …

---

## [NeuralPDE passing current grid point the the loss and activation funciton](https://discourse.julialang.org/t/neuralpde-passing-current-grid-point-the-the-loss-and-activation-funciton/92729)

<div class="topic-metadata">

**Author:** [@c\_sell](https://discourse.julialang.org/u/c_sell)\
**Replies:** 1\
**Last updated:** [January 10, 2023, 2:41am UTC](https://discourse.julialang.org/t/neuralpde-passing-current-grid-point-the-the-loss-and-activation-funciton/92729 "2023-01-10T02:41:34Z")

</div>

Hello everyone, i have three questions regarding the NeuralPDE package: is it possible to pass the current grid point to the additional cost function? I would like to take the derivative at the boundary of the domain …

---

## [MATLAB outperforms Julia (20 times faster) running this nested loop](https://discourse.julialang.org/t/matlab-outperforms-julia-20-times-faster-running-this-nested-loop/92691)

<div class="topic-metadata">

**Author:** [@SantiagoOrtiz](https://discourse.julialang.org/u/SantiagoOrtiz)\
**Replies:** 20\
**Last updated:** [January 10, 2023, 2:03am UTC](https://discourse.julialang.org/t/matlab-outperforms-julia-20-times-faster-running-this-nested-loop/92691 "2023-01-10T02:03:30Z")

</div>

Hello Fellas, I am relatively new to Julia Programming. So far, Julia’s high performance has caught my attention. However, it was disappointing to see that MATLAB performs 20 times faster in executing the following prog…

---

## [Find DataFrame row with missing values present](https://discourse.julialang.org/t/find-dataframe-row-with-missing-values-present/92728)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 8\
**Last updated:** [January 9, 2023, 11:14pm UTC](https://discourse.julialang.org/t/find-dataframe-row-with-missing-values-present/92728 "2023-01-09T23:14:47Z")

</div>

I am trying to find a row in a dataframe column that has missing values as well. As an example the following code without the missing value works: julia\> df = DataFrame(name=\["a", "b", "c"\], value=\[1,2,3\]) 3×2 DataFram…

---

## [Help implementing parallelism with readbytes!](https://discourse.julialang.org/t/help-implementing-parallelism-with-readbytes/92672)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 9\
**Last updated:** [January 9, 2023, 9:44pm UTC](https://discourse.julialang.org/t/help-implementing-parallelism-with-readbytes/92672 "2023-01-09T21:44:08Z")

</div>

I have to read some TBs of data and I want to read a 10-50GB chunk using readbytes! and process it. Since processing the chunk takes longer than reading it it would be a waste to every time wait for the readbytes!. So I…

---

## [Proper way to revise a package under local development](https://discourse.julialang.org/t/proper-way-to-revise-a-package-under-local-development/92730)

<div class="topic-metadata">

**Author:** [@Robert\_Aronoff](https://discourse.julialang.org/u/Robert_Aronoff)\
**Replies:** 1\
**Last updated:** [January 9, 2023, 9:10pm UTC](https://discourse.julialang.org/t/proper-way-to-revise-a-package-under-local-development/92730 "2023-01-09T21:10:45Z")

</div>

Am a bit turned around on appropriate methodology. I am developing a package on my local machine. Created the package structure with PkgTemplates, moved the folder out of dev to a more convenient location, went in to th…

---

## [Requires.jl and precompilation](https://discourse.julialang.org/t/requires-jl-and-precompilation/53155)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 4\
**Last updated:** [January 9, 2023, 6:25pm UTC](https://discourse.julialang.org/t/requires-jl-and-precompilation/53155 "2023-01-09T18:25:23Z")

</div>

I have a question, about Requires.jl and precompilation. Say I have the following package: module AxisArrayConversion ... \_\_init\_\_() = @require AxisArrays=... include("axis\_arrays.jl") end Then things defined in the “a…

---

## [Is there a package for calculating source code metrics?](https://discourse.julialang.org/t/is-there-a-package-for-calculating-source-code-metrics/63283)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 6\
**Last updated:** [January 9, 2023, 1:25pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-calculating-source-code-metrics/63283 "2023-01-09T13:25:41Z")

</div>

Is there something like scc that allows to determine some code metrics for Julia in an easy, fire-and-forget kind of manner? What I’d be interested in is a tool that I can point at a directory, which it will recursively …

---

## [How to stack multiple environments/projects for a reproducibility repository?](https://discourse.julialang.org/t/how-to-stack-multiple-environments-projects-for-a-reproducibility-repository/92709)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 5\
**Last updated:** [January 9, 2023, 12:36pm UTC](https://discourse.julialang.org/t/how-to-stack-multiple-environments-projects-for-a-reproducibility-repository/92709 "2023-01-09T12:36:06Z")

</div>

Is it possible - and if yes, how - to stack multiple environments for a reproducibility repository? That is, I would like to have two sets of Project.toml/Manifest.toml files living outside the DEPOT\_PATH where I am able…

---

## [Inconsistant precision?](https://discourse.julialang.org/t/inconsistant-precision/92674)

<div class="topic-metadata">

**Author:** [@dgagnon](https://discourse.julialang.org/u/dgagnon)\
**Replies:** 13\
**Last updated:** [January 9, 2023, 11:45am UTC](https://discourse.julialang.org/t/inconsistant-precision/92674 "2023-01-09T11:45:16Z")

</div>

Hello I am a bit confuse as to how precision is assigned or indicated in Julia. Consider: julia\> a = Complex(1.0, 0.0) 1.0 + 0.0im julia\> typeof(a) ComplexF64 So by default a Complex number will be built with Float6…

---

## [Using do with file handle somehow causes allocations?](https://discourse.julialang.org/t/using-do-with-file-handle-somehow-causes-allocations/92704)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 4\
**Last updated:** [January 9, 2023, 11:24am UTC](https://discourse.julialang.org/t/using-do-with-file-handle-somehow-causes-allocations/92704 "2023-01-09T11:24:28Z")

</div>

I was implementing some code regarding my prev question and came across some behavior that I can’t wrap my head around when reading chunks from a file. I put the reduced code below. Actually readbytes! doesn’t make the d…

---

## [Does unitful break the Float64 constructor?](https://discourse.julialang.org/t/does-unitful-break-the-float64-constructor/90655)

<div class="topic-metadata">

**Author:** [@Philip\_Stuckey](https://discourse.julialang.org/u/Philip_Stuckey)\
**Replies:** 2\
**Last updated:** [January 9, 2023, 10:50am UTC](https://discourse.julialang.org/t/does-unitful-break-the-float64-constructor/90655 "2023-01-09T10:50:25Z")

</div>

So I was running into an issue with a stack overflow error in JSON3, and in looking into it I discovered using Unitful: m Float64(10m) yields 10m In short, this means Float64(x) isa Float64 doesn’t always hold. Is…

---

## [FluxTraning log metrics](https://discourse.julialang.org/t/fluxtraning-log-metrics/92696)

<div class="topic-metadata">

**Author:** [@Oto\_Brzobohaty](https://discourse.julialang.org/u/Oto_Brzobohaty)\
**Replies:** 0\
**Last updated:** [January 9, 2023, 7:18am UTC](https://discourse.julialang.org/t/fluxtraning-log-metrics/92696 "2023-01-09T07:18:16Z")

</div>

Dear All, I am trying to use FluxTraing.jl to train my model: traindata, valdata = splitobs((data\_X, data\_Yr)) trainiter, valiter = DataLoader(traindata, 128), DataLoader(valdata, 256); learner = Learner(model, (tra…

---

## [Julia 1.7 and below do not have constant-type globals. Julia 1.8 implemented typed globals](https://discourse.julialang.org/t/julia-1-7-and-below-do-not-have-constant-type-globals-julia-1-8-implemented-typed-globals/1989)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 18\
**Last updated:** [January 9, 2023, 4:44am UTC](https://discourse.julialang.org/t/julia-1-7-and-below-do-not-have-constant-type-globals-julia-1-8-implemented-typed-globals/1989 "2023-01-09T04:44:18Z")

</div>

Quoting the documentation (http://docs.julialang.org/en/latest/manual/types.html#Type-Declarations-1): Currently, type declarations cannot be used in global scope, e.g. in the REPL, since Julia does not yet have consta…

---

## [Library to track performance over time](https://discourse.julialang.org/t/library-to-track-performance-over-time/92656)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 3\
**Last updated:** [January 8, 2023, 5:25pm UTC](https://discourse.julialang.org/t/library-to-track-performance-over-time/92656 "2023-01-08T17:25:15Z")

</div>

I’m often interested in tracking certain metrics’ evolution over time (eg. performance on some benchmark task, model accuracy, time-to-first-plot, testing time, etc.) Is there a library that helps with these things? I kn…

---

## [Applying a macro to a variable](https://discourse.julialang.org/t/applying-a-macro-to-a-variable/92188)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 14\
**Last updated:** [January 8, 2023, 12:38pm UTC](https://discourse.julialang.org/t/applying-a-macro-to-a-variable/92188 "2023-01-08T12:38:04Z")

</div>

I created a macro to generate a simple sequence: macro seq(n::Int64) # n is degree f = \[\] I = Vector{Int}() if n \< 0 print("The input must be equal to or bigger than zero.") else for i…

---

## [Setting up a build environment in BinaryBuilder](https://discourse.julialang.org/t/setting-up-a-build-environment-in-binarybuilder/92669)

<div class="topic-metadata">

**Author:** [@Rex\_Wang](https://discourse.julialang.org/u/Rex_Wang)\
**Replies:** 1\
**Last updated:** [January 8, 2023, 1:38pm UTC](https://discourse.julialang.org/t/setting-up-a-build-environment-in-binarybuilder/92669 "2023-01-08T13:38:44Z")

</div>

Hello! I am writing a wrapper for zbar, but the environment of the container is minimized, so I need to install some additional packages. More precisely, I need to install libmagickwand-dev as mentioned in an issue of z…

---

## [Sortperm with keyword lt = !isless throws BoundsError](https://discourse.julialang.org/t/sortperm-with-keyword-lt-isless-throws-boundserror/92648)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 9\
**Last updated:** [January 8, 2023, 12:52pm UTC](https://discourse.julialang.org/t/sortperm-with-keyword-lt-isless-throws-boundserror/92648 "2023-01-08T12:52:30Z")

</div>

Does this happen to any of you too? Do you have any idea why? sortperm(rand(1:10,10)) # ok sortperm(rand(1:10,10^2)) # ok sortperm(rand(1:10,10^7)) # ok sortperm(rand(1:10,10), lt= \>=) #ok sortperm(rand(1:10,10^2),…

---

## [How to Get Rid of Blue Line in This Plot of Reflection?](https://discourse.julialang.org/t/how-to-get-rid-of-blue-line-in-this-plot-of-reflection/92661)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [January 8, 2023, 11:59am UTC](https://discourse.julialang.org/t/how-to-get-rid-of-blue-line-in-this-plot-of-reflection/92661 "2023-01-08T11:59:17Z")

</div>

Hi all, I am filling a region between two curves from reflection. using Plots, LaTeXStrings, Plots.PlotMeasures gr() function make\_fg\_plot() g(x) = sin(x^2) + cos(2x) -1 yshift = y -\> y + 5 yreflection = …

---

## [Difficulty in using ccall](https://discourse.julialang.org/t/difficulty-in-using-ccall/92665)

<div class="topic-metadata">

**Author:** [@aditi\_dey29](https://discourse.julialang.org/u/aditi_dey29)\
**Replies:** 4\
**Last updated:** [January 8, 2023, 10:53am UTC](https://discourse.julialang.org/t/difficulty-in-using-ccall/92665 "2023-01-08T10:53:29Z")

</div>

I’m trying to wrap the LibRaw C library in Julia using Clang.jl to provide the .raw image support in Julia. The wrapping was done successfully to give me a .jl file, with julia functions calling all the respective C lang…

---

## [Any packages/tools to automatically turn natural codes for matrix operations into pre-allocated forms?](https://discourse.julialang.org/t/any-packages-tools-to-automatically-turn-natural-codes-for-matrix-operations-into-pre-allocated-forms/92657)

<div class="topic-metadata">

**Author:** [@photor](https://discourse.julialang.org/u/photor)\
**Replies:** 0\
**Last updated:** [January 8, 2023, 6:00am UTC](https://discourse.julialang.org/t/any-packages-tools-to-automatically-turn-natural-codes-for-matrix-operations-into-pre-allocated-forms/92657 "2023-01-08T06:00:15Z")

</div>

For example, turn F=D\*(A+B\*C)+E into G=copy(A) mul!(G, B, C, true, true) F=copy(E) mul!(F, D, G, true, true) Thanks.

---

## [De-stdlibification impacting usability of scripts from the command line](https://discourse.julialang.org/t/de-stdlibification-impacting-usability-of-scripts-from-the-command-line/92650)

<div class="topic-metadata">

**Author:** [@brenhinkeller](https://discourse.julialang.org/u/brenhinkeller)\
**Replies:** 3\
**Last updated:** [January 7, 2023, 11:40pm UTC](https://discourse.julialang.org/t/de-stdlibification-impacting-usability-of-scripts-from-the-command-line/92650 "2023-01-07T23:40:49Z")

</div>

Please chime in here if you have any opinions about the fact that any scripts that do using SomeStdlib (currently starting with DelimitedFiles, but lots of others including Statistics are on the chopping block too) are a…

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

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