# New to Julia

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

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

**Page:** 65

---

## [Updating Julia, IJulia](https://discourse.julialang.org/t/updating-julia-ijulia/106289)

<div class="topic-metadata">

**Author:** [@KGregory](https://discourse.julialang.org/u/KGregory)\
**Replies:** 31\
**Last updated:** [November 20, 2023, 11:01pm UTC](https://discourse.julialang.org/t/updating-julia-ijulia/106289 "2023-11-20T23:01:09Z")

</div>

I previously used an Julia 1.5 with the IJulia notebook to run an Mimi package. I installed the new version of Julia via julia-1.9.3-win64.exe. The new path is C:\\Users\\Ken\\AppData\\Local\\Programs\\Julia-1.9.3\\bin The I…

---

## [How can I locate a function in a module?](https://discourse.julialang.org/t/how-can-i-locate-a-function-in-a-module/106458)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 2\
**Last updated:** [November 20, 2023, 12:46pm UTC](https://discourse.julialang.org/t/how-can-i-locate-a-function-in-a-module/106458 "2023-11-20T12:46:24Z")

</div>

I am reading someone else’s julia code. He has a huge module. In his code, he called many functions. I would like to locate the functions in the module so as to read the original codes for these functions. I do not wa…

---

## [Return types of function is Any\[Float64\], although I defined return type to be Float64](https://discourse.julialang.org/t/return-types-of-function-is-any-float64-although-i-defined-return-type-to-be-float64/106438)

<div class="topic-metadata">

**Author:** [@zarkoivkovic](https://discourse.julialang.org/u/zarkoivkovic)\
**Replies:** 2\
**Last updated:** [November 19, 2023, 2:35pm UTC](https://discourse.julialang.org/t/return-types-of-function-is-any-float64-although-i-defined-return-type-to-be-float64/106438 "2023-11-19T14:35:02Z")

</div>

Hello everyone, I have a function whose return type is defined and it’s Float64. However, when I check with Base.return\_types(f), it says Any\[Float64\]. What does it mean and will it affect performance?

---

## [F(x) = x::Int64 or f(x)::Int64 = x?](https://discourse.julialang.org/t/f-x-x-int64-or-f-x-int64-x/106395)

<div class="topic-metadata">

**Author:** [@sadish-d](https://discourse.julialang.org/u/sadish-d)\
**Replies:** 2\
**Last updated:** [November 18, 2023, 8:32pm UTC](https://discourse.julialang.org/t/f-x-x-int64-or-f-x-int64-x/106395 "2023-11-18T20:32:48Z")

</div>

If I want to define a function that always returns the same type, is it better to typeassert the returned value before returning it as in f(x) = x::Int64? Or is it better to convert what is returned to a desired type as …

---

## [MethodOfLines - numerical instability for example in docs](https://discourse.julialang.org/t/methodoflines-numerical-instability-for-example-in-docs/106359)

<div class="topic-metadata">

**Author:** [@Sushrut\_Deshpande](https://discourse.julialang.org/u/Sushrut_Deshpande)\
**Replies:** 1\
**Last updated:** [November 18, 2023, 5:57pm UTC](https://discourse.julialang.org/t/methodoflines-numerical-instability-for-example-in-docs/106359 "2023-11-18T17:57:57Z")

</div>

I am using the steady state heat equation example in the MethodOfLines.jl package. When I reduce the step side below 0.1 I have a numerical blow-up of the solution. I do not know if this is only on my end or other user…

---

## [Why does arrayref throw?](https://discourse.julialang.org/t/why-does-arrayref-throw/104283)

<div class="topic-metadata">

**Author:** [@tmpo](https://discourse.julialang.org/u/tmpo)\
**Replies:** 89\
**Last updated:** [November 18, 2023, 8:21am UTC](https://discourse.julialang.org/t/why-does-arrayref-throw/104283 "2023-11-18T08:21:25Z")

</div>

Hi, I’m confused! This code function test(a::Vector{Vector{Int}}) return @inbounds a\[1\] end turns into the typed code test(a::Vector{Vector{Int64}}) Body::Vector{Int64} (!c,+e,!n,+t,+s,?m,+i) 2 1 ─ %1 = Base.arra…

---

## [Documentation on types of Connections in ModelingToolkit.jl](https://discourse.julialang.org/t/documentation-on-types-of-connections-in-modelingtoolkit-jl/106357)

<div class="topic-metadata">

**Author:** [@Sushrut\_Deshpande](https://discourse.julialang.org/u/Sushrut_Deshpande)\
**Replies:** 1\
**Last updated:** [November 17, 2023, 2:10pm UTC](https://discourse.julialang.org/t/documentation-on-types-of-connections-in-modelingtoolkit-jl/106357 "2023-11-17T14:10:03Z")

</div>

Thank you for making ModelingToolkit. My question concerns with the documentation of building the Component Library for Acasual modeling. In the example given in the documentation (RC - Circuit) \[connect = Flow\] is use…

---

## [Snail formatter problem with non-Base64 characters](https://discourse.julialang.org/t/snail-formatter-problem-with-non-base64-characters/106285)

<div class="topic-metadata">

**Author:** [@jwalker](https://discourse.julialang.org/u/jwalker)\
**Replies:** 0\
**Last updated:** [November 15, 2023, 11:36pm UTC](https://discourse.julialang.org/t/snail-formatter-problem-with-non-base64-characters/106285 "2023-11-15T23:36:49Z")

</div>

When running juliaformatter through the snail interface (C-c j f b) on a file with a character outside of base64 (specifically \\psi, I get the following message: format: Multibyte character in data for base64 encoding …

---

## [Why ~ can not broadcast?](https://discourse.julialang.org/t/why-can-not-broadcast/106290)

<div class="topic-metadata">

**Author:** [@zhpf0530](https://discourse.julialang.org/u/zhpf0530)\
**Replies:** 2\
**Last updated:** [November 16, 2023, 3:16am UTC](https://discourse.julialang.org/t/why-can-not-broadcast/106290 "2023-11-16T03:16:00Z")

</div>

why ~ can not broadcast? a=randn(10) b=a.\>0 ~.b is wrong ~b is wrong map(~,b) is right.

---

## [Scatter plot over a map](https://discourse.julialang.org/t/scatter-plot-over-a-map/106165)

<div class="topic-metadata">

**Author:** [@yalonso](https://discourse.julialang.org/u/yalonso)\
**Replies:** 2\
**Last updated:** [November 15, 2023, 4:59pm UTC](https://discourse.julialang.org/t/scatter-plot-over-a-map/106165 "2023-11-15T16:59:02Z")

</div>

Hello, I am trying to use GMT.jl to plot some points overtop a map of a region of the U.S… I can get the map to show, but when I try to scatter points over it, I’m getting an error message. Any help here would be much a…

---

## [Turing with multiple replicates of data](https://discourse.julialang.org/t/turing-with-multiple-replicates-of-data/96340)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 0\
**Last updated:** [March 20, 2023, 2:10pm UTC](https://discourse.julialang.org/t/turing-with-multiple-replicates-of-data/96340 "2023-03-20T14:10:27Z")

</div>

I have a simple model for which I have single data to be used in inference. I’m new to julia. Right now I’m setting up inference using turing.jl . My Turing model looks like this : @model function fit\_(data1, prob) …

---

## [HTTP.post() Exceptions.StatusError(400, ...)](https://discourse.julialang.org/t/http-post-exceptions-statuserror-400/106251)

<div class="topic-metadata">

**Author:** [@alicepiller](https://discourse.julialang.org/u/alicepiller)\
**Replies:** 3\
**Last updated:** [November 15, 2023, 8:04am UTC](https://discourse.julialang.org/t/http-post-exceptions-statuserror-400/106251 "2023-11-15T08:04:16Z")

</div>

I’m trying to code the following Python code in Julia: import requests # Define the API endpoint URL url = 'https://example.com/create/' # Define your API credentials username = 'john.smith@example.com' api\_key = '1234…

---

## [How to add several values for one index in a comprehension?](https://discourse.julialang.org/t/how-to-add-several-values-for-one-index-in-a-comprehension/106208)

<div class="topic-metadata">

**Author:** [@homocomputeris](https://discourse.julialang.org/u/homocomputeris)\
**Replies:** 3\
**Last updated:** [November 14, 2023, 2:13pm UTC](https://discourse.julialang.org/t/how-to-add-several-values-for-one-index-in-a-comprehension/106208 "2023-11-14T14:13:31Z")

</div>

What would be the idiomatic way to get array like \[1, -1, 2, -2, 3, -3\] (or in general \[f(idx1), g(idx1), f(idx2), g(idx2)\] which have several values per one index following one another). \[(i,-i) for i in 1:5\] gives a l…

---

## [Is julia a good choice for this?](https://discourse.julialang.org/t/is-julia-a-good-choice-for-this/105916)

<div class="topic-metadata">

**Author:** [@wlosh](https://discourse.julialang.org/u/wlosh)\
**Replies:** 17\
**Last updated:** [November 14, 2023, 8:08am UTC](https://discourse.julialang.org/t/is-julia-a-good-choice-for-this/105916 "2023-11-14T08:08:31Z")

</div>

Hello! I’m a complete julia novice, but I’ve been hearing about it from years from friends and colleagues. I’ve approached it for a project that I want to start but need some advice on what direction to take. I’m lookin…

---

## [Invalid iteration specification, what does it mean?](https://discourse.julialang.org/t/invalid-iteration-specification-what-does-it-mean/106119)

<div class="topic-metadata">

**Author:** [@pinkpeachman](https://discourse.julialang.org/u/pinkpeachman)\
**Replies:** 3\
**Last updated:** [November 12, 2023, 5:51pm UTC](https://discourse.julialang.org/t/invalid-iteration-specification-what-does-it-mean/106119 "2023-11-12T17:51:19Z")

</div>

I would like to write a function in a .jl file, that can recursively produce polynomials for me. However I got the following error message: invalid iteration specification. \> function P(n) Pn(x)=1 ##if n==0 Pn(x)=1…

---

## [Unable to reproduce Catalyst.jl Example](https://discourse.julialang.org/t/unable-to-reproduce-catalyst-jl-example/106099)

<div class="topic-metadata">

**Author:** [@amaritm1](https://discourse.julialang.org/u/amaritm1)\
**Replies:** 21\
**Last updated:** [November 13, 2023, 9:43pm UTC](https://discourse.julialang.org/t/unable-to-reproduce-catalyst-jl-example/106099 "2023-11-13T21:43:54Z")

</div>

I am running Julia 1.9.3 using jupyter notebooks, and cannot reproduce the following example: Home · Catalyst.jl. I am simply copying and pasting the code. However, when I graph the reaction network I get the following d…

---

## [Can i check struct validity using external method?](https://discourse.julialang.org/t/can-i-check-struct-validity-using-external-method/106161)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 1\
**Last updated:** [November 13, 2023, 8:28pm UTC](https://discourse.julialang.org/t/can-i-check-struct-validity-using-external-method/106161 "2023-11-13T20:28:44Z")

</div>

Hey, I wanted to externalize my validity checks like that : struct S{PT} par::PT function S(par) rez = new{typeof(par)}(par) check(rez) && return rez end end function check(rez::S{PT}) where…

---

## [Speed up data extraction from large json file](https://discourse.julialang.org/t/speed-up-data-extraction-from-large-json-file/106032)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 11\
**Last updated:** [November 13, 2023, 10:03am UTC](https://discourse.julialang.org/t/speed-up-data-extraction-from-large-json-file/106032 "2023-11-13T10:03:30Z")

</div>

I’ve downloaded a json file from here containing records of nearly 350,000 National Lottery grants to good causes. I’m pretty new to Julia and even newer to json. The structure of the json is like this (as best I can te…

---

## [I think that my logic is correct but I am getting initial value as print, why?](https://discourse.julialang.org/t/i-think-that-my-logic-is-correct-but-i-am-getting-initial-value-as-print-why/106120)

<div class="topic-metadata">

**Author:** [@Mohit](https://discourse.julialang.org/u/Mohit)\
**Replies:** 3\
**Last updated:** [November 12, 2023, 5:17pm UTC](https://discourse.julialang.org/t/i-think-that-my-logic-is-correct-but-i-am-getting-initial-value-as-print-why/106120 "2023-11-12T17:17:52Z")

</div>

What is the reverse complement of GCTAGCT? function pattern\_RC(dna) R\_dna = “” ln = length(dna) for i in ln:-1:1 if dna\[i\] == “A” R\_dna = R\_dna \* “T” elseif dna\[i\]== “T” R\_dna = R\_dna \* “A” elseif dna\[i\]== “G” R…

---

## [Replacing readstring](https://discourse.julialang.org/t/replacing-readstring/71746)

<div class="topic-metadata">

**Author:** [@Beliavsky](https://discourse.julialang.org/u/Beliavsky)\
**Replies:** 5\
**Last updated:** [November 12, 2023, 9:33am UTC](https://discourse.julialang.org/t/replacing-readstring/71746 "2023-11-12T09:33:32Z")

</div>

Trying to run https://gist.github.com/rafaqz/fede683a3e853f36c9b367471fde2f56 with Julia 1.6.1 fails because of the lines filename = string(ARGS\[1\]) code = readstring(filename) Julia says ERROR: LoadError: UndefVarErr…

---

## [ERROR: MethodError: no method matching +(::String, ::Int64)](https://discourse.julialang.org/t/error-methoderror-no-method-matching-string-int64/106096)

<div class="topic-metadata">

**Author:** [@Mohit](https://discourse.julialang.org/u/Mohit)\
**Replies:** 5\
**Last updated:** [November 12, 2023, 1:25am UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-string-int64/106096 "2023-11-12T01:25:40Z")

</div>

I am trying to learn bioinformatics with julia and was trying to write very basic script. But i am getting an error, I am sure that I am missing a very simple concept of usage. It will be great help, if someone can exp…

---

## [Question on installation](https://discourse.julialang.org/t/question-on-installation/106074)

<div class="topic-metadata">

**Author:** [@Vin\_Lunney](https://discourse.julialang.org/u/Vin_Lunney)\
**Replies:** 3\
**Last updated:** [November 11, 2023, 3:37pm UTC](https://discourse.julialang.org/t/question-on-installation/106074 "2023-11-11T15:37:37Z")

</div>

I’m sorry if this is a really stupid question, but I’m used to seeing some type of INSTALL.md or other doc in an archive that describes the installation process. I just can’t seem to find something that actually talks ab…

---

## [Documentation page for the XLSX.jl package is hacked](https://discourse.julialang.org/t/documentation-page-for-the-xlsx-jl-package-is-hacked/106046)

<div class="topic-metadata">

**Author:** [@vsoler](https://discourse.julialang.org/u/vsoler)\
**Replies:** 5\
**Last updated:** [November 11, 2023, 8:59am UTC](https://discourse.julialang.org/t/documentation-page-for-the-xlsx-jl-package-is-hacked/106046 "2023-11-11T08:59:11Z")

</div>

I’m learning to use the XLSX.jl package. I want to read and write excel files. When I try to open its documentation page at https://felipenoris.github.io/XLSX.jl/stable/ … my Norton antivirus packge tells me that the…

---

## [Dependency architecture for a custom plotting package](https://discourse.julialang.org/t/dependency-architecture-for-a-custom-plotting-package/106054)

<div class="topic-metadata">

**Author:** [@gjlkd425](https://discourse.julialang.org/u/gjlkd425)\
**Replies:** 0\
**Last updated:** [November 10, 2023, 11:39pm UTC](https://discourse.julialang.org/t/dependency-architecture-for-a-custom-plotting-package/106054 "2023-11-10T23:39:45Z")

</div>

I am developing a package, call it Model, which consists of a module that defines all the types and functions pertinent to the computational aspect of the codebase. I am also developing some custom plotting and graphics …

---

## [Permutedims of a mesh (swapping the order of axes )](https://discourse.julialang.org/t/permutedims-of-a-mesh-swapping-the-order-of-axes/106042)

<div class="topic-metadata">

**Author:** [@gltchr](https://discourse.julialang.org/u/gltchr)\
**Replies:** 1\
**Last updated:** [November 10, 2023, 5:54pm UTC](https://discourse.julialang.org/t/permutedims-of-a-mesh-swapping-the-order-of-axes/106042 "2023-11-10T17:54:56Z")

</div>

Hello, I want to read several geometries for visualisation from a list of .obj files, however their axes are arranged in the wrong order (y,z,x) in my frame of reference. Goal: permute dimensions of a mesh. The mesh l…

---

## [Automatic building of a vector containing modified instances of a structure](https://discourse.julialang.org/t/automatic-building-of-a-vector-containing-modified-instances-of-a-structure/106038)

<div class="topic-metadata">

**Author:** [@matnbo](https://discourse.julialang.org/u/matnbo)\
**Replies:** 4\
**Last updated:** [November 10, 2023, 3:59pm UTC](https://discourse.julialang.org/t/automatic-building-of-a-vector-containing-modified-instances-of-a-structure/106038 "2023-11-10T15:59:49Z")

</div>

Dear all I have the following structure MyPar (this is a reproductible fictive example): Base.@kwdef struct MyPar n1::Int = 1 ep::Float64 = .01 co::Float64 = 1. dg::Int = 3 it::Bool = false end jul…

---

## [Building sets of matching entries in a dataset to explore interaction effects](https://discourse.julialang.org/t/building-sets-of-matching-entries-in-a-dataset-to-explore-interaction-effects/105940)

<div class="topic-metadata">

**Author:** [@BryanFrost25](https://discourse.julialang.org/u/BryanFrost25)\
**Replies:** 4\
**Last updated:** [November 10, 2023, 1:33pm UTC](https://discourse.julialang.org/t/building-sets-of-matching-entries-in-a-dataset-to-explore-interaction-effects/105940 "2023-11-10T13:33:05Z")

</div>

Here’s the relevant code from a toy problem I’m working with: ‘’‘#Inputs data = \[1 1; 1 1; 0 1; 0 1; 0 0; 1 0; 0 0; 0 0\] C = \[“A”,“B”\]; Interactions = \[\[1,2\],\[5,7,8\]\]’‘’ I’m trying to build sets of indices co…

---

## [Multiplication and no method matching error](https://discourse.julialang.org/t/multiplication-and-no-method-matching-error/105494)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 2\
**Last updated:** [November 10, 2023, 5:02am UTC](https://discourse.julialang.org/t/multiplication-and-no-method-matching-error/105494 "2023-11-10T05:02:45Z")

</div>

Hi, I am using gridap to develop this matrix but it gives me error. could you please help me find the issue. I2 = SymTensorValue{2,Float64}(1.0 ,0.0 ,1.0) I4 = I2⊗I2 I4\_sym = one(SymFourthOrderTensorValue{2,Float64}) P\_…

---

## [Call functions with the same names from different files](https://discourse.julialang.org/t/call-functions-with-the-same-names-from-different-files/105987)

<div class="topic-metadata">

**Author:** [@dgsob](https://discourse.julialang.org/u/dgsob)\
**Replies:** 4\
**Last updated:** [November 9, 2023, 12:47pm UTC](https://discourse.julialang.org/t/call-functions-with-the-same-names-from-different-files/105987 "2023-11-09T12:47:29Z")

</div>

Hi, I have a file where I include files: include("./path/File1.jl") include("./path/File2.jl") and then I want to call functions from these files, and since they have the same name, i wanted to use the file’s names as…

---

## [Scope when using the if-else-end](https://discourse.julialang.org/t/scope-when-using-the-if-else-end/105920)

<div class="topic-metadata">

**Author:** [@atBNE](https://discourse.julialang.org/u/atBNE)\
**Replies:** 4\
**Last updated:** [November 8, 2023, 4:48pm UTC](https://discourse.julialang.org/t/scope-when-using-the-if-else-end/105920 "2023-11-08T16:48:52Z")

</div>

This program fails. Knowing that “if… does not introduce a new scope”, how to repair it? a = 1 while a \>0 local a print("n, 1=next "); a = parse(Int, readline() ) if a == 1 u = u + 1 # this line #7 is f…

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

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