# General Usage

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

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

**Page:** 247

---

## ["Not a rational" constant?](https://discourse.julialang.org/t/not-a-rational-constant/104039)

<div class="topic-metadata">

**Author:** [@wherrera](https://discourse.julialang.org/u/wherrera)\
**Replies:** 5\
**Last updated:** [September 19, 2023, 7:23pm UTC](https://discourse.julialang.org/t/not-a-rational-constant/104039 "2023-09-19T19:23:00Z")

</div>

In porting some C code I came across a value called NaR, which was defined as Not a Rational (when returned due to error from a function returning a rational). In terms of type consistency, is there a rational in Julia …

---

## [Quitting a loop by pressing 'q'](https://discourse.julialang.org/t/quitting-a-loop-by-pressing-q/104028)

<div class="topic-metadata">

**Author:** [@Dan](https://discourse.julialang.org/u/Dan)\
**Replies:** 11\
**Last updated:** [September 19, 2023, 5:50pm UTC](https://discourse.julialang.org/t/quitting-a-loop-by-pressing-q/104028 "2023-09-19T17:50:37Z")

</div>

I’ve got a long (possibly infinite) loop. For illustration: function dosomething() for i=1:100 println("doing something $i") sleep(1) end end dosomething() Suppose I want to quit the loop early…

---

## [What is ambiguous here?](https://discourse.julialang.org/t/what-is-ambiguous-here/104029)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 6\
**Last updated:** [September 19, 2023, 4:51pm UTC](https://discourse.julialang.org/t/what-is-ambiguous-here/104029 "2023-09-19T16:51:14Z")

</div>

Hi, Why is this reported as ambiguous, and is it true? Practice shows it is not. using Test x = detect\_ambiguities(GMT) x\[2\] (getindex(D::GMTdataset{T, N}, inds::Vararg{Int64, N}) where {T, N} @ GMT C:\\Users\\j\\.julia\\…

---

## [Creating a package extension using Pkg (rather than manually modifying Project.toml file)](https://discourse.julialang.org/t/creating-a-package-extension-using-pkg-rather-than-manually-modifying-project-toml-file/104032)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 0\
**Last updated:** [September 19, 2023, 4:16pm UTC](https://discourse.julialang.org/t/creating-a-package-extension-using-pkg-rather-than-manually-modifying-project-toml-file/104032 "2023-09-19T16:16:36Z")

</div>

I am developing a package (MyPackage) and have activated its environment with Pkg. I want to add an extension for when it is used together with someone else’s package (SomeoneElsesPackage). If I understand right, I could…

---

## [@debug has massive performance impact on Windows](https://discourse.julialang.org/t/debug-has-massive-performance-impact-on-windows/103974)

<div class="topic-metadata">

**Author:** [@ThummeTo](https://discourse.julialang.org/u/ThummeTo)\
**Replies:** 25\
**Last updated:** [September 19, 2023, 2:44pm UTC](https://discourse.julialang.org/t/debug-has-massive-performance-impact-on-windows/103974 "2023-09-19T14:44:33Z")

</div>

Hey guys, I found that the @debug macro has a massive performance impact on my code. I use the macro very often, because the documentation says: \[The macro\] will produce no output by default. Furthermore, it’s very ch…

---

## [Strange allocation in closure](https://discourse.julialang.org/t/strange-allocation-in-closure/104017)

<div class="topic-metadata">

**Author:** [@trahflow](https://discourse.julialang.org/u/trahflow)\
**Replies:** 3\
**Last updated:** [September 19, 2023, 2:41pm UTC](https://discourse.julialang.org/t/strange-allocation-in-closure/104017 "2023-09-19T14:41:18Z")

</div>

Hi, I observe an allocation involving a closure that I do not understand. Consider the following minimal working example: julia\> function outer(a) inner(b, c) = b, c a, inner end outer (ge…

---

## [Unitful quantities of something](https://discourse.julialang.org/t/unitful-quantities-of-something/101978)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 4\
**Last updated:** [September 19, 2023, 2:02pm UTC](https://discourse.julialang.org/t/unitful-quantities-of-something/101978 "2023-09-19T14:02:33Z")

</div>

Say I want to represent concentrations like “milligrams of salt per milligrams of sugar”. Unitful.jl doesn’t seem to support this: julia\> typeof(3u"mg"/100u"mg") Float64 What would you suggest?

---

## [Prevent huge number of allocations mutating columns of arrays](https://discourse.julialang.org/t/prevent-huge-number-of-allocations-mutating-columns-of-arrays/103848)

<div class="topic-metadata">

**Author:** [@Kieran\_Marray](https://discourse.julialang.org/u/Kieran_Marray)\
**Replies:** 15\
**Last updated:** [September 19, 2023, 1:48pm UTC](https://discourse.julialang.org/t/prevent-huge-number-of-allocations-mutating-columns-of-arrays/103848 "2023-09-19T13:48:24Z")

</div>

Hi, I am writing some code to update the columns in an array by repeatedly solving a linear system. I am trying to allocate arrays for the solutions, left-hand-side, and right-hand-side at the beginning of the code and t…

---

## [Way to make Shared-SparseArray?](https://discourse.julialang.org/t/way-to-make-shared-sparsearray/104016)

<div class="topic-metadata">

**Author:** [@Fluorite-Erbite](https://discourse.julialang.org/u/Fluorite-Erbite)\
**Replies:** 1\
**Last updated:** [September 19, 2023, 11:08am UTC](https://discourse.julialang.org/t/way-to-make-shared-sparsearray/104016 "2023-09-19T11:08:56Z")

</div>

I want to process sparse matrices in parallel. But, as far as I’ve tried, I cannot make Shared-SparseArray. Is it possible?

---

## [Implement of Matlab function "nargout" in Julia](https://discourse.julialang.org/t/implement-of-matlab-function-nargout-in-julia/104011)

<div class="topic-metadata">

**Author:** [@Meteoooor](https://discourse.julialang.org/u/Meteoooor)\
**Replies:** 3\
**Last updated:** [September 19, 2023, 9:18am UTC](https://discourse.julialang.org/t/implement-of-matlab-function-nargout-in-julia/104011 "2023-09-19T09:18:20Z")

</div>

It is easy to dynamically obtain the number of output variables in MATLAB by function “nargout”，how can I do such in Julia? For example,these is the code in MATLAB function \[ varargout \] = CopyElement( V ) % V is a ten…

---

## [Undoing a view](https://discourse.julialang.org/t/undoing-a-view/103996)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 5\
**Last updated:** [September 19, 2023, 8:38am UTC](https://discourse.julialang.org/t/undoing-a-view/103996 "2023-09-19T08:38:24Z")

</div>

view(b, ixs) creates a view that references the original storage a, rather than the intermediate view b. I am interested in getting the argument b back out of c, undoing the second slice. Is there something like either …

---

## [How to disable the "skipping precompilation" info?](https://discourse.julialang.org/t/how-to-disable-the-skipping-precompilation-info/93905)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [September 19, 2023, 7:03am UTC](https://discourse.julialang.org/t/how-to-disable-the-skipping-precompilation-info/93905 "2023-09-19T07:03:15Z")

</div>

I have a module with \_\_precompile\_\_(false), and whenever I load it, I see this printed: julia\> using RossbyPlots \[ Info: Precompiling RossbyPlots \[acc5d94c-3556-452d-bda2-c31719193afc\] \[ Info: Skipping precompilation si…

---

## [Franklin website not properly formatted, missing elements](https://discourse.julialang.org/t/franklin-website-not-properly-formatted-missing-elements/103975)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 7\
**Last updated:** [September 19, 2023, 4:45am UTC](https://discourse.julialang.org/t/franklin-website-not-properly-formatted-missing-elements/103975 "2023-09-19T04:45:58Z")

</div>

Hello everyone. I am hoping to get some help on why my Franklin-made website looks wrong. I am using this repo to host this website. I am using the “lanyon” template, which you can check out here. The webpage I am hosti…

---

## [Is there an efficient implementation of double factorial somewhere?](https://discourse.julialang.org/t/is-there-an-efficient-implementation-of-double-factorial-somewhere/104002)

<div class="topic-metadata">

**Author:** [@Leticia-maria](https://discourse.julialang.org/u/Leticia-maria)\
**Replies:** 4\
**Last updated:** [September 19, 2023, 1:14am UTC](https://discourse.julialang.org/t/is-there-an-efficient-implementation-of-double-factorial-somewhere/104002 "2023-09-19T01:14:20Z")

</div>

Hey friends, is there an efficient implementation of double factorial somewhere? I implemented this one (any tips on improving its performance are welcome): function doublefactorial(number) fact = one(number) if…

---

## [Formatting DataFrames with PrettyTables](https://discourse.julialang.org/t/formatting-dataframes-with-prettytables/88033)

<div class="topic-metadata">

**Author:** [@alexgr](https://discourse.julialang.org/u/alexgr)\
**Replies:** 9\
**Last updated:** [September 19, 2023, 1:02am UTC](https://discourse.julialang.org/t/formatting-dataframes-with-prettytables/88033 "2023-09-19T01:02:55Z")

</div>

I’d like to format some numeric columns with different decimal positions. The approach I am following is this: using Random using DataFrames using PrettyTables df = DataFrame(rand(5, 3), :auto) pretty\_table(df, formatt…

---

## [Error with SSL Certificates using Docker](https://discourse.julialang.org/t/error-with-ssl-certificates-using-docker/102362)

<div class="topic-metadata">

**Author:** [@Thiago-Simoes](https://discourse.julialang.org/u/Thiago-Simoes)\
**Replies:** 2\
**Last updated:** [September 19, 2023, 12:06am UTC](https://discourse.julialang.org/t/error-with-ssl-certificates-using-docker/102362 "2023-09-19T00:06:29Z")

</div>

I’m using Docker to create a Julia container, but I can’t install the packages inside docker. I have a RUN line on Dockerfile for instantiate project, but it’s generating errors with SSL certificates. # pull latest juli…

---

## ["do" block and hard scope](https://discourse.julialang.org/t/do-block-and-hard-scope/103729)

<div class="topic-metadata">

**Author:** [@yvikhlya](https://discourse.julialang.org/u/yvikhlya)\
**Replies:** 14\
**Last updated:** [September 18, 2023, 8:59pm UTC](https://discourse.julialang.org/t/do-block-and-hard-scope/103729 "2023-09-18T20:59:23Z")

</div>

Could someone explain me why in this case: y=0 map(1:10) do x y=x^2 end outer y does not get modified, as stated in documentation, but in this case gm=zeros(Float64, Nlev, Nt) var=zeros(Union{Missing, Float32}, Nx, …

---

## [Precompiling Mousetrap fails on Ubuntu with NVidia driver](https://discourse.julialang.org/t/precompiling-mousetrap-fails-on-ubuntu-with-nvidia-driver/103945)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [September 18, 2023, 8:01pm UTC](https://discourse.julialang.org/t/precompiling-mousetrap-fails-on-ubuntu-with-nvidia-driver/103945 "2023-09-18T20:01:13Z")

</div>

I have the following issue: julia\> using Mousetrap \[ Info: Precompiling Mousetrap \[5deeb4b9-6e04-4da7-8b7f-c77fb1eae65e\] \[25147\] signal (11.1): Segmentation fault in expression starting at /home/ufechner/.julia/package…

---

## [Very recently Plots/GR not working when run from a terminal, but OK in VSCode](https://discourse.julialang.org/t/very-recently-plots-gr-not-working-when-run-from-a-terminal-but-ok-in-vscode/103979)

<div class="topic-metadata">

**Author:** [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Replies:** 11\
**Last updated:** [September 18, 2023, 7:48pm UTC](https://discourse.julialang.org/t/very-recently-plots-gr-not-working-when-run-from-a-terminal-but-ok-in-vscode/103979 "2023-09-18T19:48:07Z")

</div>

I have long used Plots with the GR backend, but very recently it has stopped working when run from a terminal. Strangely, it works fine in VSCode when I launch Julia with Opt-J Opt-O. (I also have no problem if I use th…

---

## [Vscode with multiple versions via juliaup override?](https://discourse.julialang.org/t/vscode-with-multiple-versions-via-juliaup-override/103986)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 2\
**Last updated:** [September 18, 2023, 6:47pm UTC](https://discourse.julialang.org/t/vscode-with-multiple-versions-via-juliaup-override/103986 "2023-09-18T18:47:47Z")

</div>

my vscode does not pick up the julia version I pinned in a certain directory via override: floswald@PTL11077 ~/.j/d/LandUse (master)\> juliaup override status (base) Path …

---

## [Using GNU Make, DrWatson, and Julia scripts to track dependencies and automate script running](https://discourse.julialang.org/t/using-gnu-make-drwatson-and-julia-scripts-to-track-dependencies-and-automate-script-running/103998)

<div class="topic-metadata">

**Author:** [@arnold-c](https://discourse.julialang.org/u/arnold-c)\
**Replies:** 0\
**Last updated:** [September 18, 2023, 6:38pm UTC](https://discourse.julialang.org/t/using-gnu-make-drwatson-and-julia-scripts-to-track-dependencies-and-automate-script-running/103998 "2023-09-18T18:38:41Z")

</div>

I have a number of scripts that I am trying to run using GNU Make, but within them, I am using DrWatson’s @produce\_or\_load macro to save parameter combinations to different files. I would like to use GNU Make to track de…

---

## [CSV.read very slow when number of threads changed](https://discourse.julialang.org/t/csv-read-very-slow-when-number-of-threads-changed/103991)

<div class="topic-metadata">

**Author:** [@pascal](https://discourse.julialang.org/u/pascal)\
**Replies:** 2\
**Last updated:** [September 18, 2023, 3:53pm UTC](https://discourse.julialang.org/t/csv-read-very-slow-when-number-of-threads-changed/103991 "2023-09-18T15:53:22Z")

</div>

I want to read in a csv file with ~5000 lines which is usually very fast. But when I start Julia with --threads=10 or --threads=auto waiting times for CSV.read are going through the roof. So, how can I have both, fast C…

---

## [Pinv not Type Stable?](https://discourse.julialang.org/t/pinv-not-type-stable/103885)

<div class="topic-metadata">

**Author:** [@AlexanderNenninger](https://discourse.julialang.org/u/AlexanderNenninger)\
**Replies:** 15\
**Last updated:** [September 18, 2023, 2:01pm UTC](https://discourse.julialang.org/t/pinv-not-type-stable/103885 "2023-09-18T14:01:13Z")

</div>

Why is LinearAlgebra.pinv not type stable? Can it be implemented in a type stable way? Example (thanks to @albheim) using LinearAlgebra using JET function test(M) A = rand(M, M + 2) pinv(A) end test(10) repor…

---

## [Use 2d marker in Makie \`meshscatter\`](https://discourse.julialang.org/t/use-2d-marker-in-makie-meshscatter/103978)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 16\
**Last updated:** [September 18, 2023, 1:59pm UTC](https://discourse.julialang.org/t/use-2d-marker-in-makie-meshscatter/103978 "2023-09-18T13:59:22Z")

</div>

Hello ! I’m trying to display a large set of 3D points (about 80k) with GLMakie. Initially, I used meshscatter, unfortunately my PC doesn’t have a discrete GPU so I’m trying to reduce the stress on the iGPU by using sc…

---

## [With julia-1.9, should the main task block :interactive tasks?](https://discourse.julialang.org/t/with-julia-1-9-should-the-main-task-block-interactive-tasks/92809)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 2\
**Last updated:** [September 18, 2023, 1:56pm UTC](https://discourse.julialang.org/t/with-julia-1-9-should-the-main-task-block-interactive-tasks/92809 "2023-09-18T13:56:00Z")

</div>

According to julia\> Threads.threadpool() :default the main task shouldn’t be using the :interactive thread pool, but whenever I run a busy loop on the main thread, any tasks spawned from the :interactive thread pool ar…

---

## [Performant reading of .tar.xz files](https://discourse.julialang.org/t/performant-reading-of-tar-xz-files/103912)

<div class="topic-metadata">

**Author:** [@trace\_forms](https://discourse.julialang.org/u/trace_forms)\
**Replies:** 15\
**Last updated:** [September 18, 2023, 1:55pm UTC](https://discourse.julialang.org/t/performant-reading-of-tar-xz-files/103912 "2023-09-18T13:55:45Z")

</div>

Hi there, I am trying to rapidly load data that is stored within .tar.xz files. Specifically, I am working with the genomic sequences and associated metadata for SARS-CoV-2 from GISAID. These come as separate .tar.xz fi…

---

## [Precompilation of package extension failure](https://discourse.julialang.org/t/precompilation-of-package-extension-failure/103983)

<div class="topic-metadata">

**Author:** [@abelsiqueira](https://discourse.julialang.org/u/abelsiqueira)\
**Replies:** 0\
**Last updated:** [September 18, 2023, 1:10pm UTC](https://discourse.julialang.org/t/precompilation-of-package-extension-failure/103983 "2023-09-18T13:10:16Z")

</div>

I have the following error when adding GraphIO and ParserCombinator in a brand new Julia 1.9.3 Linux installation: Warning: Module GraphIOGMLExt with build ID ffffffff-ffff-ffff-0000-177dba44e6bc is missing from the cac…

---

## [How to add/query a dict that contains tens of millions of items?](https://discourse.julialang.org/t/how-to-add-query-a-dict-that-contains-tens-of-millions-of-items/103886)

<div class="topic-metadata">

**Author:** [@leonchen2012](https://discourse.julialang.org/u/leonchen2012)\
**Replies:** 4\
**Last updated:** [September 18, 2023, 9:32am UTC](https://discourse.julialang.org/t/how-to-add-query-a-dict-that-contains-tens-of-millions-of-items/103886 "2023-09-18T09:32:29Z")

</div>

I’m using a dict with struct key and struct value. Size of each key value pair is 0.5~3k bytes. The problem is that it can be accumulated to tens of millions of key-value pairs, which would cause OOM on my computer. I u…

---

## [How to Simplify Sympy Symbolic Integration](https://discourse.julialang.org/t/how-to-simplify-sympy-symbolic-integration/103970)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 0\
**Last updated:** [September 18, 2023, 9:06am UTC](https://discourse.julialang.org/t/how-to-simplify-sympy-symbolic-integration/103970 "2023-09-18T09:06:51Z")

</div>

Hi all, I have two circles of radius b, their centers 2a apart (0 \\le a \\le b). The question is, why is the SymPy computation resulting in a very complex formula? While in the solution manual it can be explained easily…

---

## [2D Plot from Vector Function iy + jx -Div,Grad,Curl](https://discourse.julialang.org/t/2d-plot-from-vector-function-iy-jx-div-grad-curl/102390)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 3\
**Last updated:** [September 18, 2023, 9:03am UTC](https://discourse.julialang.org/t/2d-plot-from-vector-function-iy-jx-div-grad-curl/102390 "2023-09-18T09:03:25Z")

</div>

Hi all, I am reading from this Div, Grad, Curl and All that by Schey and I was wondering how to plot this with Julia(what packages needed( GR/Makie??): this is the vector functions / the questions:

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

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