# General Usage

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

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

**Page:** 293

---

## [Why is NPZ so much faster than JLD in this case?](https://discourse.julialang.org/t/why-is-npz-so-much-faster-than-jld-in-this-case/98776)

<div class="topic-metadata">

**Author:** [@Michael\_Hess](https://discourse.julialang.org/u/Michael_Hess)\
**Replies:** 3\
**Last updated:** [May 13, 2023, 3:06am UTC](https://discourse.julialang.org/t/why-is-npz-so-much-faster-than-jld-in-this-case/98776 "2023-05-13T03:06:33Z")

</div>

Hello! First post here so sorry in advance :') I am doing numerical simulations on a large dataset for a wide range of parameters, and I was trying to save the results of this analysis using the JLD save function. The a…

---

## [Changing progress bars in FluxML / SciML ecosystem](https://discourse.julialang.org/t/changing-progress-bars-in-fluxml-sciml-ecosystem/98777)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 0\
**Last updated:** [May 13, 2023, 2:27am UTC](https://discourse.julialang.org/t/changing-progress-bars-in-fluxml-sciml-ecosystem/98777 "2023-05-13T02:27:10Z")

</div>

I’m using Surrogates.jl and SurrogatesFlux.jl to train a neural network, and the output prints a progress bar for each training pass. I’d like to keep just the top (overall) progress bar, or none at all. Is there any way…

---

## [Understanding the performance of trait based dispatch together with type annotations](https://discourse.julialang.org/t/understanding-the-performance-of-trait-based-dispatch-together-with-type-annotations/98732)

<div class="topic-metadata">

**Author:** [@f.ij](https://discourse.julialang.org/u/f.ij)\
**Replies:** 1\
**Last updated:** [May 12, 2023, 12:54pm UTC](https://discourse.julialang.org/t/understanding-the-performance-of-trait-based-dispatch-together-with-type-annotations/98732 "2023-05-12T12:54:35Z")

</div>

I’m trying to write performant code, and in general opted for adding type annotations to help the compiler, since writing general code is often not very important in my code. I was currently trying to implement trait-ba…

---

## [Transducers vs Iterators](https://discourse.julialang.org/t/transducers-vs-iterators/98771)

<div class="topic-metadata">

**Author:** [@jekyllstein](https://discourse.julialang.org/u/jekyllstein)\
**Replies:** 0\
**Last updated:** [May 12, 2023, 11:03pm UTC](https://discourse.julialang.org/t/transducers-vs-iterators/98771 "2023-05-12T23:03:42Z")

</div>

I have an example of a simple processing pipeline where I noticed Transducers.jl was making a lot of allocations and behaving slowly compared to compositing iterators and generators together. I’m wondering if there’s a …

---

## [Can't build IJulia in 1.9](https://discourse.julialang.org/t/cant-build-ijulia-in-1-9/98757)

<div class="topic-metadata">

**Author:** [@ctkelley](https://discourse.julialang.org/u/ctkelley)\
**Replies:** 4\
**Last updated:** [May 12, 2023, 10:44pm UTC](https://discourse.julialang.org/t/cant-build-ijulia-in-1-9/98757 "2023-05-12T22:44:59Z")

</div>

I’m trying to build IJulia so my new notebook with know about it. I am having Conda problems again. I have tried deleting .julia and starting over with no luck. I get this message and am stuck. I have followed the direct…

---

## [How to control output type with Flux?](https://discourse.julialang.org/t/how-to-control-output-type-with-flux/98770)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [May 12, 2023, 10:34pm UTC](https://discourse.julialang.org/t/how-to-control-output-type-with-flux/98770 "2023-05-12T22:34:34Z")

</div>

Here is a MWE: using Flux function NeuralNetwork(; nb\_in=1, nb\_out=1, layer\_size=8, nb\_hid\_layers=1) # Note the use of Any\[\] since the Dense layers are of different types layers = Any\[Flux.Dense(nb\_in =\> layer\_…

---

## [Debugging ::Any types in Cthulhu's descend](https://discourse.julialang.org/t/debugging-any-types-in-cthulhus-descend/98734)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 0\
**Last updated:** [May 12, 2023, 11:11am UTC](https://discourse.julialang.org/t/debugging-any-types-in-cthulhus-descend/98734 "2023-05-12T11:11:02Z")

</div>

I’m trying to understand how to best interpret @descend from Cthulhu.jl in certain cases. Consider: julia\> using DataStructures, Cthulhu julia\> d = DefaultDict(-1, Dict(1 =\> 2)); julia\> @descend delete!(d, 1) delete!(…

---

## [Transferred several packages to JuliaMath](https://discourse.julialang.org/t/transferred-several-packages-to-juliamath/98761)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 0\
**Last updated:** [May 12, 2023, 8:14pm UTC](https://discourse.julialang.org/t/transferred-several-packages-to-juliamath/98761 "2023-05-12T20:14:53Z")

</div>

FYI: I moved the following packages from my GH account to JuliaMath. First I spruced up the CI for each. Test for appropriate Julia versions, and OS’s and 64 and 32-bit platforms where possible. Also added Aqua and JET t…

---

## [Subtyping vs adding a function to a struct's fields](https://discourse.julialang.org/t/subtyping-vs-adding-a-function-to-a-structs-fields/98638)

<div class="topic-metadata">

**Author:** [@jdossgollin](https://discourse.julialang.org/u/jdossgollin)\
**Replies:** 22\
**Last updated:** [May 12, 2023, 8:30am UTC](https://discourse.julialang.org/t/subtyping-vs-adding-a-function-to-a-structs-fields/98638 "2023-05-12T08:30:09Z")

</div>

I have a general strategic question about when to create subclasses versus when to do something else. As a motivating example, let’s say I have three boxes that I’d like to model. Boxes have various properties like mater…

---

## [What's the \`In \[N\]:\` prompt? Does it support copy-paste?](https://discourse.julialang.org/t/whats-the-in-n-prompt-does-it-support-copy-paste/98750)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 6\
**Last updated:** [May 12, 2023, 6:56pm UTC](https://discourse.julialang.org/t/whats-the-in-n-prompt-does-it-support-copy-paste/98750 "2023-05-12T18:56:41Z")

</div>

What prompt is that? (Does the copy/paste works as with the standard Julia prompt?)

---

## [Intersection of two plots](https://discourse.julialang.org/t/intersection-of-two-plots/98687)

<div class="topic-metadata">

**Author:** [@Desmond](https://discourse.julialang.org/u/Desmond)\
**Replies:** 4\
**Last updated:** [May 12, 2023, 5:38pm UTC](https://discourse.julialang.org/t/intersection-of-two-plots/98687 "2023-05-12T17:38:07Z")

</div>

I have two lines on a plot and I want Julia to find the intersection between the two lines but I can’t seem to find a package that can help with that.

---

## [Julia 1.9 on macOS modifies bundle contents, causing issues in VSCode](https://discourse.julialang.org/t/julia-1-9-on-macos-modifies-bundle-contents-causing-issues-in-vscode/98752)

<div class="topic-metadata">

**Author:** [@mattwigway](https://discourse.julialang.org/u/mattwigway)\
**Replies:** 0\
**Last updated:** [May 12, 2023, 4:39pm UTC](https://discourse.julialang.org/t/julia-1-9-on-macos-modifies-bundle-contents-causing-issues-in-vscode/98752 "2023-05-12T16:39:52Z")

</div>

When running Julia in VSCode, I’ve seen this message a few times: Digging into the syslog a bit (using the log show command), I see this: 2023-05-12 12:27:19.701485-0400 ... Error ... sandboxd: \[com.apple…

---

## [Status outdated after updating to Julia 1.9](https://discourse.julialang.org/t/status-outdated-after-updating-to-julia-1-9/98700)

<div class="topic-metadata">

**Author:** [@Soldalma](https://discourse.julialang.org/u/Soldalma)\
**Replies:** 4\
**Last updated:** [May 12, 2023, 3:46pm UTC](https://discourse.julialang.org/t/status-outdated-after-updating-to-julia-1-9/98700 "2023-05-12T15:46:21Z")

</div>

I updated from version 1.8.5 to version 1.9. Now I am getting this message: (BWModule) pkg\> status --outdated -m Status C:\\Users\\fsald\\Dropbox\\Code\\Julia\\bootstrapwalkforward\\BWModule\\Manifest.toml ⌃ \[ad839575\] Blink …

---

## [Julia version 1.9.0 on VSCODE , for loops and other weird output](https://discourse.julialang.org/t/julia-version-1-9-0-on-vscode-for-loops-and-other-weird-output/98716)

<div class="topic-metadata">

**Author:** [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Replies:** 5\
**Last updated:** [May 12, 2023, 2:51pm UTC](https://discourse.julialang.org/t/julia-version-1-9-0-on-vscode-for-loops-and-other-weird-output/98716 "2023-05-12T14:51:58Z")

</div>

trying to do simple for loop on julia 1.9.0 (in vscode), for i in 1:10 println(i) end julia seems to start evaluating endlessly up what i see on the repl is the following line #87 for i in 1:10 julia\> versionin…

---

## [Very different performance in different computers due to garbage collection?](https://discourse.julialang.org/t/very-different-performance-in-different-computers-due-to-garbage-collection/87563)

<div class="topic-metadata">

**Author:** [@TheLeache](https://discourse.julialang.org/u/TheLeache)\
**Replies:** 28\
**Last updated:** [May 12, 2023, 12:54pm UTC](https://discourse.julialang.org/t/very-different-performance-in-different-computers-due-to-garbage-collection/87563 "2023-05-12T12:54:26Z")

</div>

So, I have a code which calculates a measure of “openness” or “sprawl” around points in a series of big rasters from the National Land Cover Dataset. I had used this code on my personal laptop (A 2020 ROG G14 with a Ryze…

---

## [Cfunction error handler](https://discourse.julialang.org/t/cfunction-error-handler/20678)

<div class="topic-metadata">

**Author:** [@Bernard\_GODARD](https://discourse.julialang.org/u/Bernard_GODARD)\
**Replies:** 3\
**Last updated:** [May 12, 2023, 7:49am UTC](https://discourse.julialang.org/t/cfunction-error-handler/20678 "2023-05-12T07:49:02Z")

</div>

Hi I am trying to wrap a C function to set a error handler in the CALCEPH C library. The prototype is: void calceph\_seterrorhandler(int typehandler, void (\*userfunc)(const char\*)) The error message is passed to userfu…

---

## [How to check symmetry inside tuples and avoide overwrtting?](https://discourse.julialang.org/t/how-to-check-symmetry-inside-tuples-and-avoide-overwrtting/98694)

<div class="topic-metadata">

**Author:** [@Optimization](https://discourse.julialang.org/u/Optimization)\
**Replies:** 6\
**Last updated:** [May 12, 2023, 6:52am UTC](https://discourse.julialang.org/t/how-to-check-symmetry-inside-tuples-and-avoide-overwrtting/98694 "2023-05-12T06:52:50Z")

</div>

Is there any easy way to check if you have symmetric tuples in your lists? Like auto checking that \[(2,3),(3,5),(3,2),..., \[10,8)\] has. Because of (2,3) and (3,2). Also I don’r have any tuples with same number as first…

---

## [How can I just use the return value from one function but without calling that function in Julia](https://discourse.julialang.org/t/how-can-i-just-use-the-return-value-from-one-function-but-without-calling-that-function-in-julia/98708)

<div class="topic-metadata">

**Author:** [@jianqixi](https://discourse.julialang.org/u/jianqixi)\
**Replies:** 2\
**Last updated:** [May 12, 2023, 12:10am UTC](https://discourse.julialang.org/t/how-can-i-just-use-the-return-value-from-one-function-but-without-calling-that-function-in-julia/98708 "2023-05-12T00:10:46Z")

</div>

I know it maybe weird to ask this kind of question, but I am not sure Julia has this kind of way to achieve what I want. Here is one example code: function initialize(a,b,c) do something return x end function run(a,…

---

## [Plotting trajectories](https://discourse.julialang.org/t/plotting-trajectories/7111)

<div class="topic-metadata">

**Author:** [@Romero\_Azzalini](https://discourse.julialang.org/u/Romero_Azzalini)\
**Replies:** 3\
**Last updated:** [May 11, 2023, 10:41pm UTC](https://discourse.julialang.org/t/plotting-trajectories/7111 "2023-05-11T22:41:46Z")

</div>

Hi, I wanted to plot trajectories around a planet and therefore cut out a circle in the middle of the plot (PyPlot). I tried it with fill, but I can still see the trajectories :frowning: Also I want to plot 3D trajec…

---

## ["julia: error while loading shared libraries: libjulia.so.1: cannot open shared object file: No such file or directory" error when starting julia from command line on ubuntu](https://discourse.julialang.org/t/julia-error-while-loading-shared-libraries-libjulia-so-1-cannot-open-shared-object-file-no-such-file-or-directory-error-when-starting-julia-from-command-line-on-ubuntu/72707)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 4\
**Last updated:** [May 11, 2023, 8:06pm UTC](https://discourse.julialang.org/t/julia-error-while-loading-shared-libraries-libjulia-so-1-cannot-open-shared-object-file-no-such-file-or-directory-error-when-starting-julia-from-command-line-on-ubuntu/72707 "2023-05-11T20:06:27Z")

</div>

On ubuntu 18.04 I have a desktop which I haven’t really used since pre-pandemic times (with julia 1.3.1). I can run julia 1.3.1 from it just fine. However, I want to run the latest version (1.7.0)! I have downloaded tha…

---

## [Question on Starting Julia with Sys Image](https://discourse.julialang.org/t/question-on-starting-julia-with-sys-image/98686)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 1\
**Last updated:** [May 11, 2023, 5:51pm UTC](https://discourse.julialang.org/t/question-on-starting-julia-with-sys-image/98686 "2023-05-11T17:51:03Z")

</div>

I’ve created a system image following the example described here for OhMyREPL. I can now do the following, and it works! julia --sysimage=OMR-sysimage.so But typing that every time is a bit cumbersome. Can loading th…

---

## [Saving arguments or wrap function?](https://discourse.julialang.org/t/saving-arguments-or-wrap-function/98688)

<div class="topic-metadata">

**Author:** [@Veenty](https://discourse.julialang.org/u/Veenty)\
**Replies:** 4\
**Last updated:** [May 11, 2023, 5:42pm UTC](https://discourse.julialang.org/t/saving-arguments-or-wrap-function/98688 "2023-05-11T17:42:41Z")

</div>

Currently I have a structure where I save functions into something of the sort struct fooS x::Float64 A::Dict{Symbol, Function} fooS(x) = new(consfoo(x)...) end function consfoo(x) return x, Dict{Sym…

---

## [Logging: filter packages](https://discourse.julialang.org/t/logging-filter-packages/98692)

<div class="topic-metadata">

**Author:** [@FedeClaudi](https://discourse.julialang.org/u/FedeClaudi)\
**Replies:** 1\
**Last updated:** [May 11, 2023, 5:23pm UTC](https://discourse.julialang.org/t/logging-filter-packages/98692 "2023-05-11T17:23:43Z")

</div>

Hey folks, A quick question: I’ve set the logging level so that I can see @debug messages from my package as I develop stuff. However this will naturally also show @debug messages from other packages that are called fro…

---

## [Matplotlib & Julia : Pcolormesh and mask](https://discourse.julialang.org/t/matplotlib-julia-pcolormesh-and-mask/1792)

<div class="topic-metadata">

**Author:** [@lcambier](https://discourse.julialang.org/u/lcambier)\
**Replies:** 2\
**Last updated:** [May 11, 2023, 3:55pm UTC](https://discourse.julialang.org/t/matplotlib-julia-pcolormesh-and-mask/1792 "2023-05-11T15:55:48Z")

</div>

Hi, I have a 2d matrix with values that I currently plot doing something like axis\[:pcolormesh\](A', vmin=minimum(A\[:\]), vmax=0, edgecolor="white") But some values in A are non-relevant and I’d like to give them a whit…

---

## [Index elements of a function with several outputs](https://discourse.julialang.org/t/index-elements-of-a-function-with-several-outputs/98684)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 3\
**Last updated:** [May 11, 2023, 3:08pm UTC](https://discourse.julialang.org/t/index-elements-of-a-function-with-several-outputs/98684 "2023-05-11T15:08:51Z")

</div>

I would like to access specific output elements of a function. Here an example: function foo() return 1, 2, 3, 4, 5 end If I am only interested in output two and four I can use the underscore: \_, output2, \_, outp…

---

## [Work around for \`eigvals!(Matrix{Dec64})\`?](https://discourse.julialang.org/t/work-around-for-eigvals-matrix-dec64/98680)

<div class="topic-metadata">

**Author:** [@AwesomeQuest](https://discourse.julialang.org/u/AwesomeQuest)\
**Replies:** 2\
**Last updated:** [May 11, 2023, 2:30pm UTC](https://discourse.julialang.org/t/work-around-for-eigvals-matrix-dec64/98680 "2023-05-11T14:30:54Z")

</div>

Reading the code for eigvals!, it always tries to promote the matrix to some kind of “normal” float so it can work with LAPACK.geevx!… I think. But that clearly defeats the purpose of using something like DecFP. julia\> …

---

## [Why the allocated memory keep increase in for loop](https://discourse.julialang.org/t/why-the-allocated-memory-keep-increase-in-for-loop/98683)

<div class="topic-metadata">

**Author:** [@crazyfireji](https://discourse.julialang.org/u/crazyfireji)\
**Replies:** 0\
**Last updated:** [May 11, 2023, 1:55pm UTC](https://discourse.julialang.org/t/why-the-allocated-memory-keep-increase-in-for-loop/98683 "2023-05-11T13:55:48Z")

</div>

steps = 799500:100:800000 print("样本数为：",length(steps),"\\n") function main(filepath, nx, ny, nz, steps, Axi, Axj, Ayi, Ayj) hx = 1.0/(nx - 1); hy = 1/(ny - 1); for n in steps print("读取$(n)步 \\n") …

---

## [Load pkg in startup, then activate environment](https://discourse.julialang.org/t/load-pkg-in-startup-then-activate-environment/98671)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 1\
**Last updated:** [May 11, 2023, 12:20pm UTC](https://discourse.julialang.org/t/load-pkg-in-startup-then-activate-environment/98671 "2023-05-11T12:20:22Z")

</div>

What happens if a launch julia, load a package, and then activate a new enviroment?

---

## [How to convert a number to an hexadecimal \`bitstring\`?](https://discourse.julialang.org/t/how-to-convert-a-number-to-an-hexadecimal-bitstring/98673)

<div class="topic-metadata">

**Author:** [@tokujin](https://discourse.julialang.org/u/tokujin)\
**Replies:** 3\
**Last updated:** [May 11, 2023, 11:27am UTC](https://discourse.julialang.org/t/how-to-convert-a-number-to-an-hexadecimal-bitstring/98673 "2023-05-11T11:27:11Z")

</div>

I can do string(parse(Int, bitstring(x), base=2), base=16) to convert bitstring(x) to an hexadecimal string, but is there another way, one which is simpler and doesn’t trim the leading zeros off of integers?

---

## [Trying to implement Miller's recurrence algorithm and getting terrible results](https://discourse.julialang.org/t/trying-to-implement-millers-recurrence-algorithm-and-getting-terrible-results/98574)

<div class="topic-metadata">

**Author:** [@fda-tome](https://discourse.julialang.org/u/fda-tome)\
**Replies:** 6\
**Last updated:** [May 11, 2023, 11:07am UTC](https://discourse.julialang.org/t/trying-to-implement-millers-recurrence-algorithm-and-getting-terrible-results/98574 "2023-05-11T11:07:08Z")

</div>

I am currently trying to implement Miller’s algorithm but Im getting terrible numerical results, numerical errors are getting to 80% of original values. Is there an issue with my code? function besselj(orderLim, arg::Bi…

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

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