# General Usage

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

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

**Page:** 357

---

## [Julia Sympy Apply To Both Sides Of Equation](https://discourse.julialang.org/t/julia-sympy-apply-to-both-sides-of-equation/91514)

<div class="topic-metadata">

**Author:** [@Brian\_Toomey](https://discourse.julialang.org/u/Brian_Toomey)\
**Replies:** 10\
**Last updated:** [December 13, 2022, 3:25pm UTC](https://discourse.julialang.org/t/julia-sympy-apply-to-both-sides-of-equation/91514 "2022-12-13T15:25:46Z")

</div>

Julia Sympy is great! Many thanks to the people that worked on it. I’m wondering about how one might implement a strategy like the one described here so that I could work through calculations myself for problem sets. T…

---

## [In the emacs vterm, dark\_gray color appears to be displayed as black and DataFrame border lines are broken](https://discourse.julialang.org/t/in-the-emacs-vterm-dark-gray-color-appears-to-be-displayed-as-black-and-dataframe-border-lines-are-broken/91599)

<div class="topic-metadata">

**Author:** [@Sijun](https://discourse.julialang.org/u/Sijun)\
**Replies:** 0\
**Last updated:** [December 13, 2022, 12:46pm UTC](https://discourse.julialang.org/t/in-the-emacs-vterm-dark-gray-color-appears-to-be-displayed-as-black-and-dataframe-border-lines-are-broken/91599 "2022-12-13T12:46:47Z")

</div>

As shown below: My emacs GUI is launched from WSL2. If I run vterm from an emacs terminal (emacs -nw), besides the color issue, the border lines of the DataFrame become broken. as show below: How can I fix this …

---

## [Compat entry for non-dependency](https://discourse.julialang.org/t/compat-entry-for-non-dependency/91590)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [December 13, 2022, 12:16pm UTC](https://discourse.julialang.org/t/compat-entry-for-non-dependency/91590 "2022-12-13T12:16:34Z")

</div>

In the Project.toml of package A, I would like to restrict compatibility for package B that is not a dependency. (why I am doing this)The motivation is following up on an array index ordering change of MCMCDiagnosticToo…

---

## [Typed globals: macro to define multiple, without manual type annotations](https://discourse.julialang.org/t/typed-globals-macro-to-define-multiple-without-manual-type-annotations/90818)

<div class="topic-metadata">

**Author:** [@tfiers](https://discourse.julialang.org/u/tfiers)\
**Replies:** 9\
**Last updated:** [December 13, 2022, 12:01pm UTC](https://discourse.julialang.org/t/typed-globals-macro-to-define-multiple-without-manual-type-annotations/90818 "2022-12-13T12:01:00Z")

</div>

I vaguely remember seeing a macro somewhere to define typed globals without having to give the type explicitly, something like @typed begin a = 2 b = 2.8 ⋮ end which would expand to a::Int = 2 b::Float64 = 2.8 ⋮…

---

## [Why I cannot use a tuple in \`map\` directly?](https://discourse.julialang.org/t/why-i-cannot-use-a-tuple-in-map-directly/91575)

<div class="topic-metadata">

**Author:** [@pitsianis](https://discourse.julialang.org/u/pitsianis)\
**Replies:** 4\
**Last updated:** [December 13, 2022, 11:43am UTC](https://discourse.julialang.org/t/why-i-cannot-use-a-tuple-in-map-directly/91575 "2022-12-13T11:43:35Z")

</div>

Why I cannot do this map((i,j,v) -\> v/(i\*j), zip(\[1,2\],\[10,20\],\[100,200\])) But this is just fine \[v/(i\*j) for (i,j,v) in zip(\[1,2\],\[10,20\],\[100,200\])\] And instead I have to write map(x -\> x\[3\]/(x\[1\]\*x\[2\]), zip(\[1,2\]…

---

## [Count occurances for matrix rows (where column order does not matter)](https://discourse.julialang.org/t/count-occurances-for-matrix-rows-where-column-order-does-not-matter/91374)

<div class="topic-metadata">

**Author:** [@KevinMoerman](https://discourse.julialang.org/u/KevinMoerman)\
**Replies:** 30\
**Last updated:** [December 13, 2022, 11:18am UTC](https://discourse.julialang.org/t/count-occurances-for-matrix-rows-where-column-order-does-not-matter/91374 "2022-12-13T11:18:53Z")

</div>

I would like to detect rows in a matrix which only occur once, also the column order does not matter. This relates to this discussion. I have implemented several options (see below), and all work (note though I am a Jul…

---

## [Why am I copying?](https://discourse.julialang.org/t/why-am-i-copying/91592)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 2\
**Last updated:** [December 13, 2022, 10:50am UTC](https://discourse.julialang.org/t/why-am-i-copying/91592 "2022-12-13T10:50:31Z")

</div>

In my program, I have two types of structs, one with a very longvector, and another that holds a view of a sub-part of the vector of another, reshaped to a matrix. In principle this should work: function reshapeView(ve…

---

## [Trapped in a int -\> missing -\> float loop](https://discourse.julialang.org/t/trapped-in-a-int-missing-float-loop/91578)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 10\
**Last updated:** [December 13, 2022, 10:40am UTC](https://discourse.julialang.org/t/trapped-in-a-int-missing-float-loop/91578 "2022-12-13T10:40:33Z")

</div>

Let’s say that I have a dataframe like df = DataFrame(a=\[ 1, 4, missing\], b= \[1, 4, 5\], c=\[1., 2, 3\]) 3×3 DataFrame Row │ a b c │ Int64? Int64 Float64 ─────┼───────────────────────── 1 │ 1…

---

## [What's the difference between LinearAlgebra.axpy! and BLAS.axpy!, and which one should packages extend?](https://discourse.julialang.org/t/whats-the-difference-between-linearalgebra-axpy-and-blas-axpy-and-which-one-should-packages-extend/91585)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [December 13, 2022, 5:15am UTC](https://discourse.julialang.org/t/whats-the-difference-between-linearalgebra-axpy-and-blas-axpy-and-which-one-should-packages-extend/91585 "2022-12-13T05:15:08Z")

</div>

BLAS sounds too low level, so intuitively I would think it’s LinearAlgebra.axpy! that packages should extend. However, what is the intended difference between the two? And when should one use one over the other? julia\> …

---

## [Skip some tests on nightly in CI](https://discourse.julialang.org/t/skip-some-tests-on-nightly-in-ci/91425)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [December 13, 2022, 9:27am UTC](https://discourse.julialang.org/t/skip-some-tests-on-nightly-in-ci/91425 "2022-12-13T09:27:08Z")

</div>

I am using Github Actions for CI on a package. I want to skip some tests on nightly, but it is a moving target and I don’t want to keep updating the code after every release. I am wondering what the best way to do this …

---

## [There is a huge difference in time consumption between calling a function sentence by sentence and calling the entire function at once](https://discourse.julialang.org/t/there-is-a-huge-difference-in-time-consumption-between-calling-a-function-sentence-by-sentence-and-calling-the-entire-function-at-once/82946)

<div class="topic-metadata">

**Author:** [@HANHAOHAN](https://discourse.julialang.org/u/HANHAOHAN)\
**Replies:** 33\
**Last updated:** [December 13, 2022, 8:50am UTC](https://discourse.julialang.org/t/there-is-a-huge-difference-in-time-consumption-between-calling-a-function-sentence-by-sentence-and-calling-the-entire-function-at-once/82946 "2022-12-13T08:50:01Z")

</div>

First, I statistics time consumer of each sentence with @btime: function (m::CoarseDecoder)(bg::T, fg, mask::T, encoder\_outs=nothing) where{T} bg\_x = bg mask\_x = mask mask\_outs = Vector{T}() bg\_outs = Ve…

---

## [BSON error after project packages update \[Resolved\]](https://discourse.julialang.org/t/bson-error-after-project-packages-update-resolved/91547)

<div class="topic-metadata">

**Author:** [@Maxim\_Lubov](https://discourse.julialang.org/u/Maxim_Lubov)\
**Replies:** 0\
**Last updated:** [December 12, 2022, 9:34am UTC](https://discourse.julialang.org/t/bson-error-after-project-packages-update-resolved/91547 "2022-12-12T09:34:05Z")

</div>

I have update packages for my project and strange error occurs. I have also update Julia from 1.7.2 to 1.8.2. Previously following code works without problems: model2 = BSON.load(filepath, @\_\_MODULE\_\_) Now, I have fol…

---

## [Real fft of a 3D array with FFTW](https://discourse.julialang.org/t/real-fft-of-a-3d-array-with-fftw/91572)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 2\
**Last updated:** [December 12, 2022, 10:52pm UTC](https://discourse.julialang.org/t/real-fft-of-a-3d-array-with-fftw/91572 "2022-12-12T22:52:38Z")

</div>

Hi, I need to take the 3D fft of an array of real data. I’d like to do that using rfft() from the FFTW library rather than the usual fft() to speed up the process and keep memory requirements low. Now my data is stored…

---

## [Inplace multiplication of sub-matrices without allocations](https://discourse.julialang.org/t/inplace-multiplication-of-sub-matrices-without-allocations/91534)

<div class="topic-metadata">

**Author:** [@CeterisPartybus](https://discourse.julialang.org/u/CeterisPartybus)\
**Replies:** 12\
**Last updated:** [December 12, 2022, 8:44pm UTC](https://discourse.julialang.org/t/inplace-multiplication-of-sub-matrices-without-allocations/91534 "2022-12-12T20:44:36Z")

</div>

I am writing a performance-critical part and would like to avoid any memory allocations in that part by creating caches beforehand. I then essentially need to multiply sub-arrays in a loop. Is there any way to do these m…

---

## [Why is a multi-argument inplace map much faster in this case than a broadcast?](https://discourse.julialang.org/t/why-is-a-multi-argument-inplace-map-much-faster-in-this-case-than-a-broadcast/91525)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 16\
**Last updated:** [December 12, 2022, 7:14pm UTC](https://discourse.julialang.org/t/why-is-a-multi-argument-inplace-map-much-faster-in-this-case-than-a-broadcast/91525 "2022-12-12T19:14:55Z")

</div>

julia\> A = rand(10, 1000); B = copy(A); C = zero(A); D = zero(A); julia\> @btime map!(+, $C, $A, $B); 3.405 μs (0 allocations: 0 bytes) julia\> @btime $D .= $A .+ $B; 10.915 μs (0 allocations: 0 bytes) julia\> A = r…

---

## [How to add data labels to bar plot?](https://discourse.julialang.org/t/how-to-add-data-labels-to-bar-plot/56168)

<div class="topic-metadata">

**Author:** [@Ivan](https://discourse.julialang.org/u/Ivan)\
**Replies:** 6\
**Last updated:** [December 12, 2022, 6:05pm UTC](https://discourse.julialang.org/t/how-to-add-data-labels-to-bar-plot/56168 "2022-12-12T18:05:56Z")

</div>

I want to add data labels to the bars of my bar plot, as seen here: (chart and python code accessible here How do I do it? Right now what I have is: plotly() y = rand(5) x = string.(\[1,2,3,4,5\]) using Plots bar = pl…

---

## [Strange behavior with DifferentialEquations.jl](https://discourse.julialang.org/t/strange-behavior-with-differentialequations-jl/91562)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [December 12, 2022, 5:31pm UTC](https://discourse.julialang.org/t/strange-behavior-with-differentialequations-jl/91562 "2022-12-12T17:31:04Z")

</div>

@ChrisRackauckas, I know you are busy today, but for afterwards, I have what “seems” to be a bug in DifferentialEquations.jl. Here is a MWE: using DifferentialEquations ## Data generation function lotka!(du, u, p, t) …

---

## [Accessing only a subset of function outputs](https://discourse.julialang.org/t/accessing-only-a-subset-of-function-outputs/91558)

<div class="topic-metadata">

**Author:** [@Atiyah](https://discourse.julialang.org/u/Atiyah)\
**Replies:** 7\
**Last updated:** [December 12, 2022, 4:49pm UTC](https://discourse.julialang.org/t/accessing-only-a-subset-of-function-outputs/91558 "2022-12-12T16:49:10Z")

</div>

suppose that there is a function with several return values function foo() ... ret1, ret2, ret3 end and suppose that a caller is interested in a particular subset of the return values and not all of them. How cou…

---

## [Discontinuation of ParallelDataTransfer.jl?](https://discourse.julialang.org/t/discontinuation-of-paralleldatatransfer-jl/91294)

<div class="topic-metadata">

**Author:** [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Replies:** 4\
**Last updated:** [December 12, 2022, 4:26pm UTC](https://discourse.julialang.org/t/discontinuation-of-paralleldatatransfer-jl/91294 "2022-12-12T16:26:28Z")

</div>

It seems to me that ParallelDataTransfer.jl is discontinued - the project still misses project.toml file and uses REQUIRE - this blocks the package from being installed in recent versions of Julia. My question is - is t…

---

## [@btime with local function --\> not defined](https://discourse.julialang.org/t/btime-with-local-function-not-defined/10204)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 3\
**Last updated:** [December 12, 2022, 4:06pm UTC](https://discourse.julialang.org/t/btime-with-local-function-not-defined/10204 "2022-12-12T16:06:13Z")

</div>

dear J wizards—how do I use @btime inside a function with a passed argument? julia\> function testme( afun ); @btime begin afun(2) end end testme (generic function with 1 method) julia\> testme( println ) ERROR: UndefVar…

---

## [Can threads communicate with each other while in multithreading?](https://discourse.julialang.org/t/can-threads-communicate-with-each-other-while-in-multithreading/91550)

<div class="topic-metadata">

**Author:** [@le\_ackerman](https://discourse.julialang.org/u/le_ackerman)\
**Replies:** 2\
**Last updated:** [December 12, 2022, 1:07pm UTC](https://discourse.julialang.org/t/can-threads-communicate-with-each-other-while-in-multithreading/91550 "2022-12-12T13:07:28Z")

</div>

Hi! I am a beginner in parallel computing and been fooling around with different packages in multithreading. My question is very specific: I want to write a code to do multithreading… and i want to know is there any …

---

## ["Tuple type used as state" error in solve](https://discourse.julialang.org/t/tuple-type-used-as-state-error-in-solve/91541)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 2\
**Last updated:** [December 12, 2022, 11:07am UTC](https://discourse.julialang.org/t/tuple-type-used-as-state-error-in-solve/91541 "2022-12-12T11:07:15Z")

</div>

I am solving a system of two equations two unknowns using ODEProblem/solve pair. This works as long as I do not include them within a function. If I do, I get an error: ERROR: Tuple type used as a state. Since a tuple d…

---

## [Documenter keeps asking me for GitHub credentials](https://discourse.julialang.org/t/documenter-keeps-asking-me-for-github-credentials/91509)

<div class="topic-metadata">

**Author:** [@dgagnon](https://discourse.julialang.org/u/dgagnon)\
**Replies:** 2\
**Last updated:** [December 12, 2022, 10:50am UTC](https://discourse.julialang.org/t/documenter-keeps-asking-me-for-github-credentials/91509 "2022-12-12T10:50:47Z")

</div>

Why do I get a GitHub prompt every time I run documenter? Even if I simply open make.jl I get the request. Then I get a second window asking again for my github login and a third asking again for my password. I can en…

---

## [Sampler for Categorical Rational Distributions](https://discourse.julialang.org/t/sampler-for-categorical-rational-distributions/55077)

<div class="topic-metadata">

**Author:** [@Ian\_Slagle](https://discourse.julialang.org/u/Ian_Slagle)\
**Replies:** 3\
**Last updated:** [February 11, 2021, 7:46pm UTC](https://discourse.julialang.org/t/sampler-for-categorical-rational-distributions/55077 "2021-02-11T19:46:27Z")

</div>

With the new Distributions update (this did not appear to happen several versions ago), this works rand(Categorical(\[0.5, 0.5\])) and this works Categorical(\[1//2, 1//2\]) but this causes an error (“ArgumentError: Samp…

---

## [Vectorized sprintf?](https://discourse.julialang.org/t/vectorized-sprintf/91526)

<div class="topic-metadata">

**Author:** [@tp2750](https://discourse.julialang.org/u/tp2750)\
**Replies:** 7\
**Last updated:** [December 12, 2022, 7:58am UTC](https://discourse.julialang.org/t/vectorized-sprintf/91526 "2022-12-12T07:58:07Z")

</div>

In R I can easily generate vectors of formatted strings like this: \> sprintf("a%.2d", 1:10) \[1\] "a01" "a02" "a03" "a04" "a05" "a06" "a07" "a08" "a09" "a10" What is the closest in julia? As @sprintf is a macro I canno…

---

## [Parametric Type for Uninitialized/Undef Objects](https://discourse.julialang.org/t/parametric-type-for-uninitialized-undef-objects/91543)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 0\
**Last updated:** [December 12, 2022, 6:06am UTC](https://discourse.julialang.org/t/parametric-type-for-uninitialized-undef-objects/91543 "2022-12-12T06:06:47Z")

</div>

I’ve learned that you can create type-stable references to uninitialized objects like so: julia\> struct Foo{A} a::A end julia\> x = Ref{Foo{Int}}() Base.RefValue{Foo{Int64}}(Foo{Int64}(1847082903376)) julia\> x\[\] = Foo(…

---

## [Is it possible to suppress a message printed by a function?](https://discourse.julialang.org/t/is-it-possible-to-suppress-a-message-printed-by-a-function/91506)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 8\
**Last updated:** [December 12, 2022, 1:05am UTC](https://discourse.julialang.org/t/is-it-possible-to-suppress-a-message-printed-by-a-function/91506 "2022-12-12T01:05:18Z")

</div>

Hello, In R there are two function to print a message in the console: cat and message. The message function is better because it is possible to turn off the message it displays (with the suppressMessages function). This…

---

## [DataDrivenProblem signature not found](https://discourse.julialang.org/t/datadrivenproblem-signature-not-found/91518)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 9\
**Last updated:** [December 11, 2022, 7:17pm UTC](https://discourse.julialang.org/t/datadrivenproblem-signature-not-found/91518 "2022-12-11T19:17:16Z")

</div>

@Julius\_Martensen, @ChrisRackauckas I am symbolically fitting a function using DataDrivenProblem, which is part of the DataDrivenDiffEq ecosystem. I am using the documentation of version 0.8.6 (the documentation of ver…

---

## [Using LinearMap with MPI.jl](https://discourse.julialang.org/t/using-linearmap-with-mpi-jl/91464)

<div class="topic-metadata">

**Author:** [@devanshu](https://discourse.julialang.org/u/devanshu)\
**Replies:** 5\
**Last updated:** [December 11, 2022, 6:34am UTC](https://discourse.julialang.org/t/using-linearmap-with-mpi-jl/91464 "2022-12-11T06:34:24Z")

</div>

Hi, I am finding difficulty in using LinearMaps while also trying to parallelize the code using MPI.jl. Actually, I am using ArnoldiMethod.jl in order to implement shift-invert diagonalization technique. The minimal co…

---

## [Trouble using for loop for SARIMA](https://discourse.julialang.org/t/trouble-using-for-loop-for-sarima/91519)

<div class="topic-metadata">

**Author:** [@Agnes\_H](https://discourse.julialang.org/u/Agnes_H)\
**Replies:** 1\
**Last updated:** [December 11, 2022, 2:30am UTC](https://discourse.julialang.org/t/trouble-using-for-loop-for-sarima/91519 "2022-12-11T02:30:31Z")

</div>

Hi, I apologize in advance, most of my programming skills are self-taught, if there are any weird errors. My goal with this code was to basically create a for-loop that iterates over every column in my data frame separa…

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

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