# General Usage

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

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

**Page:** 373

---

## [ArpackBuilder gone, Arpack v0.3.1 build fails for Julia 1.0.\*](https://discourse.julialang.org/t/arpackbuilder-gone-arpack-v0-3-1-build-fails-for-julia-1-0/89869)

<div class="topic-metadata">

**Author:** [@HanD](https://discourse.julialang.org/u/HanD)\
**Replies:** 9\
**Last updated:** [November 7, 2022, 4:10pm UTC](https://discourse.julialang.org/t/arpackbuilder-gone-arpack-v0-3-1-build-fails-for-julia-1-0/89869 "2022-11-07T16:10:13Z")

</div>

We have been using Julia 1.0.\* for a legacy project for quite some time. The program relies on the MultivariateStats package, which in turn uses Arpack v0.3.1. This version of Arpack relies on ArpackBuilder, or rather, r…

---

## [Multiplication of vector of matrices and vector of vectors](https://discourse.julialang.org/t/multiplication-of-vector-of-matrices-and-vector-of-vectors/89874)

<div class="topic-metadata">

**Author:** [@dalbandea](https://discourse.julialang.org/u/dalbandea)\
**Replies:** 3\
**Last updated:** [November 7, 2022, 3:59pm UTC](https://discourse.julialang.org/t/multiplication-of-vector-of-matrices-and-vector-of-vectors/89874 "2022-11-07T15:59:50Z")

</div>

I’m trying to optimize a multiplication of a vector of Matrices A of size (L, L, L) and a vector of vectors x of size (L,L), which will result in a vector of vectors c of size (L, L). That is, each c\[i,:\] is the result …

---

## [T Distribution - Automatic Differentiation on quantile and cdf function](https://discourse.julialang.org/t/t-distribution-automatic-differentiation-on-quantile-and-cdf-function/89434)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 9\
**Last updated:** [November 7, 2022, 3:42pm UTC](https://discourse.julialang.org/t/t-distribution-automatic-differentiation-on-quantile-and-cdf-function/89434 "2022-11-07T15:42:02Z")

</div>

Hi there, I need to use the cdf (and quantile) function of the T distribution inside a function that I want to use Automatic Differentiation on. This works fine with almost any univariate distribution from the Distribut…

---

## [Silhouette coefficient calculation](https://discourse.julialang.org/t/silhouette-coefficient-calculation/89861)

<div class="topic-metadata">

**Author:** [@Shayan](https://discourse.julialang.org/u/Shayan)\
**Replies:** 5\
**Last updated:** [November 7, 2022, 1:49pm UTC](https://discourse.julialang.org/t/silhouette-coefficient-calculation/89861 "2022-11-07T13:49:47Z")

</div>

I’ve written a Julia script to calculate the silhouette coefficient of the ClusterAnalysis.jl Kmeans’ result, but it’s highly inefficient and slow. I’ve written the procedure for both common and simplified versions of th…

---

## [Importing Plots increasing garbage collection](https://discourse.julialang.org/t/importing-plots-increasing-garbage-collection/89878)

<div class="topic-metadata">

**Author:** [@jewh](https://discourse.julialang.org/u/jewh)\
**Replies:** 3\
**Last updated:** [November 7, 2022, 1:57pm UTC](https://discourse.julialang.org/t/importing-plots-increasing-garbage-collection/89878 "2022-11-07T13:57:01Z")

</div>

It seems that importing Plots is significantly increasing the mean % garbage collection time when executing this function motif2. Does anyone know why, and how to prevent it? julia\> using BenchmarkTools julia\> function…

---

## [Initiate a struct without its name but only by its type in local scope](https://discourse.julialang.org/t/initiate-a-struct-without-its-name-but-only-by-its-type-in-local-scope/89875)

<div class="topic-metadata">

**Author:** [@elakelaiset](https://discourse.julialang.org/u/elakelaiset)\
**Replies:** 4\
**Last updated:** [November 7, 2022, 1:17pm UTC](https://discourse.julialang.org/t/initiate-a-struct-without-its-name-but-only-by-its-type-in-local-scope/89875 "2022-11-07T13:17:55Z")

</div>

Hi together, i try to define a function which creates a new composite based on a copy of a given composite, but with a single field changed, and without using mutable structs. I’ve attached a code snipped which tries t…

---

## [Usage of lazy vector instead of function](https://discourse.julialang.org/t/usage-of-lazy-vector-instead-of-function/89766)

<div class="topic-metadata">

**Author:** [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Replies:** 22\
**Last updated:** [November 7, 2022, 10:37am UTC](https://discourse.julialang.org/t/usage-of-lazy-vector-instead-of-function/89766 "2022-11-07T10:37:22Z")

</div>

Hi everyone, recently I stumbled across a nice benchmark between different languages and was having a look at the Julia implementation: Now in general, I understand why there is a use case for lazy arrays, but is this…

---

## [How to save two overlapped plots together in one single file?](https://discourse.julialang.org/t/how-to-save-two-overlapped-plots-together-in-one-single-file/89852)

<div class="topic-metadata">

**Author:** [@mzd1893](https://discourse.julialang.org/u/mzd1893)\
**Replies:** 3\
**Last updated:** [November 7, 2022, 8:42am UTC](https://discourse.julialang.org/t/how-to-save-two-overlapped-plots-together-in-one-single-file/89852 "2022-11-07T08:42:51Z")

</div>

using Plots plot(0:10,sin); plot!(0:10,sin,seriestype = :scatter) In this example, the output are actually two plots. How can I save them in one file?

---

## [Using the same parameter n times in a function call](https://discourse.julialang.org/t/using-the-same-parameter-n-times-in-a-function-call/89833)

<div class="topic-metadata">

**Author:** [@Zackyzz](https://discourse.julialang.org/u/Zackyzz)\
**Replies:** 7\
**Last updated:** [November 6, 2022, 7:53pm UTC](https://discourse.julialang.org/t/using-the-same-parameter-n-times-in-a-function-call/89833 "2022-11-06T19:53:55Z")

</div>

Hello! I am struggling to find a way to “automate” this type of function call: using LinearAlgebra x = \[rand() rand(); rand() rand()\] kron(x, x) #n=2 kron(x, x, x) #n=3 kron(x, x, x, x) #n=4 Basically, having a 2x2 ma…

---

## [Running Julia with multi-threading with \`qsub\`](https://discourse.julialang.org/t/running-julia-with-multi-threading-with-qsub/89850)

<div class="topic-metadata">

**Author:** [@Rick](https://discourse.julialang.org/u/Rick)\
**Replies:** 2\
**Last updated:** [November 6, 2022, 8:20pm UTC](https://discourse.julialang.org/t/running-julia-with-multi-threading-with-qsub/89850 "2022-11-06T20:20:57Z")

</div>

Hi everyone!! I have a question on what is the correct way to run Julia with multithreads with qsub. I am trying to submit a job to the cluster to run Julia with multiple threads. I did the followings: julia "test.jl" …

---

## [How to show large number of lines using Julia, GLMakie](https://discourse.julialang.org/t/how-to-show-large-number-of-lines-using-julia-glmakie/56725)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 14\
**Last updated:** [November 6, 2022, 3:59pm UTC](https://discourse.julialang.org/t/how-to-show-large-number-of-lines-using-julia-glmakie/56725 "2022-11-06T15:59:05Z")

</div>

I try to show the road network, which has over 400,000 segments. I first tried the package OpenStreetMapXPlot.jl. However, it takes very long time and cannot plot. Then, I tried to use GLMakie.jl using Makie, GeometryT…

---

## [Why can't the compiler infer the size/type of my Zip?](https://discourse.julialang.org/t/why-cant-the-compiler-infer-the-size-type-of-my-zip/89830)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 5\
**Last updated:** [November 6, 2022, 11:53am UTC](https://discourse.julialang.org/t/why-cant-the-compiler-infer-the-size-type-of-my-zip/89830 "2022-11-06T11:53:03Z")

</div>

Hi everyone, I’m currently implementing JAX’s function transformations in Julia. In my code I dispatch on the number of the inputs to ensure that the length of slices\_iterator is known at compile time. However this appe…

---

## [Clear variables in caller workspace](https://discourse.julialang.org/t/clear-variables-in-caller-workspace/89825)

<div class="topic-metadata">

**Author:** [@hclin](https://discourse.julialang.org/u/hclin)\
**Replies:** 2\
**Last updated:** [November 6, 2022, 11:22am UTC](https://discourse.julialang.org/t/clear-variables-in-caller-workspace/89825 "2022-11-06T11:22:15Z")

</div>

Hi all, I want to utilize memory usage in Julia. Before I do some heavy computations, I want to clear some big matrices to optimize the memory usage in my code. For example, I have two big matrices, A and B. In the fun…

---

## [Softmax using Tullio](https://discourse.julialang.org/t/softmax-using-tullio/89838)

<div class="topic-metadata">

**Author:** [@minetest2048](https://discourse.julialang.org/u/minetest2048)\
**Replies:** 2\
**Last updated:** [November 6, 2022, 9:12am UTC](https://discourse.julialang.org/t/softmax-using-tullio/89838 "2022-11-06T09:12:28Z")

</div>

I want to port my DIY softmax function softmax(x) = exp.(x .- maximum(x)) / sum(exp.(x .- maximum(x))) to Tullio einsum so that it runs faster and gives fast symbolic gradients I split it into multiple lines, and it w…

---

## [Skip/nth Sampling in Turing / Thinning](https://discourse.julialang.org/t/skip-nth-sampling-in-turing-thinning/89829)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 1\
**Last updated:** [November 6, 2022, 7:49am UTC](https://discourse.julialang.org/t/skip-nth-sampling-in-turing-thinning/89829 "2022-11-06T07:49:48Z")

</div>

I’ve got a situation where I’m trying to select a set of “discriminators” from among a large number of things… so I want a vector of either -1,0,1 which when dotted with a vector of 0,1 (absent,present) gives a “score” t…

---

## [Cheapest way for creating a CartesianIndex](https://discourse.julialang.org/t/cheapest-way-for-creating-a-cartesianindex/89819)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 9\
**Last updated:** [November 6, 2022, 8:45am UTC](https://discourse.julialang.org/t/cheapest-way-for-creating-a-cartesianindex/89819 "2022-11-06T08:45:47Z")

</div>

Hi, I am trying to write a generic multidimensional algorithm where I need a random access to an ND Array. I need to define a CartesianIndex with computed coordinates and modify my array using this CI. Unfortunately i…

---

## [Drop Python 2.7 support in pyjulia?](https://discourse.julialang.org/t/drop-python-2-7-support-in-pyjulia/89694)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 4\
**Last updated:** [November 6, 2022, 3:50am UTC](https://discourse.julialang.org/t/drop-python-2-7-support-in-pyjulia/89694 "2022-11-06T03:50:16Z")

</div>

@MilesCranmer has proposed dropping Python 2.7 support via this pull request: Is anyone going to miss it?

---

## ['Cache file appears to be corrupt', How can I determine which file?](https://discourse.julialang.org/t/cache-file-appears-to-be-corrupt-how-can-i-determine-which-file/89826)

<div class="topic-metadata">

**Author:** [@contradict](https://discourse.julialang.org/u/contradict)\
**Replies:** 3\
**Last updated:** [November 6, 2022, 12:21am UTC](https://discourse.julialang.org/t/cache-file-appears-to-be-corrupt-how-can-i-determine-which-file/89826 "2022-11-06T00:21:50Z")

</div>

This happens when I import Revise, but I suspect Revise is the victim here. How can I track down the culprit? $ julia --startup-file=no \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.or…

---

## [Periodically retesting packages, saving manifest](https://discourse.julialang.org/t/periodically-retesting-packages-saving-manifest/89824)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 0\
**Last updated:** [November 5, 2022, 9:00pm UTC](https://discourse.julialang.org/t/periodically-retesting-packages-saving-manifest/89824 "2022-11-05T21:00:49Z")

</div>

To aid in delivering reliable code, I would like to setup a CI action to periodically retest my packages against its dependencies. Furthermore, when those tests have completed I would like save the Manifest.toml to have …

---

## [Problems with the Sentinel.jl package of Julia](https://discourse.julialang.org/t/problems-with-the-sentinel-jl-package-of-julia/89815)

<div class="topic-metadata">

**Author:** [@humbleclaw](https://discourse.julialang.org/u/humbleclaw)\
**Replies:** 0\
**Last updated:** [November 5, 2022, 2:15pm UTC](https://discourse.julialang.org/t/problems-with-the-sentinel-jl-package-of-julia/89815 "2022-11-05T14:15:26Z")

</div>

Following the example given in the README of the github repository of this package (https://github.com/mhudecheck/Sentinel.jl), the saveList() function creates the /.img\_cache folder but then it prints a “false” value, b…

---

## [Why is type inference failing here?](https://discourse.julialang.org/t/why-is-type-inference-failing-here/89803)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 3\
**Last updated:** [November 5, 2022, 2:09pm UTC](https://discourse.julialang.org/t/why-is-type-inference-failing-here/89803 "2022-11-05T14:09:42Z")

</div>

In the following example, it seems like it should be simple for Julia to infer that the type of prev\_x is Float64. Why is it instead getting assigned a boxed type? julia\> function tf(xs) prev\_x = xs\[1\] …

---

## [Using only a part of a colormap in Makie](https://discourse.julialang.org/t/using-only-a-part-of-a-colormap-in-makie/89784)

<div class="topic-metadata">

**Author:** [@trashspam7](https://discourse.julialang.org/u/trashspam7)\
**Replies:** 4\
**Last updated:** [November 5, 2022, 6:17am UTC](https://discourse.julialang.org/t/using-only-a-part-of-a-colormap-in-makie/89784 "2022-11-05T06:17:52Z")

</div>

I have a figure where I am plotting a line and want that line to be colored according to some other array. How do I use only part of a colormap? Or even reverse a sub-section of a colormap? I don’t have a MWE, but the r…

---

## [(why) is there no Abstract Collection type](https://discourse.julialang.org/t/why-is-there-no-abstract-collection-type/89233)

<div class="topic-metadata">

**Author:** [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Replies:** 11\
**Last updated:** [November 4, 2022, 5:13pm UTC](https://discourse.julialang.org/t/why-is-there-no-abstract-collection-type/89233 "2022-11-04T17:13:22Z")

</div>

Hi everyone, A common code pattern seems to be: function thingthatiterates(x, collection::AbstractArray) for i in collection ... end end Now in some cases, it might be better to use something non-allocating …

---

## [Is there a dedicated function computing m::Int = log(b, b^m)?](https://discourse.julialang.org/t/is-there-a-dedicated-function-computing-m-int-log-b-b-m/89776)

<div class="topic-metadata">

**Author:** [@dmetivie](https://discourse.julialang.org/u/dmetivie)\
**Replies:** 12\
**Last updated:** [November 4, 2022, 8:19pm UTC](https://discourse.julialang.org/t/is-there-a-dedicated-function-computing-m-int-log-b-b-m/89776 "2022-11-04T20:19:20Z")

</div>

I want to compute the integer m in m = log(b, y) for b integer, y=b^m. It would return an error if y is not a power of b. Right now, using the log is not ideal since julia\> log(7,7^5) 5.000000000000001 which is not a…

---

## [Pretty mesh plot in GLMakie](https://discourse.julialang.org/t/pretty-mesh-plot-in-glmakie/89679)

<div class="topic-metadata">

**Author:** [@trashspam7](https://discourse.julialang.org/u/trashspam7)\
**Replies:** 6\
**Last updated:** [November 4, 2022, 3:47pm UTC](https://discourse.julialang.org/t/pretty-mesh-plot-in-glmakie/89679 "2022-11-04T15:47:20Z")

</div>

Perhaps this is more of an artistic question, but I wanted to know if there are any recommendations for settings to play around with to make my plot prettier. I am using GLMakie.mesh! to plot some 3D surfaces within anot…

---

## [Unexpected garbage collection when using append!](https://discourse.julialang.org/t/unexpected-garbage-collection-when-using-append/89732)

<div class="topic-metadata">

**Author:** [@jewh](https://discourse.julialang.org/u/jewh)\
**Replies:** 20\
**Last updated:** [November 4, 2022, 3:22pm UTC](https://discourse.julialang.org/t/unexpected-garbage-collection-when-using-append/89732 "2022-11-04T15:22:59Z")

</div>

Working with lots of vectors of variable length and contents so I’m using the push! and append! methods frequently in my code. Using @benchmark from BenchmarkTools I’ve identified garbage collection associated with these…

---

## [\`@test\_throws ArgumentError throw(ArgumentError)\` fails](https://discourse.julialang.org/t/test-throws-argumenterror-throw-argumenterror-fails/89779)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 1\
**Last updated:** [November 4, 2022, 2:57pm UTC](https://discourse.julialang.org/t/test-throws-argumenterror-throw-argumenterror-fails/89779 "2022-11-04T14:57:20Z")

</div>

I seem to be missing something obvious here—why does the following test fail in v1.8.2? julia\> using Test julia\> @test\_throws ArgumentError throw(ArgumentError) Test Failed at REPL\[3\]:1 Expression: throw(ArgumentErro…

---

## [What exactly is "allocation" in Julia?](https://discourse.julialang.org/t/what-exactly-is-allocation-in-julia/89579)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 45\
**Last updated:** [November 4, 2022, 2:19pm UTC](https://discourse.julialang.org/t/what-exactly-is-allocation-in-julia/89579 "2022-11-04T14:19:50Z")

</div>

When dealing with performances, after type instability, the second “culprit” that arises is often memory allocation. But what exactly is memory allocation for Julia? Why it influences performances so strongly ? What are…

---

## [Converting Longitude & Latitude to X Y on a map using Julia](https://discourse.julialang.org/t/converting-longitude-latitude-to-x-y-on-a-map-using-julia/20611)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 22\
**Last updated:** [November 4, 2022, 12:37pm UTC](https://discourse.julialang.org/t/converting-longitude-latitude-to-x-y-on-a-map-using-julia/20611 "2022-11-04T12:37:39Z")

</div>

Hey. I searched for this question and I found this link: gps - Converting Longitude & Latitude to X Y on a map with Calibration points - Stack Overflow My question is not exactly the same as the above link, because I do…

---

## [Package precompilation error on Julia 1.8](https://discourse.julialang.org/t/package-precompilation-error-on-julia-1-8/89298)

<div class="topic-metadata">

**Author:** [@MatthijsCox](https://discourse.julialang.org/u/MatthijsCox)\
**Replies:** 5\
**Last updated:** [November 4, 2022, 10:07am UTC](https://discourse.julialang.org/t/package-precompilation-error-on-julia-1-8/89298 "2022-11-04T10:07:11Z")

</div>

Hi there, I have an internal company package that is working fine on previous Julia versions, but suddenly throws an error upon precompilation in julia 1.8. See error below. Any help or tips are much appreciated. It lo…

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

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