# New to Julia

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

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

**Page:** 40

---

## [Difference in behaviour between REPL and debugger](https://discourse.julialang.org/t/difference-in-behaviour-between-repl-and-debugger/117101)

<div class="topic-metadata">

**Author:** [@seb](https://discourse.julialang.org/u/seb)\
**Replies:** 6\
**Last updated:** [July 18, 2024, 12:58pm UTC](https://discourse.julialang.org/t/difference-in-behaviour-between-repl-and-debugger/117101 "2024-07-18T12:58:09Z")

</div>

I am encountering an issue with Julia where code will run correctly in the debugger but throws an error when called from the REPL, which I don’t understand. A simple example of this is the code below: function test() …

---

## [How to use gmpy2 bigints in Julia](https://discourse.julialang.org/t/how-to-use-gmpy2-bigints-in-julia/117171)

<div class="topic-metadata">

**Author:** [@gerryj](https://discourse.julialang.org/u/gerryj)\
**Replies:** 3\
**Last updated:** [July 18, 2024, 11:56am UTC](https://discourse.julialang.org/t/how-to-use-gmpy2-bigints-in-julia/117171 "2024-07-18T11:56:45Z")

</div>

I am using gmpy2 in python for bigints, 2000+ digits. I just import the functions i need and use them directly. Can i do that in Julia? How so?. If the answer is make a python call, has anyone checked the comparative p…

---

## [Precompilation Error: GR](https://discourse.julialang.org/t/precompilation-error-gr/110488)

<div class="topic-metadata">

**Author:** [@MisterX](https://discourse.julialang.org/u/MisterX)\
**Replies:** 17\
**Last updated:** [July 18, 2024, 8:33am UTC](https://discourse.julialang.org/t/precompilation-error-gr/110488 "2024-07-18T08:33:08Z")

</div>

Hello, what is the problem? Thank you… ? GR\_jll ? Plots ? Plots → UnitfulExt 139 dependencies successfully precompiled in 94 seconds. 6 already precompiled. 1 dependency had output during precompilation: GR ERROR: Loa…

---

## [How do i create a custom supertype?](https://discourse.julialang.org/t/how-do-i-create-a-custom-supertype/117166)

<div class="topic-metadata">

**Author:** [@Rockdeldiablo](https://discourse.julialang.org/u/Rockdeldiablo)\
**Replies:** 4\
**Last updated:** [July 18, 2024, 3:00am UTC](https://discourse.julialang.org/t/how-do-i-create-a-custom-supertype/117166 "2024-07-18T03:00:20Z")

</div>

hi everyone. i have a function that can return as output results of type Matrix{Categorical{Floaxx, Vector{Floatxx}}} where xx stands for the usual 16,32 or 64. i was trying to create a test for such function that che…

---

## [How can I determine which callback is happening?](https://discourse.julialang.org/t/how-can-i-determine-which-callback-is-happening/117104)

<div class="topic-metadata">

**Author:** [@ericcdammannjr](https://discourse.julialang.org/u/ericcdammannjr)\
**Replies:** 2\
**Last updated:** [July 18, 2024, 12:25am UTC](https://discourse.julialang.org/t/how-can-i-determine-which-callback-is-happening/117104 "2024-07-18T00:25:11Z")

</div>

Below I have the important parts of the scripts for a model that determines the geomorphic behaviors of a tidal marsh and lagoon system. Seen below there are 3 “behaviors” in a vector continuous callback function and eve…

---

## [Adding a local package using the Pkg manager - how to add the path?](https://discourse.julialang.org/t/adding-a-local-package-using-the-pkg-manager-how-to-add-the-path/39138)

<div class="topic-metadata">

**Author:** [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Replies:** 34\
**Last updated:** [July 18, 2024, 12:22am UTC](https://discourse.julialang.org/t/adding-a-local-package-using-the-pkg-manager-how-to-add-the-path/39138 "2024-07-18T00:22:44Z")

</div>

I have created a package using PkgTemplates, and everything is great. Now I want to use this package on another machine. I have copied the files. How do I add the path of the directory such that Pkg knows about it when I…

---

## [MPI parallel computation with SMatrix](https://discourse.julialang.org/t/mpi-parallel-computation-with-smatrix/117090)

<div class="topic-metadata">

**Author:** [@Kohei\_Hattori](https://discourse.julialang.org/u/Kohei_Hattori)\
**Replies:** 1\
**Last updated:** [July 17, 2024, 11:08pm UTC](https://discourse.julialang.org/t/mpi-parallel-computation-with-smatrix/117090 "2024-07-17T23:08:08Z")

</div>

I am a beginner in Julia. I would like to create a Julia code to send Matrix{SMatrix{2,2,ComplexF64,4}} to a neighboring process in MPI parallel computation. Here is the code I am currently working on. Thank you in advan…

---

## [Export works but not when \`\] add\` package](https://discourse.julialang.org/t/export-works-but-not-when-add-package/117030)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 10\
**Last updated:** [July 17, 2024, 1:16am UTC](https://discourse.julialang.org/t/export-works-but-not-when-add-package/117030 "2024-07-17T01:16:46Z")

</div>

I am on this one for too long and can’t fix it yet :smiling\_face\_with\_tear: :laughing: A MWE is not productible unfortunately file RingStarProblems.jl contains: module RingStarProblems if "JULIA\_REGISTRYCI\_AUTOMER…

---

## [GMT error message: Failure to open virtual file](https://discourse.julialang.org/t/gmt-error-message-failure-to-open-virtual-file/116843)

<div class="topic-metadata">

**Author:** [@morningglory05](https://discourse.julialang.org/u/morningglory05)\
**Replies:** 4\
**Last updated:** [July 16, 2024, 9:21pm UTC](https://discourse.julialang.org/t/gmt-error-message-failure-to-open-virtual-file/116843 "2024-07-16T21:21:19Z")

</div>

Someone else had this error in 2018 and opened a GMT issue for it: https://github.com/GenericMappingTools/GMT.jl/issues/59 (I’m not sure if it proper precedure to ask for the error to be reopened or to post here.) Thing…

---

## [Using expression must be at top level](https://discourse.julialang.org/t/using-expression-must-be-at-top-level/117088)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 9\
**Last updated:** [July 16, 2024, 8:33pm UTC](https://discourse.julialang.org/t/using-expression-must-be-at-top-level/117088 "2024-07-16T20:33:31Z")

</div>

In order to make my package Solver parametric, I am trying to read the user prompt to determine which solver he wants to use alongside with JuMP mutable struct SolverOptimizer solver::DataType id::Int end funct…

---

## [Getting help for Julia functions](https://discourse.julialang.org/t/getting-help-for-julia-functions/117086)

<div class="topic-metadata">

**Author:** [@sn248](https://discourse.julialang.org/u/sn248)\
**Replies:** 6\
**Last updated:** [July 16, 2024, 2:04pm UTC](https://discourse.julialang.org/t/getting-help-for-julia-functions/117086 "2024-07-16T14:04:19Z")

</div>

Hi I am a complete noob to the language (first post!) and I am coming from R programming language. I was wondering if there is any R style ‘help’ in the language. For example I am looking to understand more about the pa…

---

## [Safely accessing API tokens while automatically updating](https://discourse.julialang.org/t/safely-accessing-api-tokens-while-automatically-updating/117038)

<div class="topic-metadata">

**Author:** [@John\_Finseth](https://discourse.julialang.org/u/John_Finseth)\
**Replies:** 6\
**Last updated:** [July 16, 2024, 11:16am UTC](https://discourse.julialang.org/t/safely-accessing-api-tokens-while-automatically-updating/117038 "2024-07-16T11:16:42Z")

</div>

Hello. I’m working with setting up an API in Julia. It requires tokens, which periodically expire. I currently have my tokens saved in “tokens.json” file, which I read when initializing the code. However, I wanted to cr…

---

## [How to run my version of a function from a package](https://discourse.julialang.org/t/how-to-run-my-version-of-a-function-from-a-package/117073)

<div class="topic-metadata">

**Author:** [@sideyt](https://discourse.julialang.org/u/sideyt)\
**Replies:** 2\
**Last updated:** [July 16, 2024, 1:42am UTC](https://discourse.julialang.org/t/how-to-run-my-version-of-a-function-from-a-package/117073 "2024-07-16T01:42:00Z")

</div>

I have translated SAMIN (optimize) in the Optim package to another language (where it is needed) and need to add print statements to the Julia code for comparison. This is the code I wish to run: I have placed samin.jl…

---

## [Reduce not type stable](https://discourse.julialang.org/t/reduce-not-type-stable/117056)

<div class="topic-metadata">

**Author:** [@ssdfg](https://discourse.julialang.org/u/ssdfg)\
**Replies:** 2\
**Last updated:** [July 15, 2024, 7:35pm UTC](https://discourse.julialang.org/t/reduce-not-type-stable/117056 "2024-07-15T19:35:25Z")

</div>

julia\> reduce(vcat, \[1,2\]) 2-element Vector{Int64}: 1 2 julia\> reduce(vcat, \[1\]) 1

---

## [Some CUDA functions suddenly become very slow](https://discourse.julialang.org/t/some-cuda-functions-suddenly-become-very-slow/117025)

<div class="topic-metadata">

**Author:** [@baizhan](https://discourse.julialang.org/u/baizhan)\
**Replies:** 3\
**Last updated:** [July 14, 2024, 8:00pm UTC](https://discourse.julialang.org/t/some-cuda-functions-suddenly-become-very-slow/117025 "2024-07-14T20:00:23Z")

</div>

I am new to GPU computation and I want to start from julia. I use CUDA.jl to do this and write some code following the instruction. However, it takes very long time for the following simple code: module TestMyCUDA fun…

---

## [Julia documentation about FOR loop](https://discourse.julialang.org/t/julia-documentation-about-for-loop/104725)

<div class="topic-metadata">

**Author:** [@atBNE](https://discourse.julialang.org/u/atBNE)\
**Replies:** 16\
**Last updated:** [July 14, 2024, 5:11pm UTC](https://discourse.julialang.org/t/julia-documentation-about-for-loop/104725 "2024-07-14T17:11:28Z")

</div>

Incomplete / missing element in Julia documentation about: Repeated Evaluation: Loops https://docs.julialang.org/en/v1/manual/control-flow/#man-loops The description of the “for” loop is missing the “step” value. Pl…

---

## [Using everything exported in a module and its submodules](https://discourse.julialang.org/t/using-everything-exported-in-a-module-and-its-submodules/117024)

<div class="topic-metadata">

**Author:** [@K5Julien](https://discourse.julialang.org/u/K5Julien)\
**Replies:** 4\
**Last updated:** [July 14, 2024, 10:28am UTC](https://discourse.julialang.org/t/using-everything-exported-in-a-module-and-its-submodules/117024 "2024-07-14T10:28:12Z")

</div>

I am currently replacing some String arguments of my mutable structure with dedicated types instead. The following MWE works perfectly fine: module MyPackage ### Some code module Options module SolveMod …

---

## [How to install pySR on python(Windows system)](https://discourse.julialang.org/t/how-to-install-pysr-on-python-windows-system/116952)

<div class="topic-metadata">

**Author:** [@wilson](https://discourse.julialang.org/u/wilson)\
**Replies:** 20\
**Last updated:** [July 14, 2024, 8:52am UTC](https://discourse.julialang.org/t/how-to-install-pysr-on-python-windows-system/116952 "2024-07-14T08:52:16Z")

</div>

Hi,everyone. I am very new to pysr and julia. When I installed pysr by using the command “pip install pysr”, and imported it in python, it told that Command ‘\[‘C:\\Users\\wilson\\.julia\\juliaup\\julia-1.10.4+0.x64.w64.mingw3…

---

## [Metaprogramming: substitute the name of the argument](https://discourse.julialang.org/t/metaprogramming-substitute-the-name-of-the-argument/116867)

<div class="topic-metadata">

**Author:** [@dmi3kno](https://discourse.julialang.org/u/dmi3kno)\
**Replies:** 20\
**Last updated:** [July 14, 2024, 8:08am UTC](https://discourse.julialang.org/t/metaprogramming-substitute-the-name-of-the-argument/116867 "2024-07-14T08:08:53Z")

</div>

I am writing a function factory that takes two functions and weighs them by some \_wt \\in (0,1). function fun\_mix(fun1::Function, fun2::Function; \_nm\_wt="\_wt") f = function (u::AbstractFloat, args...; \_wt=0.5) …

---

## [Learning Orbital Dynamics](https://discourse.julialang.org/t/learning-orbital-dynamics/116607)

<div class="topic-metadata">

**Author:** [@Jose\_P](https://discourse.julialang.org/u/Jose_P)\
**Replies:** 16\
**Last updated:** [July 13, 2024, 9:28pm UTC](https://discourse.julialang.org/t/learning-orbital-dynamics/116607 "2024-07-13T21:28:37Z")

</div>

Hi everyone, I am currently learning Julia by working on a project based on the paper “Learning orbital dynamics of binary black hole systems from gravitational wave measurements.” The idea is to reconstruct the original…

---

## [How to integrate Julia with a HTML web page?](https://discourse.julialang.org/t/how-to-integrate-julia-with-a-html-web-page/48019)

<div class="topic-metadata">

**Author:** [@yasser\_rajwani](https://discourse.julialang.org/u/yasser_rajwani)\
**Replies:** 13\
**Last updated:** [July 13, 2024, 10:15am UTC](https://discourse.julialang.org/t/how-to-integrate-julia-with-a-html-web-page/48019 "2024-07-13T10:15:16Z")

</div>

How to call a Julia function from an application running in a web browser

---

## [Why would a sysimage be faster than a package (JuliaScript.jl)?](https://discourse.julialang.org/t/why-would-a-sysimage-be-faster-than-a-package-juliascript-jl/116984)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 4\
**Last updated:** [July 13, 2024, 7:45am UTC](https://discourse.julialang.org/t/why-would-a-sysimage-be-faster-than-a-package-juliascript-jl/116984 "2024-07-13T07:45:02Z")

</div>

As stated in the README, JuliaScript.jl can “create a corresponding julia module and track all precompile statements from the actual run” then “from the second time onwards, it will then run as fast as julia’s precompila…

---

## [Type of array index?](https://discourse.julialang.org/t/type-of-array-index/76065)

<div class="topic-metadata">

**Author:** [@ryofurue](https://discourse.julialang.org/u/ryofurue)\
**Replies:** 26\
**Last updated:** [July 13, 2024, 6:26am UTC](https://discourse.julialang.org/t/type-of-array-index/76065 "2024-07-13T06:26:16Z")

</div>

I wonder what the type of indices is for standard arrays? Int, Int64, or . . . ? I have this use in mind at present: # Collect indices for which v\[i\] \< thresh function partition\_vec(v, thresh) idx = Vector{Int??????…

---

## [Bio - Phylogenies](https://discourse.julialang.org/t/bio-phylogenies/116978)

<div class="topic-metadata">

**Author:** [@msarrias](https://discourse.julialang.org/u/msarrias)\
**Replies:** 2\
**Last updated:** [July 12, 2024, 9:46pm UTC](https://discourse.julialang.org/t/bio-phylogenies/116978 "2024-07-12T21:46:21Z")

</div>

Hi! I’m new to Julia so apologies for the possibly dumb question. How can I install the Phylogenies package? I am aware that this used to be part of the BioJulia package which is now deprecated and per this post split …

---

## [Alternative to Any\[ \] ? or efficient usage idea?](https://discourse.julialang.org/t/alternative-to-any-or-efficient-usage-idea/116969)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 9\
**Last updated:** [July 12, 2024, 9:19pm UTC](https://discourse.julialang.org/t/alternative-to-any-or-efficient-usage-idea/116969 "2024-07-12T21:19:53Z")

</div>

Hello everyone, Im trying to avoid use of any\[\] in my code but at the moment situation is such that I need to save results for unknown number of interactions (stochastic in nature). So, I’m using any\[\] and pushing resul…

---

## [Julia -\> C function (Create thead) -\> Julia CUDA kernel issue](https://discourse.julialang.org/t/julia-c-function-create-thead-julia-cuda-kernel-issue/116965)

<div class="topic-metadata">

**Author:** [@miniskar](https://discourse.julialang.org/u/miniskar)\
**Replies:** 1\
**Last updated:** [July 12, 2024, 12:26pm UTC](https://discourse.julialang.org/t/julia-c-function-create-thead-julia-cuda-kernel-issue/116965 "2024-07-12T12:26:32Z")

</div>

I am facing a weird problem in our application. We have a julia function calling a C function, which is creating a pthread and calling Julia CUDA kernel. I have created a small example to illustrate and reproduce the pro…

---

## [Creating a 2D computational Domain in trixi](https://discourse.julialang.org/t/creating-a-2d-computational-domain-in-trixi/115399)

<div class="topic-metadata">

**Author:** [@Chowdhury\_MD\_Irtiza](https://discourse.julialang.org/u/Chowdhury_MD_Irtiza)\
**Replies:** 1\
**Last updated:** [July 12, 2024, 9:56am UTC](https://discourse.julialang.org/t/creating-a-2d-computational-domain-in-trixi/115399 "2024-07-12T09:56:32Z")

</div>

I want to create a 2D domain for simulation analysis in Trixi. The domain follows a 2D domain of length 5400 mm and Height of 60 mm, which has 4 obstacles of length L= 12 mm and height H= 18 mm. These obstacles are pla…

---

## [Unit tests, debugger, VsCode](https://discourse.julialang.org/t/unit-tests-debugger-vscode/113419)

<div class="topic-metadata">

**Author:** [@feribg](https://discourse.julialang.org/u/feribg)\
**Replies:** 4\
**Last updated:** [July 12, 2024, 1:06am UTC](https://discourse.julialang.org/t/unit-tests-debugger-vscode/113419 "2024-07-12T01:06:02Z")

</div>

What is the recommended workflow for using tests + vscode official Julia extension + debugger. It seems like they just can’t be made to work together. If I run the file runtests.jl using TestItemRunner @run\_package\_tes…

---

## [Roundoff error in variance of array of constant value](https://discourse.julialang.org/t/roundoff-error-in-variance-of-array-of-constant-value/116890)

<div class="topic-metadata">

**Author:** [@jgr](https://discourse.julialang.org/u/jgr)\
**Replies:** 7\
**Last updated:** [July 11, 2024, 10:31pm UTC](https://discourse.julialang.org/t/roundoff-error-in-variance-of-array-of-constant-value/116890 "2024-07-11T22:31:28Z")

</div>

In the code below, var(M) is not 0, I guess the reason might be computation error, but I wonder if anyone knows how to deal with this? Thanks in advance. M = fill(5.421241248937501521, (1,10000)) M = Float64.(M) var(M) …

---

## [Issue with BigFloat rounding](https://discourse.julialang.org/t/issue-with-bigfloat-rounding/116831)

<div class="topic-metadata">

**Author:** [@chkat](https://discourse.julialang.org/u/chkat)\
**Replies:** 14\
**Last updated:** [July 10, 2024, 3:09pm UTC](https://discourse.julialang.org/t/issue-with-bigfloat-rounding/116831 "2024-07-10T15:09:01Z")

</div>

I want to set the BigFloat(7.0687866210937500e-1) by using a precision of 15 bits and two different rounding modes (up and down). So I do: setprecision(15) setrounding(BigFloat, RoundDown) # or RoundUp BigFloat(7.0687…

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

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