# General Usage

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

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

**Page:** 313

---

## [Wrap and inherit Number](https://discourse.julialang.org/t/wrap-and-inherit-number/4799)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 26\
**Last updated:** [March 23, 2023, 5:14am UTC](https://discourse.julialang.org/t/wrap-and-inherit-number/4799 "2023-03-23T05:14:32Z")

</div>

I’ve seen topics touching this in different constellations, but: How do people create a new type that would magically behave just like any subtype of (say) Number? So for example, if: struct A{T \<: Number} x::T end…

---

## [Error: Error during initialization of module CHOLMOD on HPC running Scientific Linux 7](https://discourse.julialang.org/t/error-error-during-initialization-of-module-cholmod-on-hpc-running-scientific-linux-7/92930)

<div class="topic-metadata">

**Author:** [@austin-putz](https://discourse.julialang.org/u/austin-putz)\
**Replies:** 23\
**Last updated:** [March 23, 2023, 4:50am UTC](https://discourse.julialang.org/t/error-error-during-initialization-of-module-cholmod-on-hpc-running-scientific-linux-7/92930 "2023-03-23T04:50:31Z")

</div>

Hello all, I tried to load Julia on the HPC I use (in the Netherlands managed by Wageningen). I get this error after loading julia and initializing REPL. I guess I don’t even know what to do, any ideas? Has anyone e…

---

## [Display fraction over two lines?](https://discourse.julialang.org/t/display-fraction-over-two-lines/96329)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 14\
**Last updated:** [March 23, 2023, 2:12am UTC](https://discourse.julialang.org/t/display-fraction-over-two-lines/96329 "2023-03-23T02:12:31Z")

</div>

Is it possible to display a fraction over two lines ? (In actual code rather than latex documentation)

---

## [Partially decompressing Bzip2 files](https://discourse.julialang.org/t/partially-decompressing-bzip2-files/96429)

<div class="topic-metadata">

**Author:** [@tristian](https://discourse.julialang.org/u/tristian)\
**Replies:** 2\
**Last updated:** [March 23, 2023, 1:00am UTC](https://discourse.julialang.org/t/partially-decompressing-bzip2-files/96429 "2023-03-23T01:00:58Z")

</div>

As the title of the question states, I have a few \*.csv.bzip2 compressed files that are as big as 13GB when decompressed. The files have a structured format and are essentially CSV files. I’d like to read the headers of…

---

## [Making bound variables from loop in Pluto](https://discourse.julialang.org/t/making-bound-variables-from-loop-in-pluto/96421)

<div class="topic-metadata">

**Author:** [@mmj](https://discourse.julialang.org/u/mmj)\
**Replies:** 3\
**Last updated:** [March 22, 2023, 9:27pm UTC](https://discourse.julialang.org/t/making-bound-variables-from-loop-in-pluto/96421 "2023-03-22T21:27:45Z")

</div>

Hello. I am attempting to create a Pluto notebook that performs Gaussian elimination on a matrix. I would like the user to insert whatever matrix he desires. What I have done so far is asking the user what are the dimen…

---

## [How to detect jumps in a vector mod2pi.(x), when the elements of x are increasing](https://discourse.julialang.org/t/how-to-detect-jumps-in-a-vector-mod2pi-x-when-the-elements-of-x-are-increasing/96475)

<div class="topic-metadata">

**Author:** [@empet](https://discourse.julialang.org/u/empet)\
**Replies:** 2\
**Last updated:** [March 22, 2023, 9:15pm UTC](https://discourse.julialang.org/t/how-to-detect-jumps-in-a-vector-mod2pi-x-when-the-elements-of-x-are-increasing/96475 "2023-03-22T21:15:34Z")

</div>

After integrating a toral differential equation I get as trajectory coordinates, the vectors x,y, and then calculate: xt = mod2pi.(x) yt = mod2pi.(y) I want to insert a NaN between two consecutive elements of xt a…

---

## [Dictionary showing invalid keys](https://discourse.julialang.org/t/dictionary-showing-invalid-keys/96422)

<div class="topic-metadata">

**Author:** [@gxyau](https://discourse.julialang.org/u/gxyau)\
**Replies:** 15\
**Last updated:** [March 22, 2023, 7:37pm UTC](https://discourse.julialang.org/t/dictionary-showing-invalid-keys/96422 "2023-03-22T19:37:57Z")

</div>

Hello there, Been playing around with Julia a bit just to practice some topics. I have recently started using Graphs.jl and found some unexpected behaviour. A MWE and the output has been included below. Long story shor…

---

## [Syntax error with \`using EllipsisNotation: .. as foo\`](https://discourse.julialang.org/t/syntax-error-with-using-ellipsisnotation-as-foo/96464)

<div class="topic-metadata">

**Author:** [@lmtzx9h4qqnt](https://discourse.julialang.org/u/lmtzx9h4qqnt)\
**Replies:** 4\
**Last updated:** [March 22, 2023, 6:18pm UTC](https://discourse.julialang.org/t/syntax-error-with-using-ellipsisnotation-as-foo/96464 "2023-03-22T18:18:29Z")

</div>

Is there some way to import .. from a package using as? julia\> using EllipsisNotation: .. as foo ERROR: syntax: extra token "foo" after end of expression Stacktrace: \[1\] top-level scope @ none:1 julia\> using Ellips…

---

## [Spurious memory allocations within function](https://discourse.julialang.org/t/spurious-memory-allocations-within-function/85430)

<div class="topic-metadata">

**Author:** [@dwyron](https://discourse.julialang.org/u/dwyron)\
**Replies:** 9\
**Last updated:** [March 22, 2023, 5:25pm UTC](https://discourse.julialang.org/t/spurious-memory-allocations-within-function/85430 "2023-03-22T17:25:44Z")

</div>

Hi everyone, I am trying to reduce memory allocations in a function through preallocations. However, implementing the Perfomance Tips still leaves a significant amount of probably unnecessary allocations, which I can ci…

---

## [PythonCall: Can't get attribute 'CallbackValue'](https://discourse.julialang.org/t/pythoncall-cant-get-attribute-callbackvalue/96456)

<div class="topic-metadata">

**Author:** [@Jesse\_Lane](https://discourse.julialang.org/u/Jesse_Lane)\
**Replies:** 0\
**Last updated:** [March 22, 2023, 3:46pm UTC](https://discourse.julialang.org/t/pythoncall-cant-get-attribute-callbackvalue/96456 "2023-03-22T15:46:37Z")

</div>

Hello, I have a simulator that I wrote in Julia using Agents.jl and I’m trying to do some reinforcement learning using Ray and using PythonCall for the interop. (I know there are some reinforcement learning packages in…

---

## [How does julia prioritize operations and array concatenation?](https://discourse.julialang.org/t/how-does-julia-prioritize-operations-and-array-concatenation/96447)

<div class="topic-metadata">

**Author:** [@ovt](https://discourse.julialang.org/u/ovt)\
**Replies:** 3\
**Last updated:** [March 22, 2023, 3:38pm UTC](https://discourse.julialang.org/t/how-does-julia-prioritize-operations-and-array-concatenation/96447 "2023-03-22T15:38:47Z")

</div>

Why is it ok to write 1 .-A but not \[A;1 .-A\] ? Somehow, it only works with a space between - and A. Is it because Julia prioritize the A;1 part over the 1 .-A part ? Is there any documentation on how and why julia prio…

---

## [Julia VSCode: Is it possible to automatically activate the parent julia environment of the current file?](https://discourse.julialang.org/t/julia-vscode-is-it-possible-to-automatically-activate-the-parent-julia-environment-of-the-current-file/96451)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 0\
**Last updated:** [March 22, 2023, 3:08pm UTC](https://discourse.julialang.org/t/julia-vscode-is-it-possible-to-automatically-activate-the-parent-julia-environment-of-the-current-file/96451 "2023-03-22T15:08:17Z")

</div>

I just realized in another discourse thread that this is the feature which I really want. background: I am usually working on several packages in parallel, which I all open in the same vscode workspace (i.e. in one sing…

---

## [IndexStyle for pairs iterator?](https://discourse.julialang.org/t/indexstyle-for-pairs-iterator/96450)

<div class="topic-metadata">

**Author:** [@DNF](https://discourse.julialang.org/u/DNF)\
**Replies:** 0\
**Last updated:** [March 22, 2023, 3:06pm UTC](https://discourse.julialang.org/t/indexstyle-for-pairs-iterator/96450 "2023-03-22T15:06:40Z")

</div>

I was a bit surprised to see that the pairs iterator for Matrix returns CartesianIndices by default. The docstring of pairs includes a section on specifying index style, showing these three signatures: pairs(IndexLinear…

---

## [Error: Missing source file for JSON](https://discourse.julialang.org/t/error-missing-source-file-for-json/67975)

<div class="topic-metadata">

**Author:** [@sim](https://discourse.julialang.org/u/sim)\
**Replies:** 4\
**Last updated:** [March 22, 2023, 11:21am UTC](https://discourse.julialang.org/t/error-missing-source-file-for-json/67975 "2023-03-22T11:21:17Z")

</div>

Hi, on a fresh installation of Julia on Ubuntu 16.04, I cannot install packages. Each add Pkgname results in a 1 dependency errored. To see a full report either run import Pkg; Pkg.precompile() or load the package an…

---

## [Error Precomping Lathe](https://discourse.julialang.org/t/error-precomping-lathe/73559)

<div class="topic-metadata">

**Author:** [@daler6](https://discourse.julialang.org/u/daler6)\
**Replies:** 4\
**Last updated:** [March 22, 2023, 10:38am UTC](https://discourse.julialang.org/t/error-precomping-lathe/73559 "2023-03-22T10:38:47Z")

</div>

I recently installed Julia 1.7.1. When I try using Lathe, I get the following error: \[ Info: Precompiling Lathe \[38d8eb38-e7b1-11e9-0012-376b6c802672\] ERROR: LoadError: InitError: could not load symbol “LLVMExtraInitia…

---

## [Asking for RadixSort](https://discourse.julialang.org/t/asking-for-radixsort/96416)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 1\
**Last updated:** [March 22, 2023, 6:53am UTC](https://discourse.julialang.org/t/asking-for-radixsort/96416 "2023-03-22T06:53:55Z")

</div>

The version 1.9.0-rc1: Asking for RadixSort (similarly what one can do for QuickSort) sort!(prm; alg=Base.Sort.QuickSort, order=Base.Order.Perm(Base.Order.Forward, rows), scratch=scratcha); fails. Any clues why, and h…

---

## [Performance help for first passage time simulation](https://discourse.julialang.org/t/performance-help-for-first-passage-time-simulation/96392)

<div class="topic-metadata">

**Author:** [@Bill\_Holmes](https://discourse.julialang.org/u/Bill_Holmes)\
**Replies:** 24\
**Last updated:** [March 22, 2023, 12:58am UTC](https://discourse.julialang.org/t/performance-help-for-first-passage-time-simulation/96392 "2023-03-22T00:58:40Z")

</div>

I’m relatively new to Julia but it seems fantastic! I am still learning optimization tricks and am hoping someone can help. More details below, but my basic problem is that I have a simd type of problem; run 10k relativ…

---

## [Towards the creation of an interface testing package](https://discourse.julialang.org/t/towards-the-creation-of-an-interface-testing-package/82182)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 26\
**Last updated:** [March 21, 2023, 11:20pm UTC](https://discourse.julialang.org/t/towards-the-creation-of-an-interface-testing-package/82182 "2023-03-21T23:20:32Z")

</div>

To get something actionable out of this thread, I keep thinking about an interface testing package. I also just found a glaring bug in DimensionalData.jl with mixed Int/CartesianIndex indexing. Because I just forgot to …

---

## [How to solve inequalities of this kind?](https://discourse.julialang.org/t/how-to-solve-inequalities-of-this-kind/96404)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 3\
**Last updated:** [March 21, 2023, 9:04pm UTC](https://discourse.julialang.org/t/how-to-solve-inequalities-of-this-kind/96404 "2023-03-21T21:04:59Z")

</div>

Hello, good afternoon How to solve inequalities of this kind? 4 \<= 3x - 2 \< 13

---

## [Fast permutation vector: code needed](https://discourse.julialang.org/t/fast-permutation-vector-code-needed/96357)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 38\
**Last updated:** [March 21, 2023, 5:58pm UTC](https://discourse.julialang.org/t/fast-permutation-vector-code-needed/96357 "2023-03-21T17:58:57Z")

</div>

Hello all, I need to sort integer vectors, with entries of arbitrary size relative to the length of the vector. At the moment I use sort!(prm, Base.Sort.DEFAULT\_UNSTABLE, Base.Order.Perm(Base.Order.Forward, rows)) to…

---

## [Creating Adjacency matrix from a DataFrame](https://discourse.julialang.org/t/creating-adjacency-matrix-from-a-dataframe/96395)

<div class="topic-metadata">

**Author:** [@le\_ackerman](https://discourse.julialang.org/u/le_ackerman)\
**Replies:** 6\
**Last updated:** [March 21, 2023, 5:24pm UTC](https://discourse.julialang.org/t/creating-adjacency-matrix-from-a-dataframe/96395 "2023-03-21T17:24:55Z")

</div>

I want to create an adjacency matrix with first two columns of a dataframe and the weights will be taken from the 3rd column. for reference, say the dataframe looks like: index Name\_A Name\_B 0 Adam Ben 1 …

---

## [Problem in getting a solution using the package "ReachabilityAnalysis.jl"](https://discourse.julialang.org/t/problem-in-getting-a-solution-using-the-package-reachabilityanalysis-jl/96409)

<div class="topic-metadata">

**Author:** [@Ashu](https://discourse.julialang.org/u/Ashu)\
**Replies:** 0\
**Last updated:** [March 21, 2023, 5:47pm UTC](https://discourse.julialang.org/t/problem-in-getting-a-solution-using-the-package-reachabilityanalysis-jl/96409 "2023-03-21T17:47:57Z")

</div>

Hello all, I am trying to solve a differential equation with interval coefficients using the packages “IntervalArithmetic.jl” and “ReachabilityAnalysis.jl” in Pluto.jl notebook. When I tried to plot the solution I got t…

---

## [Force reloading of shared C library](https://discourse.julialang.org/t/force-reloading-of-shared-c-library/96399)

<div class="topic-metadata">

**Author:** [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Replies:** 2\
**Last updated:** [March 21, 2023, 4:12pm UTC](https://discourse.julialang.org/t/force-reloading-of-shared-c-library/96399 "2023-03-21T16:12:12Z")

</div>

Hi, I am calling a C function, compiled with gcc -shared -fPIC as it should be. Until then, no problem; however, if I modify and compile the C code again, the changes won’t appear in Julia. I tested this by going in the…

---

## [Creating Cmds with variable number of args](https://discourse.julialang.org/t/creating-cmds-with-variable-number-of-args/96397)

<div class="topic-metadata">

**Author:** [@Conrad\_Wiebe](https://discourse.julialang.org/u/Conrad_Wiebe)\
**Replies:** 2\
**Last updated:** [March 21, 2023, 3:12pm UTC](https://discourse.julialang.org/t/creating-cmds-with-variable-number-of-args/96397 "2023-03-21T15:12:41Z")

</div>

I’m trying to create a scp command to copy over a variable number of files to another computer. I’d like for it to be a single scp call rather than one per file as it is much more efficient. I have something looking like…

---

## [@threads :Static seems not doing static scheduling?](https://discourse.julialang.org/t/threads-static-seems-not-doing-static-scheduling/96386)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 8\
**Last updated:** [March 21, 2023, 2:54pm UTC](https://discourse.julialang.org/t/threads-static-seems-not-doing-static-scheduling/96386 "2023-03-21T14:54:16Z")

</div>

I start julia with set JULIA\_EXCLUSIVE=1 and julia -t 2 and I have multi-threaded code. Meanwhile running it, I don’t know why I can not see two cores working with their maximum? but rather a switching between cores al…

---

## [Predefined Dates Locale](https://discourse.julialang.org/t/predefined-dates-locale/81250)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 1\
**Last updated:** [March 21, 2023, 2:19pm UTC](https://discourse.julialang.org/t/predefined-dates-locale/81250 "2023-03-21T14:19:13Z")

</div>

I am aware of the possibility of adding a locale to Dates, see e.g. here But I am wondering if there is a repository somewhere which already has some ‘common’ locales predefined. Right now I am looking for Swedish.

---

## [How to create a list of (x, y) labels from an n x 2 matrix of x, y data pairs?](https://discourse.julialang.org/t/how-to-create-a-list-of-x-y-labels-from-an-n-x-2-matrix-of-x-y-data-pairs/96316)

<div class="topic-metadata">

**Author:** [@Gary\_Church](https://discourse.julialang.org/u/Gary_Church)\
**Replies:** 3\
**Last updated:** [March 21, 2023, 2:18pm UTC](https://discourse.julialang.org/t/how-to-create-a-list-of-x-y-labels-from-an-n-x-2-matrix-of-x-y-data-pairs/96316 "2023-03-21T14:18:54Z")

</div>

Greetings, I’m using Julia 1.8.5, Plots and the plotly backend. I have an n x 2 matrix of x, y data pairs called “data” which I plot using: scatter(data\[:,1\], data\[:,2\]) I want to annotate each of the plotted data poi…

---

## [Profiling memory allocations](https://discourse.julialang.org/t/profiling-memory-allocations/96385)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 1\
**Last updated:** [March 21, 2023, 1:12pm UTC](https://discourse.julialang.org/t/profiling-memory-allocations/96385 "2023-03-21T13:12:10Z")

</div>

I have written some code in functional/immutable style, with the aim of not allocating any memory (on the heap). The code is weird because this is a mock-up of something I then want to create a macro to generate from si…

---

## [How to launch Dashboard in browser with Dash.jl](https://discourse.julialang.org/t/how-to-launch-dashboard-in-browser-with-dash-jl/96391)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 3\
**Last updated:** [March 21, 2023, 12:59pm UTC](https://discourse.julialang.org/t/how-to-launch-dashboard-in-browser-with-dash-jl/96391 "2023-03-21T12:59:06Z")

</div>

Hi all, I am trying to launch a Dashboard in Dash.jl in my browser. Based on the documentation, I run the following code: using Dash using DashHtmlComponents using DashCoreComponents app = dash(external\_stylesheets = …

---

## [Performance scaling of broadcasting compared to looping](https://discourse.julialang.org/t/performance-scaling-of-broadcasting-compared-to-looping/92000)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 19\
**Last updated:** [March 21, 2023, 11:24am UTC](https://discourse.julialang.org/t/performance-scaling-of-broadcasting-compared-to-looping/92000 "2023-03-21T11:24:56Z")

</div>

I’m writing a simulation where speed is very important. The program consists of a main loop where I need to collect some scalar by multiplying some floats based on connections in an adjacency matrix. As a very simplified…

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

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