# New to Julia

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

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

**Page:** 31

---

## [2 Easy Julia Beginner Programs](https://discourse.julialang.org/t/2-easy-julia-beginner-programs/121476)

<div class="topic-metadata">

**Author:** [@benslinux](https://discourse.julialang.org/u/benslinux)\
**Replies:** 3\
**Last updated:** [October 31, 2024, 5:31pm UTC](https://discourse.julialang.org/t/2-easy-julia-beginner-programs/121476 "2024-10-31T17:31:31Z")

</div>

I posted yesterday inquiring about sharing Julia projects here - my takeaway was that this forum isn’t really the place to post code - especially programs considered too elementary / basic. I get that - for any beginners…

---

## [BoundsError: attempt to access 55-element Vector{Float64} at index \[3-element BitVector\] OR UndefVarError: \`vertex\_counter\` not defined](https://discourse.julialang.org/t/boundserror-attempt-to-access-55-element-vector-float64-at-index-3-element-bitvector-or-undefvarerror-vertex-counter-not-defined/121955)

<div class="topic-metadata">

**Author:** [@tfranks](https://discourse.julialang.org/u/tfranks)\
**Replies:** 7\
**Last updated:** [October 30, 2024, 6:37pm UTC](https://discourse.julialang.org/t/boundserror-attempt-to-access-55-element-vector-float64-at-index-3-element-bitvector-or-undefvarerror-vertex-counter-not-defined/121955 "2024-10-30T18:37:07Z")

</div>

Hello, I’ve created bank and depositor agents and would now like to render as a graph with banks as the nodes and the depositors forming the edges that change at every time step. A snippet of the data frame is inserted…

---

## [Reading and writing a global variable](https://discourse.julialang.org/t/reading-and-writing-a-global-variable/121996)

<div class="topic-metadata">

**Author:** [@Matthijs\_1971](https://discourse.julialang.org/u/Matthijs_1971)\
**Replies:** 2\
**Last updated:** [October 30, 2024, 4:50pm UTC](https://discourse.julialang.org/t/reading-and-writing-a-global-variable/121996 "2024-10-30T16:50:24Z")

</div>

Please consider the following code: module MyModule global MY\_GLOBAL = 42 function test()::Nothing println("MY\_GLOBAL ", MY\_GLOBAL) # MY\_GLOBAL = 3 return nothing end en…

---

## [The runtime type and the variable type](https://discourse.julialang.org/t/the-runtime-type-and-the-variable-type/121868)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 17\
**Last updated:** [October 30, 2024, 1:59pm UTC](https://discourse.julialang.org/t/the-runtime-type-and-the-variable-type/121868 "2024-10-30T13:59:14Z")

</div>

Here’s a short experiment which demonstrates that the runtime type is an independent piece of information from the type of a variable. julia\> x::Any="hello world" "hello world" julia\> typeof(x) String julia\> x=1 1 ju…

---

## [MKLPardisoSolver() problem](https://discourse.julialang.org/t/mklpardisosolver-problem/121882)

<div class="topic-metadata">

**Author:** [@NTH](https://discourse.julialang.org/u/NTH)\
**Replies:** 2\
**Last updated:** [October 30, 2024, 10:13am UTC](https://discourse.julialang.org/t/mklpardisosolver-problem/121882 "2024-10-30T10:13:24Z")

</div>

Hello everyone, I’m very new to Julia and right now I’m testing the function MKLPardisoSolver() but I always received the error: ERROR: LoadError: MKL is not available Stacktrace: \[1\] error(s::String) @ Base ./error.…

---

## [How to integrate parse with split?](https://discourse.julialang.org/t/how-to-integrate-parse-with-split/121819)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 3\
**Last updated:** [October 30, 2024, 9:00am UTC](https://discourse.julialang.org/t/how-to-integrate-parse-with-split/121819 "2024-10-30T09:00:52Z")

</div>

Hello, How can I correct the command a, b, c = parse(Int,split(readline()))? I want to receive three inputs and simultaneously convert it to an integer and assign it to each of the variables. Thank you.

---

## [Genie /Project level how to fix UndefVarError: \`TodoMVC\` not defined](https://discourse.julialang.org/t/genie-project-level-how-to-fix-undefvarerror-todomvc-not-defined/121966)

<div class="topic-metadata">

**Author:** [@andreh](https://discourse.julialang.org/u/andreh)\
**Replies:** 0\
**Last updated:** [October 30, 2024, 1:02am UTC](https://discourse.julialang.org/t/genie-project-level-how-to-fix-undefvarerror-todomvc-not-defined/121966 "2024-10-30T01:02:49Z")

</div>

Hi, I am learning Julia with Genie Framework I am following the book Web-Development-with-Julia-and-Genie On Chapter 8, db/migations there is the module “GenerateFakeTodos” chapter 8-GenerateFakeTodos.jl After running…

---

## [The 'do'-keyword when it doesn't create an anonymous function and pass it as the first argument to a function call](https://discourse.julialang.org/t/the-do-keyword-when-it-doesnt-create-an-anonymous-function-and-pass-it-as-the-first-argument-to-a-function-call/94471)

<div class="topic-metadata">

**Author:** [@kingoslo](https://discourse.julialang.org/u/kingoslo)\
**Replies:** 4\
**Last updated:** [October 29, 2024, 9:54pm UTC](https://discourse.julialang.org/t/the-do-keyword-when-it-doesnt-create-an-anonymous-function-and-pass-it-as-the-first-argument-to-a-function-call/94471 "2024-10-29T21:54:59Z")

</div>

Hello there, I am trying to learn Julia, and I came by the do keyword in a setting that I do not understand. So I am asking for some help to work out what happens here. HDF5.h5open(fname, "r") do fd #= lots of stuff in…

---

## [Lack of improvement from distributed pmap, understanding a simple example](https://discourse.julialang.org/t/lack-of-improvement-from-distributed-pmap-understanding-a-simple-example/121880)

<div class="topic-metadata">

**Author:** [@ma-y](https://discourse.julialang.org/u/ma-y)\
**Replies:** 6\
**Last updated:** [October 29, 2024, 2:25pm UTC](https://discourse.julialang.org/t/lack-of-improvement-from-distributed-pmap-understanding-a-simple-example/121880 "2024-10-29T14:25:31Z")

</div>

Dear all, I am relatively new to Julia and have spent the last weeks trying to parallelize my code, without much success. Therefore I would like to understand the following minimal example. My computer has 16 cores, an…

---

## [How to write multithreading matrix multiplication](https://discourse.julialang.org/t/how-to-write-multithreading-matrix-multiplication/121865)

<div class="topic-metadata">

**Author:** [@Enc](https://discourse.julialang.org/u/Enc)\
**Replies:** 4\
**Last updated:** [October 29, 2024, 1:31pm UTC](https://discourse.julialang.org/t/how-to-write-multithreading-matrix-multiplication/121865 "2024-10-29T13:31:46Z")

</div>

Hello! I’m studying parallel programming in Julia, so i decided to write some basics matrix multiplication without using Linear Algebra package, because it’s already multi-threaded. using Base.Threads using BenchmarkToo…

---

## [Julia typesystem](https://discourse.julialang.org/t/julia-typesystem/121860)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 22\
**Last updated:** [October 29, 2024, 12:12pm UTC](https://discourse.julialang.org/t/julia-typesystem/121860 "2024-10-29T12:12:06Z")

</div>

Here is a demonstration of some behavior of the Julia typesystem. function mine(x::Vector{Union{Int64, T}}) where T println(typeof(x)) println(T) end julia\> mine(Vector{Union{Int64, String}}(\[1, 2, 3, "hello"\])…

---

## [Having trouble installing DifferentialEquations.jl](https://discourse.julialang.org/t/having-trouble-installing-differentialequations-jl/105217)

<div class="topic-metadata">

**Author:** [@aplund](https://discourse.julialang.org/u/aplund)\
**Replies:** 7\
**Last updated:** [October 29, 2024, 11:33am UTC](https://discourse.julialang.org/t/having-trouble-installing-differentialequations-jl/105217 "2024-10-29T11:33:40Z")

</div>

I’m trying to get up and running with the DifferentialEquations.jl package. It seems that there is some problem when installing due to a soname bump in the libklu library which is part of SuiteSparse. My system has Sui…

---

## [ODESystem usage in NeuralPDE/NNODE](https://discourse.julialang.org/t/odesystem-usage-in-neuralpde-nnode/121906)

<div class="topic-metadata">

**Author:** [@maccha](https://discourse.julialang.org/u/maccha)\
**Replies:** 3\
**Last updated:** [October 29, 2024, 10:32am UTC](https://discourse.julialang.org/t/odesystem-usage-in-neuralpde-nnode/121906 "2024-10-29T10:32:02Z")

</div>

Hi everyone, I have to infer some parameters (~ 10^4, forget for now about the possiblity of doing this) of interactions strength for a ~ 90 variables network of ODEs whose interactions links I know beforehand. I wanted…

---

## [Problems using OpenCV](https://discourse.julialang.org/t/problems-using-opencv/115446)

<div class="topic-metadata">

**Author:** [@oOosys](https://discourse.julialang.org/u/oOosys)\
**Replies:** 2\
**Last updated:** [October 28, 2024, 5:19pm UTC](https://discourse.julialang.org/t/problems-using-opencv/115446 "2024-10-28T17:19:30Z")

</div>

julia\> import OpenCV Precompiling OpenCV Info Given OpenCV was explicitly requested, output will be shown live ERROR: LoadError: InitError: could not load library "/home/o/.julia/artifacts/beeb384c8ba60497d81e26…

---

## [Terminal not fully functional](https://discourse.julialang.org/t/terminal-not-fully-functional/121737)

<div class="topic-metadata">

**Author:** [@sammyD5](https://discourse.julialang.org/u/sammyD5)\
**Replies:** 29\
**Last updated:** [October 28, 2024, 4:27pm UTC](https://discourse.julialang.org/t/terminal-not-fully-functional/121737 "2024-10-28T16:27:13Z")

</div>

Hello all, I am new to Julia and just after the installation I’ve run into some issues. When I am opening the terminal I am greeted by a warning message - “Warning: Terminal not fully functional - @Base client.jl.436” …

---

## [Function name with Type constraining](https://discourse.julialang.org/t/function-name-with-type-constraining/121635)

<div class="topic-metadata">

**Author:** [@HANHAOHAN](https://discourse.julialang.org/u/HANHAOHAN)\
**Replies:** 5\
**Last updated:** [October 28, 2024, 7:40am UTC](https://discourse.julialang.org/t/function-name-with-type-constraining/121635 "2024-10-28T07:40:41Z")

</div>

I met code as follow, anyone can give an syntactic explanation? mutable struct WriteClosure{T, KW} buf::T end function (f::WriteClosure)(i, nm, TT, v; kw...) end

---

## [Why are there no captured variables when the \`if\` expression is used as an rvalue?](https://discourse.julialang.org/t/why-are-there-no-captured-variables-when-the-if-expression-is-used-as-an-rvalue/121782)

<div class="topic-metadata">

**Author:** [@aaoo](https://discourse.julialang.org/u/aaoo)\
**Replies:** 5\
**Last updated:** [October 27, 2024, 8:08am UTC](https://discourse.julialang.org/t/why-are-there-no-captured-variables-when-the-if-expression-is-used-as-an-rvalue/121782 "2024-10-27T08:08:31Z")

</div>

When I was learning the Performance of captured variable, I found a second version of the example function that shows no captured variable in @code\_warntype. I am confused about the following three questions: Would the…

---

## [Why can't I catch the following error?](https://discourse.julialang.org/t/why-cant-i-catch-the-following-error/121712)

<div class="topic-metadata">

**Author:** [@deusexlibris](https://discourse.julialang.org/u/deusexlibris)\
**Replies:** 4\
**Last updated:** [October 26, 2024, 9:19pm UTC](https://discourse.julialang.org/t/why-cant-i-catch-the-following-error/121712 "2024-10-26T21:19:01Z")

</div>

I have created a simple web server using HTTP.jl for handling high-volume, low-latency simple requests. For performance, I spawn a separate thread on :default for each request. Everything runs fine but after running te…

---

## [Is there a way to use non-constant mass matrix depended from u?](https://discourse.julialang.org/t/is-there-a-way-to-use-non-constant-mass-matrix-depended-from-u/121787)

<div class="topic-metadata">

**Author:** [@garazha-ilya](https://discourse.julialang.org/u/garazha-ilya)\
**Replies:** 0\
**Last updated:** [October 26, 2024, 1:32pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-use-non-constant-mass-matrix-depended-from-u/121787 "2024-10-26T13:32:29Z")

</div>

Hello! The DifferentialEquations.jl documentation says that: Non-constant mass matrices are not directly supported: users are advised to transform their problem through substitution to a DAE with constant mass matric…

---

## [Best practise: organising code in Julia](https://discourse.julialang.org/t/best-practise-organising-code-in-julia/74362)

<div class="topic-metadata">

**Author:** [@roh\_codeur](https://discourse.julialang.org/u/roh_codeur)\
**Replies:** 11\
**Last updated:** [October 26, 2024, 9:13am UTC](https://discourse.julialang.org/t/best-practise-organising-code-in-julia/74362 "2024-10-26T09:13:55Z")

</div>

Hi A newbie here, from OOP background. I am looking to put together a project which will: Download data from Internet Do some manipulations on the downloaded data Do some analysis on the downloaded data Please note t…

---

## [DataFramesMeta: @rsubset or condition?](https://discourse.julialang.org/t/dataframesmeta-rsubset-or-condition/121763)

<div class="topic-metadata">

**Author:** [@alecStewart1](https://discourse.julialang.org/u/alecStewart1)\
**Replies:** 2\
**Last updated:** [October 25, 2024, 10:39pm UTC](https://discourse.julialang.org/t/dataframesmeta-rsubset-or-condition/121763 "2024-10-25T22:39:08Z")

</div>

Say I have some dataframe where I want to select items by one condition or another that’s a combination. @rsubset df :x == 1 || :x == 2 :y == 3 With the data I’m working with, this returns matches of the 2nd clause and…

---

## [Is there a way to force a wrong dispatch for test purposes?](https://discourse.julialang.org/t/is-there-a-way-to-force-a-wrong-dispatch-for-test-purposes/121743)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 3\
**Last updated:** [October 25, 2024, 2:21pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-force-a-wrong-dispatch-for-test-purposes/121743 "2024-10-25T14:21:13Z")

</div>

Hi, Suppose I have two classes and a function as follows: abstract struct A end struct B\<:A end and then the function f(x::A) = true f(x::B) = true The function is supposed to return the same thing in both cases, th…

---

## [What does \`include\` do?](https://discourse.julialang.org/t/what-does-include-do/121699)

<div class="topic-metadata">

**Author:** [@anon91151494](https://discourse.julialang.org/u/anon91151494)\
**Replies:** 27\
**Last updated:** [October 25, 2024, 1:51pm UTC](https://discourse.julialang.org/t/what-does-include-do/121699 "2024-10-25T13:51:39Z")

</div>

There have been questions about this before, but so far none of them have provided an answer at the level of detail I have been looking for. My current understanding is that include is not a simple text substitution/rep…

---

## [Clear memory after using plot!(...)](https://discourse.julialang.org/t/clear-memory-after-using-plot/121690)

<div class="topic-metadata">

**Author:** [@EatMyShorts](https://discourse.julialang.org/u/EatMyShorts)\
**Replies:** 23\
**Last updated:** [October 24, 2024, 8:18pm UTC](https://discourse.julialang.org/t/clear-memory-after-using-plot/121690 "2024-10-24T20:18:09Z")

</div>

Hello, is there a simple command for Julia to clear memory after using plot!(…) without having to constantly restart VS Code? Best regards …

---

## [How to save output of REPL terminal in VS code](https://discourse.julialang.org/t/how-to-save-output-of-repl-terminal-in-vs-code/121709)

<div class="topic-metadata">

**Author:** [@agme2014](https://discourse.julialang.org/u/agme2014)\
**Replies:** 1\
**Last updated:** [October 24, 2024, 3:56pm UTC](https://discourse.julialang.org/t/how-to-save-output-of-repl-terminal-in-vs-code/121709 "2024-10-24T15:56:26Z")

</div>

Hi, I am working with the neuralODE examples and I see the loss values getting outputted in the REPL Terminal of VSCode. Is there any way to write all of the output into a file ? I checked the forum but could not find…

---

## [Photo Polymerisation Using Catalyst with constant Photon Species](https://discourse.julialang.org/t/photo-polymerisation-using-catalyst-with-constant-photon-species/121686)

<div class="topic-metadata">

**Author:** [@Map3GOSM](https://discourse.julialang.org/u/Map3GOSM)\
**Replies:** 0\
**Last updated:** [October 24, 2024, 9:00am UTC](https://discourse.julialang.org/t/photo-polymerisation-using-catalyst-with-constant-photon-species/121686 "2024-10-24T09:00:41Z")

</div>

Hi everyone, I am trying to set up a reaction network using Catalyst where one species remains at a constant value. I’m modelling a photo reaction and want to track the concentration of photons. In a simplified form, i…

---

## [Optimization problem that fails to converge](https://discourse.julialang.org/t/optimization-problem-that-fails-to-converge/121666)

<div class="topic-metadata">

**Author:** [@Iforire](https://discourse.julialang.org/u/Iforire)\
**Replies:** 3\
**Last updated:** [October 24, 2024, 7:55am UTC](https://discourse.julialang.org/t/optimization-problem-that-fails-to-converge/121666 "2024-10-24T07:55:55Z")

</div>

Hi all, I am very new to Julia and maths is quite old for me now, so I am struggling with my code. The thing is that I would like to find the best linear combination of six parameters that fits the seventh parameter. …

---

## [Markdown in VSCode](https://discourse.julialang.org/t/markdown-in-vscode/121664)

<div class="topic-metadata">

**Author:** [@uri](https://discourse.julialang.org/u/uri)\
**Replies:** 2\
**Last updated:** [October 24, 2024, 3:17am UTC](https://discourse.julialang.org/t/markdown-in-vscode/121664 "2024-10-24T03:17:48Z")

</div>

is it possible to insert comments in a julia formatted as md. I’ve heard that something as my following example is possible, and when you hover the mouse over the md text it appears formated. """ # Simple Markdown Tit…

---

## [Scalar indexing is disallowed - ODE solve using GPU](https://discourse.julialang.org/t/scalar-indexing-is-disallowed-ode-solve-using-gpu/121645)

<div class="topic-metadata">

**Author:** [@agme2014](https://discourse.julialang.org/u/agme2014)\
**Replies:** 2\
**Last updated:** [October 23, 2024, 3:11pm UTC](https://discourse.julialang.org/t/scalar-indexing-is-disallowed-ode-solve-using-gpu/121645 "2024-10-23T15:11:27Z")

</div>

Hi, I want to use NVIDIA GPU in my laptop to speed up Neural ODE computation. I started with testing out GPU on ODEs but I am getting the below error during the “solve” step : ERROR: Scalar indexing is disallowed. Invo…

---

## [How to format or print a difference in two DateTime objects](https://discourse.julialang.org/t/how-to-format-or-print-a-difference-in-two-datetime-objects/121638)

<div class="topic-metadata">

**Author:** [@anon91151494](https://discourse.julialang.org/u/anon91151494)\
**Replies:** 7\
**Last updated:** [October 23, 2024, 2:09pm UTC](https://discourse.julialang.org/t/how-to-format-or-print-a-difference-in-two-datetime-objects/121638 "2024-10-23T14:09:48Z")

</div>

I want to print the following object, which is a difference between two DateTimes datetime\_diff = datetime2 - datetime1 The type of datetime\_diff appears to be Milliseconds. That means it can be printed, but produces t…

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

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