# General Usage

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

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

**Page:** 419

---

## [Possible bug with \\ operator](https://discourse.julialang.org/t/possible-bug-with-operator/84753)

<div class="topic-metadata">

**Author:** [@AnshPatel7](https://discourse.julialang.org/u/AnshPatel7)\
**Replies:** 3\
**Last updated:** [July 25, 2022, 2:57pm UTC](https://discourse.julialang.org/t/possible-bug-with-operator/84753 "2022-07-25T14:57:28Z")

</div>

I’m using the \\ operator to solve the linear system Ax=b in the general case, even when A is singular. This invariably throws up the SingularException(2). But in the documentation, it is clearly stated that it should giv…

---

## [Why do I have to specify the name of the module when code is included in remote processes?](https://discourse.julialang.org/t/why-do-i-have-to-specify-the-name-of-the-module-when-code-is-included-in-remote-processes/84756)

<div class="topic-metadata">

**Author:** [@zekeriya.sari](https://discourse.julialang.org/u/zekeriya.sari)\
**Replies:** 0\
**Last updated:** [July 25, 2022, 1:57pm UTC](https://discourse.julialang.org/t/why-do-i-have-to-specify-the-name-of-the-module-when-code-is-included-in-remote-processes/84756 "2022-07-25T13:57:08Z")

</div>

Hi Consider the following two files test.jl and temp.jl with the following content # test.jl file module Foo using Distributed function baz() addprocs(2) @everywhere include("temp.jl") for worker in work…

---

## [Gaussian Elimination Function that is Fast](https://discourse.julialang.org/t/gaussian-elimination-function-that-is-fast/84714)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 6\
**Last updated:** [July 25, 2022, 12:14pm UTC](https://discourse.julialang.org/t/gaussian-elimination-function-that-is-fast/84714 "2022-07-25T12:14:28Z")

</div>

I was testing this package from this repository, it is faster than A \\ b I do not know any other competitor for calculating Gaussian Elimination that can be measured with @time. If anyone knows, I would like to know an…

---

## [Fast way of selecting rows in DataFrames / csv-file with primary keys](https://discourse.julialang.org/t/fast-way-of-selecting-rows-in-dataframes-csv-file-with-primary-keys/84535)

<div class="topic-metadata">

**Author:** [@pjuergens](https://discourse.julialang.org/u/pjuergens)\
**Replies:** 4\
**Last updated:** [July 25, 2022, 10:41am UTC](https://discourse.julialang.org/t/fast-way-of-selecting-rows-in-dataframes-csv-file-with-primary-keys/84535 "2022-07-25T10:41:04Z")

</div>

Hello together, I’m trying to migrate old code from another language to Julia and doing my first steps in Julia by that. I have a csv-File (approx 100 columns, 6000 rows) that comes from a database with primary keys. Wh…

---

## [Bitwise or](https://discourse.julialang.org/t/bitwise-or/84732)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 3\
**Last updated:** [July 25, 2022, 7:44am UTC](https://discourse.julialang.org/t/bitwise-or/84732 "2022-07-25T07:44:45Z")

</div>

I would like to figure out, if the value of a variable is either one or two. The strange thing is that the result of x == 1 is of type Bool, but bitwise or, "|" makes a difference between (x == 1) and x == 1, is this an…

---

## [Plots issues using wayland on arch](https://discourse.julialang.org/t/plots-issues-using-wayland-on-arch/84556)

<div class="topic-metadata">

**Author:** [@charperflow](https://discourse.julialang.org/u/charperflow)\
**Replies:** 19\
**Last updated:** [July 25, 2022, 6:10am UTC](https://discourse.julialang.org/t/plots-issues-using-wayland-on-arch/84556 "2022-07-25T06:10:34Z")

</div>

Hi everyone, I am running an arch-linux machine using wayland for my display manager, and sway for my windows manager. I DO have the QT5 support package installed as well (qt5-wayland). That being said whenever I run a s…

---

## [LU Decomposition: MethodError: no method matching round(::Float64, ::Int64)](https://discourse.julialang.org/t/lu-decomposition-methoderror-no-method-matching-round-float64-int64/84710)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [July 25, 2022, 5:26am UTC](https://discourse.julialang.org/t/lu-decomposition-methoderror-no-method-matching-round-float64-int64/84710 "2022-07-25T05:26:53Z")

</div>

Hi all, I have read texts on Gauss-Elimination and LU Decomposition. https://web.mit.edu/18.06/www/Spring17/Gaussian-elimination.pdf The problem is when I try the function visualize\_gauss it can’t work: visualize\_gau…

---

## [Assign a struct variable to a new variable](https://discourse.julialang.org/t/assign-a-struct-variable-to-a-new-variable/84723)

<div class="topic-metadata">

**Author:** [@yang\_chen](https://discourse.julialang.org/u/yang_chen)\
**Replies:** 7\
**Last updated:** [July 25, 2022, 1:17am UTC](https://discourse.julialang.org/t/assign-a-struct-variable-to-a-new-variable/84723 "2022-07-25T01:17:10Z")

</div>

Hi, I defined a struct. Then I create a new variable like A = Pos(“id1”, 1, 2, 1, 2) Then I assign the A to another variable B. B = A; Next, I tried to modify B, B.posX1 = 3 B.posY1 = 4 However, when I check A, I …

---

## [a=string(Pkg.status()) \> "nothing". How to get and save Pkg.status())?](https://discourse.julialang.org/t/a-string-pkg-status-nothing-how-to-get-and-save-pkg-status/24571)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 4\
**Last updated:** [July 24, 2022, 12:31pm UTC](https://discourse.julialang.org/t/a-string-pkg-status-nothing-how-to-get-and-save-pkg-status/24571 "2022-07-24T12:31:14Z")

</div>

Julia 0.7.0 How to get and save Pkg.status()) ? julia\> using Pkg julia\> a=string(Pkg.status()) Status \`C:\\Users\\PC\\.julia\\environments\\v0.7\\Project.toml\` \[686f71d1\] ASDF v1.0.3 \[f9309374\] ApplicationBuilder v0…

---

## [How to generate an array by broadcasting an existing function?(any dim)](https://discourse.julialang.org/t/how-to-generate-an-array-by-broadcasting-an-existing-function-any-dim/82353)

<div class="topic-metadata">

**Author:** [@acsofie](https://discourse.julialang.org/u/acsofie)\
**Replies:** 9\
**Last updated:** [July 24, 2022, 3:19pm UTC](https://discourse.julialang.org/t/how-to-generate-an-array-by-broadcasting-an-existing-function-any-dim/82353 "2022-07-24T15:19:34Z")

</div>

julia has very useful broadcasting for vector julia\> f(a,b)=a^2+b-1 f (generic function with 1 method) julia\> f(2,3) 6 julia\> f.(1:3,6) # or @. f(1:3,6) 3-element Vector{Int64}: 6 9 14 julia\> f.(1:3,6:8…

---

## [Decompose Tuple or Union type into constituents?](https://discourse.julialang.org/t/decompose-tuple-or-union-type-into-constituents/84696)

<div class="topic-metadata">

**Author:** [@nsajko](https://discourse.julialang.org/u/nsajko)\
**Replies:** 11\
**Last updated:** [July 24, 2022, 7:06am UTC](https://discourse.julialang.org/t/decompose-tuple-or-union-type-into-constituents/84696 "2022-07-24T07:06:29Z")

</div>

Is it possible to iterate over the parameters of a Tuple or Union? Given Tuple{A, B, C, D, E, ...}, is it possible to extract the parameters (A, B, C, D, E, …)? A partial solution/hack is something like this, for extrac…

---

## [How can a macro create functions that are handled at compile time?](https://discourse.julialang.org/t/how-can-a-macro-create-functions-that-are-handled-at-compile-time/84692)

<div class="topic-metadata">

**Author:** [@mongi](https://discourse.julialang.org/u/mongi)\
**Replies:** 1\
**Last updated:** [July 24, 2022, 12:38am UTC](https://discourse.julialang.org/t/how-can-a-macro-create-functions-that-are-handled-at-compile-time/84692 "2022-07-24T00:38:19Z")

</div>

Hi, how can a one macro create multiple functions that are handled at compile time ? (not just one function) thanks

---

## [Removing manifest file for packages](https://discourse.julialang.org/t/removing-manifest-file-for-packages/84690)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 3\
**Last updated:** [July 24, 2022, 12:12am UTC](https://discourse.julialang.org/t/removing-manifest-file-for-packages/84690 "2022-07-24T00:12:25Z")

</div>

I have this issue discussed, e.g. link should I remove manifest files from my packages?

---

## [Why am I getting the message Failed to Revise](https://discourse.julialang.org/t/why-am-i-getting-the-message-failed-to-revise/84675)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 2\
**Last updated:** [July 24, 2022, 12:05am UTC](https://discourse.julialang.org/t/why-am-i-getting-the-message-failed-to-revise/84675 "2022-07-24T00:05:04Z")

</div>

I installed the package FinancialToolbox, and tested it as recommended: Pkg.test("FinancialToolbox") The package passed the test but there was a ‘Failed tp Revise’ message. There was a also a recommendation to try Revi…

---

## [Representing very big numbers](https://discourse.julialang.org/t/representing-very-big-numbers/84589)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 17\
**Last updated:** [July 23, 2022, 10:30pm UTC](https://discourse.julialang.org/t/representing-very-big-numbers/84589 "2022-07-23T22:30:40Z")

</div>

How can I perform arithmetic on numbers on the order of a googloplex i.e. 10^(10^100)? I don’t have enough memory to express them exactly as integers with all their digits, but I’d like to be able to represent them as B…

---

## [How to check how free RAM is available?](https://discourse.julialang.org/t/how-to-check-how-free-ram-is-available/15288)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 8\
**Last updated:** [July 23, 2022, 4:22pm UTC](https://discourse.julialang.org/t/how-to-check-how-free-ram-is-available/15288 "2022-07-23T16:22:27Z")

</div>

How to check how free RAM is available ? Is any call in Julia ? Paul

---

## [How to get unique values of list of struct based on condition?](https://discourse.julialang.org/t/how-to-get-unique-values-of-list-of-struct-based-on-condition/84678)

<div class="topic-metadata">

**Author:** [@Phuntsho](https://discourse.julialang.org/u/Phuntsho)\
**Replies:** 2\
**Last updated:** [July 23, 2022, 4:20pm UTC](https://discourse.julialang.org/t/how-to-get-unique-values-of-list-of-struct-based-on-condition/84678 "2022-07-23T16:20:57Z")

</div>

I have a list of struct as shown struct probs A::Tuple{Int64, Int64}; C::Tuple{Int64, Int64}; Cost::Int64 end pop\_vect = \[probs((rand(1:20),rand(1:20)),(rand(1:20),rand(1:20)), rand(1:20)) for i = 1:100\] Now I want…

---

## [Does svd() not support forwarddiff?](https://discourse.julialang.org/t/does-svd-not-support-forwarddiff/84662)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 6\
**Last updated:** [July 23, 2022, 3:51pm UTC](https://discourse.julialang.org/t/does-svd-not-support-forwarddiff/84662 "2022-07-23T15:51:43Z")

</div>

julia\> using LinearAlgebra julia\> using ForwardDiff julia\> function f(x) a=\[1 2;3 4\] a=a.\*x \_,s,\_=svd(a) return sum(s) end f (generic function with 1 method) julia\> ForwardDiff.deriv…

---

## [Matlab 3d linear equation ploting](https://discourse.julialang.org/t/matlab-3d-linear-equation-ploting/84564)

<div class="topic-metadata">

**Author:** [@jcbritobr](https://discourse.julialang.org/u/jcbritobr)\
**Replies:** 10\
**Last updated:** [July 23, 2022, 3:22pm UTC](https://discourse.julialang.org/t/matlab-3d-linear-equation-ploting/84564 "2022-07-23T15:22:12Z")

</div>

Hello, good evening. How I can port this matlab code for julia? \[x, y\] = meshgrid(-5:0.5:5); %define o número de passos no intervalo \[-5,5\] z = 2\*x - 3\*y + 2; surf(x, y, z);

---

## [LinearAlgebraX Result Output Format](https://discourse.julialang.org/t/linearalgebrax-result-output-format/84669)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 4\
**Last updated:** [July 23, 2022, 2:33pm UTC](https://discourse.julialang.org/t/linearalgebrax-result-output-format/84669 "2022-07-23T14:33:22Z")

</div>

Hi all, I am trying LinearALgebraX package, the result is quite funny, why there are //1 in all entries? How to discard all the //1? most people will be confused, unless you are already experienced with Julia and Li…

---

## [Threading, Threads.@threads vs polyester.@batch vs LoopVectorization.@tturbo](https://discourse.julialang.org/t/threading-threads-threads-vs-polyester-batch-vs-loopvectorization-tturbo/84576)

<div class="topic-metadata">

**Author:** [@fft](https://discourse.julialang.org/u/fft)\
**Replies:** 4\
**Last updated:** [July 23, 2022, 2:28pm UTC](https://discourse.julialang.org/t/threading-threads-threads-vs-polyester-batch-vs-loopvectorization-tturbo/84576 "2022-07-23T14:28:25Z")

</div>

I’m trying to understand the multithreading options in julia. Seems that there are at least three options Threads.@threads, polyester.@batch, and LoopVectorization.@tturbo. Reading it sounds like @batch can be faster tha…

---

## [Can you avoid using Base.invokelatest in this example?](https://discourse.julialang.org/t/can-you-avoid-using-base-invokelatest-in-this-example/33269)

<div class="topic-metadata">

**Author:** [@rvignolo](https://discourse.julialang.org/u/rvignolo)\
**Replies:** 20\
**Last updated:** [January 13, 2020, 3:49pm UTC](https://discourse.julialang.org/t/can-you-avoid-using-base-invokelatest-in-this-example/33269 "2020-01-13T15:49:44Z")

</div>

Hi all! Is there any way to avoid using Base.invokelatest or GeneralizedGenerated.mk\_function in an example of the following type. This is a minimal working example: function main(vars, val) f\_ex = build\_function\_ex…

---

## [How to filter InMemoryDatasets](https://discourse.julialang.org/t/how-to-filter-inmemorydatasets/83478)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 7\
**Last updated:** [July 23, 2022, 5:14am UTC](https://discourse.julialang.org/t/how-to-filter-inmemorydatasets/83478 "2022-07-23T05:14:31Z")

</div>

Example: using InMemoryDatasets ds = Dataset(x1 = 1, x2 = 1:10, x3 = repeat(1:2, 5)) res = modify!(ds, :x2 =\> byrow(isodd) =\> :ODD) The output is; julia\> include("test/filter.jl") 10×4 Dataset Row │ x1 x2 …

---

## [What is the best way to update matrix in callable function?](https://discourse.julialang.org/t/what-is-the-best-way-to-update-matrix-in-callable-function/84641)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 9\
**Last updated:** [July 23, 2022, 2:29am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-update-matrix-in-callable-function/84641 "2022-07-23T02:29:16Z")

</div>

I have a file called “run.jl” which has a function “update”. I have a main function which create matrix “Record”, which needs to be updated in a for loop. However, the matrix is not updated. What is the best way to updat…

---

## [OpenBLAS much slower on Windows than Linux](https://discourse.julialang.org/t/openblas-much-slower-on-windows-than-linux/84562)

<div class="topic-metadata">

**Author:** [@PeterSimon](https://discourse.julialang.org/u/PeterSimon)\
**Replies:** 4\
**Last updated:** [July 23, 2022, 1:09am UTC](https://discourse.julialang.org/t/openblas-much-slower-on-windows-than-linux/84562 "2022-07-23T01:09:21Z")

</div>

This is a continuation of a discussion in issues 159 and 166 of LinearSolve.jl. I have two computers with similar, 8-core i7-9700 CPUs, one of which runs Windows and the other Manjaro Linux. I ran the benchmark script …

---

## [How to write a recursive macro?](https://discourse.julialang.org/t/how-to-write-a-recursive-macro/84652)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 5\
**Last updated:** [July 22, 2022, 9:42pm UTC](https://discourse.julialang.org/t/how-to-write-a-recursive-macro/84652 "2022-07-22T21:42:39Z")

</div>

I came across some online posts about implementing short-circuiting logical operators as macros in Lisp, and I’m wondering how to do the same in Julia. I’m trying to write a vararg macro @or such that @or expr1 expr2 ex…

---

## [Multivariate Maximum Likelihood](https://discourse.julialang.org/t/multivariate-maximum-likelihood/84618)

<div class="topic-metadata">

**Author:** [@Cristian\_Montes](https://discourse.julialang.org/u/Cristian_Montes)\
**Replies:** 4\
**Last updated:** [July 22, 2022, 4:34pm UTC](https://discourse.julialang.org/t/multivariate-maximum-likelihood/84618 "2022-07-22T16:34:57Z")

</div>

I am writing a simple program to determine maximum likelihood parameters for a non-linear function. For that I am using a multivariate normal, as the function needs to calibrate two functions with correlated errors. I …

---

## [How can I reduce memory consumption when using Zygote and Integrals together](https://discourse.julialang.org/t/how-can-i-reduce-memory-consumption-when-using-zygote-and-integrals-together/84638)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 0\
**Last updated:** [July 22, 2022, 3:43pm UTC](https://discourse.julialang.org/t/how-can-i-reduce-memory-consumption-when-using-zygote-and-integrals-together/84638 "2022-07-22T15:43:25Z")

</div>

Let’s start with a simple example: julia\> using Integrals julia\> using SciMLSensitivity julia\> using BenchmarkTools julia\> using Zygote julia\> f(x,h)=sin(x)\*exp(h\*cos(x)) f (generic function with 1 method) julia\> …

---

## [Distance matrix](https://discourse.julialang.org/t/distance-matrix/84619)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 5\
**Last updated:** [July 22, 2022, 2:44pm UTC](https://discourse.julialang.org/t/distance-matrix/84619 "2022-07-22T14:44:42Z")

</div>

I’m given a 20\*122 matrix p. Each row of matrix is a 20-element vector. I want to calculate the distance between each vector and form a distance matrix. Here’s my code mul = \[\] for i in 1:size(p,1) push!(mul,norm…

---

## [Reduce compilation time in Testing](https://discourse.julialang.org/t/reduce-compilation-time-in-testing/84387)

<div class="topic-metadata">

**Author:** [@kellertuer](https://discourse.julialang.org/u/kellertuer)\
**Replies:** 6\
**Last updated:** [July 22, 2022, 11:45am UTC](https://discourse.julialang.org/t/reduce-compilation-time-in-testing/84387 "2022-07-22T11:45:05Z")

</div>

In the package I am (co-)developing, we write a lot of tests. Now we are running into the problem, that the tests run quite long (currently for example a little more than an hour). In our output like So most of these…

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

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