# New to Julia

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

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

**Page:** 68

---

## [Lack of performances in Flux MLP](https://discourse.julialang.org/t/lack-of-performances-in-flux-mlp/104973)

<div class="topic-metadata">

**Author:** [@Mak](https://discourse.julialang.org/u/Mak)\
**Replies:** 6\
**Last updated:** [October 16, 2023, 2:17am UTC](https://discourse.julialang.org/t/lack-of-performances-in-flux-mlp/104973 "2023-10-16T02:17:44Z")

</div>

using CSV, DataFrames using Flux, Statistics, ProgressMeter using Plots using CUDA,AMDGPU; # Read the CSV file into a DataFrame df = CSV.File("real\_values\_ex\_00\_fixed\_time\_step.csv") |\> DataFrame # Extract the tem…

---

## [How does instance of a type works/interact with type parameters?](https://discourse.julialang.org/t/how-does-instance-of-a-type-works-interact-with-type-parameters/104475)

<div class="topic-metadata">

**Author:** [@EricH](https://discourse.julialang.org/u/EricH)\
**Replies:** 11\
**Last updated:** [October 15, 2023, 11:14pm UTC](https://discourse.julialang.org/t/how-does-instance-of-a-type-works-interact-with-type-parameters/104475 "2023-10-15T23:14:48Z")

</div>

Hi everyone, I am studying the code from repo ReinforcementLearningAnIntroduction.jl. In notebook Chapter01\_Tic\_Tac\_Toe.jl, there is this line that confuses me E = DefaultStateStyleEnv{Observation{Int}()}(env) Why ca…

---

## [Package trouble again](https://discourse.julialang.org/t/package-trouble-again/104977)

<div class="topic-metadata">

**Author:** [@loisel](https://discourse.julialang.org/u/loisel)\
**Replies:** 2\
**Last updated:** [October 15, 2023, 1:14pm UTC](https://discourse.julialang.org/t/package-trouble-again/104977 "2023-10-15T13:14:03Z")

</div>

Hi, I posted a few days ago because I was having trouble with the package system, I resolved the problem then, but now I have an eerily similar problem and I can’t fix it. I have a package that I’ve been developing, an…

---

## [Need for explicitly defining subtypes in function arguments?](https://discourse.julialang.org/t/need-for-explicitly-defining-subtypes-in-function-arguments/104883)

<div class="topic-metadata">

**Author:** [@hatmatrix](https://discourse.julialang.org/u/hatmatrix)\
**Replies:** 30\
**Last updated:** [October 14, 2023, 8:46pm UTC](https://discourse.julialang.org/t/need-for-explicitly-defining-subtypes-in-function-arguments/104883 "2023-10-14T20:46:46Z")

</div>

Sorry I’m very new to type systems here. I’m wondering why you need to state that your function should accept all subtypes in the class hierarchy for nodes which are defined. julia\> x = collect(1:2) 2-element Vector{In…

---

## [Overloading arithmetic operators for custom types](https://discourse.julialang.org/t/overloading-arithmetic-operators-for-custom-types/104944)

<div class="topic-metadata">

**Author:** [@evensong](https://discourse.julialang.org/u/evensong)\
**Replies:** 18\
**Last updated:** [October 14, 2023, 8:18pm UTC](https://discourse.julialang.org/t/overloading-arithmetic-operators-for-custom-types/104944 "2023-10-14T20:18:05Z")

</div>

I’m doing doing exercises on exercism.org to get familiar with Julia (most of my experience is in Python, C++, or Java). For one exercise I’ve made a custom Clock type, and I want to overload Base.show to print a timestr…

---

## [Can't install plot?](https://discourse.julialang.org/t/cant-install-plot/104928)

<div class="topic-metadata">

**Author:** [@Alex\_Beck](https://discourse.julialang.org/u/Alex_Beck)\
**Replies:** 3\
**Last updated:** [October 13, 2023, 2:01pm UTC](https://discourse.julialang.org/t/cant-install-plot/104928 "2023-10-13T14:01:56Z")

</div>

Hello, I wanted to do a little code in julia and using plot, so I watched the doc to install it and did what it was said. But when I put : Pkg.add(“Plots”) my command line say : syntax error near unexpected token \`“P…

---

## [How to change \`annotate!\` background color?](https://discourse.julialang.org/t/how-to-change-annotate-background-color/40606)

<div class="topic-metadata">

**Author:** [@takuizum](https://discourse.julialang.org/u/takuizum)\
**Replies:** 4\
**Last updated:** [October 11, 2023, 6:53pm UTC](https://discourse.julialang.org/t/how-to-change-annotate-background-color/40606 "2023-10-11T18:53:21Z")

</div>

I’m trying to use Plots and annotate function to plot a numerical value onto the line. plotly() plot(sin) annotate!(0, sin(0), text("0")) It works not bad. Furthermore, I want to put a text on the line with removing a…

---

## [JuliaHub: login gives internal server error](https://discourse.julialang.org/t/juliahub-login-gives-internal-server-error/104858)

<div class="topic-metadata">

**Author:** [@jxxcarlson](https://discourse.julialang.org/u/jxxcarlson)\
**Replies:** 2\
**Last updated:** [October 11, 2023, 5:08pm UTC](https://discourse.julialang.org/t/juliahub-login-gives-internal-server-error/104858 "2023-10-11T17:08:48Z")

</div>

Hello! I have some code I would like to run on JuliaHub. I signed up, but when I try to login with my username and password, I get this:

---

## [PyCall pyimport() fails and exits julia](https://discourse.julialang.org/t/pycall-pyimport-fails-and-exits-julia/104845)

<div class="topic-metadata">

**Author:** [@harsh1kumar](https://discourse.julialang.org/u/harsh1kumar)\
**Replies:** 2\
**Last updated:** [October 11, 2023, 2:45pm UTC](https://discourse.julialang.org/t/pycall-pyimport-fails-and-exits-julia/104845 "2023-10-11T14:45:41Z")

</div>

Hello Good People of Julia, I have recently started to work with Julia. I am trying to use PyCall and import packages like numpy and pandas but I am encountering an failure. Details below: Before using PyCall, I rebui…

---

## [Is it possible for complex matrix multiplication and adjoint speed to catch up with matlab?](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785)

<div class="topic-metadata">

**Author:** [@13299118606](https://discourse.julialang.org/u/13299118606)\
**Replies:** 38\
**Last updated:** [October 11, 2023, 12:56pm UTC](https://discourse.julialang.org/t/is-it-possible-for-complex-matrix-multiplication-and-adjoint-speed-to-catch-up-with-matlab/104785 "2023-10-11T12:56:38Z")

</div>

I need to process a large number of complex matrix multiplications in some programs, but this is very slow, especially after using Distributed parallelism, matrix multiplication will be more than 10 times slower. The spe…

---

## [Best all-purpose text or website for learning Julia?](https://discourse.julialang.org/t/best-all-purpose-text-or-website-for-learning-julia/104619)

<div class="topic-metadata">

**Author:** [@RobertTalbert](https://discourse.julialang.org/u/RobertTalbert)\
**Replies:** 27\
**Last updated:** [October 11, 2023, 12:05pm UTC](https://discourse.julialang.org/t/best-all-purpose-text-or-website-for-learning-julia/104619 "2023-10-11T12:05:41Z")

</div>

Hi, I’m new to the Julia language but I have some very modest background in Python and R. I’ve been learning what I can of Julia from Exercism.org and from taking some old R projects and “translating” them to Julia. Both…

---

## [Read special characters using CSV.read](https://discourse.julialang.org/t/read-special-characters-using-csv-read/104604)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 22\
**Last updated:** [October 11, 2023, 10:40am UTC](https://discourse.julialang.org/t/read-special-characters-using-csv-read/104604 "2023-10-11T10:40:35Z")

</div>

Hi, I’m trying to read a file (here) that contains the following (as it appears in Excel): Reading the data file, reads the special character incorrectly: MP\_names = CSV.read("All MPs 23.07.csv", DataFrame) println(…

---

## [Best way to store arrays with metadata?](https://discourse.julialang.org/t/best-way-to-store-arrays-with-metadata/104776)

<div class="topic-metadata">

**Author:** [@felipeh](https://discourse.julialang.org/u/felipeh)\
**Replies:** 1\
**Last updated:** [October 10, 2023, 12:33am UTC](https://discourse.julialang.org/t/best-way-to-store-arrays-with-metadata/104776 "2023-10-10T00:33:14Z")

</div>

I plan to run a sequence of many (on the order 100) simulations, each of which outputs an array of floating point numbers (on the order of 10k each). I want to store these arrays with metadata about the parameters used …

---

## [JuliaRegistries: can't update my package because of registry dirty](https://discourse.julialang.org/t/juliaregistries-cant-update-my-package-because-of-registry-dirty/89379)

<div class="topic-metadata">

**Author:** [@leo.boisvert](https://discourse.julialang.org/u/leo.boisvert)\
**Replies:** 9\
**Last updated:** [October 9, 2023, 5:34pm UTC](https://discourse.julialang.org/t/juliaregistries-cant-update-my-package-because-of-registry-dirty/89379 "2023-10-09T17:34:59Z")

</div>

Hi! I just joined a research lab and I’m trying to bring a little structure to the project I’m working on: GitHub - corail-research/SeaPearl.jl: Julia hybrid constraint programming solver enhanced by a reinforcement lea…

---

## [LWFBrook90 simulation questions 2 (plotting and csv saving)](https://discourse.julialang.org/t/lwfbrook90-simulation-questions-2-plotting-and-csv-saving/104745)

<div class="topic-metadata">

**Author:** [@JOY-8831](https://discourse.julialang.org/u/JOY-8831)\
**Replies:** 0\
**Last updated:** [October 9, 2023, 8:27am UTC](https://discourse.julialang.org/t/lwfbrook90-simulation-questions-2-plotting-and-csv-saving/104745 "2023-10-09T08:27:06Z")

</div>

Hi I am using LWFBrook90 v1.9 to simulate the hydro-dynamics. I have some questions about the plots. These are the scripts I am using: using LWFBrook90 using OrdinaryDiffEq: solve using DataFrames using CSV using P…

---

## [Is sizeof() giving incorrect results instead of errors for structs with mutable fields?](https://discourse.julialang.org/t/is-sizeof-giving-incorrect-results-instead-of-errors-for-structs-with-mutable-fields/104721)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 3\
**Last updated:** [October 8, 2023, 3:59am UTC](https://discourse.julialang.org/t/is-sizeof-giving-incorrect-results-instead-of-errors-for-structs-with-mutable-fields/104721 "2023-10-08T03:59:58Z")

</div>

Example: struct IMMUT a::Int64 b::Bool end sizeof(IMMUT(0, false)) == 16 # true since this is "with padding", as the documentation describes. struct MUT a::Array end vctr = Int64\[1, 2, 3\] sizeof(vctr) ==…

---

## [Trouble Getting Newton solver to converge for ContinuationPar](https://discourse.julialang.org/t/trouble-getting-newton-solver-to-converge-for-continuationpar/104541)

<div class="topic-metadata">

**Author:** [@wombat1432](https://discourse.julialang.org/u/wombat1432)\
**Replies:** 9\
**Last updated:** [October 7, 2023, 3:18pm UTC](https://discourse.julialang.org/t/trouble-getting-newton-solver-to-converge-for-continuationpar/104541 "2023-10-07T15:18:03Z")

</div>

I’m trying to use Julia to analyze the Luo-Rudy model of a cardiac action potential (similar to what Tran et al did at PMID 19659123). I have the model producing reasonable-looking trajectories and I would like to make …

---

## [How to kill Thread which is running in background in julia](https://discourse.julialang.org/t/how-to-kill-thread-which-is-running-in-background-in-julia/104606)

<div class="topic-metadata">

**Author:** [@Jayesh\_Patil](https://discourse.julialang.org/u/Jayesh_Patil)\
**Replies:** 3\
**Last updated:** [October 6, 2023, 5:50pm UTC](https://discourse.julialang.org/t/how-to-kill-thread-which-is-running-in-background-in-julia/104606 "2023-10-06T17:50:34Z")

</div>

I have one project in that project there is process which executing some calculations . and while execution is running when user request to stop the execution of process then Django send request to julia in julia that pr…

---

## [Any good resource to understand the issues with recursion in Julia?](https://discourse.julialang.org/t/any-good-resource-to-understand-the-issues-with-recursion-in-julia/104615)

<div class="topic-metadata">

**Author:** [@bguillen](https://discourse.julialang.org/u/bguillen)\
**Replies:** 11\
**Last updated:** [October 6, 2023, 11:20am UTC](https://discourse.julialang.org/t/any-good-resource-to-understand-the-issues-with-recursion-in-julia/104615 "2023-10-06T11:20:49Z")

</div>

I’m implementing basically the Median of Medians (actually, Median of Ninthers) algorithm for quick deterministic selection (see \[original post\]). It is recursive, as in the way to find a pivot is by calculating the medi…

---

## [Configurations.jl Option Type with StaticArrays.jl](https://discourse.julialang.org/t/configurations-jl-option-type-with-staticarrays-jl/104640)

<div class="topic-metadata">

**Author:** [@matthew3245](https://discourse.julialang.org/u/matthew3245)\
**Replies:** 6\
**Last updated:** [October 6, 2023, 7:46am UTC](https://discourse.julialang.org/t/configurations-jl-option-type-with-staticarrays-jl/104640 "2023-10-06T07:46:56Z")

</div>

I’m trying to use Configuration.jl to load a TOML config file into an option structure with StaticVectors or Floats. There are two approaches I’ve used so far to try and achieve this, however, they both have terrible per…

---

## [Code uses excessive memory when using \`\`\`.+\`\`\` instead of a loop?](https://discourse.julialang.org/t/code-uses-excessive-memory-when-using-instead-of-a-loop/104624)

<div class="topic-metadata">

**Author:** [@felipeh](https://discourse.julialang.org/u/felipeh)\
**Replies:** 3\
**Last updated:** [October 6, 2023, 3:13am UTC](https://discourse.julialang.org/t/code-uses-excessive-memory-when-using-instead-of-a-loop/104624 "2023-10-06T03:13:59Z")

</div>

In debugging some code I wrote, I noticed that there seems to be a significant difference between x = x .+ 1 and writing the loop out explicitly. In particular, the following code runs in 0.006 seconds and reports only …

---

## [Weird matrix multiplication results from MKL](https://discourse.julialang.org/t/weird-matrix-multiplication-results-from-mkl/104623)

<div class="topic-metadata">

**Author:** [@jacques1](https://discourse.julialang.org/u/jacques1)\
**Replies:** 2\
**Last updated:** [October 5, 2023, 6:32pm UTC](https://discourse.julialang.org/t/weird-matrix-multiplication-results-from-mkl/104623 "2023-10-05T18:32:29Z")

</div>

Hi, I’m trying to use a simple OLS solution to an overdetermined linear system using MKL and LinearAlgebra, with coefficient matrix ‘’’ M = \[200000 0 0 (2e5)^2 0; 0 0 0 0 0; 0 0 0 0 0; 0 0 0 0 0; 0 2e5 0 0 (2e5)^2; 0 0…

---

## [Interpolate across arc length for constant distances between points](https://discourse.julialang.org/t/interpolate-across-arc-length-for-constant-distances-between-points/104520)

<div class="topic-metadata">

**Author:** [@modifiedbear](https://discourse.julialang.org/u/modifiedbear)\
**Replies:** 1\
**Last updated:** [October 5, 2023, 2:47pm UTC](https://discourse.julialang.org/t/interpolate-across-arc-length-for-constant-distances-between-points/104520 "2023-10-05T14:47:07Z")

</div>

Is there a way to divide a discretized curve (or a set of points) into another where the segments are of equal length? For example, in Matlab I can do the following to get an ellipse with equispaced points or discretiza…

---

## [Setting up Makie on Mac](https://discourse.julialang.org/t/setting-up-makie-on-mac/62991)

<div class="topic-metadata">

**Author:** [@Rajith\_Vidanaarachch](https://discourse.julialang.org/u/Rajith_Vidanaarachch)\
**Replies:** 10\
**Last updated:** [October 5, 2023, 12:12pm UTC](https://discourse.julialang.org/t/setting-up-makie-on-mac/62991 "2023-10-05T12:12:14Z")

</div>

I had the same problem as this guy (https://discourse.julialang.org/t/no-backend-available-glmakie-cairomakie-wglmakie/62984) with Makie, so I decided to try just GLMakie to figure out what’s going on. These are my step…

---

## [Julia as first language](https://discourse.julialang.org/t/julia-as-first-language/104383)

<div class="topic-metadata">

**Author:** [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)\
**Replies:** 117\
**Last updated:** [October 4, 2023, 8:53pm UTC](https://discourse.julialang.org/t/julia-as-first-language/104383 "2023-10-04T20:53:55Z")

</div>

Is Julia a language, that can be described to be suitable as a first programming language? I think it has the potential to be that. Tim Holy thinks so as well. As somebody, who is highly interested into programming for…

---

## [Solving steady state in julia](https://discourse.julialang.org/t/solving-steady-state-in-julia/104559)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 2\
**Last updated:** [October 4, 2023, 8:43am UTC](https://discourse.julialang.org/t/solving-steady-state-in-julia/104559 "2023-10-04T08:43:47Z")

</div>

I was looking for some solvers for my example model to find steady state values for states. I found SSRootfind() and DynamicSS(). Upon reading I felt. It is much better to use DynamicSS as for SSRootfind() your initial v…

---

## [Possible troubles when mul!(Y, A , transpose(B) )?](https://discourse.julialang.org/t/possible-troubles-when-mul-y-a-transpose-b/104548)

<div class="topic-metadata">

**Author:** [@ddcampayo](https://discourse.julialang.org/u/ddcampayo)\
**Replies:** 9\
**Last updated:** [October 4, 2023, 7:01am UTC](https://discourse.julialang.org/t/possible-troubles-when-mul-y-a-transpose-b/104548 "2023-10-04T07:01:32Z")

</div>

Hi, everyone. I’m new to this language, I’ve been loving it so far, despite having encountered some setbacks. One of them could be a memory leak when multiplying a matrix with its transpose. I use the mul!(Y,A,B) functi…

---

## [General Registry: Create tag for macro usage](https://discourse.julialang.org/t/general-registry-create-tag-for-macro-usage/104528)

<div class="topic-metadata">

**Author:** [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)\
**Replies:** 6\
**Last updated:** [October 3, 2023, 1:24pm UTC](https://discourse.julialang.org/t/general-registry-create-tag-for-macro-usage/104528 "2023-10-03T13:24:42Z")

</div>

In a recent discussion about newbie friendliness, the topic about macros came up. Someone suggested, that it may be beneficial to prevent auto merges to the general registry, for code that uses them. I think that’s a bi…

---

## [Get unique Request ID for each request hit to the Same API of julia in Genie Framework](https://discourse.julialang.org/t/get-unique-request-id-for-each-request-hit-to-the-same-api-of-julia-in-genie-framework/104530)

<div class="topic-metadata">

**Author:** [@Jayesh\_Patil](https://discourse.julialang.org/u/Jayesh_Patil)\
**Replies:** 0\
**Last updated:** [October 3, 2023, 9:15am UTC](https://discourse.julialang.org/t/get-unique-request-id-for-each-request-hit-to-the-same-api-of-julia-in-genie-framework/104530 "2023-10-03T09:15:18Z")

</div>

I have an API in which some calculations are happening on input data and its time consuming process. So, if multiple clients hit the same API at a time and while processing if any client want to stop the execution of th…

---

## [Add named colors and use them in PlotlyJS](https://discourse.julialang.org/t/add-named-colors-and-use-them-in-plotlyjs/104522)

<div class="topic-metadata">

**Author:** [@mjmat](https://discourse.julialang.org/u/mjmat)\
**Replies:** 0\
**Last updated:** [October 3, 2023, 3:47am UTC](https://discourse.julialang.org/t/add-named-colors-and-use-them-in-plotlyjs/104522 "2023-10-03T03:47:59Z")

</div>

Hello, First, I am not sure how to properly add named colors to Colors.jl - I think that might be the main problem. I managed to (apparently) add a named color by running: using Colors Colors.color\_names = merge!(Colo…

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

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