# General Usage

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

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

**Page:** 338

---

## [How to generate independent vectors via for-loop?](https://discourse.julialang.org/t/how-to-generate-independent-vectors-via-for-loop/93584)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 14\
**Last updated:** [January 26, 2023, 7:15pm UTC](https://discourse.julialang.org/t/how-to-generate-independent-vectors-via-for-loop/93584 "2023-01-26T19:15:51Z")

</div>

At a point in my real code, I want to generate a number of independent vectors based on parameter N(which is calculated at a certain point in the code). For example, if N=3, then I need to generate the following vectors: …

---

## [Static compilation of a mixed python - julia application](https://discourse.julialang.org/t/static-compilation-of-a-mixed-python-julia-application/93566)

<div class="topic-metadata">

**Author:** [@mesonepigreco](https://discourse.julialang.org/u/mesonepigreco)\
**Replies:** 2\
**Last updated:** [January 26, 2023, 6:35pm UTC](https://discourse.julialang.org/t/static-compilation-of-a-mixed-python-julia-application/93566 "2023-01-26T18:35:08Z")

</div>

I have a python application which is enhanced with julia in the performance critical parts. The julia source is called with the julia modle of python, however, the full python code is executed with the python-jl interpre…

---

## [It is taking too long to LibPQ.jl report connection time out](https://discourse.julialang.org/t/it-is-taking-too-long-to-libpq-jl-report-connection-time-out/93571)

<div class="topic-metadata">

**Author:** [@Rafael\_Brus](https://discourse.julialang.org/u/Rafael_Brus)\
**Replies:** 0\
**Last updated:** [January 26, 2023, 1:51pm UTC](https://discourse.julialang.org/t/it-is-taking-too-long-to-libpq-jl-report-connection-time-out/93571 "2023-01-26T13:51:15Z")

</div>

It is taking one or two hours to LibPQ.jl report connection time out. I’m using the version 1.14.1 Does anyone have any ideas?

---

## [Subset of eigenvalues/vectors for Generalized eigenproblem](https://discourse.julialang.org/t/subset-of-eigenvalues-vectors-for-generalized-eigenproblem/92856)

<div class="topic-metadata">

**Author:** [@physh](https://discourse.julialang.org/u/physh)\
**Replies:** 11\
**Last updated:** [January 26, 2023, 12:53pm UTC](https://discourse.julialang.org/t/subset-of-eigenvalues-vectors-for-generalized-eigenproblem/92856 "2023-01-26T12:53:47Z")

</div>

Hi all, In my code I have a generalized eigenvalue problem eigen(A,B) where the matrices A and B are both real, symmetric and dense. The size is so far not a big deal (~1500x1500), as I’m still running on my laptop, b…

---

## [Is there a package for "simple" polynomials?](https://discourse.julialang.org/t/is-there-a-package-for-simple-polynomials/93560)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 6\
**Last updated:** [January 26, 2023, 10:34am UTC](https://discourse.julialang.org/t/is-there-a-package-for-simple-polynomials/93560 "2023-01-26T10:34:44Z")

</div>

Hello, I recently implemented some multivariate polynomials with R & C++ and I observed this implementation is faster than my Julia implementation. But in Julia I use TypedPolynomials.jl (or a related package, don’t rem…

---

## [How to add a new \`@series\` within a type recipe?](https://discourse.julialang.org/t/how-to-add-a-new-series-within-a-type-recipe/93561)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 1\
**Last updated:** [January 26, 2023, 9:25am UTC](https://discourse.julialang.org/t/how-to-add-a-new-series-within-a-type-recipe/93561 "2023-01-26T09:25:49Z")

</div>

From this question, I understand that a type recipe is for plotting a specific type with a wider range of signatures. However, I cannot add an hline in the figure within a recipe. using RecipesBase: @recipe, @series st…

---

## [Interaction between \`Logging.jl\`, \`JuliaFormatter.jl\` and \`Documenter.jl\`?](https://discourse.julialang.org/t/interaction-between-logging-jl-juliaformatter-jl-and-documenter-jl/93504)

<div class="topic-metadata">

**Author:** [@iago-lito](https://discourse.julialang.org/u/iago-lito)\
**Replies:** 3\
**Last updated:** [January 26, 2023, 9:36am UTC](https://discourse.julialang.org/t/interaction-between-logging-jl-juliaformatter-jl-and-documenter-jl/93504 "2023-01-26T09:36:58Z")

</div>

Hi there, I am very confused by the interaction(s?) between Logging.jl, JuliaFormatter.jl and Documenter.jl. My initial problem was that I had blocks like this in my package documentation: \`\`\`@example my\_function() # r…

---

## [How do you do the Matlab equivilant of any,all in Julia](https://discourse.julialang.org/t/how-do-you-do-the-matlab-equivilant-of-any-all-in-julia/93289)

<div class="topic-metadata">

**Author:** [@m\_x155](https://discourse.julialang.org/u/m_x155)\
**Replies:** 8\
**Last updated:** [January 26, 2023, 6:40am UTC](https://discourse.julialang.org/t/how-do-you-do-the-matlab-equivilant-of-any-all-in-julia/93289 "2023-01-26T06:40:32Z")

</div>

In matlab any and all allow you to quickly identify rows or columns of a matrix that meet some criteria. For example if you have an array of logicals such as A=\[1 1;0 1;0 0; 0 1; 1 1\] any(A,2) checks if there are any …

---

## [When I call a function from fortran complied dll in windows, there is a "EXCEPTION\_ACCESS\_VIOLATION" error](https://discourse.julialang.org/t/when-i-call-a-function-from-fortran-complied-dll-in-windows-there-is-a-exception-access-violation-error/93554)

<div class="topic-metadata">

**Author:** [@liaoweiyang2017](https://discourse.julialang.org/u/liaoweiyang2017)\
**Replies:** 0\
**Last updated:** [January 26, 2023, 5:23am UTC](https://discourse.julialang.org/t/when-i-call-a-function-from-fortran-complied-dll-in-windows-there-is-a-exception-access-violation-error/93554 "2023-01-26T05:23:54Z")

</div>

The julia version: (base) D:\\julia\_code\_w\\WEM3D\\WEM3D\\test\\Fwd0114\>julia \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | \_ \_ \_| |\_ \_\_ \_ | Type "?" f…

---

## [Understanding runtime errors with PackageCompiler built executables](https://discourse.julialang.org/t/understanding-runtime-errors-with-packagecompiler-built-executables/29120)

<div class="topic-metadata">

**Author:** [@blaiseli](https://discourse.julialang.org/u/blaiseli)\
**Replies:** 6\
**Last updated:** [January 26, 2023, 5:15am UTC](https://discourse.julialang.org/t/understanding-runtime-errors-with-packagecompiler-built-executables/29120 "2023-01-26T05:15:29Z")

</div>

I tried to build an application using PackageCompiler.build\_executable. I can run the resulting executable with its --help option, but when it comes to deal with actual data processing, I get a “fatal: error thrown and n…

---

## [Why is this code not type stable?](https://discourse.julialang.org/t/why-is-this-code-not-type-stable/93527)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 18\
**Last updated:** [January 26, 2023, 1:20am UTC](https://discourse.julialang.org/t/why-is-this-code-not-type-stable/93527 "2023-01-26T01:20:38Z")

</div>

inner(pc) = sum(pc) outer(pc,σ) = prod(pc,σ) tst = let pc = rand(3,10) σ = 2.0 tst() = losses = outer(inner(pc), σ) end

---

## [Changing orientation of plots in gadfly](https://discourse.julialang.org/t/changing-orientation-of-plots-in-gadfly/93506)

<div class="topic-metadata">

**Author:** [@ChrisVL1](https://discourse.julialang.org/u/ChrisVL1)\
**Replies:** 17\
**Last updated:** [January 26, 2023, 12:12am UTC](https://discourse.julialang.org/t/changing-orientation-of-plots-in-gadfly/93506 "2023-01-26T00:12:55Z")

</div>

Sorry to reopen this issue, but I am trying to recreate this same plotting style in Gadfly as this issue Plotting histogram on the y-axis at the end of a time series. I have these two plots and want to plot side by side …

---

## [Strange behavior of mod with float](https://discourse.julialang.org/t/strange-behavior-of-mod-with-float/93536)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 3\
**Last updated:** [January 25, 2023, 10:52pm UTC](https://discourse.julialang.org/t/strange-behavior-of-mod-with-float/93536 "2023-01-25T22:52:12Z")

</div>

Hello, What is the best way to determine if a float number b is an integer multiple of another float number a, (i.e. b = k a with k an integer)? I wanted to use the following test abs(mod(b, a))\<1e-12, but I am confuse…

---

## [Taking advantage of pkgimages in 'scripts'](https://discourse.julialang.org/t/taking-advantage-of-pkgimages-in-scripts/93535)

<div class="topic-metadata">

**Author:** [@Mason](https://discourse.julialang.org/u/Mason)\
**Replies:** 2\
**Last updated:** [January 25, 2023, 10:47pm UTC](https://discourse.julialang.org/t/taking-advantage-of-pkgimages-in-scripts/93535 "2023-01-25T22:47:23Z")

</div>

There’s a lot of benchmark scripts out there right now where Julia is at a big disadvantage due to compiler overhead and such. Has anyone thought out an easy way that we can start taking advantage of pkgimages to reduce …

---

## [What's an interactive task? Does it pause a running task?](https://discourse.julialang.org/t/whats-an-interactive-task-does-it-pause-a-running-task/93532)

<div class="topic-metadata">

**Author:** [@Ashlin\_Harris](https://discourse.julialang.org/u/Ashlin_Harris)\
**Replies:** 0\
**Last updated:** [January 25, 2023, 7:47pm UTC](https://discourse.julialang.org/t/whats-an-interactive-task-does-it-pause-a-running-task/93532 "2023-01-25T19:47:15Z")

</div>

Julia 1.9 includes interactive tasks, but I can’t find an example or a description of what they do. I assume that they designate low latency tasks that should take priority over other tasks. For instance, in the followin…

---

## [Order in which macros are processed](https://discourse.julialang.org/t/order-in-which-macros-are-processed/93530)

<div class="topic-metadata">

**Author:** [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Replies:** 0\
**Last updated:** [January 25, 2023, 7:03pm UTC](https://discourse.julialang.org/t/order-in-which-macros-are-processed/93530 "2023-01-25T19:03:45Z")

</div>

Given the following code in a file called “TestMacro.jl”: module TestMacro import Base struct Glob end export Glob macro define() :(Base.:\*(a::Glob, b::Glob) = "here") end @define Base.:\*(a::Glob, b::Glob) = "th…

---

## [Stateful iterators with known eltype](https://discourse.julialang.org/t/stateful-iterators-with-known-eltype/93528)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [January 25, 2023, 6:46pm UTC](https://discourse.julialang.org/t/stateful-iterators-with-known-eltype/93528 "2023-01-25T18:46:04Z")

</div>

Iterators.Stateful tries to determine the type of the (value, state) tuple using internal introspection tools. This can be complicated if the type of state keeps changing across iterations, and in such cases the inferred…

---

## [FLoops @init allocate only once](https://discourse.julialang.org/t/floops-init-allocate-only-once/93500)

<div class="topic-metadata">

**Author:** [@Salmon](https://discourse.julialang.org/u/Salmon)\
**Replies:** 13\
**Last updated:** [January 25, 2023, 6:34pm UTC](https://discourse.julialang.org/t/floops-init-allocate-only-once/93500 "2023-01-25T18:34:54Z")

</div>

Hi, Does anyone know if there are any tricks to using FLoops thread-safe buffers for better performance? I am trying to adapt my code which makes use of Buffers such as Buffers\[Threads.threadid()\] to the recommended app…

---

## [An error in implementation of "for" loop while using "IntervalArithmetic.jl" package in "Pluto.jl" notebook](https://discourse.julialang.org/t/an-error-in-implementation-of-for-loop-while-using-intervalarithmetic-jl-package-in-pluto-jl-notebook/93523)

<div class="topic-metadata">

**Author:** [@Kanishk](https://discourse.julialang.org/u/Kanishk)\
**Replies:** 1\
**Last updated:** [January 25, 2023, 6:11pm UTC](https://discourse.julialang.org/t/an-error-in-implementation-of-for-loop-while-using-intervalarithmetic-jl-package-in-pluto-jl-notebook/93523 "2023-01-25T18:11:24Z")

</div>

Hello I am trying to find a root of an equation using Interval Newton method in Julia. I am using “IntervalArithmetic.jl” package in “Pluto.jl” notebook. The code seems logically correct (checked a few times) but it is …

---

## [Disappearing methods from loaded libraries, seemingly iff \`using PreallocationTools\`](https://discourse.julialang.org/t/disappearing-methods-from-loaded-libraries-seemingly-iff-using-preallocationtools/93496)

<div class="topic-metadata">

**Author:** [@joaovgranja](https://discourse.julialang.org/u/joaovgranja)\
**Replies:** 6\
**Last updated:** [January 25, 2023, 4:32pm UTC](https://discourse.julialang.org/t/disappearing-methods-from-loaded-libraries-seemingly-iff-using-preallocationtools/93496 "2023-01-25T16:32:50Z")

</div>

I have a weird issue that I am unable to reproduce in a MWE. It happens in the context of a reasonably large project. Some methods are not available despite their libraries being loaded. For instance: MethodError: no m…

---

## [Packages in the Project.toml file are not found in the project](https://discourse.julialang.org/t/packages-in-the-project-toml-file-are-not-found-in-the-project/93494)

<div class="topic-metadata">

**Author:** [@devanshu](https://discourse.julialang.org/u/devanshu)\
**Replies:** 3\
**Last updated:** [January 25, 2023, 1:53pm UTC](https://discourse.julialang.org/t/packages-in-the-project-toml-file-are-not-found-in-the-project/93494 "2023-01-25T13:53:36Z")

</div>

Hi, I have a project named HeisenbergMBL. While precompiling in the project environment I get the following error, (HeisenbergMBL) pkg\> precompile Precompiling project... ✗ HeisenbergMBL 0 dependencies successfully…

---

## [Equivalent of Stateful in IterTools](https://discourse.julialang.org/t/equivalent-of-stateful-in-itertools/93510)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 1\
**Last updated:** [January 25, 2023, 1:45pm UTC](https://discourse.julialang.org/t/equivalent-of-stateful-in-itertools/93510 "2023-01-25T13:45:38Z")

</div>

Hello, The package Base.Iterators has been deprecated for many years now, in favor of IterTools. But I don’t see the equivalent of the Stateful iterator in IterTools’ documentation. Is it in another package ?

---

## [Issue Arpack computing eigs](https://discourse.julialang.org/t/issue-arpack-computing-eigs/93254)

<div class="topic-metadata">

**Author:** [@Sparsetacus](https://discourse.julialang.org/u/Sparsetacus)\
**Replies:** 1\
**Last updated:** [January 25, 2023, 1:31pm UTC](https://discourse.julialang.org/t/issue-arpack-computing-eigs/93254 "2023-01-25T13:31:36Z")

</div>

Hi all, I have a weird error using Arpack.jl. I am using eigs to compute a generalized eigenvalue problem for large, symmetric, sparse matrices, i.e. eigs(A, B, nev = 1, which = :SM). I am using julia 1.8.5 on ubuntu …

---

## [Should Diagonal(A) give an InexactError if not isdiag(A)?](https://discourse.julialang.org/t/should-diagonal-a-give-an-inexacterror-if-not-isdiag-a/93464)

<div class="topic-metadata">

**Author:** [@fgerick](https://discourse.julialang.org/u/fgerick)\
**Replies:** 3\
**Last updated:** [January 25, 2023, 11:33am UTC](https://discourse.julialang.org/t/should-diagonal-a-give-an-inexacterror-if-not-isdiag-a/93464 "2023-01-25T11:33:53Z")

</div>

I understand the convenience of not having to do Diagonal(diag(A)), but with the same logic Int(1.2) should give 1. I would expect an InexactError, if isdiag(A) == false.

---

## [How to read hex columns in CSV files](https://discourse.julialang.org/t/how-to-read-hex-columns-in-csv-files/93493)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 12\
**Last updated:** [January 25, 2023, 11:12am UTC](https://discourse.julialang.org/t/how-to-read-hex-columns-in-csv-files/93493 "2023-01-25T11:12:25Z")

</div>

I have the following code: using DLMReader ds = filereader(logfile\_name, types = \[Float64, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int, Int\], header=\[:time, :RTR, :addr, :F…

---

## [How to pass any number of symbols to a macro using a function?](https://discourse.julialang.org/t/how-to-pass-any-number-of-symbols-to-a-macro-using-a-function/93497)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 0\
**Last updated:** [January 25, 2023, 10:20am UTC](https://discourse.julialang.org/t/how-to-pass-any-number-of-symbols-to-a-macro-using-a-function/93497 "2023-01-25T10:20:11Z")

</div>

How to pass any number of symbols to a macro using a function? function func(args::Vararg{Symbol, N}) where N # return @macros x y z # \`x, y, z\` from \`args\` end func(:x, :y, :z) # -\> @macro x y z

---

## [What does the \`primary\` attribute do and how to plot curves with scatters added onto it in \`Plots.jl\`?](https://discourse.julialang.org/t/what-does-the-primary-attribute-do-and-how-to-plot-curves-with-scatters-added-onto-it-in-plots-jl/93486)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 1\
**Last updated:** [January 25, 2023, 9:17am UTC](https://discourse.julialang.org/t/what-does-the-primary-attribute-do-and-how-to-plot-curves-with-scatters-added-onto-it-in-plots-jl/93486 "2023-01-25T09:17:03Z")

</div>

For example, we have the following recipe: using RecipesBase: @userplot, @recipe, @series @userplot MyPlot @recipe function f(plot::MyPlot) x, y = plot.args palette --\> :tab20 @series begin seriesty…

---

## [Group by value in column](https://discourse.julialang.org/t/group-by-value-in-column/93473)

<div class="topic-metadata">

**Author:** [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Replies:** 7\
**Last updated:** [January 25, 2023, 8:42am UTC](https://discourse.julialang.org/t/group-by-value-in-column/93473 "2023-01-25T08:42:55Z")

</div>

How do I get 3 groups here based on the column value? In this case when you find a word all in capitals. df = DataFrame(a = \["HOLA", 2,3,"HELLO", 4,5,6, "HALLO", 7,8,9,10\], b = rand(12), c=rand(12)) I want to get 3 gro…

---

## [Question on Idiomatic Julia, Traits, and Types](https://discourse.julialang.org/t/question-on-idiomatic-julia-traits-and-types/93484)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 6\
**Last updated:** [January 25, 2023, 7:36am UTC](https://discourse.julialang.org/t/question-on-idiomatic-julia-traits-and-types/93484 "2023-01-25T07:36:39Z")

</div>

I’m trying to better learn and understand how to write idiomatic Julia. Please consider the following example. I have a some types defined as follows. abstract type MyAbstractType end Base.@kwdef struct MyStruct\_1D \<:…

---

## [About extension support](https://discourse.julialang.org/t/about-extension-support/93462)

<div class="topic-metadata">

**Author:** [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Replies:** 7\
**Last updated:** [January 25, 2023, 6:48am UTC](https://discourse.julialang.org/t/about-extension-support/93462 "2023-01-25T06:48:06Z")

</div>

I’m developing a Julia package that supports extensions. Currently I need to know: Where should I store extension data locally? Store as artifacts, store in scratchspaces or somewhere else? For the code in extensions, …

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

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