# General Usage

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

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

**Page:** 347

---

## [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…

---

## [CircleFit testing fails for v1.9.0-beta2 on github, but works locally](https://discourse.julialang.org/t/circlefit-testing-fails-for-v1-9-0-beta2-on-github-but-works-locally/92640)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 9\
**Last updated:** [January 7, 2023, 9:52pm UTC](https://discourse.julialang.org/t/circlefit-testing-fails-for-v1-9-0-beta2-on-github-but-works-locally/92640 "2023-01-07T21:52:43Z")

</div>

I recently tested my package for fitting circles locally with v1.9.0-beta2 and the tests passed. Now I added the version to the github workflow but version v1.9.0-beta2 fails the tests. Does anyone have an idea how to f…

---

## [Specifying return Activity in Enzyme](https://discourse.julialang.org/t/specifying-return-activity-in-enzyme/92641)

<div class="topic-metadata">

**Author:** [@RS-Coop](https://discourse.julialang.org/u/RS-Coop)\
**Replies:** 0\
**Last updated:** [January 7, 2023, 4:46pm UTC](https://discourse.julialang.org/t/specifying-return-activity-in-enzyme/92641 "2023-01-07T16:46:50Z")

</div>

Consider a function f:\\mathbb{R}^n\\to\\mathbb{R}. Following along from the Enzyme AutoDiff API documentation example on computing the Hessian via FoR mixed mode AD, I have written the following julia function to compute H…

---

## [Defining an Anonymous Function in a Macro](https://discourse.julialang.org/t/defining-an-anonymous-function-in-a-macro/92625)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 2\
**Last updated:** [January 7, 2023, 5:22am UTC](https://discourse.julialang.org/t/defining-an-anonymous-function-in-a-macro/92625 "2023-01-07T05:22:07Z")

</div>

I’m working on a macro that defines several functions that all have the same parameters. However, upon evaluation, the keyword arguments of the functions are getting prefixed with Main. as though they are variables that …

---

## [Find zero of a nonlinear equation using Julia](https://discourse.julialang.org/t/find-zero-of-a-nonlinear-equation-using-julia/61974)

<div class="topic-metadata">

**Author:** [@maoc](https://discourse.julialang.org/u/maoc)\
**Replies:** 14\
**Last updated:** [January 7, 2023, 12:47am UTC](https://discourse.julialang.org/t/find-zero-of-a-nonlinear-equation-using-julia/61974 "2023-01-07T00:47:16Z")

</div>

After a process usyng the SymPy in Julia, I generated a system of nonlinear equations. For the sake of simplicity, I am going to put an approximation here for the case of just a non-linear equation. What I get is somethi…

---

## [Extracting model params/equivalent of broom tidiers in julia?](https://discourse.julialang.org/t/extracting-model-params-equivalent-of-broom-tidiers-in-julia/92560)

<div class="topic-metadata">

**Author:** [@jonfoong](https://discourse.julialang.org/u/jonfoong)\
**Replies:** 1\
**Last updated:** [January 6, 2023, 8:13pm UTC](https://discourse.julialang.org/t/extracting-model-params-equivalent-of-broom-tidiers-in-julia/92560 "2023-01-06T20:13:14Z")

</div>

Hi I am new to Julia and am using it to run mixed models since it’s so much faster. However I’ve no experience with Julia and it feels like online support is scarce. I would like help with extracting model parameters but…

---

## [Guideline on verbose in module (design pattern?)](https://discourse.julialang.org/t/guideline-on-verbose-in-module-design-pattern/72659)

<div class="topic-metadata">

**Author:** [@Thomas](https://discourse.julialang.org/u/Thomas)\
**Replies:** 0\
**Last updated:** [December 6, 2021, 3:45pm UTC](https://discourse.julialang.org/t/guideline-on-verbose-in-module-design-pattern/72659 "2021-12-06T15:45:39Z")

</div>

So far I use a kwarg verbose (0,1,2,inf) to allow diagnostic information during my computation: verbose && println("message here") A more systematic way to handle this is using the Logging module and @info, @warn, @err…

---

## [Keeping well-defined mathematical functions orthogonal to a project structs design](https://discourse.julialang.org/t/keeping-well-defined-mathematical-functions-orthogonal-to-a-project-structs-design/92601)

<div class="topic-metadata">

**Author:** [@dalbandea](https://discourse.julialang.org/u/dalbandea)\
**Replies:** 3\
**Last updated:** [January 6, 2023, 5:51pm UTC](https://discourse.julialang.org/t/keeping-well-defined-mathematical-functions-orthogonal-to-a-project-structs-design/92601 "2023-01-06T17:51:09Z")

</div>

I have a doubt regarding a design pattern. To expose it I’m going to refer to IterativeSolvers.jl’s Conjugate Gradient algorithm. For the end user, they supply the function cg(A, b; kwargs...), which solves the equation…

---

## [I Have PlotlyJS Codes to Plot Inverted Cone and Cylinder, How to Combine them into One?](https://discourse.julialang.org/t/i-have-plotlyjs-codes-to-plot-inverted-cone-and-cylinder-how-to-combine-them-into-one/92589)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 3\
**Last updated:** [January 6, 2023, 3:31pm UTC](https://discourse.julialang.org/t/i-have-plotlyjs-codes-to-plot-inverted-cone-and-cylinder-how-to-combine-them-into-one/92589 "2023-01-06T15:31:14Z")

</div>

Hi all, I have code to plot each of the cylinder and cone from this discourse. How to combine them into one, so the inverted cone will be inside the cylinder? The color needs to be adjusted as well, can we make a gri…

---

## [What is the recommended way to debug \`using\` latency issues?](https://discourse.julialang.org/t/what-is-the-recommended-way-to-debug-using-latency-issues/92561)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 3\
**Last updated:** [January 6, 2023, 2:19pm UTC](https://discourse.julialang.org/t/what-is-the-recommended-way-to-debug-using-latency-issues/92561 "2023-01-06T14:19:01Z")

</div>

I wonder if anybody has good recommendations for debugging the latency of using statements. The new @time\_imports already helps quite a lot but I haven’t found a workflow I really like. Here is an example of what I mean: …

---

## [The mutation function changes all the values in a dictionary](https://discourse.julialang.org/t/the-mutation-function-changes-all-the-values-in-a-dictionary/92602)

<div class="topic-metadata">

**Author:** [@fordonez](https://discourse.julialang.org/u/fordonez)\
**Replies:** 3\
**Last updated:** [January 6, 2023, 1:50pm UTC](https://discourse.julialang.org/t/the-mutation-function-changes-all-the-values-in-a-dictionary/92602 "2023-01-06T13:50:46Z")

</div>

Hi everyone. I am using a mutate function that changes the value of an array and then I save the array to a dictionary. The problem is that the function changes all the values saved in the dictionary. a = Dict() b = o…

---

## [Counting the number of paragraphs ("p") between containers ("div")](https://discourse.julialang.org/t/counting-the-number-of-paragraphs-p-between-containers-div/92576)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 22\
**Last updated:** [January 6, 2023, 1:47pm UTC](https://discourse.julialang.org/t/counting-the-number-of-paragraphs-p-between-containers-div/92576 "2023-01-06T13:47:11Z")

</div>

I am trying to parse the content of a website and part of the logic to get the right information is counting the number of times a paragraph of text (represented by the element “p”) occurs between a particular container …

---

## [Would a search directly calling memchr have disadvantages?](https://discourse.julialang.org/t/would-a-search-directly-calling-memchr-have-disadvantages/92592)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 5\
**Last updated:** [January 6, 2023, 12:07pm UTC](https://discourse.julialang.org/t/would-a-search-directly-calling-memchr-have-disadvantages/92592 "2023-01-06T12:07:38Z")

</div>

Just looking at the ScanByte package by @jakobnissen (thanks for giving me ideas! :slight\_smile: ). It’s written to find the first occurrence of a given byte in a byte array. Just as a test I thought I can also call memc…

---

## [AbstractPlotting Example Won't Work After I Change it to Makie](https://discourse.julialang.org/t/abstractplotting-example-wont-work-after-i-change-it-to-makie/92593)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 9\
**Last updated:** [January 6, 2023, 11:36am UTC](https://discourse.julialang.org/t/abstractplotting-example-wont-work-after-i-change-it-to-makie/92593 "2023-01-06T11:36:09Z")

</div>

Hi all, I saw this link: https://juliaplots.org/MakieReferenceImages/gallery//streamplot\_animation/index.html I want to create the animation, but it said that “everything from AbstractPlotting is moved to Makie” thus …

---

## [Why are the inferred types different between collect and comprehension?](https://discourse.julialang.org/t/why-are-the-inferred-types-different-between-collect-and-comprehension/92590)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [January 6, 2023, 9:23am UTC](https://discourse.julialang.org/t/why-are-the-inferred-types-different-between-collect-and-comprehension/92590 "2023-01-06T09:23:10Z")

</div>

julia\> using ApproxFun julia\> A = Derivative(); B = Multiplication(Fun()); julia\> ops = (A, B); julia\> \[ops...\] |\> eltype Operator{Float64} julia\> collect(ops) |\> eltype Operator Shouldn’t these lead to the same res…

---

## [Precompilation of complex code does not make time to first model step faster](https://discourse.julialang.org/t/precompilation-of-complex-code-does-not-make-time-to-first-model-step-faster/92453)

<div class="topic-metadata">

**Author:** [@Chiil](https://discourse.julialang.org/u/Chiil)\
**Replies:** 8\
**Last updated:** [January 5, 2023, 11:29am UTC](https://discourse.julialang.org/t/precompilation-of-complex-code-does-not-make-time-to-first-model-step-faster/92453 "2023-01-05T11:29:23Z")

</div>

I have ported the dynamical core of our C++ CFD code to Julia a while ago, and see now huge speedups going from 1.8 to 1.9 (170 sec to 21 sec to first model step). Inspired by many discussions on this forum, I tried to p…

---

## [Why are the colours in errorshow.jl hardcoded?](https://discourse.julialang.org/t/why-are-the-colours-in-errorshow-jl-hardcoded/92013)

<div class="topic-metadata">

**Author:** [@Euhan](https://discourse.julialang.org/u/Euhan)\
**Replies:** 4\
**Last updated:** [January 6, 2023, 6:01am UTC](https://discourse.julialang.org/t/why-are-the-colours-in-errorshow-jl-hardcoded/92013 "2023-01-06T06:01:24Z")

</div>

After having struggled with debugging on command-line (rather that jupyter that I had been using before), I realised that the trace of stack frames provides references to files and lines in the output. I had not noticed …

---

## [Meta-metaprogramming practical examples](https://discourse.julialang.org/t/meta-metaprogramming-practical-examples/92535)

<div class="topic-metadata">

**Author:** [@xlxs4](https://discourse.julialang.org/u/xlxs4)\
**Replies:** 4\
**Last updated:** [January 6, 2023, 3:23am UTC](https://discourse.julialang.org/t/meta-metaprogramming-practical-examples/92535 "2023-01-06T03:23:47Z")

</div>

From Tom Kwongs’ excellent Hands-on Design Patterns and Best Practices with Julia: It is possible to have a quoted expression that contains another quoted expression. \[…\] :( :( x = 1 ) ) |\> dump \[…\] It can be usefu…

---

## [Symbolic Legendre Polynomials](https://discourse.julialang.org/t/symbolic-legendre-polynomials/92579)

<div class="topic-metadata">

**Author:** [@elvispy](https://discourse.julialang.org/u/elvispy)\
**Replies:** 5\
**Last updated:** [January 6, 2023, 2:25am UTC](https://discourse.julialang.org/t/symbolic-legendre-polynomials/92579 "2023-01-06T02:25:08Z")

</div>

Is there an implemented version of the legendre Polynomials with symbolic variables? I have checked Symbolics.jl which points to SpecialFunctions.jl The Polynomials.jl The ClassicalOrthogonalPolyomials.jl Bu…

---

## [Computing Lyapunov Spectrum of the Lorenz Attraktor with Gram Schmidt and variational equation](https://discourse.julialang.org/t/computing-lyapunov-spectrum-of-the-lorenz-attraktor-with-gram-schmidt-and-variational-equation/92575)

<div class="topic-metadata">

**Author:** [@physician97](https://discourse.julialang.org/u/physician97)\
**Replies:** 1\
**Last updated:** [January 6, 2023, 1:21am UTC](https://discourse.julialang.org/t/computing-lyapunov-spectrum-of-the-lorenz-attraktor-with-gram-schmidt-and-variational-equation/92575 "2023-01-06T01:21:22Z")

</div>

Hello, I’m new to this forum. I’m studying physics at Cologne university and for my thesis I want to calculate Lyapunovexponents of several systems. I choosed the Lorentz Attraktor at first to program the way to calcula…

---

## [Only 1 BLAS thread in 1.9-beta2](https://discourse.julialang.org/t/only-1-blas-thread-in-1-9-beta2/92578)

<div class="topic-metadata">

**Author:** [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Replies:** 2\
**Last updated:** [January 6, 2023, 12:18am UTC](https://discourse.julialang.org/t/only-1-blas-thread-in-1-9-beta2/92578 "2023-01-06T00:18:14Z")

</div>

When I start up Julia 1.9-beta2 on my 8-core Windows machine, BLAS.get\_num\_threads() returns 1 (whether or not I start with the -t8 option. Is this intended behavior or a bug? PS D:\\peter\\Documents\> julia …

---

## [Prevent JuliaFormatter from adding whitespaces to logging arguments](https://discourse.julialang.org/t/prevent-juliaformatter-from-adding-whitespaces-to-logging-arguments/92547)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 1\
**Last updated:** [January 5, 2023, 11:38pm UTC](https://discourse.julialang.org/t/prevent-juliaformatter-from-adding-whitespaces-to-logging-arguments/92547 "2023-01-05T23:38:11Z")

</div>

Is there any setting that I can add to my .JuliaFormatter.toml that stops it from adding whitespaces to something like @error "An error occured" code="XY on Z" foo=1 bar=2 because I find the resulting @error "An error…

---

## [More examples of PlotlyJS with Buttons](https://discourse.julialang.org/t/more-examples-of-plotlyjs-with-buttons/92581)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 0\
**Last updated:** [January 5, 2023, 10:57pm UTC](https://discourse.julialang.org/t/more-examples-of-plotlyjs-with-buttons/92581 "2023-01-05T22:57:01Z")

</div>

Hi all. I was wondering if anyone has some examples for adding buttons with using PlotlyJS. The ones on the documentation are OK but do not answer any of my questions hehehe. Cheers. M.

---

## [Julia v1.9.0-beta2 is fast](https://discourse.julialang.org/t/julia-v1-9-0-beta2-is-fast/92290)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 43\
**Last updated:** [January 5, 2023, 10:20pm UTC](https://discourse.julialang.org/t/julia-v1-9-0-beta2-is-fast/92290 "2023-01-05T22:20:59Z")

</div>

First test on Ubuntu 20.04: Code, save it in bench.jl: using CSV const input=""" time,ping 1,25.7 2,31.8 """ function read\_csv(in) io = IOBuffer(in) file = CSV.File(io) close(io) file end file = read…

---

## [Running Julia from a Python script](https://discourse.julialang.org/t/running-julia-from-a-python-script/92567)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 9\
**Last updated:** [January 5, 2023, 8:07pm UTC](https://discourse.julialang.org/t/running-julia-from-a-python-script/92567 "2023-01-05T20:07:59Z")

</div>

I would like to run Julia from a Python script, such as: import os for o in \[1,2\]: cmd = f'julia -i --project="." -- tst.jl --omega={o}' os.system(cmd) However, when I execute the script, I get subshel…

---

## [Unusual empty \`UnitRange\`s while reinterpreting a vector](https://discourse.julialang.org/t/unusual-empty-unitrange-s-while-reinterpreting-a-vector/92546)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 4\
**Last updated:** [January 5, 2023, 5:25pm UTC](https://discourse.julialang.org/t/unusual-empty-unitrange-s-while-reinterpreting-a-vector/92546 "2023-01-05T17:25:51Z")

</div>

julia\> r = reinterpret(UnitRange{Int}, \[1,-1\])\[1\] 1:-1 julia\> isempty(r) true julia\> length(r) # source of errors -1 julia\> 1:-1 # the constructor changes the endpoint to ensure that the length is zero 1:0 julia\> r =…

---

## [When should you use views?](https://discourse.julialang.org/t/when-should-you-use-views/25092)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 9\
**Last updated:** [June 10, 2019, 3:51pm UTC](https://discourse.julialang.org/t/when-should-you-use-views/25092 "2019-06-10T15:51:32Z")

</div>

I was wondering in which cases you should use views to avoid copy of data. The example I had in mind is m = maximum(arr\[4:end\]) m = maximum(@view arr\[4:end\]) are those equivalent ?

---

## [Indexing using multi-indices with fixed sum](https://discourse.julialang.org/t/indexing-using-multi-indices-with-fixed-sum/92486)

<div class="topic-metadata">

**Author:** [@sbarthelme](https://discourse.julialang.org/u/sbarthelme)\
**Replies:** 8\
**Last updated:** [January 5, 2023, 4:40pm UTC](https://discourse.julialang.org/t/indexing-using-multi-indices-with-fixed-sum/92486 "2023-01-05T16:40:46Z")

</div>

I’m trying to implement de Casteljau’s algorithm in a dimension-independent way. For the curious, it’s alg. 2.13 in this reference. The algorithm is naturally expressed as a loop that involves a multi-index \\alpha: H…

---

## [Getting a REPL after executing startup code](https://discourse.julialang.org/t/getting-a-repl-after-executing-startup-code/92537)

<div class="topic-metadata">

**Author:** [@GHTaarn](https://discourse.julialang.org/u/GHTaarn)\
**Replies:** 9\
**Last updated:** [January 5, 2023, 3:35pm UTC](https://discourse.julialang.org/t/getting-a-repl-after-executing-startup-code/92537 "2023-01-05T15:35:51Z")

</div>

I would like to pass some initial code to Julia and then continue with a REPL, from bash (the Linux command line) I input echo 'println(4)' | julia -i which prints out “4” and exits. How do I get Julia to give me a REP…

---

## [Using Julia on Android with UserLAnd](https://discourse.julialang.org/t/using-julia-on-android-with-userland/58498)

<div class="topic-metadata">

**Author:** [@eliascarv](https://discourse.julialang.org/u/eliascarv)\
**Replies:** 26\
**Last updated:** [January 5, 2023, 9:23am UTC](https://discourse.julialang.org/t/using-julia-on-android-with-userland/58498 "2023-01-05T09:23:17Z")

</div>

The purpose of this post is to teach a way to use the Julia language on an Android smartphone. PS. Sorry for my English Step 1 Download these apps: UserLAnd (Linux emulator) CodeBoard (Optional. A custom keyboard for…

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

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