# General Usage

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

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

**Page:** 264

---

## [JuliaHub bug: package dependent not listed](https://discourse.julialang.org/t/juliahub-bug-package-dependent-not-listed/102229)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [July 29, 2023, 12:04pm UTC](https://discourse.julialang.org/t/juliahub-bug-package-dependent-not-listed/102229 "2023-07-29T12:04:50Z")

</div>

The page for InfiniteLinearAlgebra lists InfiniteArrays as a dependency, but InfiniteArrays lists no dependents.

---

## [Too much garbage collection for a simple vector addition operation](https://discourse.julialang.org/t/too-much-garbage-collection-for-a-simple-vector-addition-operation/102173)

<div class="topic-metadata">

**Author:** [@ducanh-le](https://discourse.julialang.org/u/ducanh-le)\
**Replies:** 12\
**Last updated:** [July 29, 2023, 7:16am UTC](https://discourse.julialang.org/t/too-much-garbage-collection-for-a-simple-vector-addition-operation/102173 "2023-07-29T07:16:02Z")

</div>

Hi everyone, I’m trying to optimize my code. When look at the profiler, the 2nd and the 3rd line below got GC flags: function resourceAvailable(v::Int32, a::Int32, usedResource::Vector{Int32}, md::ModelData) needed…

---

## [How to show a floating point number without truncating, when the number can be expressed with a finite number of digits?](https://discourse.julialang.org/t/how-to-show-a-floating-point-number-without-truncating-when-the-number-can-be-expressed-with-a-finite-number-of-digits/102178)

<div class="topic-metadata">

**Author:** [@archisman](https://discourse.julialang.org/u/archisman)\
**Replies:** 5\
**Last updated:** [July 29, 2023, 5:44am UTC](https://discourse.julialang.org/t/how-to-show-a-floating-point-number-without-truncating-when-the-number-can-be-expressed-with-a-finite-number-of-digits/102178 "2023-07-29T05:44:43Z")

</div>

Today I attended the keynote talk by Stephen Wolfram in JuliaCon 2023, and he showed how Julia functions can be called inside Mathematica. He also showed an example where Julia evaluates 4^45 = 0. I figured out that 4.…

---

## [Can I set --optimize flag when calling script](https://discourse.julialang.org/t/can-i-set-optimize-flag-when-calling-script/102217)

<div class="topic-metadata">

**Author:** [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Replies:** 3\
**Last updated:** [July 29, 2023, 1:43am UTC](https://discourse.julialang.org/t/can-i-set-optimize-flag-when-calling-script/102217 "2023-07-29T01:43:38Z")

</div>

If I call a script with ./script.jl (crucially, not julia script.jl) can I still set the -O flag somehow? Passing it in after the file name doesn’t seem to work.

---

## [How to implement the LayerNorm in NeuralPDE by Lux.jl](https://discourse.julialang.org/t/how-to-implement-the-layernorm-in-neuralpde-by-lux-jl/102120)

<div class="topic-metadata">

**Author:** [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)\
**Replies:** 2\
**Last updated:** [July 28, 2023, 11:42pm UTC](https://discourse.julialang.org/t/how-to-implement-the-layernorm-in-neuralpde-by-lux-jl/102120 "2023-07-28T23:42:13Z")

</div>

I tried to implement LayerNorm from Lux.jl package into NeuralPDE following a code: chain =\[Lux.Chain(Lux.LayerNorm(1,Lux.relu),Dense(1,10,Lux.tanh),Dense(10,20,Lux.tanh),Dense(20,10,Lux.tanh),Dense(10,1)) for \_ in 1:12…

---

## [Convert string containing quotes to command](https://discourse.julialang.org/t/convert-string-containing-quotes-to-command/101334)

<div class="topic-metadata">

**Author:** [@maths.tex](https://discourse.julialang.org/u/maths.tex)\
**Replies:** 5\
**Last updated:** [July 28, 2023, 9:46pm UTC](https://discourse.julialang.org/t/convert-string-containing-quotes-to-command/101334 "2023-07-28T21:46:49Z")

</div>

I’m new to julia. I have the following strings readen from a json file: pathtoexe = “c:\\my soft\\myexe.exe” folder = “c:\\folder with spaces” mycommand= “‘pathtoexe’ /option /D=‘folder’” The following commands replace …

---

## [Pre-Lowering Cassette?](https://discourse.julialang.org/t/pre-lowering-cassette/102213)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 1\
**Last updated:** [July 28, 2023, 8:59pm UTC](https://discourse.julialang.org/t/pre-lowering-cassette/102213 "2023-07-28T20:59:36Z")

</div>

I’ve been working with Cassette, and it’s awesome. Its docs are so good at teaching. I’m not sure if it was @oxinabox who wrote them or what but thank you! I’m running into some challenges working with the IR, and it’s …

---

## [How to Spawn Child RNGs with Random?](https://discourse.julialang.org/t/how-to-spawn-child-rngs-with-random/102122)

<div class="topic-metadata">

**Author:** [@alegresor](https://discourse.julialang.org/u/alegresor)\
**Replies:** 5\
**Last updated:** [July 26, 2023, 5:59pm UTC](https://discourse.julialang.org/t/how-to-spawn-child-rngs-with-random/102122 "2023-07-26T17:59:13Z")

</div>

In Python I can spawn independent child RNGs with numpy.random.Generator.spawn. How can I do this in Julia?

---

## [Latest stable documentation not being deployed](https://discourse.julialang.org/t/latest-stable-documentation-not-being-deployed/88053)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 5\
**Last updated:** [July 28, 2023, 4:29pm UTC](https://discourse.julialang.org/t/latest-stable-documentation-not-being-deployed/88053 "2023-07-28T16:29:36Z")

</div>

I’m trying to get the stable documentation for ApproxFun.jl to build. The tagbot script contains ssh: ${{ secrets.DOCUMENTER\_KEY }} and the documentation job script contains on: pull\_request: push: …

---

## [Strange Glib\_jll behavior](https://discourse.julialang.org/t/strange-glib-jll-behavior/102168)

<div class="topic-metadata">

**Author:** [@bojohnson02](https://discourse.julialang.org/u/bojohnson02)\
**Replies:** 1\
**Last updated:** [July 28, 2023, 4:10pm UTC](https://discourse.julialang.org/t/strange-glib-jll-behavior/102168 "2023-07-28T16:10:34Z")

</div>

My reseach cluster underwent big changes recently. I was running into errors with my Julia code and have started fresh with a new juliaup installation. I’m still getting some strange behavior that I think I’ve isolated i…

---

## [GC.gc() error](https://discourse.julialang.org/t/gc-gc-error/102203)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 2\
**Last updated:** [July 28, 2023, 4:00pm UTC](https://discourse.julialang.org/t/gc-gc-error/102203 "2023-07-28T16:00:35Z")

</div>

got the following error and Julia quitted. Should be the result of calling GC.gc(). any idea how to avoid it? v.1.9.1, Apple silicon M2 Ultra mjulia191(74249,0x1e7495e00) malloc: \*\*\* error for object 0x48db150c0: point…

---

## [Julia, New Package, Github and VSCode](https://discourse.julialang.org/t/julia-new-package-github-and-vscode/102079)

<div class="topic-metadata">

**Author:** [@jlhouchin](https://discourse.julialang.org/u/jlhouchin)\
**Replies:** 4\
**Last updated:** [July 28, 2023, 3:54pm UTC](https://discourse.julialang.org/t/julia-new-package-github-and-vscode/102079 "2023-07-28T15:54:13Z")

</div>

I have several projects I was looking at porting to Julia. I needed to understand how to properly create a new Package and publish it to GitHub and code from Codium. I read all I could find. I read all the tutorials I c…

---

## [ForwardDiff.jl with Symbolics.jl](https://discourse.julialang.org/t/forwarddiff-jl-with-symbolics-jl/98706)

<div class="topic-metadata">

**Author:** [@dchang10](https://discourse.julialang.org/u/dchang10)\
**Replies:** 3\
**Last updated:** [July 28, 2023, 2:43pm UTC](https://discourse.julialang.org/t/forwarddiff-jl-with-symbolics-jl/98706 "2023-07-28T14:43:28Z")

</div>

I’m trying to do mixed symbolic and numeric derivatives. I want to define a type that holds a function that I will use to differentiate on in the future, this function may be ill-defined, so I would like to be able to op…

---

## [How to Query Trino via REST python client?](https://discourse.julialang.org/t/how-to-query-trino-via-rest-python-client/98832)

<div class="topic-metadata">

**Author:** [@EMCP](https://discourse.julialang.org/u/EMCP)\
**Replies:** 1\
**Last updated:** [July 28, 2023, 2:29pm UTC](https://discourse.julialang.org/t/how-to-query-trino-via-rest-python-client/98832 "2023-07-28T14:29:46Z")

</div>

I have a trino cluster, which I am just wanting to query in Julia … get things into a few nice Table.jl tables and do some work with each dataset… but having trouble getting connected … the raw REST api is undocumented u…

---

## [How to colour individual array entries in a DataFrame cell with PrettyTables or similar?](https://discourse.julialang.org/t/how-to-colour-individual-array-entries-in-a-dataframe-cell-with-prettytables-or-similar/102157)

<div class="topic-metadata">

**Author:** [@Olegg](https://discourse.julialang.org/u/Olegg)\
**Replies:** 5\
**Last updated:** [July 28, 2023, 2:04am UTC](https://discourse.julialang.org/t/how-to-colour-individual-array-entries-in-a-dataframe-cell-with-prettytables-or-similar/102157 "2023-07-28T02:04:27Z")

</div>

I have a many-column DataFrames with most columns containing an array in each cell. (These are properties per solution in multi-constrained optimisation.) Here’s a snippet with 3-element arrays Would it be possible t…

---

## [X \* y + z does not automatically use FMA instruction](https://discourse.julialang.org/t/x-y-z-does-not-automatically-use-fma-instruction/100640)

<div class="topic-metadata">

**Author:** [@GLOBEX\_CORP](https://discourse.julialang.org/u/GLOBEX_CORP)\
**Replies:** 31\
**Last updated:** [July 27, 2023, 11:14pm UTC](https://discourse.julialang.org/t/x-y-z-does-not-automatically-use-fma-instruction/100640 "2023-07-27T23:14:11Z")

</div>

I am new to Julia and was wondering why the code x \* y + z does not use fmadd where all values are floats, but instead fmul followed by fadd. On the other hand, if I use the @fastmath decorator, the @code\_native changes …

---

## [\[Design pattern\] How to let my package internally use functions of another package it does know nothing about?](https://discourse.julialang.org/t/design-pattern-how-to-let-my-package-internally-use-functions-of-another-package-it-does-know-nothing-about/102149)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 10\
**Last updated:** [July 27, 2023, 8:02pm UTC](https://discourse.julialang.org/t/design-pattern-how-to-let-my-package-internally-use-functions-of-another-package-it-does-know-nothing-about/102149 "2023-07-27T20:02:56Z")

</div>

Hello, my objective is to have an imputer in my Machine Learning package that internally could use as actual imputer for each dimension (column) of the provided matrix any estimator that provides the “interface” mod=Mode…

---

## [Trying to translate Matlab code to Julia - need help #50640](https://discourse.julialang.org/t/trying-to-translate-matlab-code-to-julia-need-help-50640/102111)

<div class="topic-metadata">

**Author:** [@manuelcaeiro](https://discourse.julialang.org/u/manuelcaeiro)\
**Replies:** 14\
**Last updated:** [July 27, 2023, 6:26pm UTC](https://discourse.julialang.org/t/trying-to-translate-matlab-code-to-julia-need-help-50640/102111 "2023-07-27T18:26:38Z")

</div>

I’m trying to translate the following code in Matlab: e = 1.05; %Eccentricity a = -147562.72; %km b = abs(a)\*sqrt(e.^2 -1); %Equation for Semi-Minor Axis, b x1 = linspace( a, 2\*a, 1E3); %…

---

## [Feature request: add a reinstall\_all\_packages to Pkg](https://discourse.julialang.org/t/feature-request-add-a-reinstall-all-packages-to-pkg/102128)

<div class="topic-metadata">

**Author:** [@Paul\_Soderlind](https://discourse.julialang.org/u/Paul_Soderlind)\
**Replies:** 8\
**Last updated:** [July 27, 2023, 5:58pm UTC](https://discourse.julialang.org/t/feature-request-add-a-reinstall-all-packages-to-pkg/102128 "2023-07-27T17:58:40Z")

</div>

I suggest adding a simple function (\`reinstall\_all\_packages\`\`?) to Pkg that would purge all of .julia, except startup.jl and Project.toml (EDIT: plus some dev and Pluto stuff that I forgot about), and do an update Mot…

---

## [Reuse Dask from Julia on existing HPC facilities](https://discourse.julialang.org/t/reuse-dask-from-julia-on-existing-hpc-facilities/102166)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 0\
**Last updated:** [July 27, 2023, 4:34pm UTC](https://discourse.julialang.org/t/reuse-dask-from-julia-on-existing-hpc-facilities/102166 "2023-07-27T16:34:34Z")

</div>

There are many scientific facilities with Dask installed (and ports opened etc.) and user simply use Dask panel from the JupyterLab instance. I’m wondering if anyone has tried / what needed to be able to piggy back exis…

---

## [Preferred Kernel in jupyter notebook](https://discourse.julialang.org/t/preferred-kernel-in-jupyter-notebook/102138)

<div class="topic-metadata">

**Author:** [@Ethan\_Tran](https://discourse.julialang.org/u/Ethan_Tran)\
**Replies:** 5\
**Last updated:** [July 27, 2023, 4:20pm UTC](https://discourse.julialang.org/t/preferred-kernel-in-jupyter-notebook/102138 "2023-07-27T16:20:18Z")

</div>

I have used three different versions of Julia on my PC (1.8.5, 1.9.0, and 1.9.2). For all versions, I’ve already installed the IJulia package or using Pkg and Pkg.build("IJulia"). However, when I use the jupyter notebook…

---

## [Explicit type annotation in document for function in julia · JuliaLang/julia](https://discourse.julialang.org/t/explicit-type-annotation-in-document-for-function-in-julia-julialang-julia/102137)

<div class="topic-metadata">

**Author:** [@hungpham3112](https://discourse.julialang.org/u/hungpham3112)\
**Replies:** 6\
**Last updated:** [July 27, 2023, 2:50pm UTC](https://discourse.julialang.org/t/explicit-type-annotation-in-document-for-function-in-julia-julialang-julia/102137 "2023-07-27T14:50:49Z")

</div>

---

## [N dimensional array with different type](https://discourse.julialang.org/t/n-dimensional-array-with-different-type/102147)

<div class="topic-metadata">

**Author:** [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Replies:** 4\
**Last updated:** [July 27, 2023, 1:58pm UTC](https://discourse.julialang.org/t/n-dimensional-array-with-different-type/102147 "2023-07-27T13:58:10Z")

</div>

Hello, Is it possible to create a multidimensional array that would have several types of data of the following type? Here id and i is index. P1, P2, time ev type of Float64. check ev type of bool and another is arra…

---

## [Very simple Flux model refusing to converge](https://discourse.julialang.org/t/very-simple-flux-model-refusing-to-converge/102129)

<div class="topic-metadata">

**Author:** [@jClugstor](https://discourse.julialang.org/u/jClugstor)\
**Replies:** 3\
**Last updated:** [July 27, 2023, 12:00pm UTC](https://discourse.julialang.org/t/very-simple-flux-model-refusing-to-converge/102129 "2023-07-27T12:00:30Z")

</div>

I’m attempting to do something very simple for now. I just want to do a nonlinear curve fitting of sine using Flux.jl. So far, the model is completely refusing to converge, and is giving some very strange results. I must…

---

## [What is the current best way to draw pixels in julia?](https://discourse.julialang.org/t/what-is-the-current-best-way-to-draw-pixels-in-julia/102142)

<div class="topic-metadata">

**Author:** [@1m1](https://discourse.julialang.org/u/1m1)\
**Replies:** 1\
**Last updated:** [July 27, 2023, 5:53am UTC](https://discourse.julialang.org/t/what-is-the-current-best-way-to-draw-pixels-in-julia/102142 "2023-07-27T05:53:19Z")

</div>

is it Gtk? to be fast and reliable fast includes changing the drawing fast i would like to have a single, dedicated window that my julia draws on. if one had access to the pixels of a video, it should be possible to re…

---

## [DenseArray vs. Strided](https://discourse.julialang.org/t/densearray-vs-strided/102127)

<div class="topic-metadata">

**Author:** [@orenbenkiki](https://discourse.julialang.org/u/orenbenkiki)\
**Replies:** 2\
**Last updated:** [July 27, 2023, 4:52am UTC](https://discourse.julialang.org/t/densearray-vs-strided/102127 "2023-07-27T04:52:57Z")

</div>

I’m trying to understand the semantics of dense vs. strided arrays in Julia (in the Base array types). In my mind, there are three types of “regular” matrices: Strided: offset in memory of element (i, j) is (a + b \* …

---

## [GLMakie libgobject-2.0.so error](https://discourse.julialang.org/t/glmakie-libgobject-2-0-so-error/97850)

<div class="topic-metadata">

**Author:** [@Daniel\_Lewis](https://discourse.julialang.org/u/Daniel_Lewis)\
**Replies:** 10\
**Last updated:** [July 27, 2023, 12:55am UTC](https://discourse.julialang.org/t/glmakie-libgobject-2-0-so-error/97850 "2023-07-27T00:55:37Z")

</div>

hi I’m working on ubuntu 20.04 and try to use GLMakie but get the following error: ERROR: LoadError: InitError: could not load library "libgobject-2.0.so" libgobject-2.0.so: undefined symbol: g\_uri\_ref when runing: u…

---

## [Question about sum(x -\> ..., 1:n) notation](https://discourse.julialang.org/t/question-about-sum-x-1-n-notation/102132)

<div class="topic-metadata">

**Author:** [@Mark\_Szlazak](https://discourse.julialang.org/u/Mark_Szlazak)\
**Replies:** 2\
**Last updated:** [July 26, 2023, 6:12pm UTC](https://discourse.julialang.org/t/question-about-sum-x-1-n-notation/102132 "2023-07-26T18:12:34Z")

</div>

Hi again Dan. Question about this formula you wrote. I don’t understand the notation. sum(k -\> loops(n,k), 1:n) == factorial(n) What does sum(k-\>loops(n,k), 1:n) mean? Is something ranging from k to loops(n,k)? Also, w…

---

## [Help with speeding up this code](https://discourse.julialang.org/t/help-with-speeding-up-this-code/101407)

<div class="topic-metadata">

**Author:** [@Mark\_Szlazak](https://discourse.julialang.org/u/Mark_Szlazak)\
**Replies:** 30\
**Last updated:** [July 10, 2023, 10:45pm UTC](https://discourse.julialang.org/t/help-with-speeding-up-this-code/101407 "2023-07-10T22:45:29Z")

</div>

I am new to this language, tried a few speed up tips and this is the best i got. Is there anything else that can be done to get a significant performance increase? Can you show me how? using Plots, Printf, OffsetArrays …

---

## [Memoize functions defined in \`SymPy.jl\`](https://discourse.julialang.org/t/memoize-functions-defined-in-sympy-jl/102070)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 3\
**Last updated:** [July 26, 2023, 2:21pm UTC](https://discourse.julialang.org/t/memoize-functions-defined-in-sympy-jl/102070 "2023-07-26T14:21:13Z")

</div>

Is there a way to memoize a function that is defined in another module? Ideally, I would like to to something along the lines of import OtherModule: func using Memoization # I want this to replace \`func\` with a memoiz…

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

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