# General Usage

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

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

**Page:** 206

---

## [Build julia-debug on a Raspberry Pi](https://discourse.julialang.org/t/build-julia-debug-on-a-raspberry-pi/109556)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 4\
**Last updated:** [February 1, 2024, 12:00pm UTC](https://discourse.julialang.org/t/build-julia-debug-on-a-raspberry-pi/109556 "2024-02-01T12:00:15Z")

</div>

I’m running into sporadic segfaults when using GitHub - JuliaRobotics/AprilTags.jl: Using Apriltags in Julia, and after some (extensive) tinkering with @johanter he wisely suggested I try to run my segfault-causing scrip…

---

## [How do I delete all installed packages on Juliaup (1.10)?](https://discourse.julialang.org/t/how-do-i-delete-all-installed-packages-on-juliaup-1-10/109554)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 2\
**Last updated:** [February 1, 2024, 10:48am UTC](https://discourse.julialang.org/t/how-do-i-delete-all-installed-packages-on-juliaup-1-10/109554 "2024-02-01T10:48:45Z")

</div>

Hello! I am on Windows 10 and wish to delete all packages and start from clean. This includes artifacts etc. The reason I want do so is that I am having issues with updating CUDA.jl, Pkg.update is not working (I am usin…

---

## [Can \`startup.jl\` set different startup options for different Julia installations?](https://discourse.julialang.org/t/can-startup-jl-set-different-startup-options-for-different-julia-installations/109507)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 17\
**Last updated:** [February 1, 2024, 3:41am UTC](https://discourse.julialang.org/t/can-startup-jl-set-different-startup-options-for-different-julia-installations/109507 "2024-02-01T03:41:01Z")

</div>

Two different versions of Julia are installed on Linux but there is only one ~/.julia/config/startup.jl. I want to set different startup options for the two versions, can I? And how? Thanks!

---

## [Replacing static arrays for use with Enzyme.jl](https://discourse.julialang.org/t/replacing-static-arrays-for-use-with-enzyme-jl/109278)

<div class="topic-metadata">

**Author:** [@jwalker](https://discourse.julialang.org/u/jwalker)\
**Replies:** 10\
**Last updated:** [January 31, 2024, 11:04pm UTC](https://discourse.julialang.org/t/replacing-static-arrays-for-use-with-enzyme-jl/109278 "2024-01-31T23:04:30Z")

</div>

I’m implementing AD in a code that makes use of types built upon SLArray and SArray, and am trying to understand the best way toward converting things so that the code plays well with Enzyme. From my understanding, to w…

---

## [Sparse matrices copy arrays, do not view them](https://discourse.julialang.org/t/sparse-matrices-copy-arrays-do-not-view-them/109505)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 18\
**Last updated:** [January 31, 2024, 9:06pm UTC](https://discourse.julialang.org/t/sparse-matrices-copy-arrays-do-not-view-them/109505 "2024-01-31T21:06:01Z")

</div>

I wrote this program, which preallocates the csc arrays. I have to do a lot of kronecker products and i wanted to re-use this arrays and to write in them. Each iteration would have a different @view inside them, but if…

---

## [Nice printing of some values of an array](https://discourse.julialang.org/t/nice-printing-of-some-values-of-an-array/109512)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 5\
**Last updated:** [January 31, 2024, 5:38pm UTC](https://discourse.julialang.org/t/nice-printing-of-some-values-of-an-array/109512 "2024-01-31T17:38:25Z")

</div>

During a simulation, it can be useful to monitor some representative values of an array (mean, max, min, median). With a colleague, we’ve tried to write a function or macro that prints the minimum and maximum value of a…

---

## [Why does Meta.parse ignores comments?](https://discourse.julialang.org/t/why-does-meta-parse-ignores-comments/109523)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 6\
**Last updated:** [January 31, 2024, 4:46pm UTC](https://discourse.julialang.org/t/why-does-meta-parse-ignores-comments/109523 "2024-01-31T16:46:02Z")

</div>

I am really surprised that Meta.parse seems to actively kick out some information julia\> Meta.parse(""" function hi() # comment end """) :(function hi() #= none:1 =# #= none:1 =# …

---

## [Partitioning a vector](https://discourse.julialang.org/t/partitioning-a-vector/109511)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 7\
**Last updated:** [January 31, 2024, 4:18pm UTC](https://discourse.julialang.org/t/partitioning-a-vector/109511 "2024-01-31T16:18:43Z")

</div>

Dear all, I have a vector: I = 1:55. I need to partition it into 10 subvectors, none of which must be empty and the length of each of which is a random number. What is the best way to do this? Could someone help me?

---

## [Bounds check outside loop affects loop performance](https://discourse.julialang.org/t/bounds-check-outside-loop-affects-loop-performance/109524)

<div class="topic-metadata">

**Author:** [@wheeheee](https://discourse.julialang.org/u/wheeheee)\
**Replies:** 0\
**Last updated:** [January 31, 2024, 4:10pm UTC](https://discourse.julialang.org/t/bounds-check-outside-loop-affects-loop-performance/109524 "2024-01-31T16:10:50Z")

</div>

While playing around with a function, I noticed that adding a bounds check (si\_check) had a drastic impact on its performance. Although for N \<= 18, there is no noticeable performance impact, and the emitted LLVM IR show…

---

## [Sparse(kroneckersum). sparse or not?](https://discourse.julialang.org/t/sparse-kroneckersum-sparse-or-not/109521)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 0\
**Last updated:** [January 31, 2024, 2:56pm UTC](https://discourse.julialang.org/t/sparse-kroneckersum-sparse-or-not/109521 "2024-01-31T14:56:53Z")

</div>

I wrote these two sparseArrays functions: using SparseArrays using LinearAlgebra using Kronecker Sz = \[\[0.5, 0\] \[0, -0.5\]\] C = kroneckersum(Sz, Sz) D = sparse(C) display(issparse(D)) display(D) E = kronecker(Sz, Sz) …

---

## [Is there a way to abort a task that does not yield?](https://discourse.julialang.org/t/is-there-a-way-to-abort-a-task-that-does-not-yield/109468)

<div class="topic-metadata">

**Author:** [@taotree](https://discourse.julialang.org/u/taotree)\
**Replies:** 3\
**Last updated:** [January 31, 2024, 1:16pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-abort-a-task-that-does-not-yield/109468 "2024-01-31T13:16:03Z")

</div>

I searched for running a task with a timeout, but all the answers I found used async tasks which won’t work because the whole point is that the code doesn’t yield. I understand that killing a thread is generally bad, bu…

---

## [Distributed: Passing views of an array for read access to workers (using pmap)](https://discourse.julialang.org/t/distributed-passing-views-of-an-array-for-read-access-to-workers-using-pmap/109379)

<div class="topic-metadata">

**Author:** [@james](https://discourse.julialang.org/u/james)\
**Replies:** 8\
**Last updated:** [January 31, 2024, 9:42am UTC](https://discourse.julialang.org/t/distributed-passing-views-of-an-array-for-read-access-to-workers-using-pmap/109379 "2024-01-31T09:42:42Z")

</div>

I have a large array and want multiple workers to have read access to that array in parallel. Each worker works on a disjoint interval of the array. My plan was to create a view of each of the sections of the array, and…

---

## [What interface bugs have you ran into in the ecosystem?](https://discourse.julialang.org/t/what-interface-bugs-have-you-ran-into-in-the-ecosystem/109001)

<div class="topic-metadata">

**Author:** [@ckfinite](https://discourse.julialang.org/u/ckfinite)\
**Replies:** 35\
**Last updated:** [January 31, 2024, 8:33am UTC](https://discourse.julialang.org/t/what-interface-bugs-have-you-ran-into-in-the-ecosystem/109001 "2024-01-31T08:33:32Z")

</div>

I’m currently working on the formal design of a statically-checked trait system for Julia building off of our work on subtyping and static typing for Julia. The system as a whole is sadly some ways out yet because of a n…

---

## [Type Instability using StaticArrays that I dont get](https://discourse.julialang.org/t/type-instability-using-staticarrays-that-i-dont-get/109499)

<div class="topic-metadata">

**Author:** [@Christian\_Dengler](https://discourse.julialang.org/u/Christian_Dengler)\
**Replies:** 4\
**Last updated:** [January 31, 2024, 8:03am UTC](https://discourse.julialang.org/t/type-instability-using-staticarrays-that-i-dont-get/109499 "2024-01-31T08:03:30Z")

</div>

Hello, I have a type instability according to @code\_warntype in the following code. To me it seems all types should be inferable though. What would I need to change to make it type stable? using StaticArrays import Lin…

---

## [Error for install Plots.jl (especially Libtiff\_jll) help me!](https://discourse.julialang.org/t/error-for-install-plots-jl-especially-libtiff-jll-help-me/109484)

<div class="topic-metadata">

**Author:** [@bellroot](https://discourse.julialang.org/u/bellroot)\
**Replies:** 0\
**Last updated:** [January 31, 2024, 2:02am UTC](https://discourse.julialang.org/t/error-for-install-plots-jl-especially-libtiff-jll-help-me/109484 "2024-01-31T02:02:06Z")

</div>

Hello all, Recently, I upgraded Julia from version 1.9.0 to 1.10.0. After that, an error occurred when I tried to install Plots.jl (\*I am working in an environment where GitHub IP is blocked) Error message is like thi…

---

## [Why Is There a Significant Slow-down with DuckDB.jl Bridging?](https://discourse.julialang.org/t/why-is-there-a-significant-slow-down-with-duckdb-jl-bridging/109426)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 1\
**Last updated:** [January 30, 2024, 11:25pm UTC](https://discourse.julialang.org/t/why-is-there-a-significant-slow-down-with-duckdb-jl-bridging/109426 "2024-01-30T23:25:30Z")

</div>

I did an interesting little exploration with DuckDB.jl + bridging to another local database of a different SQL flavor today (SQLite). Here’s what I did: using BenchmarkTools using DBInterface using DuckDB using HealthSa…

---

## [Functors instead of arrays, matrices etc](https://discourse.julialang.org/t/functors-instead-of-arrays-matrices-etc/109282)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 22\
**Last updated:** [January 30, 2024, 4:24pm UTC](https://discourse.julialang.org/t/functors-instead-of-arrays-matrices-etc/109282 "2024-01-30T16:24:12Z")

</div>

So, there is this C++ eigen feature which I really like: CWiseNullaryOp. To sum it up, you can write a functor, which stores some values and returns some algorithms, and use this as a matrix. This permits you to not st…

---

## [CUDA race conditions](https://discourse.julialang.org/t/cuda-race-conditions/109458)

<div class="topic-metadata">

**Author:** [@trasor](https://discourse.julialang.org/u/trasor)\
**Replies:** 0\
**Last updated:** [January 30, 2024, 4:21pm UTC](https://discourse.julialang.org/t/cuda-race-conditions/109458 "2024-01-30T16:21:49Z")

</div>

Hi together, i try to paralize some of my code with Cuda kernels, but somehow produced race conditions: The kernel looks somewhat like: function updateB!(inputs) x = threadIdx().x + (blockIdx().x-1) \* blockDim().x i…

---

## [Large amount of memory allocation when using autodiff and IPNewton](https://discourse.julialang.org/t/large-amount-of-memory-allocation-when-using-autodiff-and-ipnewton/109451)

<div class="topic-metadata">

**Author:** [@TimOb](https://discourse.julialang.org/u/TimOb)\
**Replies:** 1\
**Last updated:** [January 30, 2024, 4:02pm UTC](https://discourse.julialang.org/t/large-amount-of-memory-allocation-when-using-autodiff-and-ipnewton/109451 "2024-01-30T16:02:37Z")

</div>

Hi all, I’m new to Julia and have been working on a model which essentially is a long loop over optimisation problems: for state = 1:n x0 = ones(5)/2; fun1(x) = -hh\_utility(x, state)\[1\]; …

---

## [Upper boundary for dispatch in Julia](https://discourse.julialang.org/t/upper-boundary-for-dispatch-in-julia/109405)

<div class="topic-metadata">

**Author:** [@BBReactionHooper](https://discourse.julialang.org/u/BBReactionHooper)\
**Replies:** 15\
**Last updated:** [January 30, 2024, 3:30pm UTC](https://discourse.julialang.org/t/upper-boundary-for-dispatch-in-julia/109405 "2024-01-30T15:30:14Z")

</div>

Hi fellows, I have a function, which can return five different types according to some conditions. Julia seems to have a problem with type-inference. I created a small example with a similar problem. We create a random …

---

## [Snap breaks Julia on Ubuntu](https://discourse.julialang.org/t/snap-breaks-julia-on-ubuntu/109452)

<div class="topic-metadata">

**Author:** [@sullivan](https://discourse.julialang.org/u/sullivan)\
**Replies:** 3\
**Last updated:** [January 30, 2024, 3:08pm UTC](https://discourse.julialang.org/t/snap-breaks-julia-on-ubuntu/109452 "2024-01-30T15:08:58Z")

</div>

Running julia via snap on Ubuntu 22.04. My user’s files are an nfs mount. After adding the directories to apparmor home.d, we are able to run Julia in the user’s home directory. But not in any subdirectories. Does anyon…

---

## [Fresh Julia/PyPlot install errors with \_imaging: the specified module could not be found](https://discourse.julialang.org/t/fresh-julia-pyplot-install-errors-with-imaging-the-specified-module-could-not-be-found/109311)

<div class="topic-metadata">

**Author:** [@alkoedl](https://discourse.julialang.org/u/alkoedl)\
**Replies:** 4\
**Last updated:** [January 30, 2024, 12:32pm UTC](https://discourse.julialang.org/t/fresh-julia-pyplot-install-errors-with-imaging-the-specified-module-could-not-be-found/109311 "2024-01-30T12:32:57Z")

</div>

After a long time with a perfectly well working PyPlot I today had to install Julia and PyPlot from scratch on a new computer. Adding PyPlot and building Conda/PyCall works. Upon “using PyPlot” conda/matplotlib are insta…

---

## [What are active scratchspaces and how to manage them?](https://discourse.julialang.org/t/what-are-active-scratchspaces-and-how-to-manage-them/109445)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 1\
**Last updated:** [January 30, 2024, 12:43pm UTC](https://discourse.julialang.org/t/what-are-active-scratchspaces-and-how-to-manage-them/109445 "2024-01-30T12:43:19Z")

</div>

Pkg.jl outputs pkg\> gc Active manifest files: 8 found Active artifact files: 121 found Active scratchspaces: 3 found Deleted no artifacts, repos, packages or scratchspaces The docs do not have an…

---

## [Multivariate polynomial with symbolic values](https://discourse.julialang.org/t/multivariate-polynomial-with-symbolic-values/109345)

<div class="topic-metadata">

**Author:** [@hugopottinger](https://discourse.julialang.org/u/hugopottinger)\
**Replies:** 3\
**Last updated:** [January 30, 2024, 10:21am UTC](https://discourse.julialang.org/t/multivariate-polynomial-with-symbolic-values/109345 "2024-01-30T10:21:42Z")

</div>

For a multivariate polynomial with symbolic coefficients such as p = ax + bx^2y + cx\*y I require in my code to be able to use functions similar to those in MultivariatePolynomials such as length(p), degree(p,x), coeffi…

---

## [Unexpected allocation](https://discourse.julialang.org/t/unexpected-allocation/109393)

<div class="topic-metadata">

**Author:** [@abraunst](https://discourse.julialang.org/u/abraunst)\
**Replies:** 7\
**Last updated:** [January 30, 2024, 8:45am UTC](https://discourse.julialang.org/t/unexpected-allocation/109393 "2024-01-30T08:45:33Z")

</div>

I’m trying to write an iteration for my type. The iteration needs to keep a Vector and an Int in its state. I cannot get rid of an allocation. I condensed the problem into the following MWE: function iter((i,v)) v\[…

---

## [Strategy help](https://discourse.julialang.org/t/strategy-help/109370)

<div class="topic-metadata">

**Author:** [@mpeters2](https://discourse.julialang.org/u/mpeters2)\
**Replies:** 23\
**Last updated:** [January 30, 2024, 6:42am UTC](https://discourse.julialang.org/t/strategy-help/109370 "2024-01-30T06:42:26Z")

</div>

I’d looking for some input on the best way to tackle this. Right now I have a struct that looks something like this: mutable struct Line win::Window startPoint::Vector{Int64} endPoint::Vector{Int64} li…

---

## [Maximum does not work on UInt](https://discourse.julialang.org/t/maximum-does-not-work-on-uint/109424)

<div class="topic-metadata">

**Author:** [@crinders](https://discourse.julialang.org/u/crinders)\
**Replies:** 7\
**Last updated:** [January 30, 2024, 6:24am UTC](https://discourse.julialang.org/t/maximum-does-not-work-on-uint/109424 "2024-01-30T06:24:59Z")

</div>

a = convert(UInt, 1) b= convert(UInt, 2) maximum(a, b) fails with ERROR: MethodError: objects of type UInt64 are not callable Maybe you forgot to use an operator such as \*, ^, %, / etc. ? Stacktrace: \[1\] mapreduce\_fir…

---

## [Custom Complex number type for specific Real type](https://discourse.julialang.org/t/custom-complex-number-type-for-specific-real-type/109374)

<div class="topic-metadata">

**Author:** [@mattsignorelli](https://discourse.julialang.org/u/mattsignorelli)\
**Replies:** 9\
**Last updated:** [January 30, 2024, 12:40am UTC](https://discourse.julialang.org/t/custom-complex-number-type-for-specific-real-type/109374 "2024-01-30T00:40:26Z")

</div>

Hello! I have implemented a Julia interface to a C library for a special number type. The real and complex types are handled internally by the C library, so I have Julia wrapper structs that are basically MyNumber and Co…

---

## [What is an elegant way to use Julia on a Linux server?](https://discourse.julialang.org/t/what-is-an-elegant-way-to-use-julia-on-a-linux-server/108890)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 29\
**Last updated:** [January 29, 2024, 5:22pm UTC](https://discourse.julialang.org/t/what-is-an-elegant-way-to-use-julia-on-a-linux-server/108890 "2024-01-29T17:22:50Z")

</div>

I know I can just throw a well-written script into the server and run it by command julia myScript.jl, or I can start julia and type some little code directly in the REPL. But is that all? I would like to learn some bet…

---

## [Parallelizing over an iterable](https://discourse.julialang.org/t/parallelizing-over-an-iterable/108936)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 18\
**Last updated:** [January 29, 2024, 5:07pm UTC](https://discourse.julialang.org/t/parallelizing-over-an-iterable/108936 "2024-01-29T17:07:44Z")

</div>

Suppose we are working with an iterable with known finite length. I have a function that does something like function makeresult(n::Int) it = makeiterator(n) res = 0.0 for x in it res += f(x) en…

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

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