# General Usage

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

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

**Page:** 489

---

## [Rust / Julia Comparison Post](https://discourse.julialang.org/t/rust-julia-comparison-post/75403)

<div class="topic-metadata">

**Author:** [@johnmyleswhite](https://discourse.julialang.org/u/johnmyleswhite)\
**Replies:** 56\
**Last updated:** [February 1, 2022, 11:38pm UTC](https://discourse.julialang.org/t/rust-julia-comparison-post/75403 "2022-02-01T23:38:10Z")

</div>

This post is on Hacker News right now – it seems worth digging in to understand why Rust does so much better here given that the code seem like a fairly naive port without much optimization effort: Julia Rust

---

## [Need resource for worked examples for simple things](https://discourse.julialang.org/t/need-resource-for-worked-examples-for-simple-things/75579)

<div class="topic-metadata">

**Author:** [@anon69491625](https://discourse.julialang.org/u/anon69491625)\
**Replies:** 8\
**Last updated:** [February 1, 2022, 10:56pm UTC](https://discourse.julialang.org/t/need-resource-for-worked-examples-for-simple-things/75579 "2022-02-01T22:56:23Z")

</div>

Hi all working my way through the high level concepts and hitting a stumbling block. My first inclination is to look at a simple worked example and figure out what I don’t understand. So an example is that I wanted to l…

---

## [Plots PyPlot backend issue](https://discourse.julialang.org/t/plots-pyplot-backend-issue/75608)

<div class="topic-metadata">

**Author:** [@vepiteski](https://discourse.julialang.org/u/vepiteski)\
**Replies:** 0\
**Last updated:** [February 1, 2022, 10:52pm UTC](https://discourse.julialang.org/t/plots-pyplot-backend-issue/75608 "2022-02-01T22:52:19Z")

</div>

Hi Using the pyplot backend triggered segmentation fault in the REPL. After uninstalling everything related to Plots and PyPlot, trying fresh environments, I reluctantly reinstalled ALL my julia setup from scratch. Now…

---

## [UnionAll as a Type Parameter](https://discourse.julialang.org/t/unionall-as-a-type-parameter/75585)

<div class="topic-metadata">

**Author:** [@RGon](https://discourse.julialang.org/u/RGon)\
**Replies:** 3\
**Last updated:** [February 1, 2022, 9:56pm UTC](https://discourse.julialang.org/t/unionall-as-a-type-parameter/75585 "2022-02-01T21:56:58Z")

</div>

I’m trying to build a structure that separates parametric types (UnionAll) into three categories (Gaussian Alarms, Gaussian Observations, and Reset Observations). I regularly deal with many different UnionAll types. I tr…

---

## [Performance of custom \`Vec\` type versus \`SVector{3, Float64}\`](https://discourse.julialang.org/t/performance-of-custom-vec-type-versus-svector-3-float64/75594)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 4\
**Last updated:** [February 1, 2022, 7:47pm UTC](https://discourse.julialang.org/t/performance-of-custom-vec-type-versus-svector-3-float64/75594 "2022-02-01T19:47:05Z")

</div>

I’m having trouble replicating the performance of SVector{3, Float64} with my own custom Vec type. Here’s the code: using LinearAlgebra using StaticArrays using BenchmarkTools struct Vec x::Float64 y::Float64 …

---

## [How to control threads in combination of LoopVectorization and @spawn](https://discourse.julialang.org/t/how-to-control-threads-in-combination-of-loopvectorization-and-spawn/75466)

<div class="topic-metadata">

**Author:** [@Chiil](https://discourse.julialang.org/u/Chiil)\
**Replies:** 6\
**Last updated:** [February 1, 2022, 7:26pm UTC](https://discourse.julialang.org/t/how-to-control-threads-in-combination-of-loopvectorization-and-spawn/75466 "2022-02-01T19:26:56Z")

</div>

I am having a simple test program to learn how to divide work over threads. If I launch with one thread, the output is: ──────────────────────────────────────────────────────────────────── Ti…

---

## [Parallelizing a Nested Loop Concurrently](https://discourse.julialang.org/t/parallelizing-a-nested-loop-concurrently/75402)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 17\
**Last updated:** [February 1, 2022, 5:23pm UTC](https://discourse.julialang.org/t/parallelizing-a-nested-loop-concurrently/75402 "2022-02-01T17:23:03Z")

</div>

Hi! I am trying to code a problem in which I have two loops. An inner loop that a computes a sample average for a given agent using many many simulations of a particular function (which is not trivial, but each individua…

---

## [Mixed-mode automatic differentiation using ForwardDiff and ReverseDiff](https://discourse.julialang.org/t/mixed-mode-automatic-differentiation-using-forwarddiff-and-reversediff/74440)

<div class="topic-metadata">

**Author:** [@StevenWhitaker](https://discourse.julialang.org/u/StevenWhitaker)\
**Replies:** 9\
**Last updated:** [February 1, 2022, 5:22pm UTC](https://discourse.julialang.org/t/mixed-mode-automatic-differentiation-using-forwarddiff-and-reversediff/74440 "2022-02-01T17:22:19Z")

</div>

I need to take the gradient of a function. I can use ForwardDiff without any issues, but for part of my code I have found ReverseDiff to run much faster. The issue is that the other part of my code errors with ReverseDif…

---

## [Is there a function that extracts the index from an element of a CategoricalArray created by the function \`cut\`?](https://discourse.julialang.org/t/is-there-a-function-that-extracts-the-index-from-an-element-of-a-categoricalarray-created-by-the-function-cut/75551)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 6\
**Last updated:** [February 1, 2022, 3:40pm UTC](https://discourse.julialang.org/t/is-there-a-function-that-extracts-the-index-from-an-element-of-a-categoricalarray-created-by-the-function-cut/75551 "2022-02-01T15:40:38Z")

</div>

The function cut in the CategoricalArray package returns a CategoricalArray object, as in this example: x = rand(10) ct = cut(x, 3) "Q3: \[0.735346, 0.972399\]" "Q2: \[0.335188, 0.735346)" "Q1: \[0.00586079, 0.335188)" …

---

## [DataFrame join rename multiple columns in join command](https://discourse.julialang.org/t/dataframe-join-rename-multiple-columns-in-join-command/75574)

<div class="topic-metadata">

**Author:** [@korilium](https://discourse.julialang.org/u/korilium)\
**Replies:** 1\
**Last updated:** [February 1, 2022, 1:02pm UTC](https://discourse.julialang.org/t/dataframe-join-rename-multiple-columns-in-join-command/75574 "2022-02-01T13:02:46Z")

</div>

So i want to outerjoin three dataframes and rename their columns at the same time. Here is the code that I try to do using DataFramesMeta, Dates, Plots, DataFrames, MarketData, PyCall start = DateTime(2018,1,1) IBCI =…

---

## [List of pairs](https://discourse.julialang.org/t/list-of-pairs/75564)

<div class="topic-metadata">

**Author:** [@ahmad88](https://discourse.julialang.org/u/ahmad88)\
**Replies:** 9\
**Last updated:** [February 1, 2022, 10:55am UTC](https://discourse.julialang.org/t/list-of-pairs/75564 "2022-02-01T10:55:25Z")

</div>

Hi How I can create a list of pairs, something like A\[1\]=\[(1,2),(1,5),(2,4)\] A\[2\]=\[(3,4),(2,5),(3,6)\] and append new pairs to it and access the element of it ??

---

## [Pluto frozen: "waiting for api.github.com"](https://discourse.julialang.org/t/pluto-frozen-waiting-for-api-github-com/75565)

<div class="topic-metadata">

**Author:** [@maajdl](https://discourse.julialang.org/u/maajdl)\
**Replies:** 0\
**Last updated:** [February 1, 2022, 9:30am UTC](https://discourse.julialang.org/t/pluto-frozen-waiting-for-api-github-com/75565 "2022-02-01T09:30:08Z")

</div>

Hello Since a few days, I have difficulties to start Pluto. I get this message on the status bar: waiting for api.github.com Any idea what it means, and if I could solve that? Thanks, Michel

---

## [Parameterising types with multiple parameters](https://discourse.julialang.org/t/parameterising-types-with-multiple-parameters/75562)

<div class="topic-metadata">

**Author:** [@torrance](https://discourse.julialang.org/u/torrance)\
**Replies:** 3\
**Last updated:** [February 1, 2022, 8:23am UTC](https://discourse.julialang.org/t/parameterising-types-with-multiple-parameters/75562 "2022-02-01T08:23:32Z")

</div>

I have a type parameterised by floating point precision, something like this: struct MyType{T \<: AbstractFloat} x::T data::Array{T} end Note that it’s import that the type of x and the type of the array data ma…

---

## [Best practice for user-customizable methods](https://discourse.julialang.org/t/best-practice-for-user-customizable-methods/75552)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 3\
**Last updated:** [February 1, 2022, 5:27am UTC](https://discourse.julialang.org/t/best-practice-for-user-customizable-methods/75552 "2022-02-01T05:27:52Z")

</div>

Suppose there is a function in some package for which I want to implement a custom method in my own package MyPackage. However, I also want users of MyPackage to customize/overwrite that method further if they want. I’m …

---

## [PyPlot on remote server](https://discourse.julialang.org/t/pyplot-on-remote-server/40049)

<div class="topic-metadata">

**Author:** [@hongchengni](https://discourse.julialang.org/u/hongchengni)\
**Replies:** 0\
**Last updated:** [May 23, 2020, 10:00pm UTC](https://discourse.julialang.org/t/pyplot-on-remote-server/40049 "2020-05-23T22:00:47Z")

</div>

Hello, I am used to the Python Matplotlib package for plotting figures, which is packaged as PyPlot in Julia. When I want to use it for plotting on a remote server, which does not support GUI, I want to save the plot to …

---

## [Possible to plot ylabels and yticks on left and right using twinx() and pyplot?](https://discourse.julialang.org/t/possible-to-plot-ylabels-and-yticks-on-left-and-right-using-twinx-and-pyplot/75549)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 2\
**Last updated:** [February 1, 2022, 12:10am UTC](https://discourse.julialang.org/t/possible-to-plot-ylabels-and-yticks-on-left-and-right-using-twinx-and-pyplot/75549 "2022-02-01T00:10:22Z")

</div>

I’m having trouble making a plot with labels and ticks on the left and right sides. Perhaps this capability has stopped working? According to this question from a couple years ago, it looks like it was working then. How…

---

## [Stats on expanding or moving data windows](https://discourse.julialang.org/t/stats-on-expanding-or-moving-data-windows/75534)

<div class="topic-metadata">

**Author:** [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Replies:** 3\
**Last updated:** [January 31, 2022, 9:08pm UTC](https://discourse.julialang.org/t/stats-on-expanding-or-moving-data-windows/75534 "2022-01-31T21:08:22Z")

</div>

I am coding up functions for means/std/corr/OLS on expanding/moving inclusion/moving exclusion windows. So far, a simple approach (mostly loops) seems to provide pretty nice performance. My question: is this already don…

---

## [Dict subtype definition](https://discourse.julialang.org/t/dict-subtype-definition/75496)

<div class="topic-metadata">

**Author:** [@iskyd](https://discourse.julialang.org/u/iskyd)\
**Replies:** 5\
**Last updated:** [January 31, 2022, 7:15pm UTC](https://discourse.julialang.org/t/dict-subtype-definition/75496 "2022-01-31T19:15:46Z")

</div>

I want to define the data type of a dictionary using subtype definition. I’m trying to do seomthing like Dict{String, \<:Union{String, Vector{String}}} but if I try Dict{String, \<:Union{String, Vector{String}}}() I g…

---

## [Strange behavior of @views with reverse indexing](https://discourse.julialang.org/t/strange-behavior-of-views-with-reverse-indexing/75508)

<div class="topic-metadata">

**Author:** [@romainvieme](https://discourse.julialang.org/u/romainvieme)\
**Replies:** 10\
**Last updated:** [January 31, 2022, 6:02pm UTC](https://discourse.julialang.org/t/strange-behavior-of-views-with-reverse-indexing/75508 "2022-01-31T18:02:09Z")

</div>

I’ve noticed a strange behavior using @views with reverse indexing. When I execute the following code: using LinearAlgebra A=\[1.0; 2.0\]; B=\[3.0; 4.0\]; C = zeros(1); D = zeros(1); mul!(C, A\[1:end\]', B\[end:-1:1\]) @views …

---

## [How to suppress/hide all the warnings in IJulia or Julia language?](https://discourse.julialang.org/t/how-to-suppress-hide-all-the-warnings-in-ijulia-or-julia-language/5110)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 17\
**Last updated:** [January 31, 2022, 4:14pm UTC](https://discourse.julialang.org/t/how-to-suppress-hide-all-the-warnings-in-ijulia-or-julia-language/5110 "2022-01-31T16:14:56Z")

</div>

There are a lot of warnings which are always of no need to be fixed, while including code files. This makes the IJulia page messy. How to hide these warnings in Julia language or IJulia? Can anyone help? Thanks! Th…

---

## [Fixing Makie light position after moving the camera](https://discourse.julialang.org/t/fixing-makie-light-position-after-moving-the-camera/75514)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 0\
**Last updated:** [January 31, 2022, 3:37pm UTC](https://discourse.julialang.org/t/fixing-makie-light-position-after-moving-the-camera/75514 "2022-01-31T15:37:11Z")

</div>

Using Makie 0.16.3, the light look OK with the default camera position: using GLMakie f, a, p = meshscatter(0:1, 0:1, 0:1, color=\[:blue, :green\], markersize=0.3) update\_cam!(a.scene, (1.5, 3, 3), (0.5, -0.5, -0.5)) …

---

## [Lookup in Dict{Int,Float64} allocates](https://discourse.julialang.org/t/lookup-in-dict-int-float64-allocates/75495)

<div class="topic-metadata">

**Author:** [@johnomotani](https://discourse.julialang.org/u/johnomotani)\
**Replies:** 2\
**Last updated:** [January 31, 2022, 12:27pm UTC](https://discourse.julialang.org/t/lookup-in-dict-int-float64-allocates/75495 "2022-01-31T12:27:12Z")

</div>

I was surprised that the following code reports an allocation when looking up a Float64 value from a Dict{Int64,Float64} using BenchmarkTools n = 1\_000\_000 d = Dict(i=\>rand() for i in 1:n); @btime d\[42\] # 19.346 ns (1 …

---

## [Julia jargon/terminology definitions - please check!](https://discourse.julialang.org/t/julia-jargon-terminology-definitions-please-check/75234)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [January 31, 2022, 9:35am UTC](https://discourse.julialang.org/t/julia-jargon-terminology-definitions-please-check/75234 "2022-01-31T09:35:38Z")

</div>

I am not sure these definitions are correct, so can you help me in checking them? Tk! primitive type: A type defined with the “primitive type” keyword. Objects of a primitive type have a given fixed memory size specif…

---

## [Norm of Number type I define](https://discourse.julialang.org/t/norm-of-number-type-i-define/75365)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 7\
**Last updated:** [January 31, 2022, 8:50am UTC](https://discourse.julialang.org/t/norm-of-number-type-i-define/75365 "2022-01-31T08:50:17Z")

</div>

I have implemented my own Type of Real (let’s call it My) Julia’s boast holds true: having defined “all” the operations for My, Julia is “unreasonably” effective at giving me all sorts of matrix algebra operations at ze…

---

## [C project utility scripts in Julia](https://discourse.julialang.org/t/c-project-utility-scripts-in-julia/75454)

<div class="topic-metadata">

**Author:** [@Gravlax](https://discourse.julialang.org/u/Gravlax)\
**Replies:** 6\
**Last updated:** [January 31, 2022, 7:39am UTC](https://discourse.julialang.org/t/c-project-utility-scripts-in-julia/75454 "2022-01-31T07:39:17Z")

</div>

Dear all, I was wondering if anyone has experience with the development of utility tools for a main code written in another language (e.g. C). Several activities around such code would require some kind of scripting (co…

---

## [How do I change the default location for animation files in Javis?](https://discourse.julialang.org/t/how-do-i-change-the-default-location-for-animation-files-in-javis/75479)

<div class="topic-metadata">

**Author:** [@BinChicken42](https://discourse.julialang.org/u/BinChicken42)\
**Replies:** 2\
**Last updated:** [January 31, 2022, 6:43am UTC](https://discourse.julialang.org/t/how-do-i-change-the-default-location-for-animation-files-in-javis/75479 "2022-01-31T06:43:34Z")

</div>

When I render a Javis animation, it creates a animation file in the same folder as the code file. Is there a way to change something so that all of my animation files are made in one location, such as a folder just for m…

---

## [Regarding the multithreaded performance of OpenBLAS](https://discourse.julialang.org/t/regarding-the-multithreaded-performance-of-openblas/75450)

<div class="topic-metadata">

**Author:** [@ash](https://discourse.julialang.org/u/ash)\
**Replies:** 7\
**Last updated:** [January 31, 2022, 6:33am UTC](https://discourse.julialang.org/t/regarding-the-multithreaded-performance-of-openblas/75450 "2022-01-31T06:33:25Z")

</div>

I have been benchmarking some code and coming across all sorts of questions (see my other thread for in-depth details, I will post a progress update soon). However, I have an OpenBLAS question that I believe merits its …

---

## [Segfault and crash embedding when julia runs multithreaded gc](https://discourse.julialang.org/t/segfault-and-crash-embedding-when-julia-runs-multithreaded-gc/75221)

<div class="topic-metadata">

**Author:** [@xapkohheh](https://discourse.julialang.org/u/xapkohheh)\
**Replies:** 37\
**Last updated:** [January 31, 2022, 1:57am UTC](https://discourse.julialang.org/t/segfault-and-crash-embedding-when-julia-runs-multithreaded-gc/75221 "2022-01-31T01:57:55Z")

</div>

Hello! I’m very new to julia, but immediately tried to embed it into a node-based CG software (sidefx houdini) for geometry processing. everything worked perfectly fine, until i ran a multithreaded loop that did a bunch…

---

## [Returning Arrays from Functions - Recommended Approach?](https://discourse.julialang.org/t/returning-arrays-from-functions-recommended-approach/75448)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 3\
**Last updated:** [January 30, 2022, 10:38pm UTC](https://discourse.julialang.org/t/returning-arrays-from-functions-recommended-approach/75448 "2022-01-30T22:38:03Z")

</div>

I have been working through an exercise of reviewing and re-reviewing some code I have that solves a one-dimensional system of coupled ODEs using finite differences (just as a toy problem to get better with Julia). I hav…

---

## [What is \`N\` in \`Array{T,N}\`?](https://discourse.julialang.org/t/what-is-n-in-array-t-n/75476)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [January 30, 2022, 9:58pm UTC](https://discourse.julialang.org/t/what-is-n-in-array-t-n/75476 "2022-01-30T21:58:00Z")

</div>

As in the title, what is N in Array{T,N} ? When dealing with parametric types, the doc shows the parameter being a Type, but here it is an integer. The doc actually says: " it can be any type at all (or a value of any …

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

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