# General Usage

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

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

**Page:** 205

---

## [Automating the Best Layout for Plotting Variables?](https://discourse.julialang.org/t/automating-the-best-layout-for-plotting-variables/109672)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 3\
**Last updated:** [February 4, 2024, 2:57pm UTC](https://discourse.julialang.org/t/automating-the-best-layout-for-plotting-variables/109672 "2024-02-04T14:57:37Z")

</div>

Hi folks! I have been struggling with a problem on how to best plot variables that are not always guaranteed in data. Let me show an example of what I am talking about: Suppose I have a dataframe that looks something l…

---

## [Two point boundary value problem solution not obeying boundary condition](https://discourse.julialang.org/t/two-point-boundary-value-problem-solution-not-obeying-boundary-condition/109633)

<div class="topic-metadata">

**Author:** [@bast](https://discourse.julialang.org/u/bast)\
**Replies:** 1\
**Last updated:** [February 4, 2024, 10:47am UTC](https://discourse.julialang.org/t/two-point-boundary-value-problem-solution-not-obeying-boundary-condition/109633 "2024-02-04T10:47:36Z")

</div>

Hello, I am trying to replicate the solution of an optimal control problem (Redirecting). The canonical system is given by \\begin{aligned} & \\dot{x}(t)=x(t)\\left(1-\\frac{x(t)}{a}\\right)-\\frac{1}{(c+\\tau)} \\frac{x(t)^…

---

## [Allocations in broadcasted assignment (StackOverflow question)](https://discourse.julialang.org/t/allocations-in-broadcasted-assignment-stackoverflow-question/109680)

<div class="topic-metadata">

**Author:** [@bert](https://discourse.julialang.org/u/bert)\
**Replies:** 2\
**Last updated:** [February 4, 2024, 7:21am UTC](https://discourse.julialang.org/t/allocations-in-broadcasted-assignment-stackoverflow-question/109680 "2024-02-04T07:21:49Z")

</div>

I came across this StackOverflow post and am wondering what the solution is. I have played around with the example in this post (copied below) and, like the author, cannot get rid of the allocation in d’s broadcast assig…

---

## [Packages on GitHub that I can never download](https://discourse.julialang.org/t/packages-on-github-that-i-can-never-download/109501)

<div class="topic-metadata">

**Author:** [@jackmarry](https://discourse.julialang.org/u/jackmarry)\
**Replies:** 16\
**Last updated:** [February 4, 2024, 3:11am UTC](https://discourse.julialang.org/t/packages-on-github-that-i-can-never-download/109501 "2024-02-04T03:11:38Z")

</div>

julia newbie, there are some packages on GitHub that I can never download, some code packages are unregistered, can I install them by downloading the source code files from GitHub, or use them locally.

---

## [Why does a non-allocating function seem to allocate when being called in a multi-threaded map?](https://discourse.julialang.org/t/why-does-a-non-allocating-function-seem-to-allocate-when-being-called-in-a-multi-threaded-map/79531)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [February 3, 2024, 10:52pm UTC](https://discourse.julialang.org/t/why-does-a-non-allocating-function-seem-to-allocate-when-being-called-in-a-multi-threaded-map/79531 "2024-02-03T22:52:32Z")

</div>

I am measuring allocations using TimerOutputs. Here is a MWE: julia\> Threads.nthreads() 2 julia\> using TimerOutputs, Folds julia\> f!(M) = begin t = TimerOutput() @timeit t "update" M .= 1; println…

---

## [How to get mouse coords in Mousetrap.jl](https://discourse.julialang.org/t/how-to-get-mouse-coords-in-mousetrap-jl/109685)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 0\
**Last updated:** [February 3, 2024, 9:21pm UTC](https://discourse.julialang.org/t/how-to-get-mouse-coords-in-mousetrap-jl/109685 "2024-02-03T21:21:31Z")

</div>

Is there a function to poll the current mouse position in Mousetrap.jl? I want my render\_area to render differently depending on where the mouse is.

---

## [Memory build-up when loading DataFrames in a loop](https://discourse.julialang.org/t/memory-build-up-when-loading-dataframes-in-a-loop/109678)

<div class="topic-metadata">

**Author:** [@isaacjeffersonlee](https://discourse.julialang.org/u/isaacjeffersonlee)\
**Replies:** 2\
**Last updated:** [February 3, 2024, 6:24pm UTC](https://discourse.julialang.org/t/memory-build-up-when-loading-dataframes-in-a-loop/109678 "2024-02-03T18:24:02Z")

</div>

When I sequentially load a very large DataFrame into memory and then sort it in place, the memory usage builds eventually running out of memory? Is there anything I can do to prevent this? Why is the garbage collector n…

---

## [Define Python function in Julia file... with package imports](https://discourse.julialang.org/t/define-python-function-in-julia-file-with-package-imports/109663)

<div class="topic-metadata">

**Author:** [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Replies:** 2\
**Last updated:** [February 3, 2024, 5:52pm UTC](https://discourse.julialang.org/t/define-python-function-in-julia-file-with-package-imports/109663 "2024-02-03T17:52:35Z")

</div>

Thanks to PythonCall.jl, Python functions can be defined in Julia files like so: julia\> using PythonCall julia\> @pyexec """ def fib(n): a, b = 0, 1 for i in range(n): a, b = …

---

## [Throw and error](https://discourse.julialang.org/t/throw-and-error/109666)

<div class="topic-metadata">

**Author:** [@jiang\_ming\_zhang](https://discourse.julialang.org/u/jiang_ming_zhang)\
**Replies:** 1\
**Last updated:** [February 3, 2024, 12:22pm UTC](https://discourse.julialang.org/t/throw-and-error/109666 "2024-02-03T12:22:11Z")

</div>

julia\> a = 3 3 julia\> b = 4 4 julia\> throw("a:$a is unequal b:$b") ERROR: "a:3 is unequal b:4" Stacktrace: \[1\] top-level scope @ REPL\[19\]:1 I am a bit confused here. Is the ‘ERROR’ here indicating that there is s…

---

## [Symbolics.jl Finding Coefficients of Cross Terms Problem](https://discourse.julialang.org/t/symbolics-jl-finding-coefficients-of-cross-terms-problem/109649)

<div class="topic-metadata">

**Author:** [@Umut\_Can\_Turhan](https://discourse.julialang.org/u/Umut_Can_Turhan)\
**Replies:** 1\
**Last updated:** [February 3, 2024, 5:44pm UTC](https://discourse.julialang.org/t/symbolics-jl-finding-coefficients-of-cross-terms-problem/109649 "2024-02-03T17:44:42Z")

</div>

When I try to run the following code, the print function always returns the integer 0 (zero). However, you can easily see that the coefficient of the z\[1\] \* z\[2\] term equals -2. The Symbolics.jl module is robust for just…

---

## [Unreasonably fast FFT on CUDA](https://discourse.julialang.org/t/unreasonably-fast-fft-on-cuda/109398)

<div class="topic-metadata">

**Author:** [@jabru](https://discourse.julialang.org/u/jabru)\
**Replies:** 8\
**Last updated:** [February 3, 2024, 3:56pm UTC](https://discourse.julialang.org/t/unreasonably-fast-fft-on-cuda/109398 "2024-02-03T15:56:01Z")

</div>

Hey there, so I am currently working on an algorithm that will likely strongly depend on the FFT very significantly. Therefore I am considering to do the FFT in FFTW on Cuda to speed up the algorithm. It is a 3d FFT wit…

---

## [Help with this code (deallocation/pointers on sparse matrices)](https://discourse.julialang.org/t/help-with-this-code-deallocation-pointers-on-sparse-matrices/109574)

<div class="topic-metadata">

**Author:** [@Enlil50](https://discourse.julialang.org/u/Enlil50)\
**Replies:** 31\
**Last updated:** [February 3, 2024, 9:32am UTC](https://discourse.julialang.org/t/help-with-this-code-deallocation-pointers-on-sparse-matrices/109574 "2024-02-03T09:32:46Z")

</div>

This is a follow up of a recent thread I made Sparse matrices copy arrays, do not view them I sum up all the shared ideas, with 2 code examples. This is intended as a much clearer version and prosecution of that thread,…

---

## [Documenter generates inconsistent plots](https://discourse.julialang.org/t/documenter-generates-inconsistent-plots/109610)

<div class="topic-metadata">

**Author:** [@putianyi888](https://discourse.julialang.org/u/putianyi888)\
**Replies:** 6\
**Last updated:** [February 3, 2024, 8:45am UTC](https://discourse.julialang.org/t/documenter-generates-inconsistent-plots/109610 "2024-02-03T08:45:45Z")

</div>

An auto-generated plot in my package documentation is inconsistent across irrelevent commits. The most recent build changed the image while the related commit is irrelevant. Both images are different from what I get loc…

---

## [Why does profiling suggest that integer comparison dominates broadcasted assignment?](https://discourse.julialang.org/t/why-does-profiling-suggest-that-integer-comparison-dominates-broadcasted-assignment/109606)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 4\
**Last updated:** [February 3, 2024, 2:47am UTC](https://discourse.julialang.org/t/why-does-profiling-suggest-that-integer-comparison-dominates-broadcasted-assignment/109606 "2024-02-03T02:47:53Z")

</div>

julia\> a = rand(40000,4000); b = rand(40000,4000); julia\> Profile.clear() julia\> @bprofile $a\[1:end, 1:end\] .= $b BenchmarkTools.Trial: 9 samples with 1 evaluation. Range (min … max): 571.819 ms … 586.555 ms ┊ GC (m…

---

## [Should we make a Julia binding for Flecs?](https://discourse.julialang.org/t/should-we-make-a-julia-binding-for-flecs/109654)

<div class="topic-metadata">

**Author:** [@Tarny\_GG\_Channie](https://discourse.julialang.org/u/Tarny_GG_Channie)\
**Replies:** 0\
**Last updated:** [February 3, 2024, 12:59am UTC](https://discourse.julialang.org/t/should-we-make-a-julia-binding-for-flecs/109654 "2024-02-03T00:59:53Z")

</div>

While Julia has many ECS libraries such as Overseer it might be a good idea to leverage larger communities. Flecs is a fast, lightweight ECS written in c with many bindings. Would it be a good idea to add a Julia bindin…

---

## [Is there any documentation on "IntegralFunctions"](https://discourse.julialang.org/t/is-there-any-documentation-on-integralfunctions/108970)

<div class="topic-metadata">

**Author:** [@Laura](https://discourse.julialang.org/u/Laura)\
**Replies:** 8\
**Last updated:** [February 3, 2024, 12:36am UTC](https://discourse.julialang.org/t/is-there-any-documentation-on-integralfunctions/108970 "2024-02-03T00:36:50Z")

</div>

I have been trying to solve two integrals at the same time using the Integrals.jl Package. I am following the example in the documentation of Integrals.jl in the link below. My function that I am integrating is an in-…

---

## [Automatically convert rows of a matrix to vectors](https://discourse.julialang.org/t/automatically-convert-rows-of-a-matrix-to-vectors/109643)

<div class="topic-metadata">

**Author:** [@AliceandBob](https://discourse.julialang.org/u/AliceandBob)\
**Replies:** 3\
**Last updated:** [February 2, 2024, 9:15pm UTC](https://discourse.julialang.org/t/automatically-convert-rows-of-a-matrix-to-vectors/109643 "2024-02-02T21:15:05Z")

</div>

I’ve been using Julia from v0.6 but today I found this! I am very shocked! Julia will automatically convert the rows of a matrix to vectors! I know how to circumvent this, but I don’t believe I am the only one who fee…

---

## [Fast allocation of blocks in sparse matrix](https://discourse.julialang.org/t/fast-allocation-of-blocks-in-sparse-matrix/109561)

<div class="topic-metadata">

**Author:** [@johannesnauta](https://discourse.julialang.org/u/johannesnauta)\
**Replies:** 7\
**Last updated:** [February 2, 2024, 6:34pm UTC](https://discourse.julialang.org/t/fast-allocation-of-blocks-in-sparse-matrix/109561 "2024-02-02T18:34:00Z")

</div>

When trying to generate a “super adjacency matrix”, that is an adjacency matrix where each of its entries is the identity matrix, I noticed a bottleneck when generating the sparse block-matrix. More specifically, I am t…

---

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

<div class="topic-metadata">

**Author:** [@Sh\_166](https://discourse.julialang.org/u/Sh_166)\
**Replies:** 12\
**Last updated:** [February 2, 2024, 5:36pm UTC](https://discourse.julialang.org/t/strange-solution-with-differentialequations-jl/109579 "2024-02-02T17:36:47Z")

</div>

I have run into a weird problem with DifferentialEquations.jl. MWE: Pkg.add("Symbolics") Pkg.add("Plots") Pkg.add("DifferentialEquations") using Symbolics, Plots, DifferentialEquations function trial(dx, x, p, t) …

---

## [A question on the type system](https://discourse.julialang.org/t/a-question-on-the-type-system/109624)

<div class="topic-metadata">

**Author:** [@alemelis](https://discourse.julialang.org/u/alemelis)\
**Replies:** 2\
**Last updated:** [February 2, 2024, 4:44pm UTC](https://discourse.julialang.org/t/a-question-on-the-type-system/109624 "2024-02-02T16:44:34Z")

</div>

Hello! Say I have two nested(?) structures as mutable struct MyInnerStruct index :: Int64 vector :: Vector{Float64} boolean\_flag :: Bool a :: Float64 b :: Float64 c :: Float64 end struct MyOute…

---

## [@\_4::Union{Nothing, Tuple{Int64,Int64}} in simple iterator](https://discourse.julialang.org/t/4-union-nothing-tuple-int64-int64-in-simple-iterator/48698)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 7\
**Last updated:** [February 2, 2024, 3:50pm UTC](https://discourse.julialang.org/t/4-union-nothing-tuple-int64-int64-in-simple-iterator/48698 "2024-02-02T15:50:21Z")

</div>

What that @\_4::Union{Nothing, Tuple{Int64,Int64}} is indicating? Where is there any possible Tuple in this code? Is there anything important about this warning of type evaluation? When one runs @code\_warntype that line i…

---

## [Options for trimming precompile caches of third-party dependencies](https://discourse.julialang.org/t/options-for-trimming-precompile-caches-of-third-party-dependencies/109598)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 0\
**Last updated:** [February 1, 2024, 11:24pm UTC](https://discourse.julialang.org/t/options-for-trimming-precompile-caches-of-third-party-dependencies/109598 "2024-02-01T23:24:19Z")

</div>

I haven’t ran into a situation where it’d be significantly useful to load less from third-party packages, but is it at all possible to trim their precompile caches to only what my package needs without going as far as fo…

---

## [Double checking there is no multi-threaded dense x sparse matmul implementation](https://discourse.julialang.org/t/double-checking-there-is-no-multi-threaded-dense-x-sparse-matmul-implementation/106619)

<div class="topic-metadata">

**Author:** [@RomeoV](https://discourse.julialang.org/u/RomeoV)\
**Replies:** 7\
**Last updated:** [February 1, 2024, 9:48pm UTC](https://discourse.julialang.org/t/double-checking-there-is-no-multi-threaded-dense-x-sparse-matmul-implementation/106619 "2024-02-01T21:48:15Z")

</div>

I am in need of having very efficient dense x sparse matmul code, but it seems there is no threaded implementation of this available (only sparse x dense). I therefore wrote my own version, which achieves about 3x speedu…

---

## [How to install properly julia](https://discourse.julialang.org/t/how-to-install-properly-julia/109587)

<div class="topic-metadata">

**Author:** [@Sparsetacus](https://discourse.julialang.org/u/Sparsetacus)\
**Replies:** 7\
**Last updated:** [February 1, 2024, 7:00pm UTC](https://discourse.julialang.org/t/how-to-install-properly-julia/109587 "2024-02-01T19:00:40Z")

</div>

Hi all, I have a question on how to install julia on linux : what is the best way between : juliaup with the command curl -fsSL https://install.julialang.org | sh ? Where does this command install julia ? cloning …

---

## [Why does the \`Irrational\` type exist](https://discourse.julialang.org/t/why-does-the-irrational-type-exist/109586)

<div class="topic-metadata">

**Author:** [@Alseidon](https://discourse.julialang.org/u/Alseidon)\
**Replies:** 1\
**Last updated:** [February 1, 2024, 5:56pm UTC](https://discourse.julialang.org/t/why-does-the-irrational-type-exist/109586 "2024-02-01T17:56:32Z")

</div>

I recently stumbled upon an error writing x-\>zeros(typeof(x), (2, 2)), when I applied this to π. I quickly found that this was related to the Irrational type, which seems to be kind of a headache: Zero(π) and one(π) are …

---

## [Sum Types question](https://discourse.julialang.org/t/sum-types-question/109576)

<div class="topic-metadata">

**Author:** [@Larbino1](https://discourse.julialang.org/u/Larbino1)\
**Replies:** 1\
**Last updated:** [February 1, 2024, 3:29pm UTC](https://discourse.julialang.org/t/sum-types-question/109576 "2024-02-01T15:29:19Z")

</div>

I am considering using sum types for my package, and I have a question about the interface. Say I have a sum type of fruits, Apple Orange, and Pear. I have 3 methods consume(::Apple), consume(::Orange), consume(::Pear). …

---

## [Using unix datetime as String](https://discourse.julialang.org/t/using-unix-datetime-as-string/59994)

<div class="topic-metadata">

**Author:** [@rikh](https://discourse.julialang.org/u/rikh)\
**Replies:** 5\
**Last updated:** [April 25, 2021, 5:42pm UTC](https://discourse.julialang.org/t/using-unix-datetime-as-string/59994 "2021-04-25T17:42:07Z")

</div>

I’m trying to pass a unix datetime to a server but am unsure how to avoid the scientific notation: julia\> using Dates julia\> t = datetime2unix(now()) 1.619369013568e9 julia\> "$t" "1.619369013568e9" Instead, the serve…

---

## [Compute pairwise distances (Distances.jl)](https://discourse.julialang.org/t/compute-pairwise-distances-distances-jl/54297)

<div class="topic-metadata">

**Author:** [@bhaveshshrimali](https://discourse.julialang.org/u/bhaveshshrimali)\
**Replies:** 9\
**Last updated:** [February 1, 2024, 2:38pm UTC](https://discourse.julialang.org/t/compute-pairwise-distances-distances-jl/54297 "2024-02-01T14:38:22Z")

</div>

While trying to port some of my code from Python (NumPy + Numba) to Julia, I noticed that the pairwise distance evaluation is at times slightly slower when using Distances.jl. It is a pretty trivial piece of code that I …

---

## [Warning: Terminal not fully functional with Julia 1.0.5 on Windows](https://discourse.julialang.org/t/warning-terminal-not-fully-functional-with-julia-1-0-5-on-windows/67522)

<div class="topic-metadata">

**Author:** [@martin82](https://discourse.julialang.org/u/martin82)\
**Replies:** 25\
**Last updated:** [September 8, 2021, 7:07pm UTC](https://discourse.julialang.org/t/warning-terminal-not-fully-functional-with-julia-1-0-5-on-windows/67522 "2021-09-08T19:07:11Z")

</div>

Does the repl work?

---

## [LinearAlgebra.inv! not exported, in-place inversion](https://discourse.julialang.org/t/linearalgebra-inv-not-exported-in-place-inversion/109563)

<div class="topic-metadata">

**Author:** [@AdaemmerP](https://discourse.julialang.org/u/AdaemmerP)\
**Replies:** 5\
**Last updated:** [February 1, 2024, 12:00pm UTC](https://discourse.julialang.org/t/linearalgebra-inv-not-exported-in-place-inversion/109563 "2024-02-01T12:00:47Z")

</div>

Why is inv!() not exported from LinearAlgebra? What is the fastest and most efficient way to invert a Matrix? I have to invert (I - A) where I is the identity Matrix. In some cases A may be sparse. Imat = I(10) Imatx =…

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

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