# New to Julia

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

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

**Page:** 26

---

## [Package directories query](https://discourse.julialang.org/t/package-directories-query/123626)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 21\
**Last updated:** [December 10, 2024, 4:28pm UTC](https://discourse.julialang.org/t/package-directories-query/123626 "2024-12-10T16:28:44Z")

</div>

This question is based from information present in this documentation page: Code Loading · The Julia Language Specifically, under the Package directories section, the following is written: Which dependencies a packa…

---

## [Use of \`global\` in a module for global variable is pointless?](https://discourse.julialang.org/t/use-of-global-in-a-module-for-global-variable-is-pointless/123669)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 1\
**Last updated:** [December 10, 2024, 4:26pm UTC](https://discourse.julialang.org/t/use-of-global-in-a-module-for-global-variable-is-pointless/123669 "2024-12-10T16:26:17Z")

</div>

A quick query about the use of global in a module. module MyModule global gTest = nothing end module MyModule gTest = nothing end I think these two codes are exactly identical with no difference between them. Is t…

---

## [Module with global variables vs initialization with \`\_\_init\_\_\` function](https://discourse.julialang.org/t/module-with-global-variables-vs-initialization-with-init-function/123668)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 2\
**Last updated:** [December 10, 2024, 4:21pm UTC](https://discourse.julialang.org/t/module-with-global-variables-vs-initialization-with-init-function/123668 "2024-12-10T16:21:46Z")

</div>

Quick query about modules. Is there any difference between writing a module with initialized global variables and using an \_\_init\_\_ function to initialize those variables? Allow me to explain with two demonstrations mo…

---

## [Is there a particular reason why one sense algorithm will give an error whereas other will not?](https://discourse.julialang.org/t/is-there-a-particular-reason-why-one-sense-algorithm-will-give-an-error-whereas-other-will-not/123667)

<div class="topic-metadata">

**Author:** [@sunaina2821](https://discourse.julialang.org/u/sunaina2821)\
**Replies:** 0\
**Last updated:** [December 10, 2024, 3:41pm UTC](https://discourse.julialang.org/t/is-there-a-particular-reason-why-one-sense-algorithm-will-give-an-error-whereas-other-will-not/123667 "2024-12-10T15:41:22Z")

</div>

So, my script completely works when I use the ForwardDiffSensitivity() algorithm to solve the ODE but it does not work when I use QuadratureAdjoint(autojacvec=ZygoteVJP(true)). I will probably update this with a MWE late…

---

## [Decoupling of differential equation not presenting good correlation](https://discourse.julialang.org/t/decoupling-of-differential-equation-not-presenting-good-correlation/123655)

<div class="topic-metadata">

**Author:** [@Mishal](https://discourse.julialang.org/u/Mishal)\
**Replies:** 5\
**Last updated:** [December 10, 2024, 2:28pm UTC](https://discourse.julialang.org/t/decoupling-of-differential-equation-not-presenting-good-correlation/123655 "2024-12-10T14:28:14Z")

</div>

Hi Guys Please refer to the below code. I am not going to break down the mathematics, but this system essentially presents a cart with a vertical pendulum that has a rotational stiffness, the cart also has a spring atta…

---

## [Why doesn't the VS Code Julia Extension jump to definitions for Standard Library types, when it will jump to definitions for installed packages?](https://discourse.julialang.org/t/why-doesnt-the-vs-code-julia-extension-jump-to-definitions-for-standard-library-types-when-it-will-jump-to-definitions-for-installed-packages/123616)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 7\
**Last updated:** [December 10, 2024, 2:04pm UTC](https://discourse.julialang.org/t/why-doesnt-the-vs-code-julia-extension-jump-to-definitions-for-standard-library-types-when-it-will-jump-to-definitions-for-installed-packages/123616 "2024-12-10T14:04:04Z")

</div>

I am doing some tests with Julia and VS Code to try and figure out why the Julia Extension doesn’t seem to be able to find definitions for some functions. I wrote a short test file containing the following contents. us…

---

## [Handling dependencies for non-src, non-test code](https://discourse.julialang.org/t/handling-dependencies-for-non-src-non-test-code/123634)

<div class="topic-metadata">

**Author:** [@NelisDrost](https://discourse.julialang.org/u/NelisDrost)\
**Replies:** 1\
**Last updated:** [December 10, 2024, 3:47am UTC](https://discourse.julialang.org/t/handling-dependencies-for-non-src-non-test-code/123634 "2024-12-10T03:47:37Z")

</div>

I’m developing a package that has a different set of dependencies during development than it should for the user. Specifically, the user version depends on a specific set of DifferentialEquations packages, rather than th…

---

## [Using or import search current directory?](https://discourse.julialang.org/t/using-or-import-search-current-directory/123463)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 68\
**Last updated:** [December 9, 2024, 9:03pm UTC](https://discourse.julialang.org/t/using-or-import-search-current-directory/123463 "2024-12-09T21:03:04Z")

</div>

This is really an idea which comes from Python. (Rust uses it too, actually.) Please don’t write it off just for this reason, as there is a practical problem to be solved here. Consider the following example package. M…

---

## [Formatting problems with Greek letters julia](https://discourse.julialang.org/t/formatting-problems-with-greek-letters-julia/123627)

<div class="topic-metadata">

**Author:** [@Hani.G](https://discourse.julialang.org/u/Hani.G)\
**Replies:** 3\
**Last updated:** [December 9, 2024, 8:30pm UTC](https://discourse.julialang.org/t/formatting-problems-with-greek-letters-julia/123627 "2024-12-09T20:30:30Z")

</div>

Hello everyone! Config: vscode; Win11-64bits; JuliaMono (Release v0.058) I would like to know if anyone else has had to deal with a problem with Greek letters font formatting and how to solve it, if you know of any sol…

---

## [Task termination](https://discourse.julialang.org/t/task-termination/25231)

<div class="topic-metadata">

**Author:** [@tomhaber](https://discourse.julialang.org/u/tomhaber)\
**Replies:** 7\
**Last updated:** [December 9, 2024, 1:53pm UTC](https://discourse.julialang.org/t/task-termination/25231 "2024-12-09T13:53:23Z")

</div>

I’m trying to get the following to work (or something like it) function execute(f::Function) exec = Executor() t = schedule(@task try while true run!(exec) yield() …

---

## [Embedding julia to extend c++ app for long developing code](https://discourse.julialang.org/t/embedding-julia-to-extend-c-app-for-long-developing-code/123580)

<div class="topic-metadata">

**Author:** [@Sergey](https://discourse.julialang.org/u/Sergey)\
**Replies:** 9\
**Last updated:** [December 8, 2024, 7:09pm UTC](https://discourse.julialang.org/t/embedding-julia-to-extend-c-app-for-long-developing-code/123580 "2024-12-08T19:09:50Z")

</div>

Hi everyone! I face with interesting problem. I need a language to extend existence c++ software. Support user functions, add optimization over calculations and possible neural network experiments with solution. The …

---

## [Julia Language Server (VS Code Julia Extension) "missing reference"](https://discourse.julialang.org/t/julia-language-server-vs-code-julia-extension-missing-reference/123545)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 9\
**Last updated:** [December 8, 2024, 3:38pm UTC](https://discourse.julialang.org/t/julia-language-server-vs-code-julia-extension-missing-reference/123545 "2024-12-08T15:38:12Z")

</div>

What is required for the Julia Language Server to recognize packages which I am writing locally? Can someone show a short example of a repo structure which the Julia Language Server will recognize correctly? Everything…

---

## [Print vs write](https://discourse.julialang.org/t/print-vs-write/123560)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 5\
**Last updated:** [December 8, 2024, 9:38am UTC](https://discourse.julialang.org/t/print-vs-write/123560 "2024-12-08T09:38:11Z")

</div>

Hello, I have a file like below: Hello Hello I want to write a program that reads this file and writes its contents along with line numbers to another file. I wrote the following program: function readwrite() inn…

---

## [Why the parenthesis around \`(@main)\`?](https://discourse.julialang.org/t/why-the-parenthesis-around-main/123017)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 17\
**Last updated:** [December 8, 2024, 1:43am UTC](https://discourse.julialang.org/t/why-the-parenthesis-around-main/123017 "2024-12-08T01:43:28Z")

</div>

Since Julia’s most recent release (1.11) it seems the de-facto way to write a main (entrypoint function) is function (@main)(args) println("hello world") end Why the parenthesis around @main? Not that it matters, …

---

## [Can the Julia shell be changed to \`/bin/bash\`?](https://discourse.julialang.org/t/can-the-julia-shell-be-changed-to-bin-bash/122500)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 3\
**Last updated:** [December 7, 2024, 10:02pm UTC](https://discourse.julialang.org/t/can-the-julia-shell-be-changed-to-bin-bash/122500 "2024-12-07T22:02:32Z")

</div>

I’ve just learned that the Julia shell is not /bin/sh as I had assumed. It is it’s own thing, apparently. Can the default shell be changed so that a /bin/bash shell is launched when the Shell Mode key ; is pressed? I’m…

---

## [LegendreBasis from DiffEqFlux is not present in current version?](https://discourse.julialang.org/t/legendrebasis-from-diffeqflux-is-not-present-in-current-version/123568)

<div class="topic-metadata">

**Author:** [@Luis\_Reig\_Quilis](https://discourse.julialang.org/u/Luis_Reig_Quilis)\
**Replies:** 3\
**Last updated:** [December 7, 2024, 5:51pm UTC](https://discourse.julialang.org/t/legendrebasis-from-diffeqflux-is-not-present-in-current-version/123568 "2024-12-07T17:51:41Z")

</div>

Good day, everyone. I am trying to follow this tutorial from DiffEqFlux. During the second step of the tutorial, we have to create a TensorLayer to perform 10th order expansions in a Legendre Basis using the following …

---

## [Comparing characters](https://discourse.julialang.org/t/comparing-characters/123442)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 2\
**Last updated:** [December 7, 2024, 6:58am UTC](https://discourse.julialang.org/t/comparing-characters/123442 "2024-12-07T06:58:49Z")

</div>

Hello, I have a file like the following: Where The Mind ~ Is Without Fear I wrote the following program to compare characters and find the largest character: function compare() inn = open("input.txt","r") ch …

---

## [Solving a PDE but no plots are returned](https://discourse.julialang.org/t/solving-a-pde-but-no-plots-are-returned/123493)

<div class="topic-metadata">

**Author:** [@Jax\_Xu](https://discourse.julialang.org/u/Jax_Xu)\
**Replies:** 9\
**Last updated:** [December 7, 2024, 2:44am UTC](https://discourse.julialang.org/t/solving-a-pde-but-no-plots-are-returned/123493 "2024-12-07T02:44:45Z")

</div>

Hi Community! I am practicing solving a basic one-dimensional diffusion equation in Julia and hoping to get familiar with Julia asap. I fixed up the local scope parameters by using ‘global’ to define ‘u’ and ‘b’ in my l…

---

## [How to write an \`include\_once\` function?](https://discourse.julialang.org/t/how-to-write-an-include-once-function/123496)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 5\
**Last updated:** [December 6, 2024, 11:26pm UTC](https://discourse.julialang.org/t/how-to-write-an-include-once-function/123496 "2024-12-06T23:26:15Z")

</div>

Closely related to this recent post: Using or import search current directory? Is it possible to write an include\_once function, which calls include, but only once. function include\_once(path) if not run before …

---

## [What is the intended use case for \`JULIA\_LOAD\_PATH\` and \`JULIA\_DEPOT\_PATH\`?](https://discourse.julialang.org/t/what-is-the-intended-use-case-for-julia-load-path-and-julia-depot-path/123452)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 15\
**Last updated:** [December 6, 2024, 7:18pm UTC](https://discourse.julialang.org/t/what-is-the-intended-use-case-for-julia-load-path-and-julia-depot-path/123452 "2024-12-06T19:18:01Z")

</div>

My reading of the docs causes me to conclude the following: Environment Variables · The Julia Language JULIA\_DEPOT\_PATH controls where Julia will save packages downloaded via pkg If set, JULIA\_DEPOT\_PATH specifi…

---

## [Why isn't there a non-! version of deleteat!()?](https://discourse.julialang.org/t/why-isnt-there-a-non-version-of-deleteat/123355)

<div class="topic-metadata">

**Author:** [@francisbarton](https://discourse.julialang.org/u/francisbarton)\
**Replies:** 8\
**Last updated:** [December 6, 2024, 12:29pm UTC](https://discourse.julialang.org/t/why-isnt-there-a-non-version-of-deleteat/123355 "2024-12-06T12:29:41Z")

</div>

I just used the following bit of code in an Advent of Code puzzle, to sequentially alter a vector by removing one of its elements in turn: deleteat!(copy(r), i) for i in 1:length(r) I believe I had to use copy() here, …

---

## [Is there a way to suppress Julia from loading the \`startup.jl\` file, using a command line flag?](https://discourse.julialang.org/t/is-there-a-way-to-suppress-julia-from-loading-the-startup-jl-file-using-a-command-line-flag/123530)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 3\
**Last updated:** [December 6, 2024, 11:33am UTC](https://discourse.julialang.org/t/is-there-a-way-to-suppress-julia-from-loading-the-startup-jl-file-using-a-command-line-flag/123530 "2024-12-06T11:33:33Z")

</div>

I’m doing some testing, and I need a way to do two things: Load a temporary, customized startup.jl file Stop Julia from automatically loading startup.jl, which in this particular case is the one from the users home dir…

---

## [Integrating Julia into a JUCE Plugin](https://discourse.julialang.org/t/integrating-julia-into-a-juce-plugin/123468)

<div class="topic-metadata">

**Author:** [@seclorum](https://discourse.julialang.org/u/seclorum)\
**Replies:** 4\
**Last updated:** [December 6, 2024, 9:24am UTC](https://discourse.julialang.org/t/integrating-julia-into-a-juce-plugin/123468 "2024-12-06T09:24:28Z")

</div>

Hi there, I’m pretty new to Julia and decided to bite off a huge chunk of technical naivete and try to integrate a simple Julia module (a port of Tony Hardy-Bicks DFM1 Korg MS20 filter) into a JUCE Plugin project. My r…

---

## [OAuth 2.0 Authentication in pure Julia](https://discourse.julialang.org/t/oauth-2-0-authentication-in-pure-julia/33135)

<div class="topic-metadata">

**Author:** [@ASF](https://discourse.julialang.org/u/ASF)\
**Replies:** 5\
**Last updated:** [December 6, 2024, 7:28am UTC](https://discourse.julialang.org/t/oauth-2-0-authentication-in-pure-julia/33135 "2024-12-06T07:28:28Z")

</div>

I want to grab some data through an API call but I need to authenticate my requests via oauth2. What is the easiest way to do this in pure Julia?

---

## [Show and showcompact on custom types](https://discourse.julialang.org/t/show-and-showcompact-on-custom-types/8493)

<div class="topic-metadata">

**Author:** [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Replies:** 18\
**Last updated:** [December 5, 2024, 8:45pm UTC](https://discourse.julialang.org/t/show-and-showcompact-on-custom-types/8493 "2024-12-05T20:45:28Z")

</div>

I am trying to define a custom type with convenient methods for readout, and having some very basic trouble. I have read the documentation for show with no luck in sorting this out. Defining a method for Base.show(::IO, …

---

## [Solving a coupled differential equation](https://discourse.julialang.org/t/solving-a-coupled-differential-equation/123482)

<div class="topic-metadata">

**Author:** [@fanzhy171](https://discourse.julialang.org/u/fanzhy171)\
**Replies:** 5\
**Last updated:** [December 5, 2024, 11:04am UTC](https://discourse.julialang.org/t/solving-a-coupled-differential-equation/123482 "2024-12-05T11:04:18Z")

</div>

Hello everyone, I am new to julia and try to use it to solve my problem, which involves solving coupled differential equations. I will show my problem below: Here is my attempted solution: using DifferentialEquation…

---

## [Callback error: " no method matching isless(::Float64, ::Vector{Float64})"](https://discourse.julialang.org/t/callback-error-no-method-matching-isless-float64-vector-float64/123476)

<div class="topic-metadata">

**Author:** [@Jordie](https://discourse.julialang.org/u/Jordie)\
**Replies:** 1\
**Last updated:** [December 5, 2024, 6:56am UTC](https://discourse.julialang.org/t/callback-error-no-method-matching-isless-float64-vector-float64/123476 "2024-12-05T06:56:52Z")

</div>

Hi everyone, I’m trying to use a callback function. I’m not sure how the callback function works and am trying out this very simple script, but it has not been working. Here is the script: ### Installs all relevant pac…

---

## [When should I define my own \`deepcopy\` and \`copy\` functions for types, if ever?](https://discourse.julialang.org/t/when-should-i-define-my-own-deepcopy-and-copy-functions-for-types-if-ever/123447)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 10\
**Last updated:** [December 4, 2024, 3:24pm UTC](https://discourse.julialang.org/t/when-should-i-define-my-own-deepcopy-and-copy-functions-for-types-if-ever/123447 "2024-12-04T15:24:52Z")

</div>

Just wanted to understand if I should define deepcopy and copy for my own types, if at all. Looking at the code suggests to me deepcopy is automatic, and therefore there is generally no need to define it for user define…

---

## [Reading characters until the space key is pressed](https://discourse.julialang.org/t/reading-characters-until-the-space-key-is-pressed/123408)

<div class="topic-metadata">

**Author:** [@hack3rcon](https://discourse.julialang.org/u/hack3rcon)\
**Replies:** 2\
**Last updated:** [December 4, 2024, 9:32am UTC](https://discourse.julialang.org/t/reading-characters-until-the-space-key-is-pressed/123408 "2024-12-04T09:32:56Z")

</div>

Hello, I want to write a program that receives data from the input and terminates the program as soon as the space key is pressed. I wrote the following program: function space() print("Please write something: ") …

---

## [Julia test directory \`test\` or \`tests\`?](https://discourse.julialang.org/t/julia-test-directory-test-or-tests/123426)

<div class="topic-metadata">

**Author:** [@world-peace](https://discourse.julialang.org/u/world-peace)\
**Replies:** 1\
**Last updated:** [December 3, 2024, 9:26pm UTC](https://discourse.julialang.org/t/julia-test-directory-test-or-tests/123426 "2024-12-03T21:26:52Z")

</div>

This documentation page suggests the correct name for unit test directory is test 5. Creating Packages · Pkg.jl On the other hand, this documentation page suggests the correct name is tests Unit Testing · The Julia …

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

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