# New to Julia

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

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

**Page:** 36

---

## [Why Does @btime Show Near-Zero Execution Time Despite Non-Trivial @code\_native and @code\_llvm Output in Julia?](https://discourse.julialang.org/t/why-does-btime-show-near-zero-execution-time-despite-non-trivial-code-native-and-code-llvm-output-in-julia/118838)

<div class="topic-metadata">

**Author:** [@alex11](https://discourse.julialang.org/u/alex11)\
**Replies:** 5\
**Last updated:** [September 1, 2024, 12:33pm UTC](https://discourse.julialang.org/t/why-does-btime-show-near-zero-execution-time-despite-non-trivial-code-native-and-code-llvm-output-in-julia/118838 "2024-09-01T12:33:25Z")

</div>

I’m starting Chris Rackauckas’ course on parallel computation in Julia. In the first section in order to show the relationship between types and speed he defines two classes MyComplex (a struct of two Float64s) and MySl…

---

## [Unable to define LaTeX macros in Mathjax3 using Documenter.jl](https://discourse.julialang.org/t/unable-to-define-latex-macros-in-mathjax3-using-documenter-jl/118813)

<div class="topic-metadata">

**Author:** [@msw](https://discourse.julialang.org/u/msw)\
**Replies:** 3\
**Last updated:** [September 1, 2024, 5:42am UTC](https://discourse.julialang.org/t/unable-to-define-latex-macros-in-mathjax3-using-documenter-jl/118813 "2024-09-01T05:42:23Z")

</div>

I am trying to set up Documenter.jl with MathJax and I want to define some macros. I am doing as in the manual. However, it does not seem to work properly, as I get Undefined control sequence \\R. Below is an example cop…

---

## [Runtime dispatch in struct that contains struct](https://discourse.julialang.org/t/runtime-dispatch-in-struct-that-contains-struct/118840)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 5\
**Last updated:** [August 31, 2024, 2:33pm UTC](https://discourse.julialang.org/t/runtime-dispatch-in-struct-that-contains-struct/118840 "2024-08-31T14:33:34Z")

</div>

Hi, in my code, I have a structure similar to the below. The function that I call in running should be determined by FooContainer.foo, so it is clear to me that I have runtime dispatch here. What is the idiomatic way to …

---

## [Getting issue with genie for function](https://discourse.julialang.org/t/getting-issue-with-genie-for-function/118834)

<div class="topic-metadata">

**Author:** [@Shiva\_raj](https://discourse.julialang.org/u/Shiva_raj)\
**Replies:** 2\
**Last updated:** [August 31, 2024, 9:35am UTC](https://discourse.julialang.org/t/getting-issue-with-genie-for-function/118834 "2024-08-31T09:35:06Z")

</div>

HI team I am facing issue with Genie while running below code for julie. module App using Genie.Router using Genie export vertical\_addition function vertical\_addition(numbers::Vector{Union{Int, Float64}}) # Conver…

---

## [Installation fails (on Ubuntu 22) when using instruction (via curl): \`curl: (23) Failure writing output to destination\`](https://discourse.julialang.org/t/installation-fails-on-ubuntu-22-when-using-instruction-via-curl-curl-23-failure-writing-output-to-destination/110977)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 22\
**Last updated:** [August 30, 2024, 1:04pm UTC](https://discourse.julialang.org/t/installation-fails-on-ubuntu-22-when-using-instruction-via-curl-curl-23-failure-writing-output-to-destination/110977 "2024-08-30T13:04:58Z")

</div>

I have a new ubuntu 22 computer, and try to install Julia via: $ curl -fsSL https://install.julialang.org | sh info: downloading installer curl: (23) Failure writing output to destination juliaup: command failed: downl…

---

## [How to add an inset to a plot](https://discourse.julialang.org/t/how-to-add-an-inset-to-a-plot/37189)

<div class="topic-metadata">

**Author:** [@jipphysics](https://discourse.julialang.org/u/jipphysics)\
**Replies:** 14\
**Last updated:** [August 29, 2024, 2:40pm UTC](https://discourse.julialang.org/t/how-to-add-an-inset-to-a-plot/37189 "2024-08-29T14:40:16Z")

</div>

I am trying to understand how to plot a figure with an inset in Julia using the Plots package. I have tried the examples in the documentation without too much success (see https://docs.juliaplots.org/latest/layouts/). I …

---

## [How to print the unprintable? (how to inspect variables where println fails)](https://discourse.julialang.org/t/how-to-print-the-unprintable-how-to-inspect-variables-where-println-fails/118600)

<div class="topic-metadata">

**Author:** [@orebas](https://discourse.julialang.org/u/orebas)\
**Replies:** 2\
**Last updated:** [August 29, 2024, 6:50am UTC](https://discourse.julialang.org/t/how-to-print-the-unprintable-how-to-inspect-variables-where-println-fails/118600 "2024-08-29T06:50:37Z")

</div>

I am trying to debug some code which is giving a cryptic error. (This is the same MWE from this question. I have made some small changes to the symbolics package, i.e. trying to print out the relevant variables. This …

---

## [Help with dataframes please](https://discourse.julialang.org/t/help-with-dataframes-please/118502)

<div class="topic-metadata">

**Author:** [@DTL](https://discourse.julialang.org/u/DTL)\
**Replies:** 5\
**Last updated:** [August 29, 2024, 5:03am UTC](https://discourse.julialang.org/t/help-with-dataframes-please/118502 "2024-08-29T05:03:13Z")

</div>

Hi, I’ve got a large CSV file I’m trying to analyse in Julia. I can load it into a data frame easily and I’ve got the column types identified correctly. Format is basically Location datetime value area1, 2024-07-20 2…

---

## [What imported TOML files create in Julia](https://discourse.julialang.org/t/what-imported-toml-files-create-in-julia/118733)

<div class="topic-metadata">

**Author:** [@coloradoriverboy](https://discourse.julialang.org/u/coloradoriverboy)\
**Replies:** 4\
**Last updated:** [August 28, 2024, 8:36pm UTC](https://discourse.julialang.org/t/what-imported-toml-files-create-in-julia/118733 "2024-08-28T20:36:43Z")

</div>

I was given the slide below in a presentation to show how Julia creates dictionaries from TOML sections but I think it is incorrect unless I am not understanding , I would think the \[SLS\] section had two key value pairs…

---

## [Selecting entries of an array based on selection criteria provided by other array](https://discourse.julialang.org/t/selecting-entries-of-an-array-based-on-selection-criteria-provided-by-other-array/118632)

<div class="topic-metadata">

**Author:** [@oscarvdvelde](https://discourse.julialang.org/u/oscarvdvelde)\
**Replies:** 10\
**Last updated:** [August 28, 2024, 8:35pm UTC](https://discourse.julialang.org/t/selecting-entries-of-an-array-based-on-selection-criteria-provided-by-other-array/118632 "2024-08-28T20:35:36Z")

</div>

Consider this example, which may run in a loop where selection is updated. a = \[1.0,1.2,0.9, 3.4, 4.5,4.5, 9.7, -1.5,-2.1\] b = \[1,1,1,2,3,3,4,5,5\] # e.g. a grouping of a selection = \[1,3,5\] # these groups # What I…

---

## [Plots.jl failing to precompile on Windows11](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694)

<div class="topic-metadata">

**Author:** [@GregVernon](https://discourse.julialang.org/u/GregVernon)\
**Replies:** 11\
**Last updated:** [August 28, 2024, 3:06pm UTC](https://discourse.julialang.org/t/plots-jl-failing-to-precompile-on-windows11/118694 "2024-08-28T15:06:45Z")

</div>

I’ve seen a few other posts related to build issues with Plots.jl (and FFMPEG.jl), but it’s not clear to me what is / if there is a solution – and the final comment in the last of those examples recommends the previous p…

---

## [Handling memory](https://discourse.julialang.org/t/handling-memory/118692)

<div class="topic-metadata">

**Author:** [@pnkgharde](https://discourse.julialang.org/u/pnkgharde)\
**Replies:** 2\
**Last updated:** [August 28, 2024, 12:26pm UTC](https://discourse.julialang.org/t/handling-memory/118692 "2024-08-28T12:26:00Z")

</div>

There is any function or option just like c/c++ pointer in julia ?

---

## [Unexpected problem with previously working code - multiple dispatch seems to be failing](https://discourse.julialang.org/t/unexpected-problem-with-previously-working-code-multiple-dispatch-seems-to-be-failing/118622)

<div class="topic-metadata">

**Author:** [@benoitseron](https://discourse.julialang.org/u/benoitseron)\
**Replies:** 5\
**Last updated:** [August 27, 2024, 5:43pm UTC](https://discourse.julialang.org/t/unexpected-problem-with-previously-working-code-multiple-dispatch-seems-to-be-failing/118622 "2024-08-27T17:43:48Z")

</div>

I came back from vacations and started to work on my code again. Some code that was working previously doesn’t seem to work anymore, while I don’t think I made any modifications to the code (updated my machine, but nothi…

---

## [Comparing Symbolics.jl with Mathematica](https://discourse.julialang.org/t/comparing-symbolics-jl-with-mathematica/118656)

<div class="topic-metadata">

**Author:** [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Replies:** 2\
**Last updated:** [August 27, 2024, 2:17pm UTC](https://discourse.julialang.org/t/comparing-symbolics-jl-with-mathematica/118656 "2024-08-27T14:17:46Z")

</div>

Here I compare performing some simple CAS calculations on Mathematica and on Julia using Symbolics On Mathematica On Julia using Pkg Pkg.activate("/Users/ssiew/juliascript/Symbolics") # Pkg.add("Symbolics") # Pkg.ad…

---

## [GLMakie legend 2 columns](https://discourse.julialang.org/t/glmakie-legend-2-columns/118657)

<div class="topic-metadata">

**Author:** [@NaSi](https://discourse.julialang.org/u/NaSi)\
**Replies:** 1\
**Last updated:** [August 27, 2024, 9:09am UTC](https://discourse.julialang.org/t/glmakie-legend-2-columns/118657 "2024-08-27T09:09:50Z")

</div>

Hi there ! I am using GLMakie to plot some data and I would like to plot a legend with 2 colums. How can I do this ? Thanks :slight\_smile: f = Figure(fontsize=26, fonts = (; regular = "Times New Roman")) ax1 = …

---

## [Subscript in label](https://discourse.julialang.org/t/subscript-in-label/118620)

<div class="topic-metadata">

**Author:** [@NaSi](https://discourse.julialang.org/u/NaSi)\
**Replies:** 3\
**Last updated:** [August 26, 2024, 11:56pm UTC](https://discourse.julialang.org/t/subscript-in-label/118620 "2024-08-26T23:56:31Z")

</div>

Hello! I have a very simple question but unfortunatly, I don’t find any solution only. I am plotting using GLMakie and I want to write the labels of my plot : ax2 = GLMakie.Axis(f\[2,1\], xlabel = "Time since start of CO…

---

## [Pinv and autodiff error](https://discourse.julialang.org/t/pinv-and-autodiff-error/118636)

<div class="topic-metadata">

**Author:** [@JADekker](https://discourse.julialang.org/u/JADekker)\
**Replies:** 2\
**Last updated:** [August 26, 2024, 6:27pm UTC](https://discourse.julialang.org/t/pinv-and-autodiff-error/118636 "2024-08-26T18:27:12Z")

</div>

Hi, I’m getting the following error in the following MWE: (I’m aware that I could implement Moore-Penrose by hand to circumvent the issue; I’d rather not do this, as I’m trying to understand why exactly I get this error…

---

## [Creating API for mobile and web apps](https://discourse.julialang.org/t/creating-api-for-mobile-and-web-apps/118550)

<div class="topic-metadata">

**Author:** [@Shiva\_raj](https://discourse.julialang.org/u/Shiva_raj)\
**Replies:** 7\
**Last updated:** [August 26, 2024, 12:38pm UTC](https://discourse.julialang.org/t/creating-api-for-mobile-and-web-apps/118550 "2024-08-26T12:38:53Z")

</div>

Hi Team, I am building a mathematics logic for a school for geometry and basic maths. I want to create a mobile app in reactive native and back end in julia with API exposed. need support and suggestion on how to achie…

---

## [How to best assign values to multiple locations in a Vector of Vectors?](https://discourse.julialang.org/t/how-to-best-assign-values-to-multiple-locations-in-a-vector-of-vectors/118607)

<div class="topic-metadata">

**Author:** [@oscarvdvelde](https://discourse.julialang.org/u/oscarvdvelde)\
**Replies:** 2\
**Last updated:** [August 26, 2024, 4:23am UTC](https://discourse.julialang.org/t/how-to-best-assign-values-to-multiple-locations-in-a-vector-of-vectors/118607 "2024-08-26T04:23:34Z")

</div>

I am looking for an equivalent to myvector\[locations\] .= myvalue for a vector of vectors. It seems that I can assign to one location at a time. Is there a way? myvecvec = \[Int64\[\] for i in 1:10\] myvecvec\[2\] = \[1,2\] # …

---

## [Dct error when using Images](https://discourse.julialang.org/t/dct-error-when-using-images/111775)

<div class="topic-metadata">

**Author:** [@AbdelazimHussien](https://discourse.julialang.org/u/AbdelazimHussien)\
**Replies:** 8\
**Last updated:** [August 26, 2024, 2:54am UTC](https://discourse.julialang.org/t/dct-error-when-using-images/111775 "2024-08-26T02:54:27Z")

</div>

Hello everyone, I have the following code using TestImages, ImageView img = testimage("cameraman") pixels = img\[1:8,1:8\] pixels = convert(Array{Float32}, pixels) freqs = dct(pixels) round(freqs) pixels2 = idct(freqs) b…

---

## [What is a Symbol in Julia](https://discourse.julialang.org/t/what-is-a-symbol-in-julia/117636)

<div class="topic-metadata">

**Author:** [@Farouk](https://discourse.julialang.org/u/Farouk)\
**Replies:** 3\
**Last updated:** [August 25, 2024, 3:05pm UTC](https://discourse.julialang.org/t/what-is-a-symbol-in-julia/117636 "2024-08-25T15:05:35Z")

</div>

Hello, I am new to Julia (with no CS background) I have experience in python programming and a bit of other languages like:C, JAVA, R. I really do not understand what a symbol is :upside\_down\_face:, I know it is used in …

---

## [Genie web framework issue for simple calculator app](https://discourse.julialang.org/t/genie-web-framework-issue-for-simple-calculator-app/118566)

<div class="topic-metadata">

**Author:** [@Shiva\_raj](https://discourse.julialang.org/u/Shiva_raj)\
**Replies:** 1\
**Last updated:** [August 25, 2024, 7:28am UTC](https://discourse.julialang.org/t/genie-web-framework-issue-for-simple-calculator-app/118566 "2024-08-25T07:28:26Z")

</div>

HI Team, I am trying to create a calculator app in julia with Genie web framwork for API , but I am getting below error using Genie, Genie.Router, Genie.Renderer.Json # Load the separate modules include("src/addition.…

---

## [Read DataFrame from Excel file skipping one line with units and "cleaning-up" column names](https://discourse.julialang.org/t/read-dataframe-from-excel-file-skipping-one-line-with-units-and-cleaning-up-column-names/114528)

<div class="topic-metadata">

**Author:** [@mjmat](https://discourse.julialang.org/u/mjmat)\
**Replies:** 11\
**Last updated:** [August 24, 2024, 6:14pm UTC](https://discourse.julialang.org/t/read-dataframe-from-excel-file-skipping-one-line-with-units-and-cleaning-up-column-names/114528 "2024-08-24T18:14:23Z")

</div>

I suspect this has been asked before, but I can’t seem to find an answer to this (apparently) simple problem. Let’s assume I have an Excel file with m columns, and the following rows: 1st row: variable names 2nd row: …

---

## [What is the Julia equivalent of R's na.omit()?](https://discourse.julialang.org/t/what-is-the-julia-equivalent-of-rs-na-omit/118546)

<div class="topic-metadata">

**Author:** [@Susan.Thomas](https://discourse.julialang.org/u/Susan.Thomas)\
**Replies:** 2\
**Last updated:** [August 24, 2024, 2:47am UTC](https://discourse.julialang.org/t/what-is-the-julia-equivalent-of-rs-na-omit/118546 "2024-08-24T02:47:45Z")

</div>

An a’b operation to get the dot product of two vectors returns missing' if either (or both) vector has missing’ elements. There doesn’t seem to be a simple way to join a and b, do the equivalent of an na.omit() on the st…

---

## [Subset differences between || and | operators](https://discourse.julialang.org/t/subset-differences-between-and-operators/118510)

<div class="topic-metadata">

**Author:** [@Adrian\_G](https://discourse.julialang.org/u/Adrian_G)\
**Replies:** 2\
**Last updated:** [August 23, 2024, 1:20am UTC](https://discourse.julialang.org/t/subset-differences-between-and-operators/118510 "2024-08-23T01:20:14Z")

</div>

Hi, I’m new to Julia. I have some questions regarding the subset function of DataFrames. I would appreciate if you could help me to solve them. df = DataFrame(x=\[2,0,8,9\], y=\[0,0,0,8\], z=\["A", "B", "C", "D"\], w=\["A","A"…

---

## [VSCode: Executing inline is periodically very slow](https://discourse.julialang.org/t/vscode-executing-inline-is-periodically-very-slow/118413)

<div class="topic-metadata">

**Author:** [@HannesBraun](https://discourse.julialang.org/u/HannesBraun)\
**Replies:** 6\
**Last updated:** [August 22, 2024, 6:26pm UTC](https://discourse.julialang.org/t/vscode-executing-inline-is-periodically-very-slow/118413 "2024-08-22T18:26:12Z")

</div>

Hello everyone, I am using Julia for some time now and I use it on VSCode on files and data which is located in a Nextcloud Folder (it is local on my machine as far as I understand it) on Windows, Mac and Linux. Most o…

---

## [Warmup, samples and discard\_adapt](https://discourse.julialang.org/t/warmup-samples-and-discard-adapt/118412)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 0\
**Last updated:** [August 20, 2024, 10:42am UTC](https://discourse.julialang.org/t/warmup-samples-and-discard-adapt/118412 "2024-08-20T10:42:55Z")

</div>

Hello everyone, I want to know simple explanation of difference between warm up and samples and what happens when we do discard\_adapt = false. Below you can see plots for two different conditions with and without disca…

---

## [Change in behavior when loading a module twice](https://discourse.julialang.org/t/change-in-behavior-when-loading-a-module-twice/118370)

<div class="topic-metadata">

**Author:** [@Magnus\_Lilledahl](https://discourse.julialang.org/u/Magnus_Lilledahl)\
**Replies:** 4\
**Last updated:** [August 20, 2024, 9:52am UTC](https://discourse.julialang.org/t/change-in-behavior-when-loading-a-module-twice/118370 "2024-08-20T09:52:51Z")

</div>

I have a module Mod1 stored in a file Mod1.jl and a module Mod2 stored in a file Mod2.jl. ‘Mod1’ exports a function userfun that uses a function foo which is defined in Mod2. Mod2 also defines some new types. module Mod…

---

## [The impact of different ways of passing parameters on the speed of function computation](https://discourse.julialang.org/t/the-impact-of-different-ways-of-passing-parameters-on-the-speed-of-function-computation/118340)

<div class="topic-metadata">

**Author:** [@JianchengSuo](https://discourse.julialang.org/u/JianchengSuo)\
**Replies:** 12\
**Last updated:** [August 20, 2024, 8:32am UTC](https://discourse.julialang.org/t/the-impact-of-different-ways-of-passing-parameters-on-the-speed-of-function-computation/118340 "2024-08-20T08:32:22Z")

</div>

I have a doubt and I will use a simple polynomial function as an example to describe it. Defining a regular polynomial function, the speed of direct value calculation is very fast (0.8ns): f1(x,y)=x^3\*y^3+2\*x^2\*y+3\*x\*y…

---

## [Performance of loops](https://discourse.julialang.org/t/performance-of-loops/118273)

<div class="topic-metadata">

**Author:** [@Matthijs\_1971](https://discourse.julialang.org/u/Matthijs_1971)\
**Replies:** 30\
**Last updated:** [August 19, 2024, 8:20pm UTC](https://discourse.julialang.org/t/performance-of-loops/118273 "2024-08-19T20:20:45Z")

</div>

Julia has several ways to define loops or repeat code, each with advantages and disadvantages. I am looking at the performance of some also inspired by previous posts on this forum. #!/usr/bin/env julia # https://disco…

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

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