# New to Julia

**URL:** https://discourse.julialang.org/c/first-steps/8.md?page=15

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

**Page:** 16

---

## [Libpcre2-8-0.dll not found with pyjulia / proper way to use julia functions in Python](https://discourse.julialang.org/t/libpcre2-8-0-dll-not-found-with-pyjulia-proper-way-to-use-julia-functions-in-python/128752)

<div class="topic-metadata">

**Author:** [@Owen77S](https://discourse.julialang.org/u/Owen77S)\
**Replies:** 1\
**Last updated:** [May 6, 2025, 1:59pm UTC](https://discourse.julialang.org/t/libpcre2-8-0-dll-not-found-with-pyjulia-proper-way-to-use-julia-functions-in-python/128752 "2025-05-06T13:59:02Z")

</div>

I have a Julia environnement called env and structured this way : env/ │ ├── Project.toml ├── Manifest.toml ├── folder/ │ └── funcs.jl │ └── script.py │ └── script.jl My file funcs.jl is using packages ins…

---

## [Moments of censored distributions](https://discourse.julialang.org/t/moments-of-censored-distributions/128753)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 0\
**Last updated:** [May 6, 2025, 12:32pm UTC](https://discourse.julialang.org/t/moments-of-censored-distributions/128753 "2025-05-06T12:32:59Z")

</div>

(I’ve deleted the post at it seemed to be incorrect, but I somehow can’t remove the post)

---

## [Javascript's Module pattern for encapsulation in Julia](https://discourse.julialang.org/t/javascripts-module-pattern-for-encapsulation-in-julia/128729)

<div class="topic-metadata">

**Author:** [@Gesee](https://discourse.julialang.org/u/Gesee)\
**Replies:** 8\
**Last updated:** [May 6, 2025, 10:12am UTC](https://discourse.julialang.org/t/javascripts-module-pattern-for-encapsulation-in-julia/128729 "2025-05-06T10:12:48Z")

</div>

I have done some JavaScript recently and I discovered the module pattern. Something like this const moduleSecret = (() =\> { let secret = "I'm hidden !"; return { getSecret: () =\> secret, setSecr…

---

## [Simple speed comparison with Matlab](https://discourse.julialang.org/t/simple-speed-comparison-with-matlab/128667)

<div class="topic-metadata">

**Author:** [@josujugo](https://discourse.julialang.org/u/josujugo)\
**Replies:** 33\
**Last updated:** [May 6, 2025, 6:58am UTC](https://discourse.julialang.org/t/simple-speed-comparison-with-matlab/128667 "2025-05-06T06:58:03Z")

</div>

Hi, Julia experts: I am new using Julia and I want to check differences with Matlab. I have written a simple Matlab example: N=100000 tic for K=\[1:N\] sum(cos(2 \* pi \* \[0:N\]/N) .\* exp(-j \* 2 \* K \* pi/N \* \[0:N\]))/N …

---

## [How to avoid issue of unstable solution in case of Differential Equation based models](https://discourse.julialang.org/t/how-to-avoid-issue-of-unstable-solution-in-case-of-differential-equation-based-models/128714)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 5\
**Last updated:** [May 5, 2025, 4:33pm UTC](https://discourse.julialang.org/t/how-to-avoid-issue-of-unstable-solution-in-case-of-differential-equation-based-models/128714 "2025-05-05T16:33:22Z")

</div>

Hello, I was curious that how to approach this problem with unstable solution. I have already tried different solver such as TRBDF2(), Rodas5() , Rosenbrock23() but it didn’t worked. using DifferentialEquations using…

---

## [@threads - control number of threads\`](https://discourse.julialang.org/t/threads-control-number-of-threads/128388)

<div class="topic-metadata">

**Author:** [@freeman](https://discourse.julialang.org/u/freeman)\
**Replies:** 11\
**Last updated:** [May 5, 2025, 3:18pm UTC](https://discourse.julialang.org/t/threads-control-number-of-threads/128388 "2025-05-05T15:18:06Z")

</div>

There’s another post with the same name \[1\], but I couldn’t get the answer I want out of it despite that it has something marked as “answer” My situation is that I would like to have control over the number of threads u…

---

## [Gram-Schmidt decomposition](https://discourse.julialang.org/t/gram-schmidt-decomposition/75417)

<div class="topic-metadata">

**Author:** [@pafloxy](https://discourse.julialang.org/u/pafloxy)\
**Replies:** 16\
**Last updated:** [May 5, 2025, 1:56pm UTC](https://discourse.julialang.org/t/gram-schmidt-decomposition/75417 "2025-05-05T13:56:56Z")

</div>

Hi! Is there any specific module in Julia for performing linear algebra operations like Gram-Schmidt orthogonalization for a given set of vectors?

---

## [Concatenate matrices without specifying the size of zero matrices](https://discourse.julialang.org/t/concatenate-matrices-without-specifying-the-size-of-zero-matrices/128681)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 2\
**Last updated:** [May 4, 2025, 7:37am UTC](https://discourse.julialang.org/t/concatenate-matrices-without-specifying-the-size-of-zero-matrices/128681 "2025-05-04T07:37:14Z")

</div>

I wonder if there is a way to concatenate matrices without the need to specifying the size of the zero portions. For square matrices, I have a clever idea as follows julia\> using LinearAlgebra julia\> A = rand(-9:9, 2,…

---

## [Derivatives and Symbolics.jacobian in Symbolics.jl](https://discourse.julialang.org/t/derivatives-and-symbolics-jacobian-in-symbolics-jl/89581)

<div class="topic-metadata">

**Author:** [@FelixHeox](https://discourse.julialang.org/u/FelixHeox)\
**Replies:** 6\
**Last updated:** [May 4, 2025, 2:48am UTC](https://discourse.julialang.org/t/derivatives-and-symbolics-jacobian-in-symbolics-jl/89581 "2025-05-04T02:48:51Z")

</div>

Hi, this is my first post here. I am new to using Symbolics.jl (coming from a MATLAB background) and have a couple questions regarding Differential and Symbolics.jacobian. I am using a Mac, and the Pluto environment: @v…

---

## [Round a float, and force a specific number of decimal places](https://discourse.julialang.org/t/round-a-float-and-force-a-specific-number-of-decimal-places/87547)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 8\
**Last updated:** [May 2, 2025, 8:28pm UTC](https://discourse.julialang.org/t/round-a-float-and-force-a-specific-number-of-decimal-places/87547 "2025-05-02T20:28:23Z")

</div>

Rounding a float to two decimal places, say, does not necessarily create a number with two decimal places. For example round(10.001, digits = 2) produces 10.0 How can I force a specific number of shown decimal places? …

---

## [WARNING: both X and Y export "F"; uses of it in module Z must be qualified](https://discourse.julialang.org/t/warning-both-x-and-y-export-f-uses-of-it-in-module-z-must-be-qualified/128574)

<div class="topic-metadata">

**Author:** [@Matthijs\_1971](https://discourse.julialang.org/u/Matthijs_1971)\
**Replies:** 12\
**Last updated:** [May 1, 2025, 1:47pm UTC](https://discourse.julialang.org/t/warning-both-x-and-y-export-f-uses-of-it-in-module-z-must-be-qualified/128574 "2025-05-01T13:47:20Z")

</div>

Some versions of Julia reported warnings like these ones: WARNING: both IOExtras and Base export “readuntil”; uses of it in module WebSockets must be qualified WARNING: both IOExtras and Base export “readuntil”; uses …

---

## [About the show method for LinearAlgebra.jl objects](https://discourse.julialang.org/t/about-the-show-method-for-linearalgebra-jl-objects/128589)

<div class="topic-metadata">

**Author:** [@WalterMadelim](https://discourse.julialang.org/u/WalterMadelim)\
**Replies:** 4\
**Last updated:** [May 1, 2025, 9:32am UTC](https://discourse.julialang.org/t/about-the-show-method-for-linearalgebra-jl-objects/128589 "2025-05-01T09:32:04Z")

</div>

I find it convenient to type this command @show A; in Julia REPL, to get an executable code, e.g., julia\> using LinearAlgebra julia\> A = rand(-9:9, 3, 3); julia\> @show A; A = \[0 -8 -2; -7 -2 3; 1 9 8\] Note that the l…

---

## [Unable to use PlutoUI elements whilst using Pkg() to activate local env](https://discourse.julialang.org/t/unable-to-use-plutoui-elements-whilst-using-pkg-to-activate-local-env/128579)

<div class="topic-metadata">

**Author:** [@Koustubh\_Jain](https://discourse.julialang.org/u/Koustubh_Jain)\
**Replies:** 2\
**Last updated:** [April 30, 2025, 5:53pm UTC](https://discourse.julialang.org/t/unable-to-use-plutoui-elements-whilst-using-pkg-to-activate-local-env/128579 "2025-04-30T17:53:21Z")

</div>

Hi all, I am new to Julia and trying to migrate my workflow from MATLAB to Julia. There is package I need to use which is not there in the pkg registry. I had looked up that one can add pkgs to local envs simply by addin…

---

## [Iterating over primes](https://discourse.julialang.org/t/iterating-over-primes/128556)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 11\
**Last updated:** [April 30, 2025, 2:47pm UTC](https://discourse.julialang.org/t/iterating-over-primes/128556 "2025-04-30T14:47:38Z")

</div>

In Project Euler, prime numbers come up quite a lot, but sometimes it is not clear how many prime numbers are needed. To avoid duplicate calculations, and as a challenge to get a bit more familiar with iterators in julia…

---

## [Error during backward integration with callback in DifferentialEquations.jl](https://discourse.julialang.org/t/error-during-backward-integration-with-callback-in-differentialequations-jl/128563)

<div class="topic-metadata">

**Author:** [@remydutto](https://discourse.julialang.org/u/remydutto)\
**Replies:** 2\
**Last updated:** [April 30, 2025, 1:19pm UTC](https://discourse.julialang.org/t/error-during-backward-integration-with-callback-in-differentialequations-jl/128563 "2025-04-30T13:19:06Z")

</div>

Hi everyone, I was trying to run the following example using OrdinaryDiffEq function dynamic!(dx, x, p, t) dx\[1\] = exp(-x\[2\] - sin(x\[2\])^2) dx\[2\] = 1. / (x\[2\] + 1.) dx\[3\] = 1. end x0 = \[0., 1.016428257183…

---

## [Infinite array](https://discourse.julialang.org/t/infinite-array/128455)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 10\
**Last updated:** [April 28, 2025, 8:12pm UTC](https://discourse.julialang.org/t/infinite-array/128455 "2025-04-28T20:12:33Z")

</div>

Hello, How can I define an infinite array? For example, I don’t know the number of data that will be entered into the array and I want to have an infinite array where no matter how much data I put into it, the length of…

---

## [Mapping a 'getter'](https://discourse.julialang.org/t/mapping-a-getter/107276)

<div class="topic-metadata">

**Author:** [@Marco\_Antoniotti](https://discourse.julialang.org/u/Marco_Antoniotti)\
**Replies:** 33\
**Last updated:** [April 27, 2025, 10:16am UTC](https://discourse.julialang.org/t/mapping-a-getter/107276 "2025-04-27T10:16:18Z")

</div>

Hi Is there a way to use a “getter” as a function? But without defining a “getter”. Example struct Person name age end This gets me a type. Now suppose I have ps = \[Person("John", 12), Person("Alice", 14)\]…

---

## [ERROR: LoadError: BoundsError: attempt to access 10-element Vector{Int64} at index \[11\]](https://discourse.julialang.org/t/error-loaderror-boundserror-attempt-to-access-10-element-vector-int64-at-index-11/128114)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 26\
**Last updated:** [April 27, 2025, 6:15am UTC](https://discourse.julialang.org/t/error-loaderror-boundserror-attempt-to-access-10-element-vector-int64-at-index-11/128114 "2025-04-27T06:15:49Z")

</div>

Hello, The contents of the file.txt file is as follows: 1 2 3 4 5 6 7 8 9 10 I wrote the following code to put the numbers in the file into an array: function arrayandfile() array = fill(0,10) inn = open("fil…

---

## [Why does "Doesn't exist" always print?](https://discourse.julialang.org/t/why-does-doesnt-exist-always-print/128427)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 8\
**Last updated:** [April 27, 2025, 5:31am UTC](https://discourse.julialang.org/t/why-does-doesnt-exist-always-print/128427 "2025-04-27T05:31:32Z")

</div>

Hello, Please take a look at the following code: function search() array = \[1,2,3,4,5\] low = 0 high = 0 while true print("Please enter two numbers for Low and high index: ") low, high = …

---

## [Verbose test output with highlighted differences](https://discourse.julialang.org/t/verbose-test-output-with-highlighted-differences/128067)

<div class="topic-metadata">

**Author:** [@Peter\_Hill](https://discourse.julialang.org/u/Peter_Hill)\
**Replies:** 2\
**Last updated:** [April 26, 2025, 8:07pm UTC](https://discourse.julialang.org/t/verbose-test-output-with-highlighted-differences/128067 "2025-04-26T20:07:38Z")

</div>

Is there a way to get more verbose output from @test failures? Take this minimal example: julia\> expected = \[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21\] julia\> result = \[1, 2, 3, 4, 5, 6, …

---

## [How Do You Actually Check for Type Stability in Julia?](https://discourse.julialang.org/t/how-do-you-actually-check-for-type-stability-in-julia/128364)

<div class="topic-metadata">

**Author:** [@Sakura](https://discourse.julialang.org/u/Sakura)\
**Replies:** 6\
**Last updated:** [April 26, 2025, 4:59pm UTC](https://discourse.julialang.org/t/how-do-you-actually-check-for-type-stability-in-julia/128364 "2025-04-26T16:59:15Z")

</div>

Hey everyone, I have been diving into Julia lately & loving the speed but I am still wrapping my head around some of the concepts— type stability. I have heard it is a big deal for performance but I am not totally sure …

---

## [Different results between 10^50 and 10.0^50](https://discourse.julialang.org/t/different-results-between-10-50-and-10-0-50/128401)

<div class="topic-metadata">

**Author:** [@quantum2025](https://discourse.julialang.org/u/quantum2025)\
**Replies:** 10\
**Last updated:** [April 25, 2025, 7:50pm UTC](https://discourse.julialang.org/t/different-results-between-10-50-and-10-0-50/128401 "2025-04-25T19:50:43Z")

</div>

I am studying the Julia language, and found a strange result, that is 10^50 and 10.0^50 generate opposite results: julia\> 10.0^200 1.0e200 julia\> 10.0^200000 Inf Can anyone tell the reason behind this result? Is it du…

---

## [Bit matrix of non-NaNs](https://discourse.julialang.org/t/bit-matrix-of-non-nans/128376)

<div class="topic-metadata">

**Author:** [@Boris](https://discourse.julialang.org/u/Boris)\
**Replies:** 8\
**Last updated:** [April 25, 2025, 7:18pm UTC](https://discourse.julialang.org/t/bit-matrix-of-non-nans/128376 "2025-04-25T19:18:32Z")

</div>

Hi. If I have a matrix with NaNs I can find them with isnan.(). Sorry for the stupid question, but how do I get the non-NaN bit matrix? suppose I have YY = rand(10,3); YY\[2,1\] = NaN; YY\[4,2\] = NaN; YY\[3,3\] = NaN; Sm = …

---

## [Getting a LoadError: GPUCompiler.InvalidIRError on trying to use LuxCUDA with EnsembleProblem](https://discourse.julialang.org/t/getting-a-loaderror-gpucompiler-invalidirerror-on-trying-to-use-luxcuda-with-ensembleproblem/128328)

<div class="topic-metadata">

**Author:** [@sunaina2821](https://discourse.julialang.org/u/sunaina2821)\
**Replies:** 3\
**Last updated:** [April 25, 2025, 11:02am UTC](https://discourse.julialang.org/t/getting-a-loaderror-gpucompiler-invalidirerror-on-trying-to-use-luxcuda-with-ensembleproblem/128328 "2025-04-25T11:02:16Z")

</div>

Here’s a MWE for my problem. I’ve been trying to use Lux with GPU and have been working on a similar problem as the MWE. The error results from the U(u, p, st)\[1\] line in most cases. At times I get it due to scalar index…

---

## [Overloading and performances](https://discourse.julialang.org/t/overloading-and-performances/128342)

<div class="topic-metadata">

**Author:** [@Gesee](https://discourse.julialang.org/u/Gesee)\
**Replies:** 10\
**Last updated:** [April 24, 2025, 4:12pm UTC](https://discourse.julialang.org/t/overloading-and-performances/128342 "2025-04-24T16:12:10Z")

</div>

Hi, I am trying to make a symbolic system and on my way, I stumbled upon something that I can’t figure out. I created multiple node to construct the syntax but when making a tree with x = SymbNode(:x) tree = AddNode(P…

---

## [Concatenating scalar ranges into single row matrix](https://discourse.julialang.org/t/concatenating-scalar-ranges-into-single-row-matrix/128326)

<div class="topic-metadata">

**Author:** [@keynescoefen](https://discourse.julialang.org/u/keynescoefen)\
**Replies:** 4\
**Last updated:** [April 23, 2025, 8:29pm UTC](https://discourse.julialang.org/t/concatenating-scalar-ranges-into-single-row-matrix/128326 "2025-04-23T20:29:18Z")

</div>

Hello! I have a simple query about concatenating ranges into a row matrix. The desired output is \[0 1 2 3 4\] which I am trying to achieve with \[\[(1 - 1):0\]' \[1:5-1\]'\] However, the output I receive is 1×2 adjoint(::V…

---

## [ArgumentError: Package REPLExt \[e5eb5ef1-03cf-53a7-ae1d-5a66b08e832b\] is required but does not seem to be installed](https://discourse.julialang.org/t/argumenterror-package-replext-e5eb5ef1-03cf-53a7-ae1d-5a66b08e832b-is-required-but-does-not-seem-to-be-installed/121492)

<div class="topic-metadata">

**Author:** [@n\_a\_n\_a](https://discourse.julialang.org/u/n_a_n_a)\
**Replies:** 4\
**Last updated:** [April 23, 2025, 11:08am UTC](https://discourse.julialang.org/t/argumenterror-package-replext-e5eb5ef1-03cf-53a7-ae1d-5a66b08e832b-is-required-but-does-not-seem-to-be-installed/121492 "2025-04-23T11:08:49Z")

</div>

I’m having this issue in VSCode, not sure exactly what is going on, I am quite clueless.

---

## [Create a Dictionary from Arrays of Keys and Values](https://discourse.julialang.org/t/create-a-dictionary-from-arrays-of-keys-and-values/13908)

<div class="topic-metadata">

**Author:** [@Elmer\_Cusipuma](https://discourse.julialang.org/u/Elmer_Cusipuma)\
**Replies:** 8\
**Last updated:** [April 21, 2025, 9:04pm UTC](https://discourse.julialang.org/t/create-a-dictionary-from-arrays-of-keys-and-values/13908 "2025-04-21T21:04:30Z")

</div>

I am trying create a Dictionary from Arrays of Keys and Values julia\> id = \[1,2,3,4\]; julia\> coord = \[0 0 0;1 0 0;5 3 0;6 5 1\]; and I want something like: Dict(id,coord) i.e. julia\> X = Dict(1 =\> \[0,0,0\], …

---

## [Tau-leaping Algorithm for Stochastic Simulation](https://discourse.julialang.org/t/tau-leaping-algorithm-for-stochastic-simulation/128237)

<div class="topic-metadata">

**Author:** [@jameslawkc](https://discourse.julialang.org/u/jameslawkc)\
**Replies:** 4\
**Last updated:** [April 20, 2025, 3:24pm UTC](https://discourse.julialang.org/t/tau-leaping-algorithm-for-stochastic-simulation/128237 "2025-04-20T15:24:54Z")

</div>

I know that there is a package called JumpProcesses.jl but there is no option to implement the tau-leaping algorithm. Is there any existing package that can implement this method?

---

## [Key error while using QLearningSolver](https://discourse.julialang.org/t/key-error-while-using-qlearningsolver/128243)

<div class="topic-metadata">

**Author:** [@Lorenzo\_Ferraiuolo](https://discourse.julialang.org/u/Lorenzo_Ferraiuolo)\
**Replies:** 1\
**Last updated:** [April 20, 2025, 9:34am UTC](https://discourse.julialang.org/t/key-error-while-using-qlearningsolver/128243 "2025-04-20T09:34:33Z")

</div>

I’m a beginner with julia and I’m trying to model an inventory menagement using sarsa and q-learning algo. The code gives me the following key error: “ERROR: LoadError: KeyError: key \[0.01781510003808362, 0.1043507798560…

[Previous page](https://discourse.julialang.org/c/first-steps/8.md?page=14)

[Next page](https://discourse.julialang.org/c/first-steps/8.md?page=16)
