# General Usage

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

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

**Page:** 367

---

## [Plots Broken on MacOS Ventura](https://discourse.julialang.org/t/plots-broken-on-macos-ventura/89386)

<div class="topic-metadata">

**Author:** [@liamfdoherty](https://discourse.julialang.org/u/liamfdoherty)\
**Replies:** 17\
**Last updated:** [November 20, 2022, 1:57am UTC](https://discourse.julialang.org/t/plots-broken-on-macos-ventura/89386 "2022-11-20T01:57:55Z")

</div>

I just upgraded to MacOS Ventura (13.0), and now, when I try to do a basic plot, e.g., with using Plots xvals = LinRange(0, 1, 100) f(x) = x^2 plot(xvals, f.(xvals)) I get the following error: Error showing value of t…

---

## [Rational Type support for DifferentialEquations](https://discourse.julialang.org/t/rational-type-support-for-differentialequations/90445)

<div class="topic-metadata">

**Author:** [@svretina](https://discourse.julialang.org/u/svretina)\
**Replies:** 5\
**Last updated:** [November 19, 2022, 7:14pm UTC](https://discourse.julialang.org/t/rational-type-support-for-differentialequations/90445 "2022-11-19T19:14:20Z")

</div>

Hello, I am trying to use the DifferentialEquations functions with Rational{BigInt} as data type. for simpler cases it works as it’s shown in https://tutorials.sciml.ai/html/type\_handling/01-number\_types.html Even tho…

---

## [How to delete all packages at once?](https://discourse.julialang.org/t/how-to-delete-all-packages-at-once/50393)

<div class="topic-metadata">

**Author:** [@Tomas\_Berky](https://discourse.julialang.org/u/Tomas_Berky)\
**Replies:** 3\
**Last updated:** [November 19, 2022, 5:09pm UTC](https://discourse.julialang.org/t/how-to-delete-all-packages-at-once/50393 "2022-11-19T17:09:38Z")

</div>

Hello guys, i want to delete all packages added. Can it be done by one command? Also i want to ask if it can be done with some lines in script(i am using atom to study julia)?

---

## [Plot Cosecant with Custom x axis (in pi)](https://discourse.julialang.org/t/plot-cosecant-with-custom-x-axis-in-pi/90491)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 3\
**Last updated:** [November 19, 2022, 2:01pm UTC](https://discourse.julialang.org/t/plot-cosecant-with-custom-x-axis-in-pi/90491 "2022-11-19T14:01:30Z")

</div>

Hi all I want to plot Cosecant function with the x axis in pi. But the function can’t be plot correctly: using Plots, LaTeXStrings gr() function pitick(start, stop, denom; mode=:text) a = Int(cld(start, π/denom)) …

---

## [Saving/exporting objects on hard drive](https://discourse.julialang.org/t/saving-exporting-objects-on-hard-drive/90492)

<div class="topic-metadata">

**Author:** [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)\
**Replies:** 6\
**Last updated:** [November 19, 2022, 1:33pm UTC](https://discourse.julialang.org/t/saving-exporting-objects-on-hard-drive/90492 "2022-11-19T13:33:39Z")

</div>

I am trying to save/export objects in memory to my hard drive. I have found two packages that should allow me to do that: JLD and JLD2. However, both only return errors. Has anyone an idea on how to do that/where my err…

---

## [Problem using SBML package](https://discourse.julialang.org/t/problem-using-sbml-package/90382)

<div class="topic-metadata">

**Author:** [@FH96](https://discourse.julialang.org/u/FH96)\
**Replies:** 5\
**Last updated:** [November 19, 2022, 12:59pm UTC](https://discourse.julialang.org/t/problem-using-sbml-package/90382 "2022-11-19T12:59:41Z")

</div>

Hi everyone! I am trying to use SBML package. I read a xml model by readSBML. According to the docs, getS and getUBs should give the stoichiometric matrix and upper boundary of the reactions, respectively. However when…

---

## [Help with YAML](https://discourse.julialang.org/t/help-with-yaml/90493)

<div class="topic-metadata">

**Author:** [@roh\_codeur](https://discourse.julialang.org/u/roh_codeur)\
**Replies:** 0\
**Last updated:** [November 19, 2022, 12:33pm UTC](https://discourse.julialang.org/t/help-with-yaml/90493 "2022-11-19T12:33:31Z")

</div>

Hi is there a way to include a YAML in another YAML please? #bar.yaml a: 1 b: 2 z: &z1 baseProp: 123 #foo.yaml !include bar.yaml a: 100 y: \[1, 2, 3\] z2: \*z1 resulting yml: a:100 b: 2 z2: baseProp: 123 I define …

---

## [Creating an empty list and adding elements to it](https://discourse.julialang.org/t/creating-an-empty-list-and-adding-elements-to-it/90479)

<div class="topic-metadata">

**Author:** [@FH96](https://discourse.julialang.org/u/FH96)\
**Replies:** 3\
**Last updated:** [November 19, 2022, 10:49am UTC](https://discourse.julialang.org/t/creating-an-empty-list-and-adding-elements-to-it/90479 "2022-11-19T10:49:56Z")

</div>

Hi! I want to make an empty list or vector or dataframe and add elements which are of tyep String31 to it. But trying the dataframe option and push! I face this error: " ArgumentError: it is not allowed to insert colle…

---

## [PyPlot stopped working when upgrading to Fedora 37](https://discourse.julialang.org/t/pyplot-stopped-working-when-upgrading-to-fedora-37/90485)

<div class="topic-metadata">

**Author:** [@marllos](https://discourse.julialang.org/u/marllos)\
**Replies:** 4\
**Last updated:** [November 19, 2022, 4:10am UTC](https://discourse.julialang.org/t/pyplot-stopped-working-when-upgrading-to-fedora-37/90485 "2022-11-19T04:10:13Z")

</div>

Hello everyone! I upgraded my system from Fedora 35 to Fedora 37 and the PyPlot package stopped working. There are many error messages when I run using PyPlot, suggesting that the matplotlib library may not be installed…

---

## [Automatic direct labels for Makie with Voronoi tessellation](https://discourse.julialang.org/t/automatic-direct-labels-for-makie-with-voronoi-tessellation/90247)

<div class="topic-metadata">

**Author:** [@dgleich](https://discourse.julialang.org/u/dgleich)\
**Replies:** 8\
**Last updated:** [November 19, 2022, 3:20am UTC](https://discourse.julialang.org/t/automatic-direct-labels-for-makie-with-voronoi-tessellation/90247 "2022-11-19T03:20:23Z")

</div>

Best practice for making plots is to directly label lines and avoid indirect legends. (See discussions by Edward Tufte on this: https://twitter.com/EdwardTufte/status/1274213603151880192/photo/1) I’ve been trying to ad…

---

## [Using ROS.jl, and running rosrun to run a .jl file, the JLD load function says file not found](https://discourse.julialang.org/t/using-ros-jl-and-running-rosrun-to-run-a-jl-file-the-jld-load-function-says-file-not-found/90440)

<div class="topic-metadata">

**Author:** [@Nishant\_Mohanty](https://discourse.julialang.org/u/Nishant_Mohanty)\
**Replies:** 1\
**Last updated:** [November 19, 2022, 1:00am UTC](https://discourse.julialang.org/t/using-ros-jl-and-running-rosrun-to-run-a-jl-file-the-jld-load-function-says-file-not-found/90440 "2022-11-19T01:00:11Z")

</div>

Hello all, I am try to generate a precomputed matrix. And then use it within a online controller on the robots. I am using ROS.jl for the same. However when I am importing the saved matrix as: vars = load("data2.jld") …

---

## [Experiments in speeding up runtime dispatch for integer value specialization](https://discourse.julialang.org/t/experiments-in-speeding-up-runtime-dispatch-for-integer-value-specialization/90355)

<div class="topic-metadata">

**Author:** [@user664303](https://discourse.julialang.org/u/user664303)\
**Replies:** 28\
**Last updated:** [November 18, 2022, 10:45pm UTC](https://discourse.julialang.org/t/experiments-in-speeding-up-runtime-dispatch-for-integer-value-specialization/90355 "2022-11-18T22:45:22Z")

</div>

I am trying to develop a package that needs to operate on small matrices, the size of which isn’t known at runtime. Nevertheless, there is a lot of performance to be gained by specializing/parameterizing particular funct…

---

## [Function calculating in BigFloat/Float64](https://discourse.julialang.org/t/function-calculating-in-bigfloat-float64/90454)

<div class="topic-metadata">

**Author:** [@gvdeynde](https://discourse.julialang.org/u/gvdeynde)\
**Replies:** 4\
**Last updated:** [November 18, 2022, 9:11pm UTC](https://discourse.julialang.org/t/function-calculating-in-bigfloat-float64/90454 "2022-11-18T21:11:26Z")

</div>

Hi all What would be the Julian approach to writing a function that, depending on an Integer parameter (the precision) would calculate using either Float64 or BigFloat and return the result in Float64 or BigFloat accord…

---

## [Distributed Computing without passing large Data Structure](https://discourse.julialang.org/t/distributed-computing-without-passing-large-data-structure/90469)

<div class="topic-metadata">

**Author:** [@astrobc1](https://discourse.julialang.org/u/astrobc1)\
**Replies:** 2\
**Last updated:** [November 18, 2022, 9:03pm UTC](https://discourse.julialang.org/t/distributed-computing-without-passing-large-data-structure/90469 "2022-11-18T21:03:54Z")

</div>

I’m trying to use distributed computing without having to pass a large Vector to each worker. Each worker only needs a single item from the Vector. I should also clarify that I cannot use SharedArrays (at least to my kno…

---

## [How to properly implement lazy compilation of submodules? Problem with invokelatest for kwarg functions](https://discourse.julialang.org/t/how-to-properly-implement-lazy-compilation-of-submodules-problem-with-invokelatest-for-kwarg-functions/90459)

<div class="topic-metadata">

**Author:** [@vpetukhov](https://discourse.julialang.org/u/vpetukhov)\
**Replies:** 0\
**Last updated:** [November 18, 2022, 3:44pm UTC](https://discourse.julialang.org/t/how-to-properly-implement-lazy-compilation-of-submodules-problem-with-invokelatest-for-kwarg-functions/90459 "2022-11-18T15:44:54Z")

</div>

Inspired by LazyModules I’m trying to make delayed loading of some of submodules from my package. However, it implies that at some point I need to update a module definition on the fly. It works well with normal function…

---

## [How to approximate a distribution function from an arbitrary list?](https://discourse.julialang.org/t/how-to-approximate-a-distribution-function-from-an-arbitrary-list/90471)

<div class="topic-metadata">

**Author:** [@somranger](https://discourse.julialang.org/u/somranger)\
**Replies:** 5\
**Last updated:** [November 18, 2022, 7:35pm UTC](https://discourse.julialang.org/t/how-to-approximate-a-distribution-function-from-an-arbitrary-list/90471 "2022-11-18T19:35:59Z")

</div>

I hope to obtain a approximated distribution function from list, counting exsiting times of each element. Is there any package can achieve this? In mathematica, function SmoothKernelDistribution (in Wolfram document, it…

---

## [Running tests from a GitLab mirror and showing results in GitHub](https://discourse.julialang.org/t/running-tests-from-a-gitlab-mirror-and-showing-results-in-github/90149)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 12\
**Last updated:** [November 18, 2022, 7:35pm UTC](https://discourse.julialang.org/t/running-tests-from-a-gitlab-mirror-and-showing-results-in-github/90149 "2022-11-18T19:35:11Z")

</div>

I know that at least some projects (e.g., GitHub - JuliaPerf/LIKWID.jl: Julia wrapper for the performance monitoring and benchmarking suite LIKWID.) use a setup where they mirror their GitHub repositories to a GitLab ins…

---

## [Optim: Why am I able to mutate array elements but not Int?](https://discourse.julialang.org/t/optim-why-am-i-able-to-mutate-array-elements-but-not-int/89924)

<div class="topic-metadata">

**Author:** [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)\
**Replies:** 13\
**Last updated:** [November 18, 2022, 5:37pm UTC](https://discourse.julialang.org/t/optim-why-am-i-able-to-mutate-array-elements-but-not-int/89924 "2022-11-18T17:37:15Z")

</div>

I am trying to pass an object inside a function I optimize with Optim.jl, mutate it, and access the result in the next iteration. While testing, I noticed that I can change elements of an array, defined outside of the f…

---

## [Any suggestion on how to increase CPU usage in Flux?](https://discourse.julialang.org/t/any-suggestion-on-how-to-increase-cpu-usage-in-flux/90467)

<div class="topic-metadata">

**Author:** [@tiZ](https://discourse.julialang.org/u/tiZ)\
**Replies:** 0\
**Last updated:** [November 18, 2022, 5:26pm UTC](https://discourse.julialang.org/t/any-suggestion-on-how-to-increase-cpu-usage-in-flux/90467 "2022-11-18T17:26:03Z")

</div>

Hi, I open this topic because I found that sometimes Flux can use 100% of the CPU, but sometimes it only uses half. For example, here is two demo model, model A have fewer hidden layers than B. Trainning model A, the C…

---

## [Debug checks without output](https://discourse.julialang.org/t/debug-checks-without-output/90458)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 5\
**Last updated:** [November 18, 2022, 4:02pm UTC](https://discourse.julialang.org/t/debug-checks-without-output/90458 "2022-11-18T16:02:15Z")

</div>

hello, is it correct way to use a large number of checks in the code without output, and then turn them off at once? const USE\_DEBUG\_CODE\_BLOCKS = true macro debug\_code\_block(expr) USE\_DEBUG\_CODE\_BLOCKS || return n…

---

## [How to install a specific version of a package with Pkg.add("...")](https://discourse.julialang.org/t/how-to-install-a-specific-version-of-a-package-with-pkg-add/29242)

<div class="topic-metadata">

**Author:** [@steph\_de\_paris](https://discourse.julialang.org/u/steph_de_paris)\
**Replies:** 9\
**Last updated:** [November 18, 2022, 3:47pm UTC](https://discourse.julialang.org/t/how-to-install-a-specific-version-of-a-package-with-pkg-add/29242 "2022-11-18T15:47:27Z")

</div>

Hello, I know that is is possible to install a specific version of a package with pkg\> add xxx@1.2.3 (for example) in the julia\> window. Nevertheless, is-it possible to do this with something like Pkg.add("xxx@1.2.3"…

---

## [Position in matrix without using findall](https://discourse.julialang.org/t/position-in-matrix-without-using-findall/90451)

<div class="topic-metadata">

**Author:** [@amar.korvac](https://discourse.julialang.org/u/amar.korvac)\
**Replies:** 2\
**Last updated:** [November 18, 2022, 2:15pm UTC](https://discourse.julialang.org/t/position-in-matrix-without-using-findall/90451 "2022-11-18T14:15:28Z")

</div>

Hello people, I need help. I don’t know how to find position of non-zero elements in matrix , but without using findall. I know only with findall.:joy:

---

## [Why can't this named tuple be converted to a supertype?](https://discourse.julialang.org/t/why-cant-this-named-tuple-be-converted-to-a-supertype/90329)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 11\
**Last updated:** [November 18, 2022, 2:03pm UTC](https://discourse.julialang.org/t/why-cant-this-named-tuple-be-converted-to-a-supertype/90329 "2022-11-18T14:03:43Z")

</div>

In the following two somewhat similar chunks of code the first generates an error, the other does not. Any ideas about why? using DataFrames, Dates NT1 = NamedTuple{(:DFPrecalc,:VPrecalc), Tuple{DataFrame,S}} where S …

---

## [Indexing a StructVector with an MVector fails](https://discourse.julialang.org/t/indexing-a-structvector-with-an-mvector-fails/90446)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 4\
**Last updated:** [November 18, 2022, 1:13pm UTC](https://discourse.julialang.org/t/indexing-a-structvector-with-an-mvector-fails/90446 "2022-11-18T13:13:29Z")

</div>

Why does indexing a StructVector with an MVector fail? E.g., I have meas\_idx 7-element MVector{7, Int64} with indices SOneTo(7): 809 267 1721 1165 643 716 1808 and pc\[meas\_idx\] ArgumentError: invalid ind…

---

## [Is the latest stable (macOS) version of Julia 1.8.2 or 1.8.3?](https://discourse.julialang.org/t/is-the-latest-stable-macos-version-of-julia-1-8-2-or-1-8-3/90416)

<div class="topic-metadata">

**Author:** [@suschizu](https://discourse.julialang.org/u/suschizu)\
**Replies:** 3\
**Last updated:** [November 18, 2022, 12:50pm UTC](https://discourse.julialang.org/t/is-the-latest-stable-macos-version-of-julia-1-8-2-or-1-8-3/90416 "2022-11-18T12:50:47Z")

</div>

the github project already marked 1.8.3 as latest stable version but the website download is still on 1.8.2 … could somebody clarify this please? thanks

---

## [Using ForwardDiff results in a stack overflow](https://discourse.julialang.org/t/using-forwarddiff-results-in-a-stack-overflow/90399)

<div class="topic-metadata">

**Author:** [@c\_sell](https://discourse.julialang.org/u/c_sell)\
**Replies:** 4\
**Last updated:** [November 18, 2022, 12:16pm UTC](https://discourse.julialang.org/t/using-forwarddiff-results-in-a-stack-overflow/90399 "2022-11-18T12:16:46Z")

</div>

Hi, im using the ForwardDiff package. The following code is only a simplification of the real problem. But I am getting there as well a stack overflow in the line of the LU decomposition. using ForwardDiff, LinearAlgeb…

---

## [Are "optimized" single thread algorithms typically different than "optimized" multithread implementations?](https://discourse.julialang.org/t/are-optimized-single-thread-algorithms-typically-different-than-optimized-multithread-implementations/90412)

<div class="topic-metadata">

**Author:** [@JohnS](https://discourse.julialang.org/u/JohnS)\
**Replies:** 8\
**Last updated:** [November 18, 2022, 9:33am UTC](https://discourse.julialang.org/t/are-optimized-single-thread-algorithms-typically-different-than-optimized-multithread-implementations/90412 "2022-11-18T09:33:41Z")

</div>

Thanks for your help everyone! I’m relatively new to multithreading and I’m probably wrong, but it seems like the fastest function for the desired output using a single thread doesn’t parallelize well. However, a for-lo…

---

## [Installing packages via an SSH SOCKS proxy on a compute cluster](https://discourse.julialang.org/t/installing-packages-via-an-ssh-socks-proxy-on-a-compute-cluster/71735)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 6\
**Last updated:** [November 18, 2022, 9:21am UTC](https://discourse.julialang.org/t/installing-packages-via-an-ssh-socks-proxy-on-a-compute-cluster/71735 "2022-11-18T09:21:35Z")

</div>

I have spent the better part of a day figuring this out, so I thought it might be interesting to share for others: In my case, I would like to run Julia on a university cluster with very restricted internet access from …

---

## [How to avoid deadlocking on finite channel](https://discourse.julialang.org/t/how-to-avoid-deadlocking-on-finite-channel/90429)

<div class="topic-metadata">

**Author:** [@HANHAOHAN](https://discourse.julialang.org/u/HANHAOHAN)\
**Replies:** 5\
**Last updated:** [November 18, 2022, 9:20am UTC](https://discourse.julialang.org/t/how-to-avoid-deadlocking-on-finite-channel/90429 "2022-11-18T09:20:38Z")

</div>

code as following will deadlock. c = Channel(2) t1 = Threads.@spawn begin while !trylock(c) yield() println("trylock for reading") end try put!(c, rand()) put!(c, rand()) …

---

## [How to specify \`margins\` to \`0mm\` in RecipesBase.jl?](https://discourse.julialang.org/t/how-to-specify-margins-to-0mm-in-recipesbase-jl/90384)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 3\
**Last updated:** [November 18, 2022, 1:25am UTC](https://discourse.julialang.org/t/how-to-specify-margins-to-0mm-in-recipesbase-jl/90384 "2022-11-18T01:25:39Z")

</div>

If I want to create a recipe for my type with only RecipesBase.@recipe, I seem not to be able to specify all margins to be 0 or 0mm, where it requires a Measure type, which is defined in Plots.Measures module. How can I …

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

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