# New to Julia

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

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

**Page:** 49

---

## [Matching any vector in function dispatch](https://discourse.julialang.org/t/matching-any-vector-in-function-dispatch/113075)

<div class="topic-metadata">

**Author:** [@suvayu](https://discourse.julialang.org/u/suvayu)\
**Replies:** 4\
**Last updated:** [April 18, 2024, 8:59am UTC](https://discourse.julialang.org/t/matching-any-vector-in-function-dispatch/113075 "2024-04-18T08:59:19Z")

</div>

I’m having trouble with function dispatch where I want to have two different implementations when the values in a dictionary are vectors or not These work as I would expect: function fn(val::Vector{Any}) @info "fn,…

---

## [Instantiate concrete type programmaticaly](https://discourse.julialang.org/t/instantiate-concrete-type-programmaticaly/113071)

<div class="topic-metadata">

**Author:** [@Sigmund](https://discourse.julialang.org/u/Sigmund)\
**Replies:** 1\
**Last updated:** [April 17, 2024, 2:45pm UTC](https://discourse.julialang.org/t/instantiate-concrete-type-programmaticaly/113071 "2024-04-17T14:45:57Z")

</div>

I want to instantiate a the following concrete type, Base.@kwdef struct A x::Int y::Int = 123 end but I’m having problems when all fields are not given. While this works: julia\> a = A(\[1, 2\]...) A(1, 2) juli…

---

## [CUDA: blockdimensions and launch\_configuration](https://discourse.julialang.org/t/cuda-blockdimensions-and-launch-configuration/113069)

<div class="topic-metadata">

**Author:** [@ErwinMoller](https://discourse.julialang.org/u/ErwinMoller)\
**Replies:** 0\
**Last updated:** [April 17, 2024, 2:00pm UTC](https://discourse.julialang.org/t/cuda-blockdimensions-and-launch-configuration/113069 "2024-04-17T14:00:25Z")

</div>

Hello, I am working on my understanding of blocks and threads/Block (which is called blockDimension). So I wrote a simple kernel (called gpu\_heavy! to impress my friends) that writes some values back to 4 CuArrays. (…

---

## [Multimodule project: Error when calling function from imported module in Julia](https://discourse.julialang.org/t/multimodule-project-error-when-calling-function-from-imported-module-in-julia/113045)

<div class="topic-metadata">

**Author:** [@dmgcodevil](https://discourse.julialang.org/u/dmgcodevil)\
**Replies:** 1\
**Last updated:** [April 17, 2024, 7:52am UTC](https://discourse.julialang.org/t/multimodule-project-error-when-calling-function-from-imported-module-in-julia/113045 "2024-04-17T07:52:28Z")

</div>

I’m new to Julia. I want to organize my code into modules. I have three modules: ModuleA.jl : module ModuleA include("ModuleB.jl") export process using .ModuleB function process(foo::Foo) end end ModuleB.jl : modul…

---

## [Precompiling a function for \`ForwardDiff\` call](https://discourse.julialang.org/t/precompiling-a-function-for-forwarddiff-call/113041)

<div class="topic-metadata">

**Author:** [@liamh](https://discourse.julialang.org/u/liamh)\
**Replies:** 1\
**Last updated:** [April 16, 2024, 11:47pm UTC](https://discourse.julialang.org/t/precompiling-a-function-for-forwarddiff-call/113041 "2024-04-16T23:47:01Z")

</div>

I am using ForwardDiff on my own function. While I expect that the first call spends a substantial amount of time compiling, subsequent identical calls are also spending 99.8+% of the time compiling. I have tried reviewi…

---

## [Creating an identifier column when combing multiple DataFrames with CSV.read](https://discourse.julialang.org/t/creating-an-identifier-column-when-combing-multiple-dataframes-with-csv-read/113013)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 2\
**Last updated:** [April 16, 2024, 5:59pm UTC](https://discourse.julialang.org/t/creating-an-identifier-column-when-combing-multiple-dataframes-with-csv-read/113013 "2024-04-16T17:59:16Z")

</div>

Suppose I have the following CSV files. df1 = DataFrame(A = 1:5, B = \["M", "F", "F", "M", "F"\]) df2 = DataFrame(A = 11:15, B = \["A", "B", "C", "D", "E"\]) df3 = DataFrame(A = 16:21, B = \["A", "B", "C", "D", "E","T"\]) …

---

## [NonlinearSolve.jl - 'solve' not defined](https://discourse.julialang.org/t/nonlinearsolve-jl-solve-not-defined/113020)

<div class="topic-metadata">

**Author:** [@Giovanni\_Bettolo](https://discourse.julialang.org/u/Giovanni_Bettolo)\
**Replies:** 5\
**Last updated:** [April 16, 2024, 5:34pm UTC](https://discourse.julialang.org/t/nonlinearsolve-jl-solve-not-defined/113020 "2024-04-16T17:34:33Z")

</div>

I am new to Julia, I have been trying to test the NonlinearSolve.jl installation using the Problem Type 1 of “Getting Started with Nonlinear Rootfinding in Julia”, but it always returns the error ’LoadError: UndefVarErro…

---

## [Clarification on when order matters when reading multiple files with CSV.read?](https://discourse.julialang.org/t/clarification-on-when-order-matters-when-reading-multiple-files-with-csv-read/112970)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 4\
**Last updated:** [April 15, 2024, 11:03pm UTC](https://discourse.julialang.org/t/clarification-on-when-order-matters-when-reading-multiple-files-with-csv-read/112970 "2024-04-15T23:03:17Z")

</div>

When using CSV.read to read multiple CSV files into a single DataFrame. When does the order the files are listed makes a difference. @nilshg points out that this is an issue with pooled arrays and can be remedied by s…

---

## [How to get help on a Julia command on a Jupyter notebook?](https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976)

<div class="topic-metadata">

**Author:** [@younes](https://discourse.julialang.org/u/younes)\
**Replies:** 7\
**Last updated:** [April 15, 2024, 9:56pm UTC](https://discourse.julialang.org/t/how-to-get-help-on-a-julia-command-on-a-jupyter-notebook/112976 "2024-04-15T21:56:47Z")

</div>

I already tried : ?replace ParseError: # Error @ /home/onto/dev/projects/intro\_julia.ipynb:1:1 ?replace ╙ ── not a unary operator Stacktrace: \[1\] top-level scope @ ~/dev/projects/intro\_julia.ipynb:1 but it does w…

---

## [Boxplot with NaN / missing / Inf in data?](https://discourse.julialang.org/t/boxplot-with-nan-missing-inf-in-data/112966)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 1\
**Last updated:** [April 15, 2024, 1:53pm UTC](https://discourse.julialang.org/t/boxplot-with-nan-missing-inf-in-data/112966 "2024-04-15T13:53:45Z")

</div>

Hello everyone, I’m struggling at the moment with boxplots. My data has several data points and many of them is NaN or Inf or missing. I was wondering if there is a way to just ignore these values without trying to edit…

---

## [Is Mocking discouraged? I would like to isolate testing](https://discourse.julialang.org/t/is-mocking-discouraged-i-would-like-to-isolate-testing/59549)

<div class="topic-metadata">

**Author:** [@s-kap](https://discourse.julialang.org/u/s-kap)\
**Replies:** 10\
**Last updated:** [April 15, 2024, 1:52pm UTC](https://discourse.julialang.org/t/is-mocking-discouraged-i-would-like-to-isolate-testing/59549 "2024-04-15T13:52:52Z")

</div>

EDIT: SimpleMock.jl allows mocking without needing macros in the live code, unlike Mocking.jl Let’s say I have 2 modules (e.g. below) and I want to test out ModuleB in an isolated way; i.e. without running the code in M…

---

## [Async Task Not Killed When Using Base.throwto to Interrupt Blocking I/O](https://discourse.julialang.org/t/async-task-not-killed-when-using-base-throwto-to-interrupt-blocking-i-o/112531)

<div class="topic-metadata">

**Author:** [@dmgcodevil](https://discourse.julialang.org/u/dmgcodevil)\
**Replies:** 2\
**Last updated:** [April 15, 2024, 1:43am UTC](https://discourse.julialang.org/t/async-task-not-killed-when-using-base-throwto-to-interrupt-blocking-i-o/112531 "2024-04-15T01:43:53Z")

</div>

I have a helper function heartbeat in Julia that is responsible for pinging a remote process. Originally, it used @fetchfrom id myid() to perform this action. However, I encountered an issue where if a worker disconnects…

---

## [How to efficiently create a struct to store parametric structs in tuples](https://discourse.julialang.org/t/how-to-efficiently-create-a-struct-to-store-parametric-structs-in-tuples/112931)

<div class="topic-metadata">

**Author:** [@walexaindre](https://discourse.julialang.org/u/walexaindre)\
**Replies:** 2\
**Last updated:** [April 14, 2024, 10:18pm UTC](https://discourse.julialang.org/t/how-to-efficiently-create-a-struct-to-store-parametric-structs-in-tuples/112931 "2024-04-14T22:18:28Z")

</div>

Hi!, I’m working with a PDE and I want suggestions on how properly store components inside a struct with no type instabilities considering that components are parametric structs too. For a MWE imagine something minimal …

---

## [Julia starts in system32 by default](https://discourse.julialang.org/t/julia-starts-in-system32-by-default/112877)

<div class="topic-metadata">

**Author:** [@Donald](https://discourse.julialang.org/u/Donald)\
**Replies:** 9\
**Last updated:** [April 14, 2024, 12:26am UTC](https://discourse.julialang.org/t/julia-starts-in-system32-by-default/112877 "2024-04-14T00:26:05Z")

</div>

I installed Julia using the recommended winget method. When I launch Julia from the start menu, the default working directory is julia\> pwd() "C:\\\\WINDOWS\\\\system32" This causes problems when trying to install packages…

---

## [Preallocating memory for a 3 dimensional array](https://discourse.julialang.org/t/preallocating-memory-for-a-3-dimensional-array/112874)

<div class="topic-metadata">

**Author:** [@Jay](https://discourse.julialang.org/u/Jay)\
**Replies:** 5\
**Last updated:** [April 13, 2024, 11:47am UTC](https://discourse.julialang.org/t/preallocating-memory-for-a-3-dimensional-array/112874 "2024-04-13T11:47:36Z")

</div>

Hi, I am new to Julia. I am writing a code where a 3 dimensional array, say A, each index with an initial size “chi”, is modified, and in the due course of time iteratively, (say 1000 times) the size of each index will…

---

## [Maintaining structures across workers](https://discourse.julialang.org/t/maintaining-structures-across-workers/112820)

<div class="topic-metadata">

**Author:** [@Utkarsh\_Sharma](https://discourse.julialang.org/u/Utkarsh_Sharma)\
**Replies:** 1\
**Last updated:** [April 12, 2024, 4:07pm UTC](https://discourse.julialang.org/t/maintaining-structures-across-workers/112820 "2024-04-12T16:07:29Z")

</div>

I created a struct params to be used across different workers as - @everywhere params = parameters(Int64\[\], ...) I initialise params.mapping\_ping as params.mapping\_ping = rand(1:params.q\_datacenters, dimensions.num\_fu…

---

## [Using Julia to solving ODE switched systems?](https://discourse.julialang.org/t/using-julia-to-solving-ode-switched-systems/112678)

<div class="topic-metadata">

**Author:** [@tridane](https://discourse.julialang.org/u/tridane)\
**Replies:** 4\
**Last updated:** [April 12, 2024, 3:24pm UTC](https://discourse.julialang.org/t/using-julia-to-solving-ode-switched-systems/112678 "2024-04-12T15:24:36Z")

</div>

Hi All, I am new to Julia. I was wondering if there is any effort in solving ODE switched systems? Thank You. A. Tridane

---

## [UndefVarError: \`##272\` not defined](https://discourse.julialang.org/t/undefvarerror-272-not-defined/112813)

<div class="topic-metadata">

**Author:** [@queueyong](https://discourse.julialang.org/u/queueyong)\
**Replies:** 2\
**Last updated:** [April 12, 2024, 12:41pm UTC](https://discourse.julialang.org/t/undefvarerror-272-not-defined/112813 "2024-04-12T12:41:52Z")

</div>

I installed latest julia version 1.10.2 and encountered error messages for every line of code with “UndefVarError: ##272 not defined.” Cannot find someone who has similar issue by searching.

---

## [Proper optim pkg install](https://discourse.julialang.org/t/proper-optim-pkg-install/112806)

<div class="topic-metadata">

**Author:** [@dkn](https://discourse.julialang.org/u/dkn)\
**Replies:** 1\
**Last updated:** [April 11, 2024, 12:56am UTC](https://discourse.julialang.org/t/proper-optim-pkg-install/112806 "2024-04-11T00:56:42Z")

</div>

Hello I’ve been using MatLab for decade fo numerical analysis Just foundout Julia and start using in Optimization But Igot so much err in using Otim pkg even after pkg.add(“Optim”) How to do it properly The procedur…

---

## [Error when defining PINN optimizer](https://discourse.julialang.org/t/error-when-defining-pinn-optimizer/112786)

<div class="topic-metadata">

**Author:** [@Donald](https://discourse.julialang.org/u/Donald)\
**Replies:** 2\
**Last updated:** [April 10, 2024, 11:05pm UTC](https://discourse.julialang.org/t/error-when-defining-pinn-optimizer/112786 "2024-04-10T23:05:47Z")

</div>

Hello. I’m trying to replicate this example in the NeuralPDE.jl documentation, but with a different PDE. I’m getting an error when I define the optimizer for the PINN. Here is my code: using NeuralPDE, Lux, ModelingTool…

---

## [\`UndefVarError\` thrown in defined variable](https://discourse.julialang.org/t/undefvarerror-thrown-in-defined-variable/112779)

<div class="topic-metadata">

**Author:** [@azeredo-e](https://discourse.julialang.org/u/azeredo-e)\
**Replies:** 2\
**Last updated:** [April 10, 2024, 4:34pm UTC](https://discourse.julialang.org/t/undefvarerror-thrown-in-defined-variable/112779 "2024-04-10T16:34:39Z")

</div>

I have a code that is throwing an UndefVarError even though the variable exists. for code in (Struct(i) for i in Tuple(...)) @assert typeof(code.name) \<: AbstractString # Error: \`code\` not defined Struct() is an im…

---

## [Join dataframe and geotable](https://discourse.julialang.org/t/join-dataframe-and-geotable/112138)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 34\
**Last updated:** [April 10, 2024, 2:40pm UTC](https://discourse.julialang.org/t/join-dataframe-and-geotable/112138 "2024-04-10T14:40:47Z")

</div>

A very basic question, I’m afraid. I have a shape file of local authority boundaries downloaded from the Office for National Statistics and GeoIO read this as expected and Makie plots it. One of the data fields in the …

---

## [Rand() doesn't work with dims as tuple of Uint](https://discourse.julialang.org/t/rand-doesnt-work-with-dims-as-tuple-of-uint/112716)

<div class="topic-metadata">

**Author:** [@alex180500](https://discourse.julialang.org/u/alex180500)\
**Replies:** 5\
**Last updated:** [April 10, 2024, 6:16am UTC](https://discourse.julialang.org/t/rand-doesnt-work-with-dims-as-tuple-of-uint/112716 "2024-04-10T06:16:32Z")

</div>

I’m trying to create random numbers in a matrix given by another variable that is a UInt32. For example I have something like this: test\_uint::UInt32 = 4 rand(Float64, (test\_uint, 10)) And get the following error ERRO…

---

## [Beam bending using Gridap](https://discourse.julialang.org/t/beam-bending-using-gridap/112723)

<div class="topic-metadata">

**Author:** [@Mishal](https://discourse.julialang.org/u/Mishal)\
**Replies:** 0\
**Last updated:** [April 9, 2024, 12:40pm UTC](https://discourse.julialang.org/t/beam-bending-using-gridap/112723 "2024-04-09T12:40:59Z")

</div>

Hi Guys I would appreciate any advice on the below code. I am struggling to get it up and running. It is cantilevered beam which I am trying to solve. using Gridap 𝒯 = CartesianDiscreteModel((0,1),(5)) writevtk(model…

---

## [Julia pkg unable to connect internet on termux](https://discourse.julialang.org/t/julia-pkg-unable-to-connect-internet-on-termux/109099)

<div class="topic-metadata">

**Author:** [@Anil\_Beniwal](https://discourse.julialang.org/u/Anil_Beniwal)\
**Replies:** 7\
**Last updated:** [April 9, 2024, 12:04pm UTC](https://discourse.julialang.org/t/julia-pkg-unable-to-connect-internet-on-termux/109099 "2024-04-09T12:04:38Z")

</div>

I’m trying to add language server for my text editor but Julia pkg gives me this error. I have installed glibc glibc-runner and my internet connection is working well.

---

## [Basic question about type invariance](https://discourse.julialang.org/t/basic-question-about-type-invariance/112674)

<div class="topic-metadata">

**Author:** [@Jesse1](https://discourse.julialang.org/u/Jesse1)\
**Replies:** 4\
**Last updated:** [April 8, 2024, 1:12pm UTC](https://discourse.julialang.org/t/basic-question-about-type-invariance/112674 "2024-04-08T13:12:09Z")

</div>

Hi there, I am getting unexpected behaviour with the DataType Dict when trying to specify subtypes. Specifically, I want a function to be able to accept a Dict where the keys are strings and the entries are tuples conta…

---

## [Aic in GLM](https://discourse.julialang.org/t/aic-in-glm/6229)

<div class="topic-metadata">

**Author:** [@LewisHein](https://discourse.julialang.org/u/LewisHein)\
**Replies:** 2\
**Last updated:** [April 9, 2024, 3:17am UTC](https://discourse.julialang.org/t/aic-in-glm/6229 "2024-04-09T03:17:47Z")

</div>

Hey everyone, I am trying to get the AIC of a model in GLM. It’s just a simple regression model with an identity link function. Yet, the call to aic(mod) says that my model is not a subtype of StatisticalModel. Shouldn…

---

## [Plotting with user input](https://discourse.julialang.org/t/plotting-with-user-input/112460)

<div class="topic-metadata">

**Author:** [@Jesse1](https://discourse.julialang.org/u/Jesse1)\
**Replies:** 8\
**Last updated:** [April 8, 2024, 10:01am UTC](https://discourse.julialang.org/t/plotting-with-user-input/112460 "2024-04-08T10:01:43Z")

</div>

Hi, I am very new to Julia and am looking for advice/information on plotting. I am trying to visualise my model fits for multiple instances and would like to visualise the plot and then give user input, perhaps like a 0…

---

## [Scaling viz plots in GeoStats](https://discourse.julialang.org/t/scaling-viz-plots-in-geostats/112242)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 18\
**Last updated:** [April 8, 2024, 8:12am UTC](https://discourse.julialang.org/t/scaling-viz-plots-in-geostats/112242 "2024-04-08T08:12:52Z")

</div>

I am making chloropleth maps of different metropolitan areas in the UK. Here are two examples: Now, Liverpool and London are very different in geographic size. Is there an easy way I can make these plots conform t…

---

## [Execution speed - can someone explain the difference?](https://discourse.julialang.org/t/execution-speed-can-someone-explain-the-difference/112655)

<div class="topic-metadata">

**Author:** [@novemberist](https://discourse.julialang.org/u/novemberist)\
**Replies:** 9\
**Last updated:** [April 8, 2024, 12:06am UTC](https://discourse.julialang.org/t/execution-speed-can-someone-explain-the-difference/112655 "2024-04-08T00:06:34Z")

</div>

Hello everyone, first of all, I’m sorry if this is a stupid question, but I’m fairly new to Julia and also not a seasoned programmer or computer scientist at all. But I’m scratching my head a little here about something…

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

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