# General Usage

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

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

**Page:** 350

---

## [Dictionaries.jl token API](https://discourse.julialang.org/t/dictionaries-jl-token-api/92318)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 5\
**Last updated:** [December 31, 2022, 3:26am UTC](https://discourse.julialang.org/t/dictionaries-jl-token-api/92318 "2022-12-31T03:26:51Z")

</div>

Reading the Dictionaries.jl readme, it looks like a really nice package that lot of effort went into. Very glad to have something like this. Thank you for your contribution! I’ve begun to play with it a bit to learn mor…

---

## [Secure systems: an alternate use case for PackageCompiler.jl](https://discourse.julialang.org/t/secure-systems-an-alternate-use-case-for-packagecompiler-jl/90955)

<div class="topic-metadata">

**Author:** [@Ashlin\_Harris](https://discourse.julialang.org/u/Ashlin_Harris)\
**Replies:** 4\
**Last updated:** [December 31, 2022, 2:11am UTC](https://discourse.julialang.org/t/secure-systems-an-alternate-use-case-for-packagecompiler-jl/90955 "2022-12-31T02:11:40Z")

</div>

Julia’s package manager relies on internet access, so it can be challenging to make dependencies available on secure systems. PackageCompiler.jl compiles Julia code ahead of time, primarily for improved performance in ce…

---

## [Memory usage in Julia v1.9.0-beta2](https://discourse.julialang.org/t/memory-usage-in-julia-v1-9-0-beta2/92320)

<div class="topic-metadata">

**Author:** [@fastwave](https://discourse.julialang.org/u/fastwave)\
**Replies:** 5\
**Last updated:** [December 30, 2022, 11:22pm UTC](https://discourse.julialang.org/t/memory-usage-in-julia-v1-9-0-beta2/92320 "2022-12-30T23:22:35Z")

</div>

This caught my attention, as I had problems with the 1.8 series. However, I’ve found that 1.9 consumes about 5 x the memory for my use case, which went up from 1.7G (1.8.3) to 10.3G in 1.9.0-beta2 . In turn v1.8.3 is wor…

---

## [Subvector pattern matching](https://discourse.julialang.org/t/subvector-pattern-matching/92226)

<div class="topic-metadata">

**Author:** [@Adrien](https://discourse.julialang.org/u/Adrien)\
**Replies:** 12\
**Last updated:** [December 30, 2022, 10:23pm UTC](https://discourse.julialang.org/t/subvector-pattern-matching/92226 "2022-12-30T22:23:01Z")

</div>

I’m looking for a way to check whether a vector contains a sub-vector matching a certain conditional pattern. I wrote a quick and dirty macro doing this, here’s an example to illustrate what I mean: julia\> f=@match i, j…

---

## [SymPy returning Any\[\]](https://discourse.julialang.org/t/sympy-returning-any/92336)

<div class="topic-metadata">

**Author:** [@ejlongman](https://discourse.julialang.org/u/ejlongman)\
**Replies:** 1\
**Last updated:** [December 30, 2022, 9:42pm UTC](https://discourse.julialang.org/t/sympy-returning-any/92336 "2022-12-30T21:42:26Z")

</div>

I am experimenting with the SymPy module, and I wrote the following code to estimate moments 1 and 2 given moments 3 and 4. With two equations and two unknowns I should get exact answers, but the following code returns “…

---

## [LayeredLayouts.jl: solve\_positions crashes Julia process with malloc error](https://discourse.julialang.org/t/layeredlayouts-jl-solve-positions-crashes-julia-process-with-malloc-error/92335)

<div class="topic-metadata">

**Author:** [@roh\_codeur](https://discourse.julialang.org/u/roh_codeur)\
**Replies:** 0\
**Last updated:** [December 30, 2022, 8:34pm UTC](https://discourse.julialang.org/t/layeredlayouts-jl-solve-positions-crashes-julia-process-with-malloc-error/92335 "2022-12-30T20:34:58Z")

</div>

Hi I was using the awesome Julia package LayeredLayouts with the below code example: using LayeredLayouts, Graphs tiny\_depgraph = SimpleDiGraph(Edge.(\[ 1 =\> 2; 2 .=\> \[4, 5, 6\]; 3 .=\> \[…

---

## [Problems installing packages - cert.pm no such file](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995)

<div class="topic-metadata">

**Author:** [@jdarnold](https://discourse.julialang.org/u/jdarnold)\
**Replies:** 15\
**Last updated:** [December 30, 2022, 2:48pm UTC](https://discourse.julialang.org/t/problems-installing-packages-cert-pm-no-such-file/83995 "2022-12-30T14:48:43Z")

</div>

I am trying to use the Genie web framework and I get the following error when I try to use it on my Arch Linux: julia\> using Genie \[ Info: Precompiling Genie \[c43c736e-a2d1-11e8-161f-af95117fbd1e\] ERROR: LoadError: Init…

---

## [Logging for later analysis](https://discourse.julialang.org/t/logging-for-later-analysis/92315)

<div class="topic-metadata">

**Author:** [@Gokhan\_Kof](https://discourse.julialang.org/u/Gokhan_Kof)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 2:27pm UTC](https://discourse.julialang.org/t/logging-for-later-analysis/92315 "2022-12-30T14:27:05Z")

</div>

Hi, Inside Logging documentation, it says “the logging tools allow you to attach arbitrary data to each event as a set of key–value pairs. This allows you to capture local variables and other program state for later ana…

---

## [Det() returns negative values for a correlation matrix](https://discourse.julialang.org/t/det-returns-negative-values-for-a-correlation-matrix/92316)

<div class="topic-metadata">

**Author:** [@Mind4Ness](https://discourse.julialang.org/u/Mind4Ness)\
**Replies:** 3\
**Last updated:** [December 30, 2022, 2:00pm UTC](https://discourse.julialang.org/t/det-returns-negative-values-for-a-correlation-matrix/92316 "2022-12-30T14:00:20Z")

</div>

Sometimes det() function returns a negative number for a correlation matrix (even it’s just 3x3). I’m not sure what is wrong. using Random, using Distributions Random.seed!(3) x = cor(rand(Uniform(-1,1),10,3)) 3×3 Ma…

---

## ["Importing" all "exported" functionality](https://discourse.julialang.org/t/importing-all-exported-functionality/92303)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 10:23am UTC](https://discourse.julialang.org/t/importing-all-exported-functionality/92303 "2022-12-30T10:23:48Z")

</div>

I would like to import a package without: having the package’s symbols enter the global namespace using any unexporrted functionality of the package In other words, I would like to import package A and then use its fu…

---

## [How to Plot Vertical Slicing in 3D like a Slice of Cheese?](https://discourse.julialang.org/t/how-to-plot-vertical-slicing-in-3d-like-a-slice-of-cheese/92275)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [December 30, 2022, 10:00am UTC](https://discourse.julialang.org/t/how-to-plot-vertical-slicing-in-3d-like-a-slice-of-cheese/92275 "2022-12-30T10:00:00Z")

</div>

Hi all, I have created the left figure of this: using Plots, LaTeXStrings, Plots.PlotMeasures gr() f(x) = 1 - (x^2)/4 plot(f,0,3, xtick=0:2:2, xlims=(0,3), ylims=(0,1.5), framestyle=:zerolines, bottom\_margin=5mm,…

---

## [Turing.jl - How to extract AR,MA coefficients from ARiMA models](https://discourse.julialang.org/t/turing-jl-how-to-extract-ar-ma-coefficients-from-arima-models/92305)

<div class="topic-metadata">

**Author:** [@flare9x](https://discourse.julialang.org/u/flare9x)\
**Replies:** 0\
**Last updated:** [December 30, 2022, 7:37am UTC](https://discourse.julialang.org/t/turing-jl-how-to-extract-ar-ma-coefficients-from-arima-models/92305 "2022-12-30T07:37:55Z")

</div>

Using Turing.jl for an ARIMA 1,1,0 model. Is there a way to extract the AR,MA (if i used 1,1,1) coefficients from the fitted model? @model ARIMA110(x) = begin T = length(x) μ ~ Uniform(-10, 10) ϕ ~ Uniform(…

---

## [No method matching problem in optimization in nested function definition](https://discourse.julialang.org/t/no-method-matching-problem-in-optimization-in-nested-function-definition/92298)

<div class="topic-metadata">

**Author:** [@csmarra](https://discourse.julialang.org/u/csmarra)\
**Replies:** 2\
**Last updated:** [December 30, 2022, 3:58am UTC](https://discourse.julialang.org/t/no-method-matching-problem-in-optimization-in-nested-function-definition/92298 "2022-12-30T03:58:39Z")

</div>

Hello everybody, I am new to Julia and I am struggling to understand the behaviour of the following code, in which I perform the minimization of a function using the package BlackBoxOptim. function includeProof(z::Real…

---

## [Speeding up solving \`Ax=b\` repeated when \`A\` is partially updated](https://discourse.julialang.org/t/speeding-up-solving-ax-b-repeated-when-a-is-partially-updated/92194)

<div class="topic-metadata">

**Author:** [@yhchang96](https://discourse.julialang.org/u/yhchang96)\
**Replies:** 4\
**Last updated:** [December 29, 2022, 10:09pm UTC](https://discourse.julialang.org/t/speeding-up-solving-ax-b-repeated-when-a-is-partially-updated/92194 "2022-12-29T22:09:10Z")

</div>

I need to solve for Ax=b where x and b are both vectors of length N+1. A is matrix of size (N+1,N+1). A has a certain structure: A\[1:N,N+1\]=1, A\[N+1,1:N\]=1, A\[N+1,N+1\]=0, and A\[1:N,1:N\] = matD + Diagonal(d). matD is a m…

---

## [Why effect inference fails?](https://discourse.julialang.org/t/why-effect-inference-fails/92293)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 1\
**Last updated:** [December 29, 2022, 9:37pm UTC](https://discourse.julialang.org/t/why-effect-inference-fails/92293 "2022-12-29T21:37:58Z")

</div>

Why is it unsure about nothrow? julia\> f(x) = x \* x f (generic function with 1 method) julia\> Base.infer\_effects(\*, (Int, Int)) (+c,+e,+n,+t) julia\> Base.infer\_effects(f, (Int, Int)) (+c,+e,?n,+t) julia\> versioninfo(…

---

## [Parallel computing with \*](https://discourse.julialang.org/t/parallel-computing-with/92276)

<div class="topic-metadata">

**Author:** [@austin-putz](https://discourse.julialang.org/u/austin-putz)\
**Replies:** 27\
**Last updated:** [December 29, 2022, 9:14pm UTC](https://discourse.julialang.org/t/parallel-computing-with/92276 "2022-12-29T21:14:47Z")

</div>

So I was testing julia with different number of threads using $ julia -t 1 or $ julia -t 7. I run versioninfo() and it confirms that I do in fact have 1 or 7 cores on a basic desktop setup. I tested a decent sized matrix…

---

## [Why doesn't this normalizing flow example work?](https://discourse.julialang.org/t/why-doesnt-this-normalizing-flow-example-work/92279)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 2\
**Last updated:** [December 29, 2022, 5:53pm UTC](https://discourse.julialang.org/t/why-doesnt-this-normalizing-flow-example-work/92279 "2022-12-29T17:53:26Z")

</div>

Hi- I am interested in using normalizing flows to approximate intractable likelihood functions. I found the following example using DiffEqFlux.jl: Continuous Normalizing Flows · DiffEqFlux.jl Given that this is such a …

---

## [Why PlotlyJS is Better than GLMakie in Creating Torus 3-dimensional object?](https://discourse.julialang.org/t/why-plotlyjs-is-better-than-glmakie-in-creating-torus-3-dimensional-object/92105)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 14\
**Last updated:** [December 29, 2022, 11:20am UTC](https://discourse.julialang.org/t/why-plotlyjs-is-better-than-glmakie-in-creating-torus-3-dimensional-object/92105 "2022-12-29T11:20:35Z")

</div>

Hi all, Thanks from the help of people in this discourse, I have plotted with GLMakie with this code: using GLMakie using ColorSchemes # Torus equation to plot # R - sqrt(x^2 + y^2) + z^2 = r^2 # r -\> a (r is the radiu…

---

## [Upsampling and downsampling in Julia for unbalanced classes](https://discourse.julialang.org/t/upsampling-and-downsampling-in-julia-for-unbalanced-classes/16856)

<div class="topic-metadata">

**Author:** [@Ajaychat3](https://discourse.julialang.org/u/Ajaychat3)\
**Replies:** 4\
**Last updated:** [December 29, 2022, 11:20am UTC](https://discourse.julialang.org/t/upsampling-and-downsampling-in-julia-for-unbalanced-classes/16856 "2022-12-29T11:20:04Z")

</div>

I use Imblearn package in python to do upsampling and downsampling for unbalanced classification problem. Is there a simple way to accomplish this in Julia?

---

## [Implementation of Coalton like trait library in Julia](https://discourse.julialang.org/t/implementation-of-coalton-like-trait-library-in-julia/92236)

<div class="topic-metadata">

**Author:** [@kishaloy](https://discourse.julialang.org/u/kishaloy)\
**Replies:** 2\
**Last updated:** [December 29, 2022, 9:15am UTC](https://discourse.julialang.org/t/implementation-of-coalton-like-trait-library-in-julia/92236 "2022-12-29T09:15:59Z")

</div>

I was looking at the Coalton library in CL and I was quite impressed by what they have achieved in terms of getting an opt-in Haskell like typeclass system in Common Lisp. Since traits and type-stability has been one …

---

## [Performance of splitting string and parsing numbers](https://discourse.julialang.org/t/performance-of-splitting-string-and-parsing-numbers/92161)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 29\
**Last updated:** [December 29, 2022, 7:56am UTC](https://discourse.julialang.org/t/performance-of-splitting-string-and-parsing-numbers/92161 "2022-12-29T07:56:05Z")

</div>

Given a string of numbers that are grouped in blocks, I want to parse the numbers and find the total of each block, and then return the largest value from the totals. Each block is separated by two newline chars, and eac…

---

## [How to Fill Horizontal Slicing under a Curve?](https://discourse.julialang.org/t/how-to-fill-horizontal-slicing-under-a-curve/92218)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 1\
**Last updated:** [December 29, 2022, 7:12am UTC](https://discourse.julialang.org/t/how-to-fill-horizontal-slicing-under-a-curve/92218 "2022-12-29T07:12:41Z")

</div>

Hi all, this is only a simple fix needed, I want to fill an area like this image: I try but it created a square fill, I want the horizontal slicing to follow the shape of the curve. Can it be done? using Plots, LaTe…

---

## [Checking for singularity of matrix](https://discourse.julialang.org/t/checking-for-singularity-of-matrix/54746)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 6\
**Last updated:** [December 29, 2022, 5:09am UTC](https://discourse.julialang.org/t/checking-for-singularity-of-matrix/54746 "2022-12-29T05:09:31Z")

</div>

When doing linear algebra procedures such as A\\b or pinv(A), where A is a square matrix, is there a way to check for singularity of A ? Otherwise I keep getting errors such as SingularException(3) or LAPACKException(…

---

## [Weird string slicing in korean](https://discourse.julialang.org/t/weird-string-slicing-in-korean/92252)

<div class="topic-metadata">

**Author:** [@rmsmsgood](https://discourse.julialang.org/u/rmsmsgood)\
**Replies:** 3\
**Last updated:** [December 29, 2022, 2:50am UTC](https://discourse.julialang.org/t/weird-string-slicing-in-korean/92252 "2022-12-29T02:50:06Z")

</div>

I have a trouble with korean string: julia\> julia = "julia" "julia" julia\> julia\[1:2\] "ju" julia\> julia = "줄리아" "줄리아" julia\> julia\[1:2\] ERROR: StringIndexError: invalid index \[2\], valid nearby indices \[1\]=\>'줄', \[4\]=\>'…

---

## [How to import a module using \`jl\_module\_import\`?](https://discourse.julialang.org/t/how-to-import-a-module-using-jl-module-import/92254)

<div class="topic-metadata">

**Author:** [@lucifer1004](https://discourse.julialang.org/u/lucifer1004)\
**Replies:** 0\
**Last updated:** [December 29, 2022, 1:53am UTC](https://discourse.julialang.org/t/how-to-import-a-module-using-jl-module-import/92254 "2022-12-29T01:53:29Z")

</div>

As the title describes, I want to use the C-API jl\_module\_import to import a package, but have not figured out how to do so. The stdlib modules, e.g., Libdl, LinearAlgebra seems to live in neither Base nor Core, then whi…

---

## [For loops issue](https://discourse.julialang.org/t/for-loops-issue/92227)

<div class="topic-metadata">

**Author:** [@Allan\_Olave](https://discourse.julialang.org/u/Allan_Olave)\
**Replies:** 15\
**Last updated:** [December 28, 2022, 11:35pm UTC](https://discourse.julialang.org/t/for-loops-issue/92227 "2022-12-28T23:35:48Z")

</div>

Running the following code in julia REPL x = 1.1; h = 0.1; x\_list = \[i for i in (x-2h):h:(x+2h)\] Gives the following output 0.9000000000000001 1.0000000000000002 1.1 1.2000000000000002 I’m expecting the output would…

---

## [Is \>5 min startup considered slow?](https://discourse.julialang.org/t/is-5-min-startup-considered-slow/69674)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 24\
**Last updated:** [December 28, 2022, 10:06pm UTC](https://discourse.julialang.org/t/is-5-min-startup-considered-slow/69674 "2022-12-28T22:06:26Z")

</div>

Hi, Activating Extensions... Starting Julia Language server 2:20 Julia Language Server: Indexing packages... 8:12 VScode closed and started again Activating Extensions... Starting Julia Language server 0:42 Julia Lang…

---

## [Semicolon is sometimes significant inside square brackets](https://discourse.julialang.org/t/semicolon-is-sometimes-significant-inside-square-brackets/91950)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 4\
**Last updated:** [December 28, 2022, 2:07pm UTC](https://discourse.julialang.org/t/semicolon-is-sometimes-significant-inside-square-brackets/91950 "2022-12-28T14:07:03Z")

</div>

Take the following example: julia\> \[1\] 1-element Vector{Int64}: 1 julia\> \[1;\] 1-element Vector{Int64}: 1 In this case, there is no effect of putting a semicolon after the vector element. So what changes in the follo…

---

## [Symbol to String](https://discourse.julialang.org/t/symbol-to-string/92217)

<div class="topic-metadata">

**Author:** [@Mirsad\_Cosovic](https://discourse.julialang.org/u/Mirsad_Cosovic)\
**Replies:** 9\
**Last updated:** [December 28, 2022, 2:02pm UTC](https://discourse.julialang.org/t/symbol-to-string/92217 "2022-12-28T14:02:44Z")

</div>

I’m trying to convert a special Symbol to a String, but I’m having some trouble. Is the following behavior usual and why? julia\> String(:Ω) == "Ω" false

---

## [How to define NamedTuple type with variable number of elements?](https://discourse.julialang.org/t/how-to-define-namedtuple-type-with-variable-number-of-elements/92223)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 6\
**Last updated:** [December 28, 2022, 1:00pm UTC](https://discourse.julialang.org/t/how-to-define-namedtuple-type-with-variable-number-of-elements/92223 "2022-12-28T13:00:08Z")

</div>

hello, how to define NamedTuple type with variable number of elements? (:a, :b) isa NTuple{N,Symbol} where N # -\> true (1, 2) isa NTuple{N,Int} where N # -\> true why ? (a=1,b=2) isa NamedTuple{NTuple{N,Symbol}, NTu…

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

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