# General Usage

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

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

**Page:** 270

---

## [Obtain jacobian used by NLsolve](https://discourse.julialang.org/t/obtain-jacobian-used-by-nlsolve/101532)

<div class="topic-metadata">

**Author:** [@PABLO\_ESTEBAN\_MONTES](https://discourse.julialang.org/u/PABLO_ESTEBAN_MONTES)\
**Replies:** 2\
**Last updated:** [July 12, 2023, 3:08pm UTC](https://discourse.julialang.org/t/obtain-jacobian-used-by-nlsolve/101532 "2023-07-12T15:08:16Z")

</div>

Hello, I have a function, let’s call it f!, whose zero I’m trying to find by using the Newton method. I know that the package NLsolve allows me to do this either giving it the jacobian, with something of the form nlsolv…

---

## [Printed output from Julia script](https://discourse.julialang.org/t/printed-output-from-julia-script/101531)

<div class="topic-metadata">

**Author:** [@adam-srut](https://discourse.julialang.org/u/adam-srut)\
**Replies:** 3\
**Last updated:** [July 12, 2023, 3:06pm UTC](https://discourse.julialang.org/t/printed-output-from-julia-script/101531 "2023-07-12T15:06:26Z")

</div>

Julia does not seem to be printing the output as it appears when redirected to a file. I have the following code in file print\_test.jl: for i in 1:10 println("iteration: $i") sleep(1) end when I run the scri…

---

## [Power minus one character](https://discourse.julialang.org/t/power-minus-one-character/101535)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 5\
**Last updated:** [July 12, 2023, 2:50pm UTC](https://discourse.julialang.org/t/power-minus-one-character/101535 "2023-07-12T14:50:41Z")

</div>

Is their a way to print W^{-1} in the console using println(“W…”)? Is their a unicode character for it?

---

## [Why do packages run continuous integration tests on Julia nightly?](https://discourse.julialang.org/t/why-do-packages-run-continuous-integration-tests-on-julia-nightly/101208)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 48\
**Last updated:** [July 12, 2023, 2:48pm UTC](https://discourse.julialang.org/t/why-do-packages-run-continuous-integration-tests-on-julia-nightly/101208 "2023-07-12T14:48:06Z")

</div>

I’m wondering why is it a standard practice to run continuous integration tests for packages on Julia nightly? It seems like there isn’t useful information to be gained from this, as oftentimes jobs fail (and seem expect…

---

## [Scalar mixed derivative using ForwardDiff](https://discourse.julialang.org/t/scalar-mixed-derivative-using-forwarddiff/101517)

<div class="topic-metadata">

**Author:** [@Vik1](https://discourse.julialang.org/u/Vik1)\
**Replies:** 2\
**Last updated:** [July 12, 2023, 12:04pm UTC](https://discourse.julialang.org/t/scalar-mixed-derivative-using-forwarddiff/101517 "2023-07-12T12:04:13Z")

</div>

I am trying to calculate the scalar second derivative wrt two different variables. To calculate the second derivative wrt one variable can be implemented as follows. f(T, v) = T^4 \* v^3 T\_i = 1.0 v\_i = 1.0 ForwardDif…

---

## [Detect argument is an iterable or a "scalar"](https://discourse.julialang.org/t/detect-argument-is-an-iterable-or-a-scalar/101436)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 25\
**Last updated:** [July 12, 2023, 10:50am UTC](https://discourse.julialang.org/t/detect-argument-is-an-iterable-or-a-scalar/101436 "2023-07-12T10:50:37Z")

</div>

I keep finding myself wanting to branch on whether an argument is a collection (iterable?) or a scalar (single value). What’s the idiomatic way? A toy example would be function func(xs) if is\_iterable(xs) # \<- How t…

---

## [How to preallocate and reuse buffers for oft-repeated computation?](https://discourse.julialang.org/t/how-to-preallocate-and-reuse-buffers-for-oft-repeated-computation/100915)

<div class="topic-metadata">

**Author:** [@philip](https://discourse.julialang.org/u/philip)\
**Replies:** 15\
**Last updated:** [July 12, 2023, 10:15am UTC](https://discourse.julialang.org/t/how-to-preallocate-and-reuse-buffers-for-oft-repeated-computation/100915 "2023-07-12T10:15:48Z")

</div>

In How to optimise Julia code: A practical guide, Jakob Nissen suggests that one way to optimize code + reduce allocations is to Preallocate buffers once and reuse them multiple times I’m wondering if someone has a wa…

---

## [Type instability when using map with closures](https://discourse.julialang.org/t/type-instability-when-using-map-with-closures/101510)

<div class="topic-metadata">

**Author:** [@ynue](https://discourse.julialang.org/u/ynue)\
**Replies:** 3\
**Last updated:** [July 12, 2023, 9:54am UTC](https://discourse.julialang.org/t/type-instability-when-using-map-with-closures/101510 "2023-07-12T09:54:37Z")

</div>

I have observed a surprising behaviour of map with closures. It seems that type instabilities appear when the function called by map overwrites a variable that belongs to an outer scope (only changing its value while kee…

---

## [Should a function be named with \`!\` if it only modifies a container type's inner values?](https://discourse.julialang.org/t/should-a-function-be-named-with-if-it-only-modifies-a-container-types-inner-values/101504)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 6\
**Last updated:** [July 12, 2023, 7:13am UTC](https://discourse.julialang.org/t/should-a-function-be-named-with-if-it-only-modifies-a-container-types-inner-values/101504 "2023-07-12T07:13:38Z")

</div>

If A is a container type like: struct A values::Vector end # Or struct A values::Tuple end where A should hold a number of custom types B: mutable struct B x end If a function called modify! can change B.…

---

## [Is there a function to make an abstractly-typed variable "more" concrete?](https://discourse.julialang.org/t/is-there-a-function-to-make-an-abstractly-typed-variable-more-concrete/101439)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 11\
**Last updated:** [July 11, 2023, 7:31pm UTC](https://discourse.julialang.org/t/is-there-a-function-to-make-an-abstractly-typed-variable-more-concrete/101439 "2023-07-11T19:31:37Z")

</div>

Is there a way to find the most concrete type representation of a variable and apply it ? For example say we got our hands to a Dict{Any, Any} julia\> d = Dict{Any,Any}("one" =\> 1, "two" =\> 2) Dict{Any, Any} with 2 entr…

---

## [Can a line continue at a '.'?](https://discourse.julialang.org/t/can-a-line-continue-at-a/101364)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 9\
**Last updated:** [July 11, 2023, 5:37pm UTC](https://discourse.julialang.org/t/can-a-line-continue-at-a/101364 "2023-07-11T17:37:40Z")

</div>

Leo Dorst & Steven De Keninck have posted a tutorial and javascript code to animate a hypercube dangling from an elastic string and I’m in the process of porting that code to Julia. The following is their code to genera…

---

## [FFTW multithreading and plans](https://discourse.julialang.org/t/fftw-multithreading-and-plans/67592)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 3\
**Last updated:** [July 11, 2023, 5:10pm UTC](https://discourse.julialang.org/t/fftw-multithreading-and-plans/67592 "2023-07-11T17:10:44Z")

</div>

Hi folks, I have a question regarding FFTW transforms, planning them, and multithreading to speed that up. In particular I lunch julia --threads 4 and once in the REPL Threads.nthreads() says I’m running with 4 thread…

---

## [How to debug memory leak / GC issue](https://discourse.julialang.org/t/how-to-debug-memory-leak-gc-issue/91936)

<div class="topic-metadata">

**Author:** [@simsurace](https://discourse.julialang.org/u/simsurace)\
**Replies:** 2\
**Last updated:** [July 11, 2023, 3:58pm UTC](https://discourse.julialang.org/t/how-to-debug-memory-leak-gc-issue/91936 "2023-07-11T15:58:31Z")

</div>

How do I debug a (supposed) memory leak or GC issue? I would like to understand which memory allocations are leaking or not removed by GC after use. Context: I’m experiencing a problem in which the memory use grows wit…

---

## [Julia and Gitlab self-hosted : a state-of-the-art?](https://discourse.julialang.org/t/julia-and-gitlab-self-hosted-a-state-of-the-art/86685)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 31\
**Last updated:** [July 11, 2023, 2:49pm UTC](https://discourse.julialang.org/t/julia-and-gitlab-self-hosted-a-state-of-the-art/86685 "2023-07-11T14:49:16Z")

</div>

I have been working since last year with julia, and I developed several packages for internal use in my company. Up to now, these developments were my own and did not require much input from other developers. I am mostly…

---

## [Unabridged printing of long strings, either in a Vector or in a DataFrame?](https://discourse.julialang.org/t/unabridged-printing-of-long-strings-either-in-a-vector-or-in-a-dataframe/101365)

<div class="topic-metadata">

**Author:** [@myersm0](https://discourse.julialang.org/u/myersm0)\
**Replies:** 6\
**Last updated:** [July 11, 2023, 12:32pm UTC](https://discourse.julialang.org/t/unabridged-printing-of-long-strings-either-in-a-vector-or-in-a-dataframe/101365 "2023-07-11T12:32:00Z")

</div>

Sometimes when I’m working with long strings, usually in the form of a Vector{String}, I’d like to be able to see them in their entirety in the REPL, even if each one gets wrapped to multiple lines. Is there an easy way …

---

## [Eliminate runtime dispatch for repeated @async calls](https://discourse.julialang.org/t/eliminate-runtime-dispatch-for-repeated-async-calls/101480)

<div class="topic-metadata">

**Author:** [@erathorn](https://discourse.julialang.org/u/erathorn)\
**Replies:** 0\
**Last updated:** [July 11, 2023, 11:54am UTC](https://discourse.julialang.org/t/eliminate-runtime-dispatch-for-repeated-async-calls/101480 "2023-07-11T11:54:05Z")

</div>

Hi all! I am writing some code where I need to call a function repeatedly, which is executed in a distributed fashion. Below you find some pseudocode to illustrate the problem. In outer\_function I followed the suggestio…

---

## [In-place cholesky decomposition fails even if the matrix is hermitian](https://discourse.julialang.org/t/in-place-cholesky-decomposition-fails-even-if-the-matrix-is-hermitian/101473)

<div class="topic-metadata">

**Author:** [@taka255](https://discourse.julialang.org/u/taka255)\
**Replies:** 2\
**Last updated:** [July 11, 2023, 8:27am UTC](https://discourse.julialang.org/t/in-place-cholesky-decomposition-fails-even-if-the-matrix-is-hermitian/101473 "2023-07-11T08:27:19Z")

</div>

Hi, I am encountering an issue with Cholesky decomposition in Julia. The code I am using is as follows: using StaticArrays, LinearAlgebra sigma = @MMatrix \[20+1.0\*cos(2.0) 3.0; 3.0 20-1.0 \*cos(2.0)\] sigma1 = @SMatrix …

---

## [Compiling Packages to Bitcode with PackageCompiler.jl](https://discourse.julialang.org/t/compiling-packages-to-bitcode-with-packagecompiler-jl/101376)

<div class="topic-metadata">

**Author:** [@ludgerpaehler](https://discourse.julialang.org/u/ludgerpaehler)\
**Replies:** 4\
**Last updated:** [July 11, 2023, 8:16am UTC](https://discourse.julialang.org/t/compiling-packages-to-bitcode-with-packagecompiler-jl/101376 "2023-07-11T08:16:38Z")

</div>

Hey everyone, Am currently trying to compile a bunch of packages with PackageCompiler.jl into bitcode, using Gen.jl as a placeholder package from hereon out. After looking at a bunch of the documentation, and the docto…

---

## [Tips on how to use let blocks to shadow local variables and avoid accidentally modifying the original variable](https://discourse.julialang.org/t/tips-on-how-to-use-let-blocks-to-shadow-local-variables-and-avoid-accidentally-modifying-the-original-variable/101467)

<div class="topic-metadata">

**Author:** [@Ethan\_Diao](https://discourse.julialang.org/u/Ethan_Diao)\
**Replies:** 9\
**Last updated:** [July 11, 2023, 7:38am UTC](https://discourse.julialang.org/t/tips-on-how-to-use-let-blocks-to-shadow-local-variables-and-avoid-accidentally-modifying-the-original-variable/101467 "2023-07-11T07:38:18Z")

</div>

I recently adapted my code using new scopes and shadowing to avoid thinking of new variable names. The simplified code is something like the following example. I originally used begin blocks instead of let blocks, so the…

---

## [Install packages on machine not connected to internet](https://discourse.julialang.org/t/install-packages-on-machine-not-connected-to-internet/100650)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 28\
**Last updated:** [July 11, 2023, 6:37am UTC](https://discourse.julialang.org/t/install-packages-on-machine-not-connected-to-internet/100650 "2023-07-11T06:37:38Z")

</div>

Hi, I work on a windows machine connected to internet. (I can’t use Docker on it) From that machine I can connect to a ubuntu server which is not connected to internet. I manage to install Julia on the server by downl…

---

## [Documenter.jl expects my local project to be registered](https://discourse.julialang.org/t/documenter-jl-expects-my-local-project-to-be-registered/101437)

<div class="topic-metadata">

**Author:** [@kapple](https://discourse.julialang.org/u/kapple)\
**Replies:** 4\
**Last updated:** [July 11, 2023, 2:35am UTC](https://discourse.julialang.org/t/documenter-jl-expects-my-local-project-to-be-registered/101437 "2023-07-11T02:35:20Z")

</div>

I have a local project, say MyProject. It has a docs directory with its own Project.toml file, which contains \[deps\] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" MyProject = "\<UUID\>" Plots = "91a5bcdd-55d7-5caf-…

---

## [Transpose of QR factorization](https://discourse.julialang.org/t/transpose-of-qr-factorization/101457)

<div class="topic-metadata">

**Author:** [@shce](https://discourse.julialang.org/u/shce)\
**Replies:** 1\
**Last updated:** [July 10, 2023, 10:52pm UTC](https://discourse.julialang.org/t/transpose-of-qr-factorization/101457 "2023-07-10T22:52:35Z")

</div>

Hello, It seems that I am not able to call the transpose function to a QR factorization object. In version 1.9.1: julia\> using LinearAlgebra julia\> A = rand(3,3); julia\> F = qr(A); julia\> typeof(F) LinearAlgebra.QRC…

---

## [Local package precompilation issues in 1.9](https://discourse.julialang.org/t/local-package-precompilation-issues-in-1-9/101459)

<div class="topic-metadata">

**Author:** [@myersm0](https://discourse.julialang.org/u/myersm0)\
**Replies:** 0\
**Last updated:** [July 10, 2023, 10:26pm UTC](https://discourse.julialang.org/t/local-package-precompilation-issues-in-1-9/101459 "2023-07-10T22:26:17Z")

</div>

I’d like to fully adopt Julia version 1.9 in my workflow, and also to recommend it to some new staff who are joining us at work soon, but I continue to have problems with local package development. (See my original issue…

---

## [Efficient approach to multiply three matrices (M1\*M2\*M3) and two vectors and a matrix (x\*M\*y)](https://discourse.julialang.org/t/efficient-approach-to-multiply-three-matrices-m1-m2-m3-and-two-vectors-and-a-matrix-x-m-y/66130)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 18\
**Last updated:** [July 10, 2023, 10:16pm UTC](https://discourse.julialang.org/t/efficient-approach-to-multiply-three-matrices-m1-m2-m3-and-two-vectors-and-a-matrix-x-m-y/66130 "2023-07-10T22:16:18Z")

</div>

I am trying to optimise a small function in which I am performing linear algebra operations. This function is called in a loop about a thousand times and thus speed is critical. The main points that I would like to opti…

---

## [Discarding pmap’s results (pforeach?)](https://discourse.julialang.org/t/discarding-pmap-s-results-pforeach/101452)

<div class="topic-metadata">

**Author:** [@lmtzx9h4qqnt](https://discourse.julialang.org/u/lmtzx9h4qqnt)\
**Replies:** 2\
**Last updated:** [July 10, 2023, 8:56pm UTC](https://discourse.julialang.org/t/discarding-pmap-s-results-pforeach/101452 "2023-07-10T20:56:46Z")

</div>

I was wondering what the best way to use pmap (or something equivalent) is when I just want to do some operations in parallel without collecting any results in memory. Silly example: julia\> pmap(x -\> println(x), 1:10) 1…

---

## [Arrow stream writer and reader implementation questions](https://discourse.julialang.org/t/arrow-stream-writer-and-reader-implementation-questions/101438)

<div class="topic-metadata">

**Author:** [@schaefer0](https://discourse.julialang.org/u/schaefer0)\
**Replies:** 0\
**Last updated:** [July 10, 2023, 2:59pm UTC](https://discourse.julialang.org/t/arrow-stream-writer-and-reader-implementation-questions/101438 "2023-07-10T14:59:43Z")

</div>

Hi, I was using the python arrow function record\_batch and find that this does not exist in julia, but there is an arrow table function. However they don’t behave the same way. I have a customer requirement (that I can…

---

## [How to shut up CondaPkg](https://discourse.julialang.org/t/how-to-shut-up-condapkg/101446)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 0\
**Last updated:** [July 10, 2023, 6:30pm UTC](https://discourse.julialang.org/t/how-to-shut-up-condapkg/101446 "2023-07-10T18:30:12Z")

</div>

More than once per day I see these messages: Initializing the project... CondaPkg Found dependencies: /home/ufechner/.julia/packages/PythonCall/1f5yE/CondaPkg.toml CondaPkg Found dependencies: /home/ufechner/.ju…

---

## [Bad performance looping over SOAs with SIMD](https://discourse.julialang.org/t/bad-performance-looping-over-soas-with-simd/101264)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 3\
**Last updated:** [July 10, 2023, 4:31pm UTC](https://discourse.julialang.org/t/bad-performance-looping-over-soas-with-simd/101264 "2023-07-10T16:31:16Z")

</div>

I’m trying to write performant code (in particular a Monte Carlo simulation) and have been stumped by the SOA vs AOS debate for a while now. Generally, when trying to use SIMD, I have seen it’s recommended to use the SOA…

---

## [What should \`issorted\` return when an order isn't defined for the elements, but a comparison works?](https://discourse.julialang.org/t/what-should-issorted-return-when-an-order-isnt-defined-for-the-elements-but-a-comparison-works/101423)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 4\
**Last updated:** [July 10, 2023, 3:02pm UTC](https://discourse.julialang.org/t/what-should-issorted-return-when-an-order-isnt-defined-for-the-elements-but-a-comparison-works/101423 "2023-07-10T15:02:09Z")

</div>

Currently, issorted returns true by default, even if the elements do not have a defined order. For example, julia\> issorted(\[NaN, NaN\]) true In this case, because NaN is a floating-point number, the comparison works, e…

---

## [Integrating bash/Julia script](https://discourse.julialang.org/t/integrating-bash-julia-script/101167)

<div class="topic-metadata">

**Author:** [@99dB](https://discourse.julialang.org/u/99dB)\
**Replies:** 5\
**Last updated:** [July 10, 2023, 11:48am UTC](https://discourse.julialang.org/t/integrating-bash-julia-script/101167 "2023-07-10T11:48:45Z")

</div>

Hello all, I have some csv files and I want to read and process theme using a Julia script by running a bash script on a cluster. For each csv, I want an independent job on the cluster. Is there a smart way of doing th…

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

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