# General Usage

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

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

**Page:** 284

---

## [Neovim terminal and @edit](https://discourse.julialang.org/t/neovim-terminal-and-edit/99822)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 11\
**Last updated:** [June 6, 2023, 11:24am UTC](https://discourse.julialang.org/t/neovim-terminal-and-edit/99822 "2023-06-06T11:24:51Z")

</div>

I often use julia inside the neovim terminal. One annoyance I have with this is that say @edit sin(1) will open that code in a new instance of neovim. Instead, I would prefer it to use the current instance. Is that possi…

---

## [Disappointing benchmark results with AMD Threadripper PRO 3975WX 32 Cores](https://discourse.julialang.org/t/disappointing-benchmark-results-with-amd-threadripper-pro-3975wx-32-cores/99806)

<div class="topic-metadata">

**Author:** [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)\
**Replies:** 10\
**Last updated:** [June 6, 2023, 8:22am UTC](https://discourse.julialang.org/t/disappointing-benchmark-results-with-amd-threadripper-pro-3975wx-32-cores/99806 "2023-06-06T08:22:16Z")

</div>

Hello, I have the Lenovo ThinkStation P620 with the AMD Threadripper PRO 3975WX with 32 cores and 64 Threads. I installed Ubuntu 22.04.2, and I noticed that the performances are not so much improved with respect for exa…

---

## [Symbolic integration with SymPy.jl](https://discourse.julialang.org/t/symbolic-integration-with-sympy-jl/78624)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 6\
**Last updated:** [June 6, 2023, 8:14am UTC](https://discourse.julialang.org/t/symbolic-integration-with-sympy-jl/78624 "2023-06-06T08:14:57Z")

</div>

I ran into a problem with SymPy.jl for symbolic integration, using SymPy m = symbols(“m”, integer=true) n = symbols(“n”, integer=true) x = symbols(“x”, integer=true) integrate(diff(x^4,(x,2)),x) The output is 4\*…

---

## [Rasters, GDAL, ArchGDAL](https://discourse.julialang.org/t/rasters-gdal-archgdal/94004)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 3\
**Last updated:** [June 6, 2023, 8:03am UTC](https://discourse.julialang.org/t/rasters-gdal-archgdal/94004 "2023-06-06T08:03:21Z")

</div>

Dear all, I’ve tried installing Rasters.jl on both my office and home computers (Julia v 1.8). Both installations have failed because both gdal and archgdal fail to precompile. Does anyone experience the same problem?…

---

## [Question: Least square fitting method for non-linear function](https://discourse.julialang.org/t/question-least-square-fitting-method-for-non-linear-function/97595)

<div class="topic-metadata">

**Author:** [@manu\_han](https://discourse.julialang.org/u/manu_han)\
**Replies:** 2\
**Last updated:** [June 6, 2023, 6:47am UTC](https://discourse.julialang.org/t/question-least-square-fitting-method-for-non-linear-function/97595 "2023-06-06T06:47:32Z")

</div>

To fit the non-linear function with other data, I am trying to use the ‘LsqFit.curve\_fit’ which was introduced by the following link: GitHub - JuliaNLSolvers/LsqFit.jl: Simple curve fitting in Julia here is toy example…

---

## [Problem with elliptic integrals](https://discourse.julialang.org/t/problem-with-elliptic-integrals/99922)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 1\
**Last updated:** [June 6, 2023, 6:09am UTC](https://discourse.julialang.org/t/problem-with-elliptic-integrals/99922 "2023-06-06T06:09:30Z")

</div>

using Plots using SpecialFunctions # using Elliptic K = ellipk # Computes Complete Elliptic Integral of 1st kind K(m) E = ellipe # Computes Complete Elliptic Integral of 2nd kind E(m) psi0(k) = (K(k) - E(k)) / k @sho…

---

## [DifferentialEquations.jl with a Float32 tspan](https://discourse.julialang.org/t/differentialequations-jl-with-a-float32-tspan/99920)

<div class="topic-metadata">

**Author:** [@tomkimpson](https://discourse.julialang.org/u/tomkimpson)\
**Replies:** 3\
**Last updated:** [June 6, 2023, 2:19am UTC](https://discourse.julialang.org/t/differentialequations-jl-with-a-float32-tspan/99920 "2023-06-06T02:19:49Z")

</div>

Hi, There is a nice blog post here on using DE.jl with different number types. In Julia v1.9 the following MWE errors: using DifferentialEquations function some\_arbitrary\_function!(du,u,p,τ) du = u/100 nothi…

---

## [Code block only for PackageCompiler and not for Revise](https://discourse.julialang.org/t/code-block-only-for-packagecompiler-and-not-for-revise/99870)

<div class="topic-metadata">

**Author:** [@xgdgsc](https://discourse.julialang.org/u/xgdgsc)\
**Replies:** 6\
**Last updated:** [June 6, 2023, 1:10am UTC](https://discourse.julialang.org/t/code-block-only-for-packagecompiler-and-not-for-revise/99870 "2023-06-06T01:10:54Z")

</div>

I’ m searching for ways to workaround can't use revise · Issue #166 · comonicon/Comonicon.jl · GitHub . When developing using Revise, Comonicon and @ccallable functions seem to cause Revise errors that needs restarting R…

---

## [Using Elasticsearch with Julia](https://discourse.julialang.org/t/using-elasticsearch-with-julia/52165)

<div class="topic-metadata">

**Author:** [@JTintern](https://discourse.julialang.org/u/JTintern)\
**Replies:** 1\
**Last updated:** [June 5, 2023, 5:23pm UTC](https://discourse.julialang.org/t/using-elasticsearch-with-julia/52165 "2023-06-05T17:23:04Z")

</div>

Hi everyone, I am trying to use elasticsearch with Julia ,when I try to connect to my index I get this error : PyError ($(Expr(:escape, :(ccall(#= /home/J1028071/.julia/packages/PyCall/zqDXB/src/pyfncall.jl:43 =# @pysy…

---

## [How to share a Julia system image that requires artifacts?](https://discourse.julialang.org/t/how-to-share-a-julia-system-image-that-requires-artifacts/99902)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 0\
**Last updated:** [June 5, 2023, 4:22pm UTC](https://discourse.julialang.org/t/how-to-share-a-julia-system-image-that-requires-artifacts/99902 "2023-06-05T16:22:27Z")

</div>

Hi! I am trying to create a relocatable Julia system image that bundles some private packages for a satellite telemetry system. I follow the tutorial in PackageCompiler.jl but I am having problems with the Artifacts. So…

---

## [Event-based or instrumentation profiler for julia?](https://discourse.julialang.org/t/event-based-or-instrumentation-profiler-for-julia/99895)

<div class="topic-metadata">

**Author:** [@linwaytin](https://discourse.julialang.org/u/linwaytin)\
**Replies:** 0\
**Last updated:** [June 5, 2023, 2:25pm UTC](https://discourse.julialang.org/t/event-based-or-instrumentation-profiler-for-julia/99895 "2023-06-05T14:25:39Z")

</div>

The built-in Profile is sampling-based, but I want to time a specific code block. I found the TimerOutputs seems useful for this job. Is this the correct way to go? Thanks.

---

## [Problem reading some WAV files using WAV.jl](https://discourse.julialang.org/t/problem-reading-some-wav-files-using-wav-jl/99788)

<div class="topic-metadata">

**Author:** [@CosmicSpittle](https://discourse.julialang.org/u/CosmicSpittle)\
**Replies:** 2\
**Last updated:** [June 5, 2023, 1:44pm UTC](https://discourse.julialang.org/t/problem-reading-some-wav-files-using-wav-jl/99788 "2023-06-05T13:44:04Z")

</div>

I have come across a wav file that I cannot read using WAV.jl (or LibSndFile.jl). I can open it in about any other audio program or library (Matlab, R, Raven, Audacity, …). If I read it into Matlab and write it back o…

---

## [How to read from external command and also get exit status](https://discourse.julialang.org/t/how-to-read-from-external-command-and-also-get-exit-status/99880)

<div class="topic-metadata">

**Author:** [@djvanderlaan](https://discourse.julialang.org/u/djvanderlaan)\
**Replies:** 2\
**Last updated:** [June 5, 2023, 1:33pm UTC](https://discourse.julialang.org/t/how-to-read-from-external-command-and-also-get-exit-status/99880 "2023-06-05T13:33:36Z")

</div>

I would like to run an external command an get its output str = read(\`ls -al\`, String) works for reading the output. However, I have a command that can also give non-zero exit codes on what I consider successful execut…

---

## [How to interrupt (not kill) julia from the REPL (again)?](https://discourse.julialang.org/t/how-to-interrupt-not-kill-julia-from-the-repl-again/99753)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 6\
**Last updated:** [June 5, 2023, 3:59am UTC](https://discourse.julialang.org/t/how-to-interrupt-not-kill-julia-from-the-repl-again/99753 "2023-06-05T03:59:56Z")

</div>

Instead of adding a question to the old thread from 2019 of almost the same title, I create a new Topic. From the old thread, I learned that Ctrl-C doesn’t always work, for example, during I/O. So, my question is, h…

---

## [Copy a function](https://discourse.julialang.org/t/copy-a-function/99884)

<div class="topic-metadata">

**Author:** [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Replies:** 2\
**Last updated:** [June 5, 2023, 11:51am UTC](https://discourse.julialang.org/t/copy-a-function/99884 "2023-06-05T11:51:20Z")

</div>

Let’s say I want to store a function in a struct.To do this, I pass this function to the constructor of the structure. However, if at some point later I redefine the original function, then the function inside the struct…

---

## [Rollsum/cumulative optimisation](https://discourse.julialang.org/t/rollsum-cumulative-optimisation/99718)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 12\
**Last updated:** [June 5, 2023, 11:36am UTC](https://discourse.julialang.org/t/rollsum-cumulative-optimisation/99718 "2023-06-05T11:36:53Z")

</div>

Hi, I was wondering if someone can help me speed up the below function (roll\_sum) in anyway? (Multi-threading, better algorithm,…etc). An easy way would be to remove the copy but I have added it so it is easy to benchm…

---

## [How to serialize data directly to my custom IO?](https://discourse.julialang.org/t/how-to-serialize-data-directly-to-my-custom-io/99754)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 2\
**Last updated:** [June 5, 2023, 11:03am UTC](https://discourse.julialang.org/t/how-to-serialize-data-directly-to-my-custom-io/99754 "2023-06-05T11:03:24Z")

</div>

Hello, how to serialize data directly to my custom IO without using IOBuffer ? I just copy serialized data bytes from IOBuffer to custom IO object.

---

## [How to convert simulated distribution to a coarser distribution](https://discourse.julialang.org/t/how-to-convert-simulated-distribution-to-a-coarser-distribution/99874)

<div class="topic-metadata">

**Author:** [@Zerosum](https://discourse.julialang.org/u/Zerosum)\
**Replies:** 1\
**Last updated:** [June 5, 2023, 8:12am UTC](https://discourse.julialang.org/t/how-to-convert-simulated-distribution-to-a-coarser-distribution/99874 "2023-06-05T08:12:31Z")

</div>

I was wondering if I could get some help on this problem. By simulating 10,000 times a stochastic system that yields a positive number at the end, I collect 10,000 random positive numbers. This is what I call a simulate…

---

## [PlotlyJS: Feature of legendgroup disable the feature to toggle visibility of individual traces](https://discourse.julialang.org/t/plotlyjs-feature-of-legendgroup-disable-the-feature-to-toggle-visibility-of-individual-traces/99875)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 0\
**Last updated:** [June 5, 2023, 8:01am UTC](https://discourse.julialang.org/t/plotlyjs-feature-of-legendgroup-disable-the-feature-to-toggle-visibility-of-individual-traces/99875 "2023-06-05T08:01:52Z")

</div>

If you have to diagrams in one figure you can group the legend according to the related sub-plots by means of the feature legendgroup. Unfortunately, this breaks in my example below the interactive functionality to toggl…

---

## [Different figure object when using PlotlyJS.make\_subplots()](https://discourse.julialang.org/t/different-figure-object-when-using-plotlyjs-make-subplots/99765)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 0\
**Last updated:** [June 2, 2023, 12:09pm UTC](https://discourse.julialang.org/t/different-figure-object-when-using-plotlyjs-make-subplots/99765 "2023-06-02T12:09:55Z")

</div>

Today it gave me a headache to understand the different behaviour of Plot() and make\_subplots() of the package PlotlyJS. Below an example that shows the difference and might help others: using PlotlyJS # --- function p…

---

## [Error when processing data from file for linear regression](https://discourse.julialang.org/t/error-when-processing-data-from-file-for-linear-regression/99824)

<div class="topic-metadata">

**Author:** [@Leticia-maria](https://discourse.julialang.org/u/Leticia-maria)\
**Replies:** 7\
**Last updated:** [June 5, 2023, 6:22am UTC](https://discourse.julialang.org/t/error-when-processing-data-from-file-for-linear-regression/99824 "2023-06-05T06:22:46Z")

</div>

Dear all, I am trying to run the following code: I extract the data from a Matlab file I split train/test I try to run linear regression the following issues: I wanna reduce allocations I wanna make It faster usin…

---

## [Learning Julia by an example of a simple Bayesian linear regression](https://discourse.julialang.org/t/learning-julia-by-an-example-of-a-simple-bayesian-linear-regression/99811)

<div class="topic-metadata">

**Author:** [@Boris](https://discourse.julialang.org/u/Boris)\
**Replies:** 10\
**Last updated:** [June 4, 2023, 8:58pm UTC](https://discourse.julialang.org/t/learning-julia-by-an-example-of-a-simple-bayesian-linear-regression/99811 "2023-06-04T20:58:49Z")

</div>

Hello everyone, long-time lurker, very occasional poster. I decided to give Julia a try once more with 1.9. So far I have struggled with the language on and off (I have touched on this previously) but would really like …

---

## [Find filtered min/max index](https://discourse.julialang.org/t/find-filtered-min-max-index/95154)

<div class="topic-metadata">

**Author:** [@filchristou](https://discourse.julialang.org/u/filchristou)\
**Replies:** 22\
**Last updated:** [June 4, 2023, 7:52pm UTC](https://discourse.julialang.org/t/find-filtered-min-max-index/95154 "2023-06-04T19:52:30Z")

</div>

Every now and then I need to find the index of the min/max element of a filtered data structure. I was wondering, how do you normally tackle this quite common problem? As a first reaction I think of findmin(o, filter(f…

---

## [Crooked array saving to files](https://discourse.julialang.org/t/crooked-array-saving-to-files/99855)

<div class="topic-metadata">

**Author:** [@k.kirshin123](https://discourse.julialang.org/u/k.kirshin123)\
**Replies:** 2\
**Last updated:** [June 4, 2023, 6:59pm UTC](https://discourse.julialang.org/t/crooked-array-saving-to-files/99855 "2023-06-04T18:59:05Z")

</div>

Hello everyone, I need to write two random matrices to txt files and read them later, but every time I try to do this, I notice that the files were written very crookedly, my program does not work from this. As I have r…

---

## [How to use the array as the argument for curve-fit?](https://discourse.julialang.org/t/how-to-use-the-array-as-the-argument-for-curve-fit/99802)

<div class="topic-metadata">

**Author:** [@manu\_han](https://discourse.julialang.org/u/manu_han)\
**Replies:** 3\
**Last updated:** [June 4, 2023, 4:29pm UTC](https://discourse.julialang.org/t/how-to-use-the-array-as-the-argument-for-curve-fit/99802 "2023-06-04T16:29:22Z")

</div>

I wanna using curve-fit with an independent variable constituted by 4 float64 elements (Vector{Array{Float64,3} with 4 elements}. However, It didn’t work and give the message as follows: MethodError: no method matching…

---

## [A bug in thread?](https://discourse.julialang.org/t/a-bug-in-thread/99835)

<div class="topic-metadata">

**Author:** [@zhijie\_sun](https://discourse.julialang.org/u/zhijie_sun)\
**Replies:** 2\
**Last updated:** [June 4, 2023, 11:09am UTC](https://discourse.julialang.org/t/a-bug-in-thread/99835 "2023-06-04T11:09:40Z")

</div>

I find if I use Threads.threadid() and sleep together, the code will give wrong result. Also give wrong result when I replace sleep by lock. The code shouldn’t output anything, but it did output, that is why I say give …

---

## [Track progress of multiple threads](https://discourse.julialang.org/t/track-progress-of-multiple-threads/94921)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 17\
**Last updated:** [June 4, 2023, 9:49am UTC](https://discourse.julialang.org/t/track-progress-of-multiple-threads/94921 "2023-06-04T09:49:22Z")

</div>

Hi, I have the following code function pb(i, k, lpad, LEN, PBSTR, PBWID,nb) perc = i/(LEN); lpad = floor(Int,perc \* LEN); print("\\r Processing data chunk ", k," of $nb : \[",first(PBSTR,lpad),first(PBWID,LE…

---

## [\`Revise.jl\` is still automatically imported although the corresponding code in \`startup.jl\` has been deleted](https://discourse.julialang.org/t/revise-jl-is-still-automatically-imported-although-the-corresponding-code-in-startup-jl-has-been-deleted/99805)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 4\
**Last updated:** [June 3, 2023, 2:36pm UTC](https://discourse.julialang.org/t/revise-jl-is-still-automatically-imported-although-the-corresponding-code-in-startup-jl-has-been-deleted/99805 "2023-06-03T14:36:34Z")

</div>

I commented out the following lines in the ~/.julia/config/startup.jl file and restarted the REPL, but the Revise.jl package was still imported into the workspace. Why? # try # using Revise # catch e # @warn "Er…

---

## [Why I don't obtain an output variable in a for loop?](https://discourse.julialang.org/t/why-i-dont-obtain-an-output-variable-in-a-for-loop/99794)

<div class="topic-metadata">

**Author:** [@RDuarte](https://discourse.julialang.org/u/RDuarte)\
**Replies:** 3\
**Last updated:** [June 3, 2023, 2:16pm UTC](https://discourse.julialang.org/t/why-i-dont-obtain-an-output-variable-in-a-for-loop/99794 "2023-06-03T14:16:07Z")

</div>

Hello I’m struggling with a for loop in julia. My WAVFilesList is a vector of five strings. I don’t understand why when I’m doing the following command I do not obtain a WAVfilenames variable in each passage of the lo…

---

## [Apply colorscheme palette by classes](https://discourse.julialang.org/t/apply-colorscheme-palette-by-classes/99809)

<div class="topic-metadata">

**Author:** [@Ordens\_Ritter](https://discourse.julialang.org/u/Ordens_Ritter)\
**Replies:** 0\
**Last updated:** [June 3, 2023, 1:32pm UTC](https://discourse.julialang.org/t/apply-colorscheme-palette-by-classes/99809 "2023-06-03T13:32:58Z")

</div>

I am using a statsplot and I want to use the palette parameter to give every run of an measurement a different color as an classifier. Which works. But Instead to use the colors of the space for all measurements, the vi…

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

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