# General Usage

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

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

**Page:** 422

---

## [Macro names](https://discourse.julialang.org/t/macro-names/84378)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 1\
**Last updated:** [July 18, 2022, 7:14am UTC](https://discourse.julialang.org/t/macro-names/84378 "2022-07-18T07:14:45Z")

</div>

using DataFrames, DataFramesMeta, DataFrameMacros using the above packages I have to preface some macro names with the package name. I presume this is because the same macro exists in multiple packages. Is there a way…

---

## [Graphs.jl : UndefVarError: nv not defined](https://discourse.julialang.org/t/graphs-jl-undefvarerror-nv-not-defined/84381)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 0\
**Last updated:** [July 18, 2022, 7:04am UTC](https://discourse.julialang.org/t/graphs-jl-undefvarerror-nv-not-defined/84381 "2022-07-18T07:04:30Z")

</div>

Hi all, I am using Jupyter Notebook on this tutorial https://pszufe.github.io/OpenStreetMapX\_Tutorial/JuliaCon2021/ I change LightGraphs into Graphs. Then there is an error when running this code: m = get\_map\_data("/…

---

## [Nothing/nothing location](https://discourse.julialang.org/t/nothing-nothing-location/84363)

<div class="topic-metadata">

**Author:** [@kurt](https://discourse.julialang.org/u/kurt)\
**Replies:** 5\
**Last updated:** [July 18, 2022, 1:08am UTC](https://discourse.julialang.org/t/nothing-nothing-location/84363 "2022-07-18T01:08:35Z")

</div>

Please, where is Nothing/nothing declared? Thank you ahead of time.

---

## [How to display two plots?](https://discourse.julialang.org/t/how-to-display-two-plots/84355)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [July 17, 2022, 4:44pm UTC](https://discourse.julialang.org/t/how-to-display-two-plots/84355 "2022-07-17T16:44:51Z")

</div>

How can I plot two plots on the screen? This does not work: using ControlSystems, Plots P₀ = tf(1.0, \[1, 1\]) p1=bodeplot(P₀) display(p1) p2=plot(step(P₀)) display(p2)

---

## [Weird behaviour of variable scope in Julia Loops](https://discourse.julialang.org/t/weird-behaviour-of-variable-scope-in-julia-loops/84359)

<div class="topic-metadata">

**Author:** [@shwetank\_verma](https://discourse.julialang.org/u/shwetank_verma)\
**Replies:** 1\
**Last updated:** [July 17, 2022, 3:49pm UTC](https://discourse.julialang.org/t/weird-behaviour-of-variable-scope-in-julia-loops/84359 "2022-07-17T15:49:33Z")

</div>

Hey everyone, I have noticed this peculiar behavior of variable scope inside the for loops in Julia. I am calling it peculiar as I have not seen this in Python. Consider this Python code: for i in range(1,10): if …

---

## [How to change branch name using \`LibGit2\`?](https://discourse.julialang.org/t/how-to-change-branch-name-using-libgit2/84353)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 4\
**Last updated:** [July 17, 2022, 12:57pm UTC](https://discourse.julialang.org/t/how-to-change-branch-name-using-libgit2/84353 "2022-07-17T12:57:07Z")

</div>

sorry, not sure which category suits best I am using LibGit2 to create a new git repository inside a package. I am doing something like: repo = LibGit2.init(path) sig = LibGit2.Signature("DrWatson", "no…

---

## [How to launch multiple Julia runs one after another?](https://discourse.julialang.org/t/how-to-launch-multiple-julia-runs-one-after-another/84351)

<div class="topic-metadata">

**Author:** [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Replies:** 4\
**Last updated:** [July 17, 2022, 12:36pm UTC](https://discourse.julialang.org/t/how-to-launch-multiple-julia-runs-one-after-another/84351 "2022-07-17T12:36:33Z")

</div>

I have 25 \*.jl files that need to be run one after another. Each of them could take an extended amount of time. Is there a way I can create a master\_run.jl file and tell Julia to run these 25 jl files one after another…

---

## [New warning msg from 1.8.0-rc3](https://discourse.julialang.org/t/new-warning-msg-from-1-8-0-rc3/84335)

<div class="topic-metadata">

**Author:** [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Replies:** 4\
**Last updated:** [July 17, 2022, 10:13am UTC](https://discourse.julialang.org/t/new-warning-msg-from-1-8-0-rc3/84335 "2022-07-17T10:13:58Z")

</div>

I’m getting WARNING: could not import Base.\_rangestyle into ArrayLayouts when I run CI for my package. This is new for 1.8.0-rc3. What does this mean? Is there something I need to do?

---

## [Including a variable outside a function in a log message](https://discourse.julialang.org/t/including-a-variable-outside-a-function-in-a-log-message/84347)

<div class="topic-metadata">

**Author:** [@florian](https://discourse.julialang.org/u/florian)\
**Replies:** 1\
**Last updated:** [July 17, 2022, 9:54am UTC](https://discourse.julialang.org/t/including-a-variable-outside-a-function-in-a-log-message/84347 "2022-07-17T09:54:42Z")

</div>

Assume I have a function that does some calculation on a piece of data and I want to log when somewthing goes wrong: struct MyData id::String number::Number end function main() data = \[MyData("a", -1), My…

---

## [Problems plotting a simple graph](https://discourse.julialang.org/t/problems-plotting-a-simple-graph/72533)

<div class="topic-metadata">

**Author:** [@Mark\_Williams](https://discourse.julialang.org/u/Mark_Williams)\
**Replies:** 5\
**Last updated:** [July 17, 2022, 6:38am UTC](https://discourse.julialang.org/t/problems-plotting-a-simple-graph/72533 "2022-07-17T06:38:55Z")

</div>

For some reason I can’t produce a plot of a graph from LightGraphs.jl using GraphPlot.jl. I’m quite new to Julia so not sure what else to try. using LightGraphs using GraphPlot sg = complete\_digraph(3) gplot(sg) I jus…

---

## [Moving from Genie to HTTP (or a linux socket)](https://discourse.julialang.org/t/moving-from-genie-to-http-or-a-linux-socket/84341)

<div class="topic-metadata">

**Author:** [@gmouts](https://discourse.julialang.org/u/gmouts)\
**Replies:** 0\
**Last updated:** [July 17, 2022, 1:33am UTC](https://discourse.julialang.org/t/moving-from-genie-to-http-or-a-linux-socket/84341 "2022-07-17T01:33:58Z")

</div>

I want to have a deamon running on a server and I would like to be able to change some parameters without restarting it. My guess was that the best way to do that was by using a socket. I played a bit with genie and I e…

---

## [Polynomial in n variables with AbstractAlgebra](https://discourse.julialang.org/t/polynomial-in-n-variables-with-abstractalgebra/84338)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 1\
**Last updated:** [July 16, 2022, 11:22pm UTC](https://discourse.julialang.org/t/polynomial-in-n-variables-with-abstractalgebra/84338 "2022-07-16T23:22:42Z")

</div>

Hello, Here is an example of the declaration of a multivariate polynomial with AbstractAlgebra: using AbstractAlgebra using Printf # used to write the result # define the symbolic constants SS, (a,b,c,d,sqrt3,w0) = Po…

---

## [Store in place results from function returning multiple arrays](https://discourse.julialang.org/t/store-in-place-results-from-function-returning-multiple-arrays/84336)

<div class="topic-metadata">

**Author:** [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Replies:** 8\
**Last updated:** [July 16, 2022, 10:48pm UTC](https://discourse.julialang.org/t/store-in-place-results-from-function-returning-multiple-arrays/84336 "2022-07-16T22:48:31Z")

</div>

What is the best practice to store in place the results of a function returning multiple arrays? A simple non-MWE: f(x,y,z) = 1 ./ x, y'.\*y, 2\*z # the actual function is long and complex, with matrix operations n…

---

## [Warning on setindex duplication](https://discourse.julialang.org/t/warning-on-setindex-duplication/84200)

<div class="topic-metadata">

**Author:** [@Marco\_Lombardi](https://discourse.julialang.org/u/Marco_Lombardi)\
**Replies:** 2\
**Last updated:** [July 14, 2022, 9:56pm UTC](https://discourse.julialang.org/t/warning-on-setindex-duplication/84200 "2022-07-14T21:56:45Z")

</div>

I have some troubles with packages compatibilities: each time I compile a module, I get a few error messages: WARNING: Method definition setindex(AbstractArray{T, 2} where T, Any, Int64, Int64) in module ArrayInterface …

---

## [Strange behavior of \`reshape\`](https://discourse.julialang.org/t/strange-behavior-of-reshape/84288)

<div class="topic-metadata">

**Author:** [@frankwswang](https://discourse.julialang.org/u/frankwswang)\
**Replies:** 7\
**Last updated:** [July 16, 2022, 7:20pm UTC](https://discourse.julialang.org/t/strange-behavior-of-reshape/84288 "2022-07-16T19:20:06Z")

</div>

It seems that reshape won’t make a shallow copy of the input array when the input array has the same shape as the output: julia\> a = rand(4); julia\> b = reshape(a, :); julia\> pop!(b); julia\> length(a) == 3 true I’m …

---

## [Large matrix crashes StaticArrays](https://discourse.julialang.org/t/large-matrix-crashes-staticarrays/58689)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 5\
**Last updated:** [July 16, 2022, 7:11pm UTC](https://discourse.julialang.org/t/large-matrix-crashes-staticarrays/58689 "2022-07-16T19:11:55Z")

</div>

Hi, I would like to instantiate a medium-size (1000,1000) matrix in a StaticArray field of MyStruct. But it crashes! Can you tell me if I am doing something wrong? a = SMatrix{1000,1000, Float64}(rand(1000,1000)) sy…

---

## [Efficient way to chain a series of \`diff\` calls](https://discourse.julialang.org/t/efficient-way-to-chain-a-series-of-diff-calls/84275)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 11\
**Last updated:** [July 16, 2022, 12:46pm UTC](https://discourse.julialang.org/t/efficient-way-to-chain-a-series-of-diff-calls/84275 "2022-07-16T12:46:26Z")

</div>

Hi, I would like to call the diff function in base a few times in a row to compute n-th differenced data. Of course, I could import Base.diff and write down an extended version of the function with an ad-hoc for-loop to…

---

## [GLMakie: Point2f not defined](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 10\
**Last updated:** [July 16, 2022, 9:41am UTC](https://discourse.julialang.org/t/glmakie-point2f-not-defined/84292 "2022-07-16T09:41:39Z")

</div>

Hi all, I have run this code smoothly yesterday, but it can’t be run anymore, it triggers an error UndefVarError: Point2f not defined Stacktrace: \*\* \[1\] (::var"#1#3"{StepRangeLen{Float64, Base.TwicePrecision{Float64}…

---

## [Makie can't plot sin(1/x) : \`Makie.convert\_arguments\`](https://discourse.julialang.org/t/makie-cant-plot-sin-1-x-makie-convert-arguments/84272)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 8\
**Last updated:** [July 16, 2022, 8:44am UTC](https://discourse.julialang.org/t/makie-cant-plot-sin-1-x-makie-convert-arguments/84272 "2022-07-16T08:44:51Z")

</div>

Hi all, I try to plot sin(1/x) by using Makie(CairoMakie) https://makie.juliaplots.org/stable/tutorials/basic-tutorial/ using CairoMakie x = LinRange(0, 10, 100) y = sin.(1/x) fig = Figure() lines(fig\[1, 1\], x, y, c…

---

## [Unexpected memory cost with Julia](https://discourse.julialang.org/t/unexpected-memory-cost-with-julia/84295)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 5\
**Last updated:** [July 16, 2022, 7:07am UTC](https://discourse.julialang.org/t/unexpected-memory-cost-with-julia/84295 "2022-07-16T07:07:20Z")

</div>

Recently I found my code had an unexpected memory cost while working with Julia. See the following example: using OMEinsum len = 20 tensor1 = rand(len,len,len,len) tensor2 = rand(len,len,len) tensor3 …

---

## [Is there a way to include Markdown files inside other Markdown?](https://discourse.julialang.org/t/is-there-a-way-to-include-markdown-files-inside-other-markdown/70895)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 7\
**Last updated:** [July 16, 2022, 4:30am UTC](https://discourse.julialang.org/t/is-there-a-way-to-include-markdown-files-inside-other-markdown/70895 "2022-07-16T04:30:11Z")

</div>

I’ve searched this topic but could not find any solution to what it seems to be it should be a pretty common need. I have several man pages of programs that share common options. For obvious reasons I would like to avoi…

---

## [Julia on embedded devices & validation thereof](https://discourse.julialang.org/t/julia-on-embedded-devices-validation-thereof/81518)

<div class="topic-metadata">

**Author:** [@AMJ](https://discourse.julialang.org/u/AMJ)\
**Replies:** 36\
**Last updated:** [July 16, 2022, 4:05am UTC](https://discourse.julialang.org/t/julia-on-embedded-devices-validation-thereof/81518 "2022-07-16T04:05:08Z")

</div>

For C and C++, there are standards that the compilers follow, there are tools that can be used to check for problems, and it is reliable when deployed to embedded systems. In Julia, there needs to at least be a sense of…

---

## [Dict from dataframe](https://discourse.julialang.org/t/dict-from-dataframe/84277)

<div class="topic-metadata">

**Author:** [@ayodyas](https://discourse.julialang.org/u/ayodyas)\
**Replies:** 5\
**Last updated:** [July 15, 2022, 10:34pm UTC](https://discourse.julialang.org/t/dict-from-dataframe/84277 "2022-07-15T22:34:22Z")

</div>

df = DataFrame(ID=1:4,X=11:14, Y=10:13) indexing to one colum worked using this - Dict(pairs(df.x)) I wanted to convert this to Dict in julia to get like 1 =\> \[ 11,10\] 2 =\> \[12,11\] 3 =\> \[13,12\] 4 =\> \[14,13\] T…

---

## [Julia array slicing to list](https://discourse.julialang.org/t/julia-array-slicing-to-list/84262)

<div class="topic-metadata">

**Author:** [@ayodyas](https://discourse.julialang.org/u/ayodyas)\
**Replies:** 4\
**Last updated:** [July 15, 2022, 7:30pm UTC](https://discourse.julialang.org/t/julia-array-slicing-to-list/84262 "2022-07-15T19:30:38Z")

</div>

I have A= \[2 1;1 2;3 3;2 4;3 5;3 6;1 7;1 8;2 9\], I wanted to get the values in second column when column one have same values, as a separate list. like— when first column value=1, \[2,7,8\] similarly second col…

---

## [Setting a module global from another module](https://discourse.julialang.org/t/setting-a-module-global-from-another-module/84283)

<div class="topic-metadata">

**Author:** [@arbitrandomuser](https://discourse.julialang.org/u/arbitrandomuser)\
**Replies:** 1\
**Last updated:** [July 15, 2022, 5:58pm UTC](https://discourse.julialang.org/t/setting-a-module-global-from-another-module/84283 "2022-07-15T17:58:01Z")

</div>

I have two packages , lets call them pkgA and pkgB . The sources of the two packages are shown below . module pkgA const glob = \[1,2\] greet() = print("Hello World!") end # module module pkgB import pkgA println("SETT…

---

## [How to reproduce the Makie default colors?](https://discourse.julialang.org/t/how-to-reproduce-the-makie-default-colors/84261)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 4\
**Last updated:** [July 15, 2022, 4:03pm UTC](https://discourse.julialang.org/t/how-to-reproduce-the-makie-default-colors/84261 "2022-07-15T16:03:45Z")

</div>

I like the default colors from Makie, and more than that, sometimes it’s useful to reproduce them when we need to plot things it a different order. How can I specify the same colors as the default theme, with the color k…

---

## [Read input stream until the next white space?](https://discourse.julialang.org/t/read-input-stream-until-the-next-white-space/84241)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 2\
**Last updated:** [July 15, 2022, 2:27pm UTC](https://discourse.julialang.org/t/read-input-stream-until-the-next-white-space/84241 "2022-07-15T14:27:46Z")

</div>

The function readuntil allows you to read an IO buffer until a specified character which could be e.g. the spacebar ' '. Is there a similar function which allows you to read until any whitespace (space, tab, newline etc.…

---

## [HEXA colour code generators in julia](https://discourse.julialang.org/t/hexa-colour-code-generators-in-julia/84270)

<div class="topic-metadata">

**Author:** [@ayodyas](https://discourse.julialang.org/u/ayodyas)\
**Replies:** 1\
**Last updated:** [July 15, 2022, 1:30pm UTC](https://discourse.julialang.org/t/hexa-colour-code-generators-in-julia/84270 "2022-07-15T13:30:14Z")

</div>

Similar to python, is there anyway to generate unique hexa colour code in julia to use in Networkx (using pycall? python code is like this, for j in range(5): rand\_colors = \[“#”+" ".join(\[random.choice(“ABCDEF01234567…

---

## [How do I call FastTransforms.jl to get a complex spherical harmonics](https://discourse.julialang.org/t/how-do-i-call-fasttransforms-jl-to-get-a-complex-spherical-harmonics/84258)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 7\
**Last updated:** [July 15, 2022, 10:46am UTC](https://discourse.julialang.org/t/how-do-i-call-fasttransforms-jl-to-get-a-complex-spherical-harmonics/84258 "2022-07-15T10:46:51Z")

</div>

I am looking for a package that can calculate the spherical harmonic function, and I expect it to be able to directly give the value of the spherical harmonic function Y\_{l,m}(\\theta,\\phi) , when given input l, m ,\\th…

---

## [Logical aggregation functions](https://discourse.julialang.org/t/logical-aggregation-functions/84250)

<div class="topic-metadata">

**Author:** [@Lincoln\_Hannah](https://discourse.julialang.org/u/Lincoln_Hannah)\
**Replies:** 2\
**Last updated:** [July 15, 2022, 7:36am UTC](https://discourse.julialang.org/t/logical-aggregation-functions/84250 "2022-07-15T07:36:10Z")

</div>

Does Julia have logical aggregation functions ? Something like AND( \[true, true, false\] ) = false OR( \[true, true, false\] ) = true

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

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