# New to Julia

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

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

**Page:** 70

---

## [How can I make code linter free?](https://discourse.julialang.org/t/how-can-i-make-code-linter-free/104061)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 1\
**Last updated:** [September 20, 2023, 12:49pm UTC](https://discourse.julialang.org/t/how-can-i-make-code-linter-free/104061 "2023-09-20T12:49:36Z")

</div>

Here is an example where I get linter but I don’t understand what can be possible cause. Code is running fine, everything seems okay. Upon checking it says possible method call errors.

---

## [Best way to include local module (with struct) in Pluto](https://discourse.julialang.org/t/best-way-to-include-local-module-with-struct-in-pluto/104044)

<div class="topic-metadata">

**Author:** [@luke-pikaart](https://discourse.julialang.org/u/luke-pikaart)\
**Replies:** 3\
**Last updated:** [September 20, 2023, 12:25pm UTC](https://discourse.julialang.org/t/best-way-to-include-local-module-with-struct-in-pluto/104044 "2023-09-20T12:25:01Z")

</div>

I am trying use Pluto with a local module. I have a module like: foo.jl module foo export foobar struct foobar A:Int end end I think the recommended way to do this is: notebook1.jl include("foo.jl"…

---

## [Julia is surprisingly slow for some simple iteration](https://discourse.julialang.org/t/julia-is-surprisingly-slow-for-some-simple-iteration/104053)

<div class="topic-metadata">

**Author:** [@baizhan](https://discourse.julialang.org/u/baizhan)\
**Replies:** 7\
**Last updated:** [September 20, 2023, 12:16pm UTC](https://discourse.julialang.org/t/julia-is-surprisingly-slow-for-some-simple-iteration/104053 "2023-09-20T12:16:24Z")

</div>

I am running the following code: N=6144 # some not-so-small number B=rand(N,N) y=rand(N) By=zeros(N) @time for i=1:N By\[i\]=0.0 for j=1:N By\[i\] += B\[i,j\]\*y\[i\] end end on my laptop, the above iteration takes a…

---

## [Functions of tuples of matrices VS Functions of vectors of tuples of matrices](https://discourse.julialang.org/t/functions-of-tuples-of-matrices-vs-functions-of-vectors-of-tuples-of-matrices/104022)

<div class="topic-metadata">

**Author:** [@arnerob](https://discourse.julialang.org/u/arnerob)\
**Replies:** 1\
**Last updated:** [September 19, 2023, 1:05pm UTC](https://discourse.julialang.org/t/functions-of-tuples-of-matrices-vs-functions-of-vectors-of-tuples-of-matrices/104022 "2023-09-19T13:05:47Z")

</div>

I get a MethodError in my code and I’m trying to understand the behaviour. Functions of tuples of matrices work and functions of vectors of tuples of matrices give a MethodError. A minimum working example would be the fo…

---

## [Contruct filter expression within loop](https://discourse.julialang.org/t/contruct-filter-expression-within-loop/104003)

<div class="topic-metadata">

**Author:** [@chedy](https://discourse.julialang.org/u/chedy)\
**Replies:** 2\
**Last updated:** [September 19, 2023, 7:11am UTC](https://discourse.julialang.org/t/contruct-filter-expression-within-loop/104003 "2023-09-19T07:11:48Z")

</div>

Hi all, I’m trying to simplify this code using a macro, but I’m pretty new to meta-programming and not sure what I need to do. I have an array bigrams of structs that have two fields (among others): w1, and w2 (both int…

---

## [How to store all in Julia](https://discourse.julialang.org/t/how-to-store-all-in-julia/103215)

<div class="topic-metadata">

**Author:** [@R0033h](https://discourse.julialang.org/u/R0033h)\
**Replies:** 10\
**Last updated:** [September 18, 2023, 10:07am UTC](https://discourse.julialang.org/t/how-to-store-all-in-julia/103215 "2023-09-18T10:07:40Z")

</div>

Could please tell me i want to save all output. what should i do. I tried use CVS and Excel but i could not. It means should i create file for each loop i wrote (println) or what.

---

## [Cointegration Johansen test and Autocorrelation Durbin Watson Test](https://discourse.julialang.org/t/cointegration-johansen-test-and-autocorrelation-durbin-watson-test/103950)

<div class="topic-metadata">

**Author:** [@ginger\_snaps](https://discourse.julialang.org/u/ginger_snaps)\
**Replies:** 2\
**Last updated:** [September 18, 2023, 10:21am UTC](https://discourse.julialang.org/t/cointegration-johansen-test-and-autocorrelation-durbin-watson-test/103950 "2023-09-18T10:21:37Z")

</div>

Hello. I’m new in Julia, but I need some performance so I’m rewriting from R and Python to Julia but I have problems with built-in functions. I know that Julia is not as wide as R and Python, but I was sure that I would…

---

## [Incorporating the ode within my neural network](https://discourse.julialang.org/t/incorporating-the-ode-within-my-neural-network/102549)

<div class="topic-metadata">

**Author:** [@Marco\_Nesta](https://discourse.julialang.org/u/Marco_Nesta)\
**Replies:** 2\
**Last updated:** [September 18, 2023, 8:19am UTC](https://discourse.julialang.org/t/incorporating-the-ode-within-my-neural-network/102549 "2023-09-18T08:19:06Z")

</div>

Good morning everyone, I am working on using neural ode for household consumption prediction using Rc models. Once I have created my solution and array. How can I make sure to incorporate the ode within the neural networ…

---

## [How do I save my dictionary as a .csv (or excel) file?](https://discourse.julialang.org/t/how-do-i-save-my-dictionary-as-a-csv-or-excel-file/36791)

<div class="topic-metadata">

**Author:** [@samantp](https://discourse.julialang.org/u/samantp)\
**Replies:** 7\
**Last updated:** [September 18, 2023, 2:08am UTC](https://discourse.julialang.org/t/how-do-i-save-my-dictionary-as-a-csv-or-excel-file/36791 "2023-09-18T02:08:37Z")

</div>

I have a dictionary, which I want to save to an excel or csv file with keys in one column and the entries in another. The keys are strings and the entries are float64s. I thought about converting my dictionary to a DataF…

---

## [Date.value doesn't work with missing values](https://discourse.julialang.org/t/date-value-doesnt-work-with-missing-values/103887)

<div class="topic-metadata">

**Author:** [@ddrake](https://discourse.julialang.org/u/ddrake)\
**Replies:** 7\
**Last updated:** [September 17, 2023, 1:48pm UTC](https://discourse.julialang.org/t/date-value-doesnt-work-with-missing-values/103887 "2023-09-17T13:48:59Z")

</div>

I have a dataframe with some Dates in it, and I want a new column or vector with the number of days between those dates. So this works: vcat(\[missing\], \[y - x for (x, y) in zip(df\[:,:date\]\[1:end\], df\[:,:date\]\[2:end\])\]) …

---

## [Similar thing to numpy's einsum in Julia](https://discourse.julialang.org/t/similar-thing-to-numpys-einsum-in-julia/103932)

<div class="topic-metadata">

**Author:** [@jisutich](https://discourse.julialang.org/u/jisutich)\
**Replies:** 6\
**Last updated:** [September 17, 2023, 2:30am UTC](https://discourse.julialang.org/t/similar-thing-to-numpys-einsum-in-julia/103932 "2023-09-17T02:30:11Z")

</div>

Hi, I am thinking about how to achieve something similar to numpy.einsum in Julia. For instance, if I have a tensor T\_{ijk} and a matrix u\_{jj'}, I want to get T'\_{ijk}= u\_{jj'}T\_{ij'k}. Also, I want to do things like H…

---

## [Scoping confusion: MethodError but method is defined](https://discourse.julialang.org/t/scoping-confusion-methoderror-but-method-is-defined/103892)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 4\
**Last updated:** [September 15, 2023, 2:32pm UTC](https://discourse.julialang.org/t/scoping-confusion-methoderror-but-method-is-defined/103892 "2023-09-15T14:32:28Z")

</div>

This kind of error keeps coming up, and I guess I need to figure out what is going on. In the course of using a function from a module which calls mutation\_wait I get a method error ERROR: MethodError: no method matchi…

---

## [Using truncation in MixtureModel](https://discourse.julialang.org/t/using-truncation-in-mixturemodel/103893)

<div class="topic-metadata">

**Author:** [@Sahil\_Khan](https://discourse.julialang.org/u/Sahil_Khan)\
**Replies:** 2\
**Last updated:** [September 15, 2023, 1:59pm UTC](https://discourse.julialang.org/t/using-truncation-in-mixturemodel/103893 "2023-09-15T13:59:56Z")

</div>

Can we also use truncation here? MixtureModel(Normal\[ Normal(-2.0, 1.2), Normal(0.0, 1.0), Normal(3.0, 2.5)\]) I was trying with some truncated distributions and it gives error. These distributions are obtaine…

---

## [Tuple vs vector (article)](https://discourse.julialang.org/t/tuple-vs-vector-article/103824)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 4\
**Last updated:** [September 14, 2023, 1:40pm UTC](https://discourse.julialang.org/t/tuple-vs-vector-article/103824 "2023-09-14T13:40:19Z")

</div>

Greetings! I am reading Julius Krumbriegel’s (is he here?) informative article about the difference between tuples and vectors: jkrumbiegel.com - Tuples and Vectors, Allocations and Performance for Beginners Example fr…

---

## [Check whether a variable is defined](https://discourse.julialang.org/t/check-whether-a-variable-is-defined/1018)

<div class="topic-metadata">

**Author:** [@Diger](https://discourse.julialang.org/u/Diger)\
**Replies:** 7\
**Last updated:** [September 14, 2023, 12:57pm UTC](https://discourse.julialang.org/t/check-whether-a-variable-is-defined/1018 "2023-09-14T12:57:45Z")

</div>

is there a simple check to see whether a variable is defined?

---

## [Obtaining Odesystem equations in code format from SBML file](https://discourse.julialang.org/t/obtaining-odesystem-equations-in-code-format-from-sbml-file/103844)

<div class="topic-metadata">

**Author:** [@Mies2027](https://discourse.julialang.org/u/Mies2027)\
**Replies:** 1\
**Last updated:** [September 14, 2023, 11:29am UTC](https://discourse.julialang.org/t/obtaining-odesystem-equations-in-code-format-from-sbml-file/103844 "2023-09-14T11:29:33Z")

</div>

Hi, I am new to Julia and have a question regarding ModelingToolkit and SBML. I imported an SBML file and converted the model into an ODESystem: mdl = readSBML("Kok2020.xml", doc -\> begin set\_level\_and\_version(3, …

---

## [The nature of pipes](https://discourse.julialang.org/t/the-nature-of-pipes/103808)

<div class="topic-metadata">

**Author:** [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)\
**Replies:** 25\
**Last updated:** [September 13, 2023, 6:50pm UTC](https://discourse.julialang.org/t/the-nature-of-pipes/103808 "2023-09-13T18:50:11Z")

</div>

Could I somehow pipe the output of addition to subtraction: addition(x, y) = x + y subtraction(a, b) = a - b function calculation() addition(10, 2) subtraction(12) end calculation() I am used to this kind …

---

## [Outer constructor not getting called despite being in stack trace?](https://discourse.julialang.org/t/outer-constructor-not-getting-called-despite-being-in-stack-trace/103801)

<div class="topic-metadata">

**Author:** [@deaminase](https://discourse.julialang.org/u/deaminase)\
**Replies:** 3\
**Last updated:** [September 13, 2023, 6:42am UTC](https://discourse.julialang.org/t/outer-constructor-not-getting-called-despite-being-in-stack-trace/103801 "2023-09-13T06:42:50Z")

</div>

Somehow Julia’s constructors manage to consistently confuse me. Here is a pared-down example of what I’m trying and failing to do: const Optional{T} = Union{Some{T}, Nothing} struct State{InpIterState,Input} full\_inp…

---

## [VScode with custom DEPOT\_PATH](https://discourse.julialang.org/t/vscode-with-custom-depot-path/101909)

<div class="topic-metadata">

**Author:** [@discourserogu](https://discourse.julialang.org/u/discourserogu)\
**Replies:** 2\
**Last updated:** [September 13, 2023, 6:07am UTC](https://discourse.julialang.org/t/vscode-with-custom-depot-path/101909 "2023-09-13T06:07:59Z")

</div>

I’m trying to get Julia to work in VScode with a custom DEPOT\_PATH, I know for general execution you could use JULIA\_DEPOT\_PATH=\\path\\to\\dir julia and it would work. How do I accomplish the same for working with VScode…

---

## [Using DiffEqFlux.jl for system identification with partially known system dynamics](https://discourse.julialang.org/t/using-diffeqflux-jl-for-system-identification-with-partially-known-system-dynamics/98197)

<div class="topic-metadata">

**Author:** [@gsh19](https://discourse.julialang.org/u/gsh19)\
**Replies:** 8\
**Last updated:** [September 12, 2023, 5:51pm UTC](https://discourse.julialang.org/t/using-diffeqflux-jl-for-system-identification-with-partially-known-system-dynamics/98197 "2023-09-12T17:51:03Z")

</div>

Hi everyone. I want to use the DiffEqFlux.jl package to model a system of interest. I have access to a dataset which contains measurements of all system states as well as the external control inputs that act on it. A fir…

---

## [Changing runtime precision. A question about FixedPointDecimals](https://discourse.julialang.org/t/changing-runtime-precision-a-question-about-fixedpointdecimals/103775)

<div class="topic-metadata">

**Author:** [@stefkuypers](https://discourse.julialang.org/u/stefkuypers)\
**Replies:** 5\
**Last updated:** [September 12, 2023, 1:07pm UTC](https://discourse.julialang.org/t/changing-runtime-precision-a-question-about-fixedpointdecimals/103775 "2023-09-12T13:07:15Z")

</div>

I’m working on economic simulations and have used the following shortcut in my code: Currency = Fixed(4) Now I’ve run into a situation where I would like to change the precision in some cases. Redefining Currency befor…

---

## [Anonymous functions, type stability](https://discourse.julialang.org/t/anonymous-functions-type-stability/103722)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 11\
**Last updated:** [September 12, 2023, 12:25pm UTC](https://discourse.julialang.org/t/anonymous-functions-type-stability/103722 "2023-09-12T12:25:20Z")

</div>

For my simulation, I want the user to easily specify a bunch of observable functions like observables = \[(x,p,force) -\> x\[1\], (x,p,force) -\> x\[2\], (x,p,force) -\> p'p\] that are then passed to the simulation and evaluate…

---

## [Error in running julia file](https://discourse.julialang.org/t/error-in-running-julia-file/103765)

<div class="topic-metadata">

**Author:** [@ABHIJITH\_S](https://discourse.julialang.org/u/ABHIJITH_S)\
**Replies:** 2\
**Last updated:** [September 12, 2023, 6:47am UTC](https://discourse.julialang.org/t/error-in-running-julia-file/103765 "2023-09-12T06:47:53Z")

</div>

Encountered a problem while running my first julia file. How do i open the file from the particular directory.

---

## [Semantics of \`@error\`](https://discourse.julialang.org/t/semantics-of-error/103760)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 1\
**Last updated:** [September 11, 2023, 9:00pm UTC](https://discourse.julialang.org/t/semantics-of-error/103760 "2023-09-11T21:00:05Z")

</div>

In doctest and CitationBibliography · Issue #34 · JuliaDocs/DocumenterCitations.jl · GitHub, the question came up what the semantics of the @error macro should be. Specifically, whether execution should continue after an…

---

## [How to use StatsBase.modes correctly with MLJ?](https://discourse.julialang.org/t/how-to-use-statsbase-modes-correctly-with-mlj/103721)

<div class="topic-metadata">

**Author:** [@roeya](https://discourse.julialang.org/u/roeya)\
**Replies:** 1\
**Last updated:** [September 11, 2023, 2:57am UTC](https://discourse.julialang.org/t/how-to-use-statsbase-modes-correctly-with-mlj/103721 "2023-09-11T02:57:26Z")

</div>

When trying to use StatsBase.modes of result of MLJ model fit I get error - ERROR: MethodError: no method matching iterate(::UnivariateFinite{Multiclass{2}, String, UInt32, Float64}) However if I use StatsBase.mode eve…

---

## [BenchmarkTools @btime breaks my function arguments](https://discourse.julialang.org/t/benchmarktools-btime-breaks-my-function-arguments/103710)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 2\
**Last updated:** [September 10, 2023, 12:00pm UTC](https://discourse.julialang.org/t/benchmarktools-btime-breaks-my-function-arguments/103710 "2023-09-10T12:00:51Z")

</div>

I have a package with an exported function that I want to benchmark. When I run the function without the @btime macro, it executes flawlessly. With the macro, however, it seems to mess with the input arguments in a way …

---

## [Revise with include chain](https://discourse.julialang.org/t/revise-with-include-chain/103684)

<div class="topic-metadata">

**Author:** [@Leibniz](https://discourse.julialang.org/u/Leibniz)\
**Replies:** 6\
**Last updated:** [September 9, 2023, 11:20pm UTC](https://discourse.julialang.org/t/revise-with-include-chain/103684 "2023-09-09T23:20:16Z")

</div>

Hi guys, how do I make Revise work properly here? File1: using Revise includet("testrevise1.jl") using .testrevise1 func() File “testrevise1.jl”: module testrevise1 export func include("testrevise2.jl") end F…

---

## [Phase field modeling](https://discourse.julialang.org/t/phase-field-modeling/103706)

<div class="topic-metadata">

**Author:** [@mary](https://discourse.julialang.org/u/mary)\
**Replies:** 0\
**Last updated:** [September 9, 2023, 7:01pm UTC](https://discourse.julialang.org/t/phase-field-modeling/103706 "2023-09-09T19:01:04Z")

</div>

Hi everyone. I am doing a phase field modeling for fracture in julia using gridap. I have done two different method:1- is the phase field modeling by applying displacement on a boundary incrementally which works. 2- i am…

---

## [Multiple Binaries from one Project](https://discourse.julialang.org/t/multiple-binaries-from-one-project/103701)

<div class="topic-metadata">

**Author:** [@ShalokShalom](https://discourse.julialang.org/u/ShalokShalom)\
**Replies:** 0\
**Last updated:** [September 9, 2023, 12:16pm UTC](https://discourse.julialang.org/t/multiple-binaries-from-one-project/103701 "2023-09-09T12:16:34Z")

</div>

Hi, lovely community I am on the journey to port one of my projects to Julia, and I like to export several binaries under one umbrella. The background of this is, so that you can better understand, that my fish shell d…

---

## [Cached data and thread safety](https://discourse.julialang.org/t/cached-data-and-thread-safety/103665)

<div class="topic-metadata">

**Author:** [@Pavel\_Kalouguine](https://discourse.julialang.org/u/Pavel_Kalouguine)\
**Replies:** 4\
**Last updated:** [September 9, 2023, 10:37am UTC](https://discourse.julialang.org/t/cached-data-and-thread-safety/103665 "2023-09-09T10:37:16Z")

</div>

Consider the situation where numerous lightweight objects depend all on a heavy-weight context (something akin to the Flyweight pattern in OOP). Here’s how it looks like in my projects: The heavy-weight context: mutabl…

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

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