# General Usage

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

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

**Page:** 314

---

## [How to add registry with LocalRegistry](https://discourse.julialang.org/t/how-to-add-registry-with-localregistry/96379)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 5\
**Last updated:** [March 21, 2023, 10:06am UTC](https://discourse.julialang.org/t/how-to-add-registry-with-localregistry/96379 "2023-03-21T10:06:43Z")

</div>

Hi all, I am trying to setup a local registry for packages that are on a private server with git. I have completed the following steps: I installed LocalRegistry I created a local registry with create\_registry, which …

---

## [Clarification on extensions introduced in Julia v1.9 vs Requires.jl](https://discourse.julialang.org/t/clarification-on-extensions-introduced-in-julia-v1-9-vs-requires-jl/96371)

<div class="topic-metadata">

**Author:** [@Norman](https://discourse.julialang.org/u/Norman)\
**Replies:** 1\
**Last updated:** [March 21, 2023, 7:14am UTC](https://discourse.julialang.org/t/clarification-on-extensions-introduced-in-julia-v1-9-vs-requires-jl/96371 "2023-03-21T07:14:38Z")

</div>

The introduction in the Pkg documentation makes me think that extensions is just like a built-in implementation of @require. But, after some initial attempt, I realized that they are not substitutes. To be concrete, sup…

---

## [Create a GeometryBasics convex polygon from an unordered set of points](https://discourse.julialang.org/t/create-a-geometrybasics-convex-polygon-from-an-unordered-set-of-points/96349)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 1\
**Last updated:** [March 20, 2023, 9:53pm UTC](https://discourse.julialang.org/t/create-a-geometrybasics-convex-polygon-from-an-unordered-set-of-points/96349 "2023-03-20T21:53:47Z")

</div>

I have a set of four 2d points and want to create a quadrilateral. Currently, I manually order the input points to ensure it is convex. Is there a function in GeometryBasiscs that crates a convex polygon from an unordere…

---

## [Vector-valued function in multidimensional list comprehension (Differentiable code)](https://discourse.julialang.org/t/vector-valued-function-in-multidimensional-list-comprehension-differentiable-code/68772)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 17\
**Last updated:** [March 21, 2023, 12:57am UTC](https://discourse.julialang.org/t/vector-valued-function-in-multidimensional-list-comprehension-differentiable-code/68772 "2023-03-21T00:57:21Z")

</div>

I’ve been using Julia for the first time for a project, and I’ve been running into issues with using list comprehensions to make multidimensional arrays when I have a vector-valued function. As a toy example, I could hav…

---

## [Orders of magnitude runtime difference in row-wise norm](https://discourse.julialang.org/t/orders-of-magnitude-runtime-difference-in-row-wise-norm/96363)

<div class="topic-metadata">

**Author:** [@Benq](https://discourse.julialang.org/u/Benq)\
**Replies:** 5\
**Last updated:** [March 21, 2023, 12:39am UTC](https://discourse.julialang.org/t/orders-of-magnitude-runtime-difference-in-row-wise-norm/96363 "2023-03-21T00:39:51Z")

</div>

I’m trying to divide every row of a matrix by its norm using the approach suggested by this comment. However, I’m finding that two functionally equivalent implementations are resulting in more than 100x difference in run…

---

## [DataFrames does not care about iocontext\[:displaysize\]?](https://discourse.julialang.org/t/dataframes-does-not-care-about-iocontext-displaysize/96358)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 1\
**Last updated:** [March 20, 2023, 9:34pm UTC](https://discourse.julialang.org/t/dataframes-does-not-care-about-iocontext-displaysize/96358 "2023-03-20T21:34:02Z")

</div>

I’m just trying to get a DataFrame to not trunctate: Suppose I have a huge monitor that can easily display statp::DataFrame: Base.active\_repl.options.iocontext\[:displaysize\] = (100, 6000) Try every REPL command: juli…

---

## [Vector of missing and float](https://discourse.julialang.org/t/vector-of-missing-and-float/96311)

<div class="topic-metadata">

**Author:** [@ejlongman](https://discourse.julialang.org/u/ejlongman)\
**Replies:** 10\
**Last updated:** [March 20, 2023, 8:56pm UTC](https://discourse.julialang.org/t/vector-of-missing-and-float/96311 "2023-03-20T20:56:19Z")

</div>

Hello, I dropped missing values from a dataframe and then turned a column into a vector. The vector does not have missing values, but it has type: 7554-element Vector{Union{Missing, Float64}}: This prevents me from us…

---

## [What next after SnoopCompile?](https://discourse.julialang.org/t/what-next-after-snoopcompile/96320)

<div class="topic-metadata">

**Author:** [@Jack\_Coughlin](https://discourse.julialang.org/u/Jack_Coughlin)\
**Replies:** 7\
**Last updated:** [March 20, 2023, 6:24pm UTC](https://discourse.julialang.org/t/what-next-after-snoopcompile/96320 "2023-03-20T18:24:15Z")

</div>

I’m working on reducing TTFX for my project using SnoopCompile.jl. I have eliminated all relevant invalidations according to precompile\_blockers @snoopi\_deep reports the following for my workload: julia\> tinf Inferenc…

---

## [Get Symbolics.simplify to work a little bit harder](https://discourse.julialang.org/t/get-symbolics-simplify-to-work-a-little-bit-harder/96353)

<div class="topic-metadata">

**Author:** [@moble](https://discourse.julialang.org/u/moble)\
**Replies:** 0\
**Last updated:** [March 20, 2023, 3:57pm UTC](https://discourse.julialang.org/t/get-symbolics-simplify-to-work-a-little-bit-harder/96353 "2023-03-20T15:57:12Z")

</div>

I’m working with some fairly long expressions, where the structure of each term is reasonably simple, but every term has the same three variables, and then a smattering of one or two other variables, and maybe an Int or …

---

## [Is it possible to have the same module imported twice with slightly different behaviour?](https://discourse.julialang.org/t/is-it-possible-to-have-the-same-module-imported-twice-with-slightly-different-behaviour/96344)

<div class="topic-metadata">

**Author:** [@jt1](https://discourse.julialang.org/u/jt1)\
**Replies:** 1\
**Last updated:** [March 20, 2023, 2:41pm UTC](https://discourse.julialang.org/t/is-it-possible-to-have-the-same-module-imported-twice-with-slightly-different-behaviour/96344 "2023-03-20T14:41:57Z")

</div>

Say I want to overwrite the behaviour of a Module (eg. the rank function in LinearAlgebra always returns 0 (this is a fictional problem)), but I don’t want to brake other modules that use LinearAlgebra (eg. I want rank w…

---

## [Julia, quarto and CSV fails precompile](https://discourse.julialang.org/t/julia-quarto-and-csv-fails-precompile/96300)

<div class="topic-metadata">

**Author:** [@JackStrauss](https://discourse.julialang.org/u/JackStrauss)\
**Replies:** 16\
**Last updated:** [March 20, 2023, 2:25pm UTC](https://discourse.julialang.org/t/julia-quarto-and-csv-fails-precompile/96300 "2023-03-20T14:25:35Z")

</div>

Hi All I was experimenting with quarto and ran into a strange problem with CSV. I am on the latest Julia on a M1, with all latest packages. Running Julia by itself, no problems with using CSV but with quarto precompile …

---

## [How to get backtrace of \`@async\` Task](https://discourse.julialang.org/t/how-to-get-backtrace-of-async-task/18170)

<div class="topic-metadata">

**Author:** [@standarddeviant](https://discourse.julialang.org/u/standarddeviant)\
**Replies:** 6\
**Last updated:** [February 2, 2023, 9:43am UTC](https://discourse.julialang.org/t/how-to-get-backtrace-of-async-task/18170 "2023-02-02T09:43:41Z")

</div>

I’m unsure how to get the thrown error or backtrace of an asynchronous Task. Here’s an example script: # silent\_test\_all\_in\_one.jl function do\_some\_work(increase::Real) a = 0.0 start\_time = time() while ti…

---

## [Displaying Rationals](https://discourse.julialang.org/t/displaying-rationals/9475)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 32\
**Last updated:** [March 20, 2023, 9:44am UTC](https://discourse.julialang.org/t/displaying-rationals/9475 "2023-03-20T09:44:10Z")

</div>

I have a small complaint about julia. I use all the time matrices of Rationals, like \> 10×10 Array{Rational{Int64},2}: \> 2//1 0//1 0//1 0//1 0//1 0//1 0//1 0//1 0//1 0//1 \> 0//1 2//1 0//1 0//1 0/…

---

## [Threads question](https://discourse.julialang.org/t/threads-question/96326)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 4\
**Last updated:** [March 20, 2023, 9:19am UTC](https://discourse.julialang.org/t/threads-question/96326 "2023-03-20T09:19:23Z")

</div>

Running Julia on 1 thread on a 4 Core Windows 10 PC, the line rand(10\_000,10\_000)^2 Uses 100% of the CPUs. From this, I assume that unless you are very advanced, there’s no benefit to writing multi-threaded code as…

---

## [Specifying output container type based on input container](https://discourse.julialang.org/t/specifying-output-container-type-based-on-input-container/96197)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 14\
**Last updated:** [March 20, 2023, 5:44am UTC](https://discourse.julialang.org/t/specifying-output-container-type-based-on-input-container/96197 "2023-03-20T05:44:46Z")

</div>

I have a question about generic functions which is probably something simple I am missing. Let’s say I have a function f defined as follows: function f(x::A)::AbstractArray{T, N-1} where {T\<:Real, N, A\<:AbstractArray{T,…

---

## [Check equality of two NamedTuples with order of the fields ignored](https://discourse.julialang.org/t/check-equality-of-two-namedtuples-with-order-of-the-fields-ignored/53177)

<div class="topic-metadata">

**Author:** [@Norman](https://discourse.julialang.org/u/Norman)\
**Replies:** 6\
**Last updated:** [March 20, 2023, 5:34am UTC](https://discourse.julialang.org/t/check-equality-of-two-namedtuples-with-order-of-the-fields-ignored/53177 "2023-03-20T05:34:53Z")

</div>

Suppose I have the following two instances of NamedTuple. julia\> a = (x=1, y=2) (x = 1, y = 2) julia\> b = (y=2, x=1) (y = 2, x = 1) julia\> a == b false What would be the best approach to test whether a and b contain …

---

## [Unstable Julia Language Server? (was Quarto VSCode and unicode characters?)](https://discourse.julialang.org/t/unstable-julia-language-server-was-quarto-vscode-and-unicode-characters/90317)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 2\
**Last updated:** [March 20, 2023, 12:10am UTC](https://discourse.julialang.org/t/unstable-julia-language-server-was-quarto-vscode-and-unicode-characters/90317 "2023-03-20T00:10:07Z")

</div>

I’m writing a Quarto document as part of a series of tutorials I’m writing, and will announce in a few weeks. My Quarto document explains the basic ideas of differential calculus using nonstandard analysis. I’ve got a c…

---

## [How exactly "in" and "not in" works in tuples?](https://discourse.julialang.org/t/how-exactly-in-and-not-in-works-in-tuples/96305)

<div class="topic-metadata">

**Author:** [@Optimization](https://discourse.julialang.org/u/Optimization)\
**Replies:** 2\
**Last updated:** [March 19, 2023, 4:38pm UTC](https://discourse.julialang.org/t/how-exactly-in-and-not-in-works-in-tuples/96305 "2023-03-19T16:38:28Z")

</div>

Hi all, I’m trying to check some belonging conditions over some tuples. One set of tuples are numeric like (2,8) and the others are combined with text (2,8,'e','f'). I want to check for every numeric pair their existan…

---

## [Julia Precompile error](https://discourse.julialang.org/t/julia-precompile-error/96308)

<div class="topic-metadata">

**Author:** [@Amritesh\_Soni](https://discourse.julialang.org/u/Amritesh_Soni)\
**Replies:** 1\
**Last updated:** [March 19, 2023, 3:01pm UTC](https://discourse.julialang.org/t/julia-precompile-error/96308 "2023-03-19T15:01:25Z")

</div>

Trying to run a set of commands but getting this error for DifferentialEquations package. What do I do? Thanks in advance Failed to precompile DifferentialEquations \[0c46a032-eb83-5123-abaf-570d42b7fbaa\] to C:\\Users\\amr…

---

## [MethodError: objects of type String are not callable](https://discourse.julialang.org/t/methoderror-objects-of-type-string-are-not-callable/96302)

<div class="topic-metadata">

**Author:** [@Amit\_pratap\_singh](https://discourse.julialang.org/u/Amit_pratap_singh)\
**Replies:** 0\
**Last updated:** [March 19, 2023, 10:32am UTC](https://discourse.julialang.org/t/methoderror-objects-of-type-string-are-not-callable/96302 "2023-03-19T10:32:28Z")

</div>

\#first plot the data plot(numpirates, globaltemperatures, legend=false) scatter!(numpirates, globaltemperatures, legend=false) #this reverses x axis we can see how the temperature changes xflip!() title!(“Global tem…

---

## [Group by criteria](https://discourse.julialang.org/t/group-by-criteria/96246)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 17\
**Last updated:** [March 19, 2023, 8:10am UTC](https://discourse.julialang.org/t/group-by-criteria/96246 "2023-03-19T08:10:38Z")

</div>

How would you solve the following problem? Given the following array of strings we want to find all groups whose group leader starts with “AT”. All the elements that are found before the first one starting with “AT” fo…

---

## [Accessing json file from CoolProp.jl c interface](https://discourse.julialang.org/t/accessing-json-file-from-coolprop-jl-c-interface/96292)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 1\
**Last updated:** [March 19, 2023, 5:41am UTC](https://discourse.julialang.org/t/accessing-json-file-from-coolprop-jl-c-interface/96292 "2023-03-19T05:41:19Z")

</div>

hi. i’m trying to make a port of some CoolProp functions in julia. The idea is to use the same CoolProp JSON files that have component properties, but read those in the julia side. One problem i see is that the current C…

---

## [Tracking allocations lost its way?](https://discourse.julialang.org/t/tracking-allocations-lost-its-way/96280)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 5\
**Last updated:** [March 19, 2023, 1:43am UTC](https://discourse.julialang.org/t/tracking-allocations-lost-its-way/96280 "2023-03-19T01:43:53Z")

</div>

I get a @time report: 92.505464 seconds (20.12 M allocations: 2.683 GiB, 0.29% gc time) . When I look at the code with --track-allocations=all, the following (abbreviated) file is obtained. All lines with any allocati…

---

## [Why does \`strip\` function return a SubString instead of a String? Can one return a String type from \`strip\`?](https://discourse.julialang.org/t/why-does-strip-function-return-a-substring-instead-of-a-string-can-one-return-a-string-type-from-strip/96282)

<div class="topic-metadata">

**Author:** [@curious](https://discourse.julialang.org/u/curious)\
**Replies:** 5\
**Last updated:** [March 18, 2023, 11:19pm UTC](https://discourse.julialang.org/t/why-does-strip-function-return-a-substring-instead-of-a-string-can-one-return-a-string-type-from-strip/96282 "2023-03-18T23:19:10Z")

</div>

I was experiencing a strange error in my code (strange because of my fault of not reading the return type of the strip function). strip returns a SubString instead of a String type and this was throwing error when using B…

---

## [NeuralODE Loss function constrain optimization](https://discourse.julialang.org/t/neuralode-loss-function-constrain-optimization/94883)

<div class="topic-metadata">

**Author:** [@Antonino\_Gandolfo](https://discourse.julialang.org/u/Antonino_Gandolfo)\
**Replies:** 19\
**Last updated:** [March 18, 2023, 1:26pm UTC](https://discourse.julialang.org/t/neuralode-loss-function-constrain-optimization/94883 "2023-03-18T13:26:01Z")

</div>

Hello everybody I’m searchig to train my NeuraODE to create a surrogate model of a mechanical device. Could you help me to figure out how can I constrain the Loss function in order to take in consideration the non linea…

---

## [Need for speed: looping over subdataframes to construct lags](https://discourse.julialang.org/t/need-for-speed-looping-over-subdataframes-to-construct-lags/96258)

<div class="topic-metadata">

**Author:** [@moshi](https://discourse.julialang.org/u/moshi)\
**Replies:** 6\
**Last updated:** [March 18, 2023, 11:25am UTC](https://discourse.julialang.org/t/need-for-speed-looping-over-subdataframes-to-construct-lags/96258 "2023-03-18T11:25:51Z")

</div>

I have a very large DataFrame with columns j, t, b, b\_t. I am creating a new column s by df.s = df.b and then I am making changes to the values in s depending on certain conditions of whether b\_t and t differ, for each…

---

## [Should closures be avoided?](https://discourse.julialang.org/t/should-closures-be-avoided/96073)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 15\
**Last updated:** [March 18, 2023, 10:52am UTC](https://discourse.julialang.org/t/should-closures-be-avoided/96073 "2023-03-18T10:52:32Z")

</div>

There seem to be several performance-related issues with closures (boxed variables) that can be tricky to understand when they will arise. Should closures be avoided as a rule? What is an alternative design pattern? They…

---

## [Flux.jl changes in api](https://discourse.julialang.org/t/flux-jl-changes-in-api/96263)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 2\
**Last updated:** [March 17, 2023, 10:47pm UTC](https://discourse.julialang.org/t/flux-jl-changes-in-api/96263 "2023-03-17T22:47:26Z")

</div>

Hello, good evening. I had an example of xor problem solving in Flux.jl, and recently I noticed that it is not working anymore because of library updates. I tryed to migrate the example but the loss is not converging to…

---

## [1.9-rc1 and threads](https://discourse.julialang.org/t/1-9-rc1-and-threads/96119)

<div class="topic-metadata">

**Author:** [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Replies:** 3\
**Last updated:** [March 17, 2023, 7:57pm UTC](https://discourse.julialang.org/t/1-9-rc1-and-threads/96119 "2023-03-17T19:57:59Z")

</div>

On Win 64, I have noticed that 1.9-rc1 Threads.@threads fails to keep my CPU busy (usage goes down to what you expect from single-threaded mode) in long computations. Clearly different from 1.8.5. Has anyone else notice…

---

## [Compiler optimization inside MetaProgramming? (precompile Expression)](https://discourse.julialang.org/t/compiler-optimization-inside-metaprogramming-precompile-expression/96256)

<div class="topic-metadata">

**Author:** [@FireCrumb](https://discourse.julialang.org/u/FireCrumb)\
**Replies:** 5\
**Last updated:** [March 17, 2023, 7:00pm UTC](https://discourse.julialang.org/t/compiler-optimization-inside-metaprogramming-precompile-expression/96256 "2023-03-17T19:00:12Z")

</div>

Hi, I have a function expression (as input), and it is greatly simplified by the time it becomes LLVM code. How can I get the optimized simplified version back as an Expression? Origin expression: ex = :( function…

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

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