# General Usage

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

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

**Page:** 426

---

## [Solve linear system repeatedly without allocation](https://discourse.julialang.org/t/solve-linear-system-repeatedly-without-allocation/83901)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 11\
**Last updated:** [July 9, 2022, 12:54am UTC](https://discourse.julialang.org/t/solve-linear-system-repeatedly-without-allocation/83901 "2022-07-09T00:54:47Z")

</div>

I have a B \\ A calculation I need to solve repeatedly (10^4–10^5 times) with the same B, ideally without allocation, that includes the result A is a mutable buffer I want to write to the elements of A may be ForwardDif…

---

## [Inconsistent documentation generation behaviors](https://discourse.julialang.org/t/inconsistent-documentation-generation-behaviors/83967)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 2\
**Last updated:** [July 8, 2022, 10:29pm UTC](https://discourse.julialang.org/t/inconsistent-documentation-generation-behaviors/83967 "2022-07-08T22:29:32Z")

</div>

The documentation for Documenter.jl describes how to write a docs/make.jl ile to generate documentation. julia-docdeploy/action.yml at master · julia-actions/julia-docdeploy · GitHub doesn’t use that file. When one bui…

---

## [Error in plotting](https://discourse.julialang.org/t/error-in-plotting/83968)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 10\
**Last updated:** [July 8, 2022, 9:56pm UTC](https://discourse.julialang.org/t/error-in-plotting/83968 "2022-07-08T21:56:39Z")

</div>

I’m trying to plotting something. This is my code x = 1:20 y = m1\[1,:\] plot(x,y) Here y is a vector. And I want to plot the elements of this vector with x values = \[1:20\]. And I got the error MethodError: objects…

---

## [Best way to update parameter values in a temporary module](https://discourse.julialang.org/t/best-way-to-update-parameter-values-in-a-temporary-module/83971)

<div class="topic-metadata">

**Author:** [@jinml](https://discourse.julialang.org/u/jinml)\
**Replies:** 4\
**Last updated:** [July 8, 2022, 9:37pm UTC](https://discourse.julialang.org/t/best-way-to-update-parameter-values-in-a-temporary-module/83971 "2022-07-08T21:37:08Z")

</div>

I am a Julia user mostly interested in numerical prototyping, where I have constant need to work with a large collection of custom functions that are related to each other, but far from being ready to define a package. I…

---

## [Performance optimization on lots of small linear algebra operations](https://discourse.julialang.org/t/performance-optimization-on-lots-of-small-linear-algebra-operations/83850)

<div class="topic-metadata">

**Author:** [@vfonov](https://discourse.julialang.org/u/vfonov)\
**Replies:** 13\
**Last updated:** [July 8, 2022, 9:11pm UTC](https://discourse.julialang.org/t/performance-optimization-on-lots-of-small-linear-algebra-operations/83850 "2022-07-08T21:11:31Z")

</div>

I stumble on a problem with execution speed when I run lots of simple linear algebra operations in a loop, where using general Arrays performs faster then StaticArrays, but still not as fast as a pure C implementation. …

---

## [Does FunctionWrappers.jl support parametric polymorphism?](https://discourse.julialang.org/t/does-functionwrappers-jl-support-parametric-polymorphism/66408)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 3\
**Last updated:** [July 8, 2022, 7:54pm UTC](https://discourse.julialang.org/t/does-functionwrappers-jl-support-parametric-polymorphism/66408 "2022-07-08T19:54:35Z")

</div>

julia\> (FunctionWrapper{T, T} where T)(x -\> x + 1) ERROR: MethodError: no method matching (FunctionWrapper{T, T} where T)(::var"#3#4") julia\> (FunctionWrapper{T, Tuple{T}} where T)(x -\> x + 1) ERROR: MethodError: no met…

---

## [Efficiently passing a set of constants to a function](https://discourse.julialang.org/t/efficiently-passing-a-set-of-constants-to-a-function/72248)

<div class="topic-metadata">

**Author:** [@bgctw](https://discourse.julialang.org/u/bgctw)\
**Replies:** 21\
**Last updated:** [July 8, 2022, 7:25pm UTC](https://discourse.julialang.org/t/efficiently-passing-a-set-of-constants-to-a-function/72248 "2022-07-08T19:25:15Z")

</div>

I am using physical constants in a function in a package. The access to these constants should be fast, best the compiler could replace the values in the lower-level-code. I can actually achieve this by using global con…

---

## [Moving to juliadb from dataframes and getting error joining tables, dataframes join ok](https://discourse.julialang.org/t/moving-to-juliadb-from-dataframes-and-getting-error-joining-tables-dataframes-join-ok/83894)

<div class="topic-metadata">

**Author:** [@bww00](https://discourse.julialang.org/u/bww00)\
**Replies:** 1\
**Last updated:** [July 8, 2022, 7:21pm UTC](https://discourse.julialang.org/t/moving-to-juliadb-from-dataframes-and-getting-error-joining-tables-dataframes-join-ok/83894 "2022-07-08T19:21:54Z")

</div>

Moving to juliadb from dataframes and getting error joining 2 tables. ERROR: LoadError: UndefRefError: access to undefined reference error is on the join statement tables load ok. Any help appreciated code and error…

---

## [Hexadecimal Float64 creation](https://discourse.julialang.org/t/hexadecimal-float64-creation/83936)

<div class="topic-metadata">

**Author:** [@uje](https://discourse.julialang.org/u/uje)\
**Replies:** 4\
**Last updated:** [July 8, 2022, 7:00pm UTC](https://discourse.julialang.org/t/hexadecimal-float64-creation/83936 "2022-07-08T19:00:08Z")

</div>

x = 0x.4p-1 0.125 What is the maths behind it, because I know 0.4 \* 2^-1 = 0.2 I’m confused as to why that returns 0.125 in Julia, please enlighten me if I’m missing something

---

## [Manipulating vectors with logsumexp](https://discourse.julialang.org/t/manipulating-vectors-with-logsumexp/83955)

<div class="topic-metadata">

**Author:** [@samerb](https://discourse.julialang.org/u/samerb)\
**Replies:** 2\
**Last updated:** [July 8, 2022, 5:28pm UTC](https://discourse.julialang.org/t/manipulating-vectors-with-logsumexp/83955 "2022-07-08T17:28:43Z")

</div>

I have an n-dimensional vector \\delta and I would like to compute the following vector expression. \\left\[ \\log \\left( \\sum\_{i=1}^n \\exp(\\delta\_i) \\right) - \\log \\left( \\sum\_{i \\neq j} \\exp(\\delta\_i) \\right) \\right\]\_{j=…

---

## [Parallelizing Multiple Workers for File Operations](https://discourse.julialang.org/t/parallelizing-multiple-workers-for-file-operations/83951)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 1\
**Last updated:** [July 8, 2022, 4:41pm UTC](https://discourse.julialang.org/t/parallelizing-multiple-workers-for-file-operations/83951 "2022-07-08T16:41:27Z")

</div>

Hi all, This is my first time trying this out but here is a problem and what I am trying to do and what I am stuck on trying to do: Problem: I have many big files (200+, 50 - 100GB each) that I am going to read out. I…

---

## [Unable to convert Linspace to Range in a function](https://discourse.julialang.org/t/unable-to-convert-linspace-to-range-in-a-function/83943)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 4\
**Last updated:** [July 8, 2022, 3:45pm UTC](https://discourse.julialang.org/t/unable-to-convert-linspace-to-range-in-a-function/83943 "2022-07-08T15:45:58Z")

</div>

Hi all, I want to plot partitions of Riemann Sums from this blog: https://julialang.org/blog/2017/03/piday/ The problem is since it is from 2017 article, it is using linspace, I read around and see it is replaced by ra…

---

## [Interpolate variables into latex matrix in Pluto](https://discourse.julialang.org/t/interpolate-variables-into-latex-matrix-in-pluto/83698)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 3\
**Last updated:** [July 8, 2022, 2:48pm UTC](https://discourse.julialang.org/t/interpolate-variables-into-latex-matrix-in-pluto/83698 "2022-07-08T14:48:16Z")

</div>

Hi all, As shown in the screen shot, I would like to reference variables inside a LaTeX matrix. Here is the code I am using. Any help would be greatly appreciated.

---

## [How to Draw Polygon inside circle and calculate its area?](https://discourse.julialang.org/t/how-to-draw-polygon-inside-circle-and-calculate-its-area/83900)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 3\
**Last updated:** [July 8, 2022, 12:57pm UTC](https://discourse.julialang.org/t/how-to-draw-polygon-inside-circle-and-calculate-its-area/83900 "2022-07-08T12:57:50Z")

</div>

I want to know how to create polygons inside circle and calculate its area, just like the image below:

---

## [Divide a matrix into 4 submatrices](https://discourse.julialang.org/t/divide-a-matrix-into-4-submatrices/83856)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 6\
**Last updated:** [July 8, 2022, 11:20am UTC](https://discourse.julialang.org/t/divide-a-matrix-into-4-submatrices/83856 "2022-07-08T11:20:54Z")

</div>

Hi, I’m given a 2\*38 matrix. -7.002 -6.94768 -6.92167 -6.85372 … -3.67384 -3.61184 -3.51171 -1.00187 -1.15017 -1.08179 -1.09073 -0.389809 -0.730911 -0.813239 And I want to get four submatrices. T…

---

## [How to draw area below a function at certain interval?](https://discourse.julialang.org/t/how-to-draw-area-below-a-function-at-certain-interval/83895)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [July 8, 2022, 11:14am UTC](https://discourse.julialang.org/t/how-to-draw-area-below-a-function-at-certain-interval/83895 "2022-07-08T11:14:51Z")

</div>

Hi all, how do we draw an area like below (definite integral)? and how to make the result function of the area becomes in the same box like label? This is my code: using Plots, LaTeXStrings gr() function Area(f, a…

---

## [Getkey for dictionaries with composite-typed values](https://discourse.julialang.org/t/getkey-for-dictionaries-with-composite-typed-values/83940)

<div class="topic-metadata">

**Author:** [@taxodium](https://discourse.julialang.org/u/taxodium)\
**Replies:** 1\
**Last updated:** [July 8, 2022, 11:05am UTC](https://discourse.julialang.org/t/getkey-for-dictionaries-with-composite-typed-values/83940 "2022-07-08T11:05:53Z")

</div>

Hi. I’m intermediate level in Julia. For some problem I want to solve, I have to define a custom composite type: struct NodeData presence\_cpu::AbstractVector{Bool} presence\_gpu::AbstractVector{Bool} mem\_…

---

## [Best practice to make sure Julia and third-party libraries use the same MKL?](https://discourse.julialang.org/t/best-practice-to-make-sure-julia-and-third-party-libraries-use-the-same-mkl/83938)

<div class="topic-metadata">

**Author:** [@jsjie](https://discourse.julialang.org/u/jsjie)\
**Replies:** 0\
**Last updated:** [July 8, 2022, 10:05am UTC](https://discourse.julialang.org/t/best-practice-to-make-sure-julia-and-third-party-libraries-use-the-same-mkl/83938 "2022-07-08T10:05:55Z")

</div>

This might be a problem of broader scope, MKL is only an example. I’m using dftd4 library in my package, and a first attempt give me Intel MKL ERROR: Parameter 4 was incorrect on entry to DSYTRF. After some digging, I …

---

## [Why does \`throw\` break type inference?](https://discourse.julialang.org/t/why-does-throw-break-type-inference/83934)

<div class="topic-metadata">

**Author:** [@yiyuezhuo](https://discourse.julialang.org/u/yiyuezhuo)\
**Replies:** 2\
**Last updated:** [July 8, 2022, 9:25am UTC](https://discourse.julialang.org/t/why-does-throw-break-type-inference/83934 "2022-07-08T09:25:01Z")

</div>

I’m researching SSA-IR, and I found that most types of Julia functions are determined by compile-time, as they’re converted to invoke type from call type with a MethodInstance in code\_typed. But there are still some call …

---

## [Type stability in MixtureModels](https://discourse.julialang.org/t/type-stability-in-mixturemodels/83932)

<div class="topic-metadata">

**Author:** [@LeeviL](https://discourse.julialang.org/u/LeeviL)\
**Replies:** 0\
**Last updated:** [July 8, 2022, 7:43am UTC](https://discourse.julialang.org/t/type-stability-in-mixturemodels/83932 "2022-07-08T07:43:36Z")

</div>

Hi! I want to define a MixtureModel in which the component distributions might be from different families. While this piece of code works, the code is type unstable: using Distributions mixture = MixtureModel(\[Normal(-2…

---

## [Optimization of function and solver DifferentialEquations.jl](https://discourse.julialang.org/t/optimization-of-function-and-solver-differentialequations-jl/83885)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 11\
**Last updated:** [July 8, 2022, 7:38am UTC](https://discourse.julialang.org/t/optimization-of-function-and-solver-differentialequations-jl/83885 "2022-07-08T07:38:02Z")

</div>

How can i optimization this function and solver. I think I used all the optimizations I could from the documentation. I can not use dt or saveat. System have chaos and hyper chaos.

---

## [Application of umap](https://discourse.julialang.org/t/application-of-umap/83925)

<div class="topic-metadata">

**Author:** [@JosieG](https://discourse.julialang.org/u/JosieG)\
**Replies:** 0\
**Last updated:** [July 8, 2022, 1:21am UTC](https://discourse.julialang.org/t/application-of-umap/83925 "2022-07-08T01:21:32Z")

</div>

Hi, I’m applying umap on my dataset. The reference is Updated Notebook with example of UMAP by davibarreira · Pull Request #44 · dillondaudert/UMAP.jl · GitHub and UMAP.jl/PlotMNIST.ipynb at master · dillondaudert/UMAP…

---

## [Unable to add PyCall to any environment](https://discourse.julialang.org/t/unable-to-add-pycall-to-any-environment/83867)

<div class="topic-metadata">

**Author:** [@peter.wolf](https://discourse.julialang.org/u/peter.wolf)\
**Replies:** 6\
**Last updated:** [July 8, 2022, 1:04am UTC](https://discourse.julialang.org/t/unable-to-add-pycall-to-any-environment/83867 "2022-07-08T01:04:20Z")

</div>

I added an issue to PyCall.jl but I think it is more likely that something has become messed up on my laptop https://github.com/JuliaPy/PyCall.jl/issues/994 Basically, if I try to add PyCall to any environment, it fail…

---

## [How can I close files for writing within a loop](https://discourse.julialang.org/t/how-can-i-close-files-for-writing-within-a-loop/83923)

<div class="topic-metadata">

**Author:** [@thehalfspace](https://discourse.julialang.org/u/thehalfspace)\
**Replies:** 5\
**Last updated:** [July 8, 2022, 12:53am UTC](https://discourse.julialang.org/t/how-can-i-close-files-for-writing-within-a-loop/83923 "2022-07-08T00:53:13Z")

</div>

I want to store output for a simulation. I want to be able to change the number of output files the code creates based on user input. Here is what I have so far, everything is inside main: function main() out\_loc = \[5…

---

## [How to generate normalized random floats in range (0;1)](https://discourse.julialang.org/t/how-to-generate-normalized-random-floats-in-range-0-1/83852)

<div class="topic-metadata">

**Author:** [@Renan\_Rabelo](https://discourse.julialang.org/u/Renan_Rabelo)\
**Replies:** 4\
**Last updated:** [July 7, 2022, 5:22pm UTC](https://discourse.julialang.org/t/how-to-generate-normalized-random-floats-in-range-0-1/83852 "2022-07-07T17:22:38Z")

</div>

I need to generate normal random floats in range \[0;1\], but randn(Float64) uses a different range. How to fix it?

---

## [Controling figure sizes in Jupyter's VSC extension](https://discourse.julialang.org/t/controling-figure-sizes-in-jupyters-vsc-extension/83889)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 0\
**Last updated:** [July 7, 2022, 12:04pm UTC](https://discourse.julialang.org/t/controling-figure-sizes-in-jupyters-vsc-extension/83889 "2022-07-07T12:04:38Z")

</div>

Hi, I started using the Jupyter VSC extension and I must say I’m very well impressed. But there is one issue that is a bit annoying, which is the figure sizes. When we have a command that generates a figure, that figure…

---

## [Clipping a mesh to a ball](https://discourse.julialang.org/t/clipping-a-mesh-to-a-ball/83833)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 18\
**Last updated:** [July 7, 2022, 11:42am UTC](https://discourse.julialang.org/t/clipping-a-mesh-to-a-ball/83833 "2022-07-07T11:42:00Z")

</div>

Hello, It looks like Makie has no functionality to clip a 3d mesh to a ball (i.e. to discard the part of the mesh which is outside the ball). Is there another package to achieve that? Motivation. This is possible with t…

---

## [How to make a function 120 times faster](https://discourse.julialang.org/t/how-to-make-a-function-120-times-faster/83848)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 15\
**Last updated:** [July 7, 2022, 10:15am UTC](https://discourse.julialang.org/t/how-to-make-a-function-120-times-faster/83848 "2022-07-07T10:15:39Z")

</div>

The function has the purpose of labeling the groups of “interconnected” cells \[two cells are connected if have a 1 and are side by side or one above the other\]. I had tried a first crude algorithm that did the job aroun…

---

## [Duplicated function documentation](https://discourse.julialang.org/t/duplicated-function-documentation/83882)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 2\
**Last updated:** [July 7, 2022, 9:05am UTC](https://discourse.julialang.org/t/duplicated-function-documentation/83882 "2022-07-07T09:05:24Z")

</div>

The documentation of a function with multiple methods is duplicated. """ doc of f """ f(m::AbstractMatrix) = g(m) f(r::AbstractVector) = g(h(r)) searching for the doc of the function help?\> f results in doc of f …

---

## [How to broadcast a value over functions instead of a function over values?](https://discourse.julialang.org/t/how-to-broadcast-a-value-over-functions-instead-of-a-function-over-values/83877)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 6\
**Last updated:** [July 7, 2022, 8:35am UTC](https://discourse.julialang.org/t/how-to-broadcast-a-value-over-functions-instead-of-a-function-over-values/83877 "2022-07-07T08:35:11Z")

</div>

This is a somewhat unusual usage, but I’m wondering if given julia\> M = \[sin cos; cos sin\] 2×2 Matrix{Function}: sin cos cos sin is there an easy way to broadcast the function evaluation over the elements for one s…

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

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