# General Usage

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

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

**Page:** 690

---

## [A method for detecting and removing coolinear inner points](https://discourse.julialang.org/t/a-method-for-detecting-and-removing-coolinear-inner-points/48492)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 6\
**Last updated:** [October 16, 2020, 7:29pm UTC](https://discourse.julialang.org/t/a-method-for-detecting-and-removing-coolinear-inner-points/48492 "2020-10-16T19:29:40Z")

</div>

Does anyone here know of a “simple” method for detecting collinear points (in this case, 2D coordinates) from n \> 2 points, and deleting the ones that are most “inner”? So from (0, 0) (0, 2) (0, 1) (1, 1) the first thre…

---

## [Using keyword arguments, default arguments, with and without Unitful](https://discourse.julialang.org/t/using-keyword-arguments-default-arguments-with-and-without-unitful/48493)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 3\
**Last updated:** [October 16, 2020, 6:41pm UTC](https://discourse.julialang.org/t/using-keyword-arguments-default-arguments-with-and-without-unitful/48493 "2020-10-16T18:41:46Z")

</div>

Hi, I have a complicated function which has enough arguments that I want to use keyword args, and I want to have some default values, and in the early stages I like to use Unitful to help me catch dimensional errors, but…

---

## [Type instability in recursion](https://discourse.julialang.org/t/type-instability-in-recursion/48283)

<div class="topic-metadata">

**Author:** [@kogad](https://discourse.julialang.org/u/kogad)\
**Replies:** 11\
**Last updated:** [October 16, 2020, 5:59pm UTC](https://discourse.julialang.org/t/type-instability-in-recursion/48283 "2020-10-16T17:59:41Z")

</div>

Hi, I am implementing genetic programming (GP) in julia. GP needs to evaluate mathematical expressions represented by tree structures, and this is the bottleneck in my implementation. The following code can evaluate tre…

---

## [Error occurs only when testing/debugging](https://discourse.julialang.org/t/error-occurs-only-when-testing-debugging/48446)

<div class="topic-metadata">

**Author:** [@Abram\_Demski](https://discourse.julialang.org/u/Abram_Demski)\
**Replies:** 2\
**Last updated:** [October 16, 2020, 5:11pm UTC](https://discourse.julialang.org/t/error-occurs-only-when-testing-debugging/48446 "2020-10-16T17:11:14Z")

</div>

As mentioned more briefly in Tests Not Giving Good Error Info, I’m encountering a strange phantom error which only occurs when running tests or stepping thru via the debugger – when I just run the code normally, no error…

---

## [Net present value (npv function)](https://discourse.julialang.org/t/net-present-value-npv-function/48487)

<div class="topic-metadata">

**Author:** [@Ping](https://discourse.julialang.org/u/Ping)\
**Replies:** 5\
**Last updated:** [October 16, 2020, 4:40pm UTC](https://discourse.julialang.org/t/net-present-value-npv-function/48487 "2020-10-16T16:40:07Z")

</div>

I have been trying to use npv to calculate the net present value. The interest rate and cashflows are from a row of matrix, look like this: npv(norm(IRR\_adj\[:,1\]),nb,AssetsCF\[:,1\]) where IRR\_add is 1×1185 Array{Float64…

---

## [Make subplots larger in Plots.jl](https://discourse.julialang.org/t/make-subplots-larger-in-plots-jl/48488)

<div class="topic-metadata">

**Author:** [@OvidiusCicero](https://discourse.julialang.org/u/OvidiusCicero)\
**Replies:** 3\
**Last updated:** [October 16, 2020, 3:45pm UTC](https://discourse.julialang.org/t/make-subplots-larger-in-plots-jl/48488 "2020-10-16T15:45:59Z")

</div>

I generate a group of subplots by plot(\<plots\>..., layout=\<number of plots\>) Is there a way to set make the height of those plots larger without setting an absolute size? (I’m working from a notebook)

---

## [Github actions CI fails saying my package is not installed, but only on Windows and Mac](https://discourse.julialang.org/t/github-actions-ci-fails-saying-my-package-is-not-installed-but-only-on-windows-and-mac/48457)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 9\
**Last updated:** [October 16, 2020, 3:40pm UTC](https://discourse.julialang.org/t/github-actions-ci-fails-saying-my-package-is-not-installed-but-only-on-windows-and-mac/48457 "2020-10-16T15:40:05Z")

</div>

My package is not registered yet (it is a new package, which I registered for the first time yesterday). The CI action runs without errors for Ubuntu, but on Windows and Mac I am getting these errors: On Mac: ERROR: L…

---

## [Documenter.jl - how to add package](https://discourse.julialang.org/t/documenter-jl-how-to-add-package/48496)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 1\
**Last updated:** [October 16, 2020, 3:38pm UTC](https://discourse.julialang.org/t/documenter-jl-how-to-add-package/48496 "2020-10-16T15:38:33Z")

</div>

I’m developing a package called UnitfulAstrodynamics, which is hosted on GitHub. I’m using Documenter.jl for documentation, and I have a docs/ folder at the top level of the package. The GitHub action julia-actions/juli…

---

## [Out of memory error](https://discourse.julialang.org/t/out-of-memory-error/48475)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 7\
**Last updated:** [October 16, 2020, 3:24pm UTC](https://discourse.julialang.org/t/out-of-memory-error/48475 "2020-10-16T15:24:29Z")

</div>

I am solving a system of linear algebraic equations with a sparse complex matrix in a loop. At each pass through the loop I form the sparse complex matrix out of real sparse matrices. First pass through the loop is okay,…

---

## [Structs with nested parametric types](https://discourse.julialang.org/t/structs-with-nested-parametric-types/48448)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 2\
**Last updated:** [October 16, 2020, 3:22pm UTC](https://discourse.julialang.org/t/structs-with-nested-parametric-types/48448 "2020-10-16T15:22:22Z")

</div>

I’m trying to create a struct with parametric types. I want the struct to have a field of type Array{U{F}}, where U\<:Unitful.Length, F\<:AbstractFloat. Is there any way to have nested parametric types for structs in Julia…

---

## [How can I check if a function is always positive?](https://discourse.julialang.org/t/how-can-i-check-if-a-function-is-always-positive/48405)

<div class="topic-metadata">

**Author:** [@kapple](https://discourse.julialang.org/u/kapple)\
**Replies:** 14\
**Last updated:** [October 16, 2020, 3:15pm UTC](https://discourse.julialang.org/t/how-can-i-check-if-a-function-is-always-positive/48405 "2020-10-16T15:15:35Z")

</div>

Suppose I have a user-defined mathematical function, say f(x::Real) = x\*exp(x) I would like to check if f(x) \> 0 for all x \\in \[x\_l, x\_u\] \\subset \\mathbb{R}. The best ideas I have are either x = xₗ:0.01:xᵤ if any(f.(…

---

## ["using" as a function?](https://discourse.julialang.org/t/using-as-a-function/48462)

<div class="topic-metadata">

**Author:** [@RodBiren](https://discourse.julialang.org/u/RodBiren)\
**Replies:** 12\
**Last updated:** [October 16, 2020, 1:32pm UTC](https://discourse.julialang.org/t/using-as-a-function/48462 "2020-10-16T13:32:49Z")

</div>

I am messing around with Pluto and decided I would like a shorter way of importing libraries. This question is sort of two fold. How can I dynamically import Modules using a macro or something else? And why is using a ke…

---

## [Broken Base.show method](https://discourse.julialang.org/t/broken-base-show-method/48453)

<div class="topic-metadata">

**Author:** [@racinmat](https://discourse.julialang.org/u/racinmat)\
**Replies:** 7\
**Last updated:** [October 16, 2020, 11:18am UTC](https://discourse.julialang.org/t/broken-base-show-method/48453 "2020-10-16T11:18:13Z")

</div>

I’m working on function that either shows full types or not based on some variable. I encountered weird bug I can’t figure out because the function is not behaving the same when running it and when debugging it. The fu…

---

## [What is the best future-proof way to check which function raised a MethodError?](https://discourse.julialang.org/t/what-is-the-best-future-proof-way-to-check-which-function-raised-a-methoderror/48354)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [October 16, 2020, 11:04am UTC](https://discourse.julialang.org/t/what-is-the-best-future-proof-way-to-check-which-function-raised-a-methoderror/48354 "2020-10-16T11:04:59Z")

</div>

I want to ensure that the MethodError is raised by by a function in my package, and not downstream. For example here’s one way: julia\> e = MethodError(sin, "a") MethodError(sin, "a", 0xffffffffffffffff) julia\> e.f == …

---

## [Scope in reduce](https://discourse.julialang.org/t/scope-in-reduce/48482)

<div class="topic-metadata">

**Author:** [@alligatorme](https://discourse.julialang.org/u/alligatorme)\
**Replies:** 1\
**Last updated:** [October 16, 2020, 9:24am UTC](https://discourse.julialang.org/t/scope-in-reduce/48482 "2020-10-16T09:24:25Z")

</div>

It sesms that the global variable is not avaliable in function of reduce’s first augument. a=range(1,10,step=1) c=2 function ad(a,b) c=c\*c return a+b+c end reduce(ad,a) the result shows: UndefVarError: c not d…

---

## [Doctests and array printing](https://discourse.julialang.org/t/doctests-and-array-printing/48477)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 3\
**Last updated:** [October 16, 2020, 6:22am UTC](https://discourse.julialang.org/t/doctests-and-array-printing/48477 "2020-10-16T06:22:51Z")

</div>

Printing of arrays changed recently: julia\> \[1\] # 1.5 1-element Array{Int64,1}: 1 julia\> \[1\] # master 1-element Vector{Int64}: 1 This breaks quite some doctests. I would like to have my doctests pass on 1.x and mast…

---

## [ERROR: MethodError: no method matching iterate(::Symbol)](https://discourse.julialang.org/t/error-methoderror-no-method-matching-iterate-symbol/47482)

<div class="topic-metadata">

**Author:** [@sz1992](https://discourse.julialang.org/u/sz1992)\
**Replies:** 5\
**Last updated:** [September 29, 2020, 1:28pm UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-iterate-symbol/47482 "2020-09-29T13:28:06Z")

</div>

Hi, if you try to iterate over ::Symbol you get an error: MWE: for i in :c @show i end ERROR: MethodError: no method matching iterate(::Symbol) however it works fine with Int: for i in 5 @show i end i = 5 note also…

---

## [Too many precompilations](https://discourse.julialang.org/t/too-many-precompilations/48416)

<div class="topic-metadata">

**Author:** [@kogad](https://discourse.julialang.org/u/kogad)\
**Replies:** 8\
**Last updated:** [October 16, 2020, 2:02am UTC](https://discourse.julialang.org/t/too-many-precompilations/48416 "2020-10-16T02:02:53Z")

</div>

Hi all, I am implementing genetic proggraming (GP) in julia. In GP, I need to evaluate mathematical expressions represented by tree structures. This is extracted and simplified code relating to the evaluation. struct …

---

## [Reset Main without restarting the REPL](https://discourse.julialang.org/t/reset-main-without-restarting-the-repl/48393)

<div class="topic-metadata">

**Author:** [@Ginter](https://discourse.julialang.org/u/Ginter)\
**Replies:** 7\
**Last updated:** [October 15, 2020, 5:46pm UTC](https://discourse.julialang.org/t/reset-main-without-restarting-the-repl/48393 "2020-10-15T17:46:33Z")

</div>

I understand that we can’t delete existing bindings or redefine structs without replacing the entire module. Is there a way of reinitializing the Main module without having to close the REPL?

---

## [Different spawning behavior of @spawn and Channel(..., spawn=true)](https://discourse.julialang.org/t/different-spawning-behavior-of-spawn-and-channel-spawn-true/48413)

<div class="topic-metadata">

**Author:** [@pbayer](https://discourse.julialang.org/u/pbayer)\
**Replies:** 4\
**Last updated:** [October 15, 2020, 5:42pm UTC](https://discourse.julialang.org/t/different-spawning-behavior-of-spawn-and-channel-spawn-true/48413 "2020-10-15T17:42:18Z")

</div>

Channel(..., spawn=true) seems to spawn not to all available threads. An MWE: using .Threads function tinfo(ch::Channel) from = take!(ch) put!(from, threadid()) end me = Channel(10) If I use Threads.@spawn to…

---

## [Is there any ETL GUI for Julia?](https://discourse.julialang.org/t/is-there-any-etl-gui-for-julia/9097)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 6\
**Last updated:** [October 15, 2020, 4:37pm UTC](https://discourse.julialang.org/t/is-there-any-etl-gui-for-julia/9097 "2020-10-15T16:37:13Z")

</div>

Is there any ETL GUI addon or package for Julia? Or any tool such as Knime, Tableau, Rapidminer… able to run Julia code integrating properly the results (numeric, plots, file operations…)?

---

## [Tests not giving good error info](https://discourse.julialang.org/t/tests-not-giving-good-error-info/48389)

<div class="topic-metadata">

**Author:** [@Abram\_Demski](https://discourse.julialang.org/u/Abram_Demski)\
**Replies:** 11\
**Last updated:** [October 15, 2020, 4:05pm UTC](https://discourse.julialang.org/t/tests-not-giving-good-error-info/48389 "2020-10-15T16:05:45Z")

</div>

Hi all! I am porting some code from a very old Julia (0.4.6) to 1.5, using the latest version of Juno (where previously I was using a similarly old version of Juno). I’m noticing some weird things going on with tests. I…

---

## [Plot window showing up when run from terminal in Plots.jl](https://discourse.julialang.org/t/plot-window-showing-up-when-run-from-terminal-in-plots-jl/48428)

<div class="topic-metadata">

**Author:** [@libensvivit](https://discourse.julialang.org/u/libensvivit)\
**Replies:** 10\
**Last updated:** [October 15, 2020, 3:03pm UTC](https://discourse.julialang.org/t/plot-window-showing-up-when-run-from-terminal-in-plots-jl/48428 "2020-10-15T15:03:50Z")

</div>

Hi, my problem is as described here. I’m using Plots.jl with the default backend to plot an image and save the figure. using Plots: plot, savefig plot(rangex,rangey,some\_image,xticks,yticks,...); savefig("name.jpg"); t…

---

## [Sublime Text 4: indentation vexation](https://discourse.julialang.org/t/sublime-text-4-indentation-vexation/48320)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 4\
**Last updated:** [October 15, 2020, 2:32pm UTC](https://discourse.julialang.org/t/sublime-text-4-indentation-vexation/48320 "2020-10-15T14:32:44Z")

</div>

Is anyone else having trouble with ST 4 indentation? https://github.com/JuliaEditorSupport/Julia-sublime/issues/90#issuecomment-707996405

---

## [Scalar multiplication makes array reallocation](https://discourse.julialang.org/t/scalar-multiplication-makes-array-reallocation/48421)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 14\
**Last updated:** [October 15, 2020, 11:39am UTC](https://discourse.julialang.org/t/scalar-multiplication-makes-array-reallocation/48421 "2020-10-15T11:39:47Z")

</div>

Hi everyone, While testing the fastest approach to multiply a matrix to a vector a discovered a nasty fact about reallocation. Multiplying a matrix for a constant-defined value (namely a scalar) makes Julia reallocate …

---

## [PackageCompiler: enable --trace-compile for Jupyter session](https://discourse.julialang.org/t/packagecompiler-enable-trace-compile-for-jupyter-session/48364)

<div class="topic-metadata">

**Author:** [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Replies:** 2\
**Last updated:** [October 15, 2020, 11:28am UTC](https://discourse.julialang.org/t/packagecompiler-enable-trace-compile-for-jupyter-session/48364 "2020-10-15T11:28:00Z")

</div>

I am using Jupyter notebook with Interact and Makie for displaying widgets and plots and I would like to quicken the startup time. I already compiled a sysimage with Makie and it’s getting better, but displaying a scene…

---

## [How to configure CI for depending packages](https://discourse.julialang.org/t/how-to-configure-ci-for-depending-packages/48417)

<div class="topic-metadata">

**Author:** [@tisztamo](https://discourse.julialang.org/u/tisztamo)\
**Replies:** 1\
**Last updated:** [October 15, 2020, 10:45am UTC](https://discourse.julialang.org/t/how-to-configure-ci-for-depending-packages/48417 "2020-10-15T10:45:02Z")

</div>

I am working on some “Low” and “High” packages in tandem, High depends on Low, both registered. On my machine I Pkg.dev-ed Low from High so when I add a feature to Low, it is immediately visible in High. When I push Lo…

---

## [How to fix Excessive output truncated?](https://discourse.julialang.org/t/how-to-fix-excessive-output-truncated/48384)

<div class="topic-metadata">

**Author:** [@Arega\_Getaneh](https://discourse.julialang.org/u/Arega_Getaneh)\
**Replies:** 2\
**Last updated:** [October 14, 2020, 7:58pm UTC](https://discourse.julialang.org/t/how-to-fix-excessive-output-truncated/48384 "2020-10-14T19:58:26Z")

</div>

Excessive output truncated after 9670023 bytes.

---

## [Not understanding iterators and lazy evaluation](https://discourse.julialang.org/t/not-understanding-iterators-and-lazy-evaluation/48322)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 11\
**Last updated:** [October 14, 2020, 6:23pm UTC](https://discourse.julialang.org/t/not-understanding-iterators-and-lazy-evaluation/48322 "2020-10-14T18:23:13Z")

</div>

Let’s say I have a big array: big = rand(1:4, 8\_000\_000) I have a loop that will run 180 times and filter big and do something with the results. Each time I filter big, the result vector will be a different size (trivi…

---

## [PlotlyJS click](https://discourse.julialang.org/t/plotlyjs-click/48380)

<div class="topic-metadata">

**Author:** [@Oto\_Brzobohaty](https://discourse.julialang.org/u/Oto_Brzobohaty)\
**Replies:** 0\
**Last updated:** [October 14, 2020, 6:11pm UTC](https://discourse.julialang.org/t/plotlyjs-click/48380 "2020-10-14T18:11:48Z")

</div>

Sometimes I need to get data from figure by clicking on data point. Usually I use PyPlot.ginput(n) This approach is not suitable when one work with remote VS Code session where no gui is available. To this end I love …

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

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