# General Usage

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

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

**Page:** 532

---

## [Best method for calculating the second derivative of 1D array](https://discourse.julialang.org/t/best-method-for-calculating-the-second-derivative-of-1d-array/69353)

<div class="topic-metadata">

**Author:** [@AngusRussell](https://discourse.julialang.org/u/AngusRussell)\
**Replies:** 11\
**Last updated:** [October 20, 2021, 7:45pm UTC](https://discourse.julialang.org/t/best-method-for-calculating-the-second-derivative-of-1d-array/69353 "2021-10-20T19:45:06Z")

</div>

Essentially I have 1D arrays of eigenvalues as shown in the above plot and I want to find the 2nd derivative of each energy band with respect to ϵ. My current method uses Dierckx.jl. In my code, the eigenvalues are …

---

## [Lazy logspace object](https://discourse.julialang.org/t/lazy-logspace-object/70091)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 3\
**Last updated:** [October 20, 2021, 7:40pm UTC](https://discourse.julialang.org/t/lazy-logspace-object/70091 "2021-10-20T19:40:03Z")

</div>

We still miss a lazy version as a range. The broadcast solution above is greedy and breaks code that expects range objects.

---

## [Datastructure for lazy evalulation](https://discourse.julialang.org/t/datastructure-for-lazy-evalulation/48972)

<div class="topic-metadata">

**Author:** [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Replies:** 0\
**Last updated:** [October 25, 2020, 10:11am UTC](https://discourse.julialang.org/t/datastructure-for-lazy-evalulation/48972 "2020-10-25T10:11:28Z")

</div>

I’m working on some visualization things and i think i need a datastructure to capture relations between ‘objects’ or ‘data’ so that i can track down the minimum set of updates. So like A depends on B and C and if C or …

---

## [Fastest package for Desktop Screenshots](https://discourse.julialang.org/t/fastest-package-for-desktop-screenshots/70103)

<div class="topic-metadata">

**Author:** [@Pytrator](https://discourse.julialang.org/u/Pytrator)\
**Replies:** 1\
**Last updated:** [October 20, 2021, 6:32pm UTC](https://discourse.julialang.org/t/fastest-package-for-desktop-screenshots/70103 "2021-10-20T18:32:33Z")

</div>

Hey guys, i am fairly new to Julia and i spent the past days on looking through packages that would help me to get all the features that pyautogui has. For mouse and keyboard automation i found Readme · GLFWAbstraction.…

---

## [Performance speed up when wrapping script with Juno.@profiler](https://discourse.julialang.org/t/performance-speed-up-when-wrapping-script-with-juno-profiler/70078)

<div class="topic-metadata">

**Author:** [@saul.ssto](https://discourse.julialang.org/u/saul.ssto)\
**Replies:** 4\
**Last updated:** [October 20, 2021, 6:22pm UTC](https://discourse.julialang.org/t/performance-speed-up-when-wrapping-script-with-juno-profiler/70078 "2021-10-20T18:22:48Z")

</div>

Hello, I’m trying to simulate the Belousov-Zhabotinsky (BZ) reaction as implemented here. I have written the following implementation for that purpose: using Images, ImageView, ProgressMeter function react(petridish::…

---

## [Understanding \`sizeof\` return values on \`Char\` / \`String\`](https://discourse.julialang.org/t/understanding-sizeof-return-values-on-char-string/70099)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 2\
**Last updated:** [October 20, 2021, 2:56pm UTC](https://discourse.julialang.org/t/understanding-sizeof-return-values-on-char-string/70099 "2021-10-20T14:56:09Z")

</div>

Can someone explain this behavior of sizeof vs summarysize ? sizeof("z") # 1 sizeof('z') # 4 Base.summarysize('z') # 4 Base.summarysize("z") # 9 When I read the doc sizeof(str::AbstractString) Size, in bytes, of the…

---

## [Precompiling RDatasets returns LoadError on CodecZlib.jl](https://discourse.julialang.org/t/precompiling-rdatasets-returns-loaderror-on-codeczlib-jl/40829)

<div class="topic-metadata">

**Author:** [@aebk2015](https://discourse.julialang.org/u/aebk2015)\
**Replies:** 2\
**Last updated:** [October 20, 2021, 10:30am UTC](https://discourse.julialang.org/t/precompiling-rdatasets-returns-loaderror-on-codeczlib-jl/40829 "2021-10-20T10:30:06Z")

</div>

I installed RDatasets but when I am calling it; it complains CodecZlib is not installed properly but even after I rebuild the CodecZlib ( Pkg.build("CodecZlib")), the error remains the same using RDatasets ┌ Info: Prec…

---

## [Multithreading on entries sparse matrix](https://discourse.julialang.org/t/multithreading-on-entries-sparse-matrix/70023)

<div class="topic-metadata">

**Author:** [@ismedina](https://discourse.julialang.org/u/ismedina)\
**Replies:** 5\
**Last updated:** [October 20, 2021, 9:40am UTC](https://discourse.julialang.org/t/multithreading-on-entries-sparse-matrix/70023 "2021-10-20T09:40:47Z")

</div>

In my work I usually have to perform some operations on sparse matrices that involve mostly checking which entries are still important and remove those that are not. I thought that I could use multithreading for that, bu…

---

## [No backend available (GLMakie, CairoMakie, WGLMakie)](https://discourse.julialang.org/t/no-backend-available-glmakie-cairomakie-wglmakie/62984)

<div class="topic-metadata">

**Author:** [@imantha](https://discourse.julialang.org/u/imantha)\
**Replies:** 25\
**Last updated:** [October 20, 2021, 9:38am UTC](https://discourse.julialang.org/t/no-backend-available-glmakie-cairomakie-wglmakie/62984 "2021-10-20T09:38:47Z")

</div>

Hi, I followed one of the tutorial from Agents.jl package.(Schelling's segregation model · Agents.jl) However after executing the following lines of code, I got an error ERROR No backend available (GLMakie, CairoMakie, …

---

## [Public package as plugin](https://discourse.julialang.org/t/public-package-as-plugin/69911)

<div class="topic-metadata">

**Author:** [@kalcool](https://discourse.julialang.org/u/kalcool)\
**Replies:** 10\
**Last updated:** [October 20, 2021, 9:36am UTC](https://discourse.julialang.org/t/public-package-as-plugin/69911 "2021-10-20T09:36:55Z")

</div>

Hi there, I am developing a program that should have a plugin system. I am thinking of using Julia’s package system for this purpose. The idea is that you install a Julia package with additional functionality and when y…

---

## [Determining dimension of array via position of "for" and "," in list comprehension](https://discourse.julialang.org/t/determining-dimension-of-array-via-position-of-for-and-in-list-comprehension/70027)

<div class="topic-metadata">

**Author:** [@pboes](https://discourse.julialang.org/u/pboes)\
**Replies:** 5\
**Last updated:** [October 20, 2021, 7:58am UTC](https://discourse.julialang.org/t/determining-dimension-of-array-via-position-of-for-and-in-list-comprehension/70027 "2021-10-20T07:58:28Z")

</div>

I am new to Julia and noticed the following when playing around with list comprehensions: Given some integers a, b,c, the comprehension \[\[i,j\] for i=1:a for j=1:b\] returns an a\*b \\times 1 array while \[\[i,j\] for i=1:a…

---

## [Replace two substrings in a string with the same \`replace\` call?](https://discourse.julialang.org/t/replace-two-substrings-in-a-string-with-the-same-replace-call/70053)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 2\
**Last updated:** [October 20, 2021, 7:47am UTC](https://discourse.julialang.org/t/replace-two-substrings-in-a-string-with-the-same-replace-call/70053 "2021-10-20T07:47:00Z")

</div>

I just found that replace could be used to replace two bits of a vector as in replace(\[1, 2, 1, 3\], 1=\>0, 2=\>4) Where the replacements are defined using Pair. I tried that with a string instead of an integer vector, b…

---

## [Fast way to calculate statistics of an array based on values (labels) of another array](https://discourse.julialang.org/t/fast-way-to-calculate-statistics-of-an-array-based-on-values-labels-of-another-array/70054)

<div class="topic-metadata">

**Author:** [@Bjorn\_De](https://discourse.julialang.org/u/Bjorn_De)\
**Replies:** 7\
**Last updated:** [October 20, 2021, 7:17am UTC](https://discourse.julialang.org/t/fast-way-to-calculate-statistics-of-an-array-based-on-values-labels-of-another-array/70054 "2021-10-20T07:17:42Z")

</div>

Hey, I have two arrays of the same size (10000x10000). One array include labels as result of an segmentation. What I want is to compute statistics for each of these segments based on the 2nd array. My approach is very s…

---

## [Julia REPL don't update VsCode YES!?](https://discourse.julialang.org/t/julia-repl-dont-update-vscode-yes/70081)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 0\
**Last updated:** [October 20, 2021, 4:04am UTC](https://discourse.julialang.org/t/julia-repl-dont-update-vscode-yes/70081 "2021-10-20T04:04:42Z")

</div>

---

## [External command interpolation without quoting spaces](https://discourse.julialang.org/t/external-command-interpolation-without-quoting-spaces/70075)

<div class="topic-metadata">

**Author:** [@chkwon](https://discourse.julialang.org/u/chkwon)\
**Replies:** 2\
**Last updated:** [October 20, 2021, 12:23am UTC](https://discourse.julialang.org/t/external-command-interpolation-without-quoting-spaces/70075 "2021-10-20T00:23:23Z")

</div>

program = "my\_program" options = \["-t 10", "-r 5"\] command = \`$(program) $(options)\` @show command # I get \`my\_program '-t 10' '-r 5'\` # I want \`my\_program -t 10 -r 5\` In the above, I want to pass several options t…

---

## [Is it possible to get allocations from 1 to 0 in this code?](https://discourse.julialang.org/t/is-it-possible-to-get-allocations-from-1-to-0-in-this-code/70056)

<div class="topic-metadata">

**Author:** [@curious](https://discourse.julialang.org/u/curious)\
**Replies:** 12\
**Last updated:** [October 19, 2021, 10:42pm UTC](https://discourse.julialang.org/t/is-it-possible-to-get-allocations-from-1-to-0-in-this-code/70056 "2021-10-19T22:42:37Z")

</div>

Hi, I have been trying to improve the performance of my code. The function below had 7 allocations before and some warning when using @code\_warntype. I made several changes that reduced allocations from 7 to 1 and remov…

---

## [UndefVarError in for loop](https://discourse.julialang.org/t/undefvarerror-in-for-loop/69999)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 33\
**Last updated:** [October 19, 2021, 10:12pm UTC](https://discourse.julialang.org/t/undefvarerror-in-for-loop/69999 "2021-10-19T22:12:59Z")

</div>

Below is my MWE. I do not know why I am having the below error though I am defining it at the beginning? using LinearAlgebra; using BenchmarkTools function curMatRLC(NodeVoltage, dt) if NodeVoltage\[1,1\]==11 return…

---

## [Saving local variables on processor during \`pmap\`](https://discourse.julialang.org/t/saving-local-variables-on-processor-during-pmap/70064)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 1\
**Last updated:** [October 19, 2021, 10:03pm UTC](https://discourse.julialang.org/t/saving-local-variables-on-processor-during-pmap/70064 "2021-10-19T22:03:45Z")

</div>

Hey, I have a small issue that I haven’t been able to solve for hours. I have a simple pmap, arr2 = pmap(f, arr). Later on, after a bunch of computation on arr2, I get an array arr3 of length equal to arr. I need to do…

---

## [PSA: JavaCall.jl is broken on macOS for Julia 1.6.3 and above](https://discourse.julialang.org/t/psa-javacall-jl-is-broken-on-macos-for-julia-1-6-3-and-above/70068)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 0\
**Last updated:** [October 19, 2021, 9:26pm UTC](https://discourse.julialang.org/t/psa-javacall-jl-is-broken-on-macos-for-julia-1-6-3-and-above/70068 "2021-10-19T21:26:58Z")

</div>

Because of some changes to how Julia handles signals as of Julia 1.6.3, JavaCall.jl is broken on macOS for Julia 1.6.3 and above. As far as I know, none of the active contributors have the needed hardware to try to resol…

---

## [My wishlist for the next version of Julia](https://discourse.julialang.org/t/my-wishlist-for-the-next-version-of-julia/69987)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 64\
**Last updated:** [October 19, 2021, 9:22pm UTC](https://discourse.julialang.org/t/my-wishlist-for-the-next-version-of-julia/69987 "2021-10-19T21:22:56Z")

</div>

As a Matlab person who recently switched over to Julia, below are some items on my wish list. Many thanks for your consideration! Creating a m x n sized NaN should be as simple as NaN(m, n). Right now, I have to do th…

---

## [Update PlotlyJS plot in Dash with async data](https://discourse.julialang.org/t/update-plotlyjs-plot-in-dash-with-async-data/66298)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 3\
**Last updated:** [October 19, 2021, 8:13pm UTC](https://discourse.julialang.org/t/update-plotlyjs-plot-in-dash-with-async-data/66298 "2021-10-19T20:13:59Z")

</div>

I would like to update a PlotlyJS plot inside Dash with data that is generated asynchronously. A MnWE (minimal not-working example) is here: using Dash, DashHtmlComponents, DashCoreComponents, PlotlyBase app = dash() …

---

## [Matrix indexing](https://discourse.julialang.org/t/matrix-indexing/70057)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 5\
**Last updated:** [October 19, 2021, 6:36pm UTC](https://discourse.julialang.org/t/matrix-indexing/70057 "2021-10-19T18:36:35Z")

</div>

I have a matrix A with the size of m x n. How do I get a matrix B with all the columns of A except the columns of n1, n2, and n3? Many thanks.

---

## [How to make this figure](https://discourse.julialang.org/t/how-to-make-this-figure/70051)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 1\
**Last updated:** [October 19, 2021, 6:40pm UTC](https://discourse.julialang.org/t/how-to-make-this-figure/70051 "2021-10-19T18:40:23Z")

</div>

Hi all… I have a 4D matrix (X,Y,Z,P) and I need to make a figure with slices and isosurfaces… something like the plot bellow. Any idea how to a figure like this in Julia?

---

## [Next Julia LTS; when?](https://discourse.julialang.org/t/next-julia-lts-when/70030)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 16\
**Last updated:** [October 19, 2021, 4:47pm UTC](https://discourse.julialang.org/t/next-julia-lts-when/70030 "2021-10-19T16:47:29Z")

</div>

Julia 1.6.4 and 1.7-rc2 releases seem imminent, both have 0 issues on their milestones. I know it’s been stated Julia 1.6.x will be the next long-term support version (LTS), but it’s not yet declared such officially (at…

---

## [Using a package imports some other unwanted packages, how to find out where is the unwanted package from?](https://discourse.julialang.org/t/using-a-package-imports-some-other-unwanted-packages-how-to-find-out-where-is-the-unwanted-package-from/70041)

<div class="topic-metadata">

**Author:** [@JianghuiDu](https://discourse.julialang.org/u/JianghuiDu)\
**Replies:** 5\
**Last updated:** [October 19, 2021, 3:57pm UTC](https://discourse.julialang.org/t/using-a-package-imports-some-other-unwanted-packages-how-to-find-out-where-is-the-unwanted-package-from/70041 "2021-10-19T15:57:51Z")

</div>

I found out some unwanted package A is imported and cause name space conflict with my own module Main. I didn’t import/using package A, so it must be loaded by other other package that I import/using. How could I find ou…

---

## [DifferentialEquations simple usage not working](https://discourse.julialang.org/t/differentialequations-simple-usage-not-working/69985)

<div class="topic-metadata">

**Author:** [@mocalvao](https://discourse.julialang.org/u/mocalvao)\
**Replies:** 4\
**Last updated:** [October 19, 2021, 3:55pm UTC](https://discourse.julialang.org/t/differentialequations-simple-usage-not-working/69985 "2021-10-19T15:55:28Z")

</div>

Hi there, I have a very simple ODE problem defined by: f\_norm(x, α) = x - α\*(1 - exp(-x)) f\_norm\_prime(x, α) = 1 - α\*exp(-x) f\_norm\_dprime(x, α) = α\*exp(-x) function dxdN!(dx, x, α, N) f = f\_norm(x, α) fx = f\_n…

---

## [Line breaks in Julia](https://discourse.julialang.org/t/line-breaks-in-julia/70037)

<div class="topic-metadata">

**Author:** [@leon](https://discourse.julialang.org/u/leon)\
**Replies:** 5\
**Last updated:** [October 19, 2021, 3:11pm UTC](https://discourse.julialang.org/t/line-breaks-in-julia/70037 "2021-10-19T15:11:03Z")

</div>

So most of the time, I do not need to worry about line breaks like in Matlab (...)? Below is an example of a Julia code that can extend to many lines (I have many A, B, C,… and each of them are very long): IndexT2 = ma…

---

## [Type stability of indexing a tuple in local scope vs global scope](https://discourse.julialang.org/t/type-stability-of-indexing-a-tuple-in-local-scope-vs-global-scope/70007)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 2\
**Last updated:** [October 19, 2021, 1:34pm UTC](https://discourse.julialang.org/t/type-stability-of-indexing-a-tuple-in-local-scope-vs-global-scope/70007 "2021-10-19T13:34:21Z")

</div>

I know that getproperty is normally not type stable. But I had the mental model that getproperty on a named tuple is magically type stable somehow. And I had the same belief for getindex on a tuple or named tuple. Howeve…

---

## [Pkg.clone keeps asking for my SSH key](https://discourse.julialang.org/t/pkg-clone-keeps-asking-for-my-ssh-key/15155)

<div class="topic-metadata">

**Author:** [@danielc](https://discourse.julialang.org/u/danielc)\
**Replies:** 21\
**Last updated:** [October 19, 2021, 12:49pm UTC](https://discourse.julialang.org/t/pkg-clone-keeps-asking-for-my-ssh-key/15155 "2021-10-19T12:49:12Z")

</div>

Hello, I am running Julia 0.7 on Ubuntu and when I try to clone a package, I get this problem: julia\> using Pkg julia\> Pkg.clone("git@github.com:eford/CORBITS.git") ┌ Warning: Pkg.clone is only kept for legacy CI scri…

---

## [Luxor linewidth scaling](https://discourse.julialang.org/t/luxor-linewidth-scaling/70022)

<div class="topic-metadata">

**Author:** [@jg-854](https://discourse.julialang.org/u/jg-854)\
**Replies:** 1\
**Last updated:** [October 19, 2021, 10:47am UTC](https://discourse.julialang.org/t/luxor-linewidth-scaling/70022 "2021-10-19T10:47:38Z")

</div>

I am creating an application with a zoom feature. I thought to use Luxor.scale, which correctly scales my primitives (boxes, triangles etc.) but preserves the linewidth’s value. Is there any way to include the scaling of…

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

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