# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=659

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

**Page:** 660

---

## [Running a code block in Juno?](https://discourse.julialang.org/t/running-a-code-block-in-juno/53010)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 2\
**Last updated:** [January 7, 2021, 10:08pm UTC](https://discourse.julialang.org/t/running-a-code-block-in-juno/53010 "2021-01-07T22:08:03Z")

</div>

Is there a way (such as a keystroke) to run a “cell” (or “block”) of code in Juno? For example, when using Spyder for Python, one can use the symbol #&& to create a “cell”. Clicking inside of that cell and using Ctrl+Ent…

---

## [What happens if two packages require each other?](https://discourse.julialang.org/t/what-happens-if-two-packages-require-each-other/3108)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 9\
**Last updated:** [January 7, 2021, 9:27pm UTC](https://discourse.julialang.org/t/what-happens-if-two-packages-require-each-other/3108 "2021-01-07T21:27:30Z")

</div>

Has this chicken & the egg problem already been resolved? edit: for clarity, this could be: shallow mutual requiring ( a deps on b && b deps on a ) or requiring each other through some intermediary packages ( a deps…

---

## [Does Project.toml for tests directory need a \[compat\] section?](https://discourse.julialang.org/t/does-project-toml-for-tests-directory-need-a-compat-section/53002)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 1\
**Last updated:** [January 7, 2021, 7:25pm UTC](https://discourse.julialang.org/t/does-project-toml-for-tests-directory-need-a-compat-section/53002 "2021-01-07T19:25:24Z")

</div>

Let’s say I specify test dependencies in special “name\_of\_package/test/Project.toml” file. Does it need to have a separate \[compat\] section? Can the compatibility versions differ from the ones in the main “Project.toml”…

---

## [Launching with JULIA\_NUM\_THREADS=\<max\>](https://discourse.julialang.org/t/launching-with-julia-num-threads-max/52964)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 2\
**Last updated:** [January 7, 2021, 6:17pm UTC](https://discourse.julialang.org/t/launching-with-julia-num-threads-max/52964 "2021-01-07T18:17:11Z")

</div>

Is there any drawback to always launching julia with the number of existing cpu cores? Suppose my cpu has 4 cores, and I need to do some non-production stuff like debugging, etc: # cpu with 4 cores firefox & export JUL…

---

## [Do \`@propagate\_inbounds\` stack together?](https://discourse.julialang.org/t/do-propagate-inbounds-stack-together/52996)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 1\
**Last updated:** [January 7, 2021, 5:17pm UTC](https://discourse.julialang.org/t/do-propagate-inbounds-stack-together/52996 "2021-01-07T17:17:10Z")

</div>

The documentation says that @propagate\_inbounds add additional layer of inlining for eliding @boundscheck blocks. That means, that if you have more than two levels of inlining, eliding does not work. If the function at …

---

## [Efficient reshaping of 2D array by pairs of columns](https://discourse.julialang.org/t/efficient-reshaping-of-2d-array-by-pairs-of-columns/52953)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 9\
**Last updated:** [January 7, 2021, 4:56pm UTC](https://discourse.julialang.org/t/efficient-reshaping-of-2d-array-by-pairs-of-columns/52953 "2021-01-07T16:56:28Z")

</div>

Hi, I’m building up an MC code that has to run fast and efficiently. At one step I need to reshape a large array with two columns into an array with much less columns and many more rows. A very simple example woudl be t…

---

## [Wiener process for Lorenz system](https://discourse.julialang.org/t/wiener-process-for-lorenz-system/52995)

<div class="topic-metadata">

**Author:** [@AhmedAlreweny](https://discourse.julialang.org/u/AhmedAlreweny)\
**Replies:** 1\
**Last updated:** [January 7, 2021, 3:40pm UTC](https://discourse.julialang.org/t/wiener-process-for-lorenz-system/52995 "2021-01-07T15:40:24Z")

</div>

I want to solve Lorenz system as a SDE with Wiener process added as noise. I was wondering if this is the correct way to represent this problem ? According to my understanding, the diagonal noise added here has the same …

---

## [Import functions using include in Pluto](https://discourse.julialang.org/t/import-functions-using-include-in-pluto/52993)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 0\
**Last updated:** [January 7, 2021, 2:49pm UTC](https://discourse.julialang.org/t/import-functions-using-include-in-pluto/52993 "2021-01-07T14:49:18Z")

</div>

My current workflow with Julia involves having one file where I define a bunch of functions, and then I write scripts which look like this: using Revise includet(joinpath(@\_\_DIR\_\_, "util.jl")) # and then I do stuff I’v…

---

## [Adding rows to a matrix dynamically](https://discourse.julialang.org/t/adding-rows-to-a-matrix-dynamically/52984)

<div class="topic-metadata">

**Author:** [@Rajesh-Nakka](https://discourse.julialang.org/u/Rajesh-Nakka)\
**Replies:** 4\
**Last updated:** [January 7, 2021, 2:00pm UTC](https://discourse.julialang.org/t/adding-rows-to-a-matrix-dynamically/52984 "2021-01-07T14:00:08Z")

</div>

I am trying to get:= Initialize a matrix of Float64 then adding rows to it dynamically in a loop! I tried with push! and append! but not able to find the right way to do it. I am currently using a not so efficient metho…

---

## [Demoting BigInt to Int64](https://discourse.julialang.org/t/demoting-bigint-to-int64/52968)

<div class="topic-metadata">

**Author:** [@gmouts](https://discourse.julialang.org/u/gmouts)\
**Replies:** 6\
**Last updated:** [January 7, 2021, 9:06am UTC](https://discourse.julialang.org/t/demoting-bigint-to-int64/52968 "2021-01-07T09:06:41Z")

</div>

I need to read some numbers from a file and then do things with them. In theory I may get numbers that are bigger than 2^{128} so I parse them as BigInt. However, usually they are smaller than 2^{63} so Int64 is enough. …

---

## [Deploying username.github.io with Franklin.jl](https://discourse.julialang.org/t/deploying-username-github-io-with-franklin-jl/52966)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 2\
**Last updated:** [January 7, 2021, 6:09am UTC](https://discourse.julialang.org/t/deploying-username-github-io-with-franklin-jl/52966 "2021-01-07T06:09:19Z")

</div>

I’m trying to publish a static webpage to cadojo.github.io with Franklin.jl (my username is cadojo on GitHub). When I use Franklin.serve(), the webpage loads as expected: However, when I check the version published …

---

## ["Bounds Error" when trying to solve an ODE system](https://discourse.julialang.org/t/bounds-error-when-trying-to-solve-an-ode-system/52537)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 6\
**Last updated:** [January 6, 2021, 11:48pm UTC](https://discourse.julialang.org/t/bounds-error-when-trying-to-solve-an-ode-system/52537 "2021-01-06T23:48:04Z")

</div>

I’m trying to solve an ODE system in Julia for the first time and I’ve encountered an error that I don’t understand. I’m just trying to solve a simple SEIR model with some arbitrary parameter values and initial condition…

---

## [Cannot add any packages under Julia 1.5.3 (Windows 10)](https://discourse.julialang.org/t/cannot-add-any-packages-under-julia-1-5-3-windows-10/52961)

<div class="topic-metadata">

**Author:** [@neophytedave](https://discourse.julialang.org/u/neophytedave)\
**Replies:** 6\
**Last updated:** [January 6, 2021, 11:34pm UTC](https://discourse.julialang.org/t/cannot-add-any-packages-under-julia-1-5-3-windows-10/52961 "2021-01-06T23:34:21Z")

</div>

I am using Julia 1.5.3 under Windows 10, and cannot add any packages. The problem is not a misspelt package name. I have been able to add packages with all previous versions. I notice that, when attempting to add packa…

---

## [How to reference new variables in a combine for dataframes?](https://discourse.julialang.org/t/how-to-reference-new-variables-in-a-combine-for-dataframes/52851)

<div class="topic-metadata">

**Author:** [@bdeonovic](https://discourse.julialang.org/u/bdeonovic)\
**Replies:** 4\
**Last updated:** [January 6, 2021, 8:13pm UTC](https://discourse.julialang.org/t/how-to-reference-new-variables-in-a-combine-for-dataframes/52851 "2021-01-06T20:13:48Z")

</div>

Posted this on slack, but I think I’ll move over to using discourse more (I’ll post a cross link) when doing split-apply-combine with a DataFrame is there anyway for the apply transformations to reference previously cal…

---

## [Flux usage: Sending callback function to CPU on a separate thread](https://discourse.julialang.org/t/flux-usage-sending-callback-function-to-cpu-on-a-separate-thread/52925)

<div class="topic-metadata">

**Author:** [@groovyda](https://discourse.julialang.org/u/groovyda)\
**Replies:** 2\
**Last updated:** [January 6, 2021, 5:26pm UTC](https://discourse.julialang.org/t/flux-usage-sending-callback-function-to-cpu-on-a-separate-thread/52925 "2021-01-06T17:26:07Z")

</div>

Hi there I was trying to run the Vision vgg16 model in the model-zoo in Flux. https://github.com/FluxML/model-zoo/blob/master/vision/cifar10/cifar10.jl I found that the performance on the GPU was quite slow - mainly du…

---

## [Julia called from Matlab](https://discourse.julialang.org/t/julia-called-from-matlab/52952)

<div class="topic-metadata">

**Author:** [@guigomes](https://discourse.julialang.org/u/guigomes)\
**Replies:** 1\
**Last updated:** [January 6, 2021, 5:48pm UTC](https://discourse.julialang.org/t/julia-called-from-matlab/52952 "2021-01-06T17:48:57Z")

</div>

How to interact Julia with Matlab?

---

## [The quasi-best MaxN function](https://discourse.julialang.org/t/the-quasi-best-maxn-function/52813)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 12\
**Last updated:** [January 6, 2021, 5:26pm UTC](https://discourse.julialang.org/t/the-quasi-best-maxn-function/52813 "2021-01-06T17:26:31Z")

</div>

I have not found among the library functions a function that finds the first N maximum values of a list. I tried to define some functions and make performance comparisons. I found two kinds of problems: one was to find a…

---

## [Suggestions to wrap the inputs for a Diff Equation solver (types and structures)](https://discourse.julialang.org/t/suggestions-to-wrap-the-inputs-for-a-diff-equation-solver-types-and-structures/52929)

<div class="topic-metadata">

**Author:** [@tiago](https://discourse.julialang.org/u/tiago)\
**Replies:** 14\
**Last updated:** [January 6, 2021, 3:42pm UTC](https://discourse.julialang.org/t/suggestions-to-wrap-the-inputs-for-a-diff-equation-solver-types-and-structures/52929 "2021-01-06T15:42:01Z")

</div>

Hello, I’m currently developing a package of a numerical solver to a certain kind of Stochastic PDE (Stochastic Neural Field Equations) in 1 and 2-dimensional space in a DifferentialEquations.jl fashion, i.e. with the us…

---

## [Type instability when indexing](https://discourse.julialang.org/t/type-instability-when-indexing/52918)

<div class="topic-metadata">

**Author:** [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Replies:** 8\
**Last updated:** [January 6, 2021, 6:08am UTC](https://discourse.julialang.org/t/type-instability-when-indexing/52918 "2021-01-06T06:08:45Z")

</div>

I’m trying to understand why type instability appears for certain indexing operations. Suppose I define three functions (MWE for a longer code where type parameter d is used to index into part of a tuple/array) struct b…

---

## [Question about SubString in DataFrames](https://discourse.julialang.org/t/question-about-substring-in-dataframes/52910)

<div class="topic-metadata">

**Author:** [@florian](https://discourse.julialang.org/u/florian)\
**Replies:** 1\
**Last updated:** [January 6, 2021, 2:38am UTC](https://discourse.julialang.org/t/question-about-substring-in-dataframes/52910 "2021-01-06T02:38:41Z")

</div>

Hi everyone, I have a question about SubStrings. The documentation states that they are views into a parent string. Suppose I want to clean up the following DataFrame: df = DataFrame(type\_year = \[“Red 2019”, “Red 2020…

---

## [Use condition result inside conditional](https://discourse.julialang.org/t/use-condition-result-inside-conditional/52893)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 8\
**Last updated:** [January 6, 2021, 1:58am UTC](https://discourse.julialang.org/t/use-condition-result-inside-conditional/52893 "2021-01-06T01:58:19Z")

</div>

I find myself with some frequency having to test a condition and, if that condition returns some value, do something with that value. For example: x = \[ 1, 2, 3 \] itest = findfirst(isequal(2),x) # get value if itest != …

---

## [Slow start up and package loading times](https://discourse.julialang.org/t/slow-start-up-and-package-loading-times/52639)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 42\
**Last updated:** [January 6, 2021, 1:40am UTC](https://discourse.julialang.org/t/slow-start-up-and-package-loading-times/52639 "2021-01-06T01:40:53Z")

</div>

I’m new to Julia, and I’m a little dismayed by what seems like excessively long times for starting up the kernel and and loading packages. First I timed how long it took for julia\> to appear in the REPL, starting from th…

---

## [Solving equation within Distributed loop](https://discourse.julialang.org/t/solving-equation-within-distributed-loop/52905)

<div class="topic-metadata">

**Author:** [@danicaratelli](https://discourse.julialang.org/u/danicaratelli)\
**Replies:** 3\
**Last updated:** [January 6, 2021, 12:00am UTC](https://discourse.julialang.org/t/solving-equation-within-distributed-loop/52905 "2021-01-06T00:00:11Z")

</div>

Hello, I am trying to solve an equation within a distributed loop. A MWE follows: using Distributed addprocs(2); include("newfile.jl") #Parameters: par1 = 5; par2 = 2; @everywhere begin using CSV, DataFrames, Blac…

---

## [Distributed loop and "include"](https://discourse.julialang.org/t/distributed-loop-and-include/52886)

<div class="topic-metadata">

**Author:** [@danicaratelli](https://discourse.julialang.org/u/danicaratelli)\
**Replies:** 4\
**Last updated:** [January 5, 2021, 5:19pm UTC](https://discourse.julialang.org/t/distributed-loop-and-include/52886 "2021-01-05T17:19:56Z")

</div>

Hello. My question is how I include an external file within a distributed loop. For example, the following works: using Distributed addprocs(2); #Parameters: par1 = 5; par2 = 2; @everywhere begin using CSV, DataF…

---

## [@everywhere and Dictionaries](https://discourse.julialang.org/t/everywhere-and-dictionaries/52880)

<div class="topic-metadata">

**Author:** [@danicaratelli](https://discourse.julialang.org/u/danicaratelli)\
**Replies:** 6\
**Last updated:** [January 5, 2021, 4:28pm UTC](https://discourse.julialang.org/t/everywhere-and-dictionaries/52880 "2021-01-05T16:28:23Z")

</div>

I am running some code in parallel. I have some parameters that I save in a dictionary: mod\_pars = Dict("par1"=\>par1,"par2"=\>par2); and for different values of par1 I want to run a particular function. So given a list…

---

## [Custom broadcasting](https://discourse.julialang.org/t/custom-broadcasting/39945)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 5\
**Last updated:** [January 5, 2021, 1:27pm UTC](https://discourse.julialang.org/t/custom-broadcasting/39945 "2021-01-05T13:27:43Z")

</div>

After spending quite a bit of time in the Customizing broadcasting section of the doc, reading a few questions here and trawling through the source code of StaticArrays.jl I’m throwing the sponge. (Once I’ve figured thi…

---

## [Passing multiple C arguments to Julia function](https://discourse.julialang.org/t/passing-multiple-c-arguments-to-julia-function/51607)

<div class="topic-metadata">

**Author:** [@eduardovrs](https://discourse.julialang.org/u/eduardovrs)\
**Replies:** 4\
**Last updated:** [January 5, 2021, 9:33am UTC](https://discourse.julialang.org/t/passing-multiple-c-arguments-to-julia-function/51607 "2021-01-05T09:33:59Z")

</div>

Passing multiple C arguments to Julia function Hello, I am new to Julia, and I am trying to pass some C arguments to Julia. So far, I was able to send only one argument from C to Julia, but when trying to send multipl…

---

## [Doubt about using Clang.jl](https://discourse.julialang.org/t/doubt-about-using-clang-jl/36599)

<div class="topic-metadata">

**Author:** [@amCap1712](https://discourse.julialang.org/u/amCap1712)\
**Replies:** 15\
**Last updated:** [January 5, 2021, 7:18am UTC](https://discourse.julialang.org/t/doubt-about-using-clang-jl/36599 "2021-01-05T07:18:04Z")

</div>

I am trying to use to Clang.jl to parse header files for GNUAstro. GNUAstro has a dependency called wcslib. When I try to run the generated .jl file, I get the error that wcsperm is not defined. That makes sense because w…

---

## [Loading packages programmatically in a different module](https://discourse.julialang.org/t/loading-packages-programmatically-in-a-different-module/52777)

<div class="topic-metadata">

**Author:** [@felix](https://discourse.julialang.org/u/felix)\
**Replies:** 4\
**Last updated:** [January 5, 2021, 6:23am UTC](https://discourse.julialang.org/t/loading-packages-programmatically-in-a-different-module/52777 "2021-01-05T06:23:33Z")

</div>

Hello, for an experimental idea I would like to try to create and manipulate modules on the fly, including letting them use packages. I’m struggling to understand/get hints from the docs about this, so I wanted to ask fo…

---

## [Access package documentation in REPL](https://discourse.julialang.org/t/access-package-documentation-in-repl/51262)

<div class="topic-metadata">

**Author:** [@devel-chm](https://discourse.julialang.org/u/devel-chm)\
**Replies:** 7\
**Last updated:** [January 5, 2021, 1:04am UTC](https://discourse.julialang.org/t/access-package-documentation-in-repl/51262 "2021-01-05T01:04:38Z")

</div>

Is there some way to view the package documentation from the REPL? If I use the help mode I get the following for an example: julia\> using TimeSeries \[ Info: Precompiling TimeSeries \[9e3dc215-6440-5c97-bce1-76c03772f…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=658)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=660)
