# New to Julia

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

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

**Page:** 71

---

## [Make my own alias infix operator](https://discourse.julialang.org/t/make-my-own-alias-infix-operator/103631)

<div class="topic-metadata">

**Author:** [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)\
**Replies:** 23\
**Last updated:** [September 9, 2023, 4:57am UTC](https://discourse.julialang.org/t/make-my-own-alias-infix-operator/103631 "2023-09-09T04:57:22Z")

</div>

Hi there :slight\_smile: I see that custom infix operators are a long-standing object to discussion, and I like to ask if there is a way today, how I can alias ∘ to \>\> As an explanation, my VSCode wont tab complete the …

---

## [Calling C function with pointer of C strings works once but not twice](https://discourse.julialang.org/t/calling-c-function-with-pointer-of-c-strings-works-once-but-not-twice/103632)

<div class="topic-metadata">

**Author:** [@dforero0896](https://discourse.julialang.org/u/dforero0896)\
**Replies:** 11\
**Last updated:** [September 8, 2023, 8:06pm UTC](https://discourse.julialang.org/t/calling-c-function-with-pointer-of-c-strings-works-once-but-not-twice/103632 "2023-09-08T20:06:14Z")

</div>

Hi, I’ve written a wrapper to a C library (GitHub - dforero0896/libpowspec: Library based on Cheng Zhao's powspec code) in here GitHub - dforero0896/Powspec.jl: Julia bindings to Cheng Zhao's powspec C code. . While my i…

---

## [Use exception: MethodError: Cannot \`convert\` an object of type Vector{String} to an object of type String](https://discourse.julialang.org/t/use-exception-methoderror-cannot-convert-an-object-of-type-vector-string-to-an-object-of-type-string/103669)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 1\
**Last updated:** [September 8, 2023, 2:16pm UTC](https://discourse.julialang.org/t/use-exception-methoderror-cannot-convert-an-object-of-type-vector-string-to-an-object-of-type-string/103669 "2023-09-08T14:16:51Z")

</div>

I try to use the DimensionMismatch excpetion https://docs.julialang.org/en/v1/base/base/#Base.DimensionMismatch throw(DimensionMismatch(\["\\n some message \\n"\])) gives MethodError: Cannot convert an object of type Vec…

---

## [Best practice: develop and adjust own package / precompilation](https://discourse.julialang.org/t/best-practice-develop-and-adjust-own-package-precompilation/103656)

<div class="topic-metadata">

**Author:** [@Lukas\_Hebing](https://discourse.julialang.org/u/Lukas_Hebing)\
**Replies:** 7\
**Last updated:** [September 8, 2023, 1:19pm UTC](https://discourse.julialang.org/t/best-practice-develop-and-adjust-own-package-precompilation/103656 "2023-09-08T13:19:03Z")

</div>

A am currently using Julia for a project, which I splitted into two different packages. Each of these package has it\`s own Manifest/Project files. There is an “application” section, in which I use the functions from the…

---

## [How to extract first arguments from dictionaries in Julia?](https://discourse.julialang.org/t/how-to-extract-first-arguments-from-dictionaries-in-julia/103653)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 3\
**Last updated:** [September 8, 2023, 1:09pm UTC](https://discourse.julialang.org/t/how-to-extract-first-arguments-from-dictionaries-in-julia/103653 "2023-09-08T13:09:07Z")

</div>

Hello, this is a basic question but I am not familiar with dictionaries, preferring arrays. I have set a dictionary as julia\> D = Dict("Field\_1"=\>\[1,2,3,4,5\], "Field\_2"=\>\["a", "b", "c", "d", "e"\]) Dict{Stri…

---

## [Mutating function plot in Makie, and plotting 2 data sets on the same figure](https://discourse.julialang.org/t/mutating-function-plot-in-makie-and-plotting-2-data-sets-on-the-same-figure/103655)

<div class="topic-metadata">

**Author:** [@Axze-rgb](https://discourse.julialang.org/u/Axze-rgb)\
**Replies:** 6\
**Last updated:** [September 8, 2023, 11:46am UTC](https://discourse.julialang.org/t/mutating-function-plot-in-makie-and-plotting-2-data-sets-on-the-same-figure/103655 "2023-09-08T11:46:05Z")

</div>

Hello, I am trying to plot 2 histograms in the same figure using Makie, f, ax1, h1 = hist(df1\[:, “AF”\]) h2 = hist!(ax1, df2\[:, “AF”\]) f but TypeError: non-boolean (Missing) used in boolean context However, thi…

---

## [Reading a csv file on a Google drive without mapping](https://discourse.julialang.org/t/reading-a-csv-file-on-a-google-drive-without-mapping/103423)

<div class="topic-metadata">

**Author:** [@dgagnon](https://discourse.julialang.org/u/dgagnon)\
**Replies:** 22\
**Last updated:** [September 8, 2023, 4:02am UTC](https://discourse.julialang.org/t/reading-a-csv-file-on-a-google-drive-without-mapping/103423 "2023-09-08T04:02:31Z")

</div>

Hello I am trying to read a file on Google drive without mapping it to a drive on Windows. The reasons I don’t want to map the drive are: 1- users may map to a different letter (I’m on Windows) and I don’t want to deal…

---

## [MLStyle's vs MacroTools' @capture](https://discourse.julialang.org/t/mlstyles-vs-macrotools-capture/102968)

<div class="topic-metadata">

**Author:** [@deaminase](https://discourse.julialang.org/u/deaminase)\
**Replies:** 4\
**Last updated:** [September 8, 2023, 12:09am UTC](https://discourse.julialang.org/t/mlstyles-vs-macrotools-capture/102968 "2023-09-08T00:09:07Z")

</div>

Hey folks. I’ve been trying to figure out how to use MLStyle.Modules.AST.@capture for doing the same thing as MacroTools.@capture(ex, fn\_(args\_\_; kws\_\_) | fn\_(args\_\_)) However, I can’t seem to come up with the syntax th…

---

## [Vector of functions as kwarg](https://discourse.julialang.org/t/vector-of-functions-as-kwarg/103629)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 5\
**Last updated:** [September 7, 2023, 9:39pm UTC](https://discourse.julialang.org/t/vector-of-functions-as-kwarg/103629 "2023-09-07T21:39:38Z")

</div>

Good evening, what is wrong with the following? function foo(; b::Vector{Function} = \[(x)-\>x\*x\]) print(b\[1\](2)) end foo() ERROR: MethodError: no method matching var"#foo#7"(::Vector{var"#8#10"}, ::typeof(foo))

---

## [Getting parameters of, and aliases for, any arbitrary type](https://discourse.julialang.org/t/getting-parameters-of-and-aliases-for-any-arbitrary-type/103616)

<div class="topic-metadata">

**Author:** [@chskcau](https://discourse.julialang.org/u/chskcau)\
**Replies:** 5\
**Last updated:** [September 7, 2023, 8:40pm UTC](https://discourse.julialang.org/t/getting-parameters-of-and-aliases-for-any-arbitrary-type/103616 "2023-09-07T20:40:28Z")

</div>

Hello, and as always, thanks in advance for taking the time to read this post and help me out. I’m back to toying around with (and hopefully learning) Julia. In order to get a better feel for the type system and the po…

---

## [Does Revise work with plain modules?](https://discourse.julialang.org/t/does-revise-work-with-plain-modules/103584)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 6\
**Last updated:** [September 7, 2023, 6:22pm UTC](https://discourse.julialang.org/t/does-revise-work-with-plain-modules/103584 "2023-09-07T18:22:22Z")

</div>

When making a change to a module, I thought I simply needed to save the file and then re-run the importing script (which loads Revise at the very top). But the changes are only ever respected if I not only save the modul…

---

## [Internal Error: UndefVarError: \`includet\` not defined](https://discourse.julialang.org/t/internal-error-undefvarerror-includet-not-defined/103601)

<div class="topic-metadata">

**Author:** [@ZhanHuijia](https://discourse.julialang.org/u/ZhanHuijia)\
**Replies:** 2\
**Last updated:** [September 7, 2023, 12:32pm UTC](https://discourse.julialang.org/t/internal-error-undefvarerror-includet-not-defined/103601 "2023-09-07T12:32:34Z")

</div>

Internal Error: UndefVarError: includet not defined

---

## [LLVM Bitcode for Graal](https://discourse.julialang.org/t/llvm-bitcode-for-graal/103581)

<div class="topic-metadata">

**Author:** [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)\
**Replies:** 1\
**Last updated:** [September 6, 2023, 10:14pm UTC](https://discourse.julialang.org/t/llvm-bitcode-for-graal/103581 "2023-09-06T22:14:40Z")

</div>

Hi there. I know, there is already an old thread open, that explains how to evaluate a single function as llvm bitcode. I would like to translate a whole program to it - in order to run it on Graal.

---

## [Startup.jl not loading](https://discourse.julialang.org/t/startup-jl-not-loading/29798)

<div class="topic-metadata">

**Author:** [@mpf01](https://discourse.julialang.org/u/mpf01)\
**Replies:** 2\
**Last updated:** [September 6, 2023, 8:56pm UTC](https://discourse.julialang.org/t/startup-jl-not-loading/29798 "2023-09-06T20:56:48Z")

</div>

Running julia from the terminal (Mac), doesn’t seem to read startup.jl. Below I confirm that the startup file exists in the correct place, I think. Can someone spot what I’m doing wrong? Thanks! \[~\]$ cat .julia/config/…

---

## [How to modularize my code like a pro](https://discourse.julialang.org/t/how-to-modularize-my-code-like-a-pro/103174)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 7\
**Last updated:** [September 6, 2023, 6:38pm UTC](https://discourse.julialang.org/t/how-to-modularize-my-code-like-a-pro/103174 "2023-09-06T18:38:07Z")

</div>

Hi guys, I work with numerical sampling methods that evolve some vectorial parameter \\boldsymbol{x} and associated momentum \\boldsymbol{p} via a force function \\boldsymbol{F}(\\boldsymbol{x}) that comes from an underlyin…

---

## [Same code but different values of simulation from two computers](https://discourse.julialang.org/t/same-code-but-different-values-of-simulation-from-two-computers/103562)

<div class="topic-metadata">

**Author:** [@Zerosum](https://discourse.julialang.org/u/Zerosum)\
**Replies:** 3\
**Last updated:** [September 6, 2023, 2:27pm UTC](https://discourse.julialang.org/t/same-code-but-different-values-of-simulation-from-two-computers/103562 "2023-09-06T14:27:59Z")

</div>

I have a laptop and a desktop. Both are Mac with M1 chip. I wrote down my codes in my desktop and transferred to my laptop. However, if I run my codes, I get different results. I run several times in both computers …

---

## [New user of Images.jl ... trouble saving grayscale PNG](https://discourse.julialang.org/t/new-user-of-images-jl-trouble-saving-grayscale-png/103553)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 4\
**Last updated:** [September 6, 2023, 1:28pm UTC](https://discourse.julialang.org/t/new-user-of-images-jl-trouble-saving-grayscale-png/103553 "2023-09-06T13:28:06Z")

</div>

I am getting a copy of the red channel of an image from the graphics card as a Float32. What I get back has a range of 0 to 1.865 (granted, I may have done something wrong, I would have figured it was supposed to be from…

---

## [XOR when indexing arrays](https://discourse.julialang.org/t/xor-when-indexing-arrays/103557)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 7\
**Last updated:** [September 6, 2023, 12:57pm UTC](https://discourse.julialang.org/t/xor-when-indexing-arrays/103557 "2023-09-06T12:57:49Z")

</div>

In a tutorial about computer hardware (https://viralinstruction.com/posts/hardware/), I came across the following Julia code: function foo(x) s = zero(eltype(x)) @inbounds for i in eachindex(x) s = x\[i ⊻…

---

## [How to obtain gradients from training a model](https://discourse.julialang.org/t/how-to-obtain-gradients-from-training-a-model/103558)

<div class="topic-metadata">

**Author:** [@cirobr](https://discourse.julialang.org/u/cirobr)\
**Replies:** 1\
**Last updated:** [September 6, 2023, 1:03am UTC](https://discourse.julialang.org/t/how-to-obtain-gradients-from-training-a-model/103558 "2023-09-06T01:03:27Z")

</div>

Cheers. When training a model, I want to investigate on the occurrence of exploding gradients. For this reason, I am using the following code to obtain the gradient values when training one epoch: losses = Float32\[\] al…

---

## [Storage of functions with pre-defined argument values](https://discourse.julialang.org/t/storage-of-functions-with-pre-defined-argument-values/103502)

<div class="topic-metadata">

**Author:** [@Charly\_Theo](https://discourse.julialang.org/u/Charly_Theo)\
**Replies:** 4\
**Last updated:** [September 5, 2023, 6:57am UTC](https://discourse.julialang.org/t/storage-of-functions-with-pre-defined-argument-values/103502 "2023-09-05T06:57:30Z")

</div>

Hi all, I am trying to store a vector of functions, which can later be retrieved and applied to one or more vectors. An example: using ShiftedArrays fs = Function\[ShiftedArrays.lag, diff\] x = rand(10) for f in fs …

---

## [Does return type declaration make function type stable?](https://discourse.julialang.org/t/does-return-type-declaration-make-function-type-stable/103473)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 7\
**Last updated:** [September 4, 2023, 10:50am UTC](https://discourse.julialang.org/t/does-return-type-declaration-make-function-type-stable/103473 "2023-09-04T10:50:54Z")

</div>

Docs read: Return type declarations are rarely used in Julia: in general, you should instead write “type-stable” functions in which Julia’s compiler can automatically infer the return type. For more information, see th…

---

## [Tools and packages to automate type stability checks?](https://discourse.julialang.org/t/tools-and-packages-to-automate-type-stability-checks/103480)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 2\
**Last updated:** [September 3, 2023, 10:05pm UTC](https://discourse.julialang.org/t/tools-and-packages-to-automate-type-stability-checks/103480 "2023-09-03T22:05:56Z")

</div>

If I understand correctly, return type annotations cannot meaningfully help with type stability. There is also @code\_warntype, @inferred, Cthulhu.jl and TypeStability.jl, but they all require pointwise manual macrosing …

---

## [Parametric function return type](https://discourse.julialang.org/t/parametric-function-return-type/103460)

<div class="topic-metadata">

**Author:** [@raythurnevoid](https://discourse.julialang.org/u/raythurnevoid)\
**Replies:** 8\
**Last updated:** [September 2, 2023, 9:34pm UTC](https://discourse.julialang.org/t/parametric-function-return-type/103460 "2023-09-02T21:34:16Z")

</div>

I wanted to create a function that takes in input a callback and can return its result while being able to tell Julia what’s going to be the return type (since the Function type is not parametric). This is the skeleton …

---

## [Understanding Types Union{}](https://discourse.julialang.org/t/understanding-types-union/103466)

<div class="topic-metadata">

**Author:** [@Denis\_Ivanov](https://discourse.julialang.org/u/Denis_Ivanov)\
**Replies:** 3\
**Last updated:** [September 2, 2023, 9:24pm UTC](https://discourse.julialang.org/t/understanding-types-union/103466 "2023-09-02T21:24:54Z")

</div>

I read the manual about types carefully, but I can’t figure out how to do this. Let’s two types of data are possible: Vector{Int8} and Vector{Vector{Int8}} eg \[1, 0, 1\] and \[\[1, 1\], \[0\]\] Following the recommendations,…

---

## [Missing documentation for ? operator, and how to improve documentation](https://discourse.julialang.org/t/missing-documentation-for-operator-and-how-to-improve-documentation/103441)

<div class="topic-metadata">

**Author:** [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)\
**Replies:** 13\
**Last updated:** [September 1, 2023, 6:20pm UTC](https://discourse.julialang.org/t/missing-documentation-for-operator-and-how-to-improve-documentation/103441 "2023-09-01T18:20:00Z")

</div>

Hi there I overall like the Julia documentation. It’s more comprehensive than most languages, and still, it lacks some things. I am new to Julia, and found an example, that attempts to showcase multiple dispatch. A pa…

---

## [How to add line for indicating mean on histogram?](https://discourse.julialang.org/t/how-to-add-line-for-indicating-mean-on-histogram/103444)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 2\
**Last updated:** [September 1, 2023, 1:24pm UTC](https://discourse.julialang.org/t/how-to-add-line-for-indicating-mean-on-histogram/103444 "2023-09-01T13:24:00Z")

</div>

I have this histogram and want to add a vline to show mean value or median value. vline!(some\_value). is not working. I get this error. ERROR: Cannot convert Float64 to series data for plotting Stacktrace: \[1\] er…

---

## [Multiple dispatch "default case"?](https://discourse.julialang.org/t/multiple-dispatch-default-case/103368)

<div class="topic-metadata">

**Author:** [@frylock](https://discourse.julialang.org/u/frylock)\
**Replies:** 8\
**Last updated:** [September 1, 2023, 12:17pm UTC](https://discourse.julialang.org/t/multiple-dispatch-default-case/103368 "2023-09-01T12:17:17Z")

</div>

I’m asking because I think I am probably going about this the wrong way. I have a “configuration file” with sections that I wanted to parse and store in a dictionary. I’m reading the sections like this: function read\_se…

---

## [Scope of variables in Pluto](https://discourse.julialang.org/t/scope-of-variables-in-pluto/103413)

<div class="topic-metadata">

**Author:** [@GenerallyClueless](https://discourse.julialang.org/u/GenerallyClueless)\
**Replies:** 11\
**Last updated:** [August 31, 2023, 9:45pm UTC](https://discourse.julialang.org/t/scope-of-variables-in-pluto/103413 "2023-08-31T21:45:42Z")

</div>

Hi everybody! I am new to Julia, POMDPs, and Pluto… and I am using all three to try and simulate a POMDP problem. I know that I am probably making some mistakes in my POMDP, but my immediate error is: UndefVarError: i …

---

## [Subtract Float32 number from Float64 number - what's the rule?](https://discourse.julialang.org/t/subtract-float32-number-from-float64-number-whats-the-rule/103324)

<div class="topic-metadata">

**Author:** [@Motz](https://discourse.julialang.org/u/Motz)\
**Replies:** 13\
**Last updated:** [August 31, 2023, 5:12pm UTC](https://discourse.julialang.org/t/subtract-float32-number-from-float64-number-whats-the-rule/103324 "2023-08-31T17:12:57Z")

</div>

I am trying to understand what happens when I subtract a Float32 from a Float64 where the numbers are “very small”. I understand what happens when both are Float64 julia\> 1.401298464324817e-45 - 1.0e-45 4.0129846432481…

---

## [Can someone explain - Warning: The current proposal will be rejected due to numerical error(s)](https://discourse.julialang.org/t/can-someone-explain-warning-the-current-proposal-will-be-rejected-due-to-numerical-error-s/103409)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 1\
**Last updated:** [August 31, 2023, 4:41pm UTC](https://discourse.julialang.org/t/can-someone-explain-warning-the-current-proposal-will-be-rejected-due-to-numerical-error-s/103409 "2023-08-31T16:41:38Z")

</div>

I want to know what causes this? What is theory behind it? A proposal getting rejected because its not suitable I understand but what it mean by numerical errors and at what stage? │ isfinite.((θ, r, ℓπ, ℓκ)) = (true,…

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

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