# General Usage

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

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

**Page:** 292

---

## [Interpreting profiling flame charts: function runs dramatically faster after calling unrelated function](https://discourse.julialang.org/t/interpreting-profiling-flame-charts-function-runs-dramatically-faster-after-calling-unrelated-function/98836)

<div class="topic-metadata">

**Author:** [@PatrickMcFarlane](https://discourse.julialang.org/u/PatrickMcFarlane)\
**Replies:** 4\
**Last updated:** [May 15, 2023, 12:42pm UTC](https://discourse.julialang.org/t/interpreting-profiling-flame-charts-function-runs-dramatically-faster-after-calling-unrelated-function/98836 "2023-05-15T12:42:36Z")

</div>

I am working on a code base to solve a large dynamic economic model with heterogeneous agents. I coded up two different iterative algorithms for solving the model. These are wrapped in functions that I’ll call f1 and f…

---

## [De-\`NamedTuple\`izing keyword arguments](https://discourse.julialang.org/t/de-namedtuple-izing-keyword-arguments/98837)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 6\
**Last updated:** [May 15, 2023, 12:21pm UTC](https://discourse.julialang.org/t/de-namedtuple-izing-keyword-arguments/98837 "2023-05-15T12:21:34Z")

</div>

I’m trying to understand if there’s optimization potential in Makie regarding its ubiquitous use of keyword arguments. My idea is writing a macro that makes a function gather its keyword arguments not into a NamedTuple b…

---

## [Is serialization a safe option for data storage?](https://discourse.julialang.org/t/is-serialization-a-safe-option-for-data-storage/98872)

<div class="topic-metadata">

**Author:** [@dnldlg](https://discourse.julialang.org/u/dnldlg)\
**Replies:** 2\
**Last updated:** [May 15, 2023, 12:06pm UTC](https://discourse.julialang.org/t/is-serialization-a-safe-option-for-data-storage/98872 "2023-05-15T12:06:25Z")

</div>

In my code i last used text files to pass parameters and these parameters are finally processed and used in structs. I was wondering if I could save these structs directly to reduce the overhead in the code. One method …

---

## [Integer power of large Integer returning very wrong results](https://discourse.julialang.org/t/integer-power-of-large-integer-returning-very-wrong-results/98747)

<div class="topic-metadata">

**Author:** [@dmetivie](https://discourse.julialang.org/u/dmetivie)\
**Replies:** 7\
**Last updated:** [May 15, 2023, 10:49am UTC](https://discourse.julialang.org/t/integer-power-of-large-integer-returning-very-wrong-results/98747 "2023-05-15T10:49:46Z")

</div>

I am with Julia 1.9 on a fresh session (windows). (Maybe it happens on previous version already) Is it normal to get stuff like julia\> 5^2000 -7794321243379011391 julia\> 2^200 0 With floating power 5^2000., it is Inf.…

---

## [LoopVectorization: Best way to have a multi and single threaded version?](https://discourse.julialang.org/t/loopvectorization-best-way-to-have-a-multi-and-single-threaded-version/98862)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 0\
**Last updated:** [May 15, 2023, 6:51am UTC](https://discourse.julialang.org/t/loopvectorization-best-way-to-have-a-multi-and-single-threaded-version/98862 "2023-05-15T06:51:04Z")

</div>

Sometimes when I use LoopVectorization, I want to have both a single and multi-threaded variant of the function available. For instance: using LoopVectorization function add!(out, x, y; thread) if thread ad…

---

## [Scientific notation vs 10^](https://discourse.julialang.org/t/scientific-notation-vs-10/98849)

<div class="topic-metadata">

**Author:** [@Ke\_Gao](https://discourse.julialang.org/u/Ke_Gao)\
**Replies:** 2\
**Last updated:** [May 14, 2023, 10:23pm UTC](https://discourse.julialang.org/t/scientific-notation-vs-10/98849 "2023-05-14T22:23:46Z")

</div>

julia\> a = 6.02\*10^23 1.2062660515345518e18 julia\> b = 6.02e23 6.02e23 julia\> a == b false Why is a not equals to b? Any help possible is greatly appreciated!

---

## [Why Random.seed!(123) don't produce the same result?](https://discourse.julialang.org/t/why-random-seed-123-dont-produce-the-same-result/98848)

<div class="topic-metadata">

**Author:** [@Optimization](https://discourse.julialang.org/u/Optimization)\
**Replies:** 2\
**Last updated:** [May 14, 2023, 9:49pm UTC](https://discourse.julialang.org/t/why-random-seed-123-dont-produce-the-same-result/98848 "2023-05-14T21:49:30Z")

</div>

How to force rand to generate the same thing every single time? I wish to create a random list of 100 numbers between 200 and 500 and due to reproduceablity I wish to use random seed. But running the follwoing gives me …

---

## [Error with MKL artifact when running app built through PackageCompiler.jl](https://discourse.julialang.org/t/error-with-mkl-artifact-when-running-app-built-through-packagecompiler-jl/98847)

<div class="topic-metadata">

**Author:** [@heyx3](https://discourse.julialang.org/u/heyx3)\
**Replies:** 1\
**Last updated:** [May 14, 2023, 9:42pm UTC](https://discourse.julialang.org/t/error-with-mkl-artifact-when-running-app-built-through-packagecompiler-jl/98847 "2023-05-14T21:42:33Z")

</div>

I’m experimenting with building my Julia application into an executable using PackageCompiler.jl. The build process seems to go just fine, but when I run the executable, it tries twice to “download artifact: MKL”, appear…

---

## [Discrete empirical distribution](https://discourse.julialang.org/t/discrete-empirical-distribution/98835)

<div class="topic-metadata">

**Author:** [@Pino](https://discourse.julialang.org/u/Pino)\
**Replies:** 3\
**Last updated:** [May 14, 2023, 6:38pm UTC](https://discourse.julialang.org/t/discrete-empirical-distribution/98835 "2023-05-14T18:38:23Z")

</div>

Silly question: if I have a histogram such as: histogram(rand(Normal(0,1),10000),nbins=100) how can I save the frequency per bin such as to have it as measure for the discretized series?

---

## [How Is Building Julia for 32-bit ARM Architecture Done?](https://discourse.julialang.org/t/how-is-building-julia-for-32-bit-arm-architecture-done/98841)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 4\
**Last updated:** [May 14, 2023, 6:00pm UTC](https://discourse.julialang.org/t/how-is-building-julia-for-32-bit-arm-architecture-done/98841 "2023-05-14T18:00:57Z")

</div>

Hi folks, This is a very naive question I have about Julia and 32-bit ARM builds! I use the last known (that I know of) 32-bit build of Julia 1.6.7 on a personal Raspberry Pi 4 server I have set-up. My question is what …

---

## [Use of Not() in select() with a function](https://discourse.julialang.org/t/use-of-not-in-select-with-a-function/53793)

<div class="topic-metadata">

**Author:** [@andferrari](https://discourse.julialang.org/u/andferrari)\
**Replies:** 5\
**Last updated:** [May 14, 2023, 4:59pm UTC](https://discourse.julialang.org/t/use-of-not-in-select-with-a-function/53793 "2023-05-14T16:59:33Z")

</div>

I try to use Not() column selector when applying a function in select() without success julia\> df = DataFrame(id1 = 1:2, id2 = 1:2) 2×2 DataFrame Row │ id1 id2 │ Int64 Int64 ─────┼────────────── 1 │ …

---

## [Is \` SuiteSparse.CHOLMOD.ldlt\` working correctly?](https://discourse.julialang.org/t/is-suitesparse-cholmod-ldlt-working-correctly/78951)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 1\
**Last updated:** [May 14, 2023, 2:17pm UTC](https://discourse.julialang.org/t/is-suitesparse-cholmod-ldlt-working-correctly/78951 "2023-05-14T14:17:48Z")

</div>

I have a sparse matrix, symmetric, real. Dimension 101680 , number of non zeros ~6M. Calling cholesky takes around 11 seconds. @time K = SuiteSparse.CHOLMOD.cholesky(K) Calling ldlt results in several minutes of “noth…

---

## [Slower execution and more GC in command prompt than VSCode](https://discourse.julialang.org/t/slower-execution-and-more-gc-in-command-prompt-than-vscode/98739)

<div class="topic-metadata">

**Author:** [@PatrickMcFarlane](https://discourse.julialang.org/u/PatrickMcFarlane)\
**Replies:** 5\
**Last updated:** [May 14, 2023, 1:52pm UTC](https://discourse.julialang.org/t/slower-execution-and-more-gc-in-command-prompt-than-vscode/98739 "2023-05-14T13:52:56Z")

</div>

I have a large repository for solving a dynamic economic model with heterogeneous agents. The code takes about 400 seconds to run when running Julia from the command prompt, but only about 240 seconds when running in VS…

---

## [ANN: ReduceWindows.jl](https://discourse.julialang.org/t/ann-reducewindows-jl/98094)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 5\
**Last updated:** [May 14, 2023, 8:56am UTC](https://discourse.julialang.org/t/ann-reducewindows-jl/98094 "2023-05-14T08:56:46Z")

</div>

I am happy to announce ReduceWindows.jl. The package allows to apply reduce over a sliding window. From the Readme: Usage using ReduceWindows x = \[1,2,3,4,5\] reduce\_window(+, x, (-1:1,)) # \[3, 6, 9, 12, 9\] reduce\_window…

---

## [\[Ann\] GmshImport package: GMSH 4.1 file parser](https://discourse.julialang.org/t/ann-gmshimport-package-gmsh-4-1-file-parser/98819)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 1\
**Last updated:** [May 14, 2023, 8:48am UTC](https://discourse.julialang.org/t/ann-gmshimport-package-gmsh-4-1-file-parser/98819 "2023-05-14T08:48:22Z")

</div>

Import .msh files in the Gmsh 4.1 format. Capability: import node and element blocks. Limitation: The element types are limited at the moment to the most common ones. The imported data are not specific to any particula…

---

## [Convert code from DataFrames version to DataFramesMeta](https://discourse.julialang.org/t/convert-code-from-dataframes-version-to-dataframesmeta/98824)

<div class="topic-metadata">

**Author:** [@hungpham3112](https://discourse.julialang.org/u/hungpham3112)\
**Replies:** 1\
**Last updated:** [May 14, 2023, 8:15am UTC](https://discourse.julialang.org/t/convert-code-from-dataframes-version-to-dataframesmeta/98824 "2023-05-14T08:15:44Z")

</div>

DataFrames (successful): lst = describe(df)\[(describe(df)."nmissing" .\> 0 .&& describe(df)."variable" .!= :x26), :variable\] DataFramesMeta: lst = @chain describe(df) begin @rsubset :nmissing \> 0 @select :variable …

---

## [Upper bound for minor version of a dependency](https://discourse.julialang.org/t/upper-bound-for-minor-version-of-a-dependency/98816)

<div class="topic-metadata">

**Author:** [@ferrolho](https://discourse.julialang.org/u/ferrolho)\
**Replies:** 6\
**Last updated:** [May 14, 2023, 8:12am UTC](https://discourse.julialang.org/t/upper-bound-for-minor-version-of-a-dependency/98816 "2023-05-14T08:12:49Z")

</div>

Is there a way of setting an upper bound for the minor version of a dependency in the \[compat\] section of Project.toml? I want to set the compatible versions of a dependency to the range \[1, 1.5\] or \[1, 1.6). This is be…

---

## [Can't load a shared library](https://discourse.julialang.org/t/cant-load-a-shared-library/98621)

<div class="topic-metadata">

**Author:** [@nebula](https://discourse.julialang.org/u/nebula)\
**Replies:** 4\
**Last updated:** [May 14, 2023, 2:58am UTC](https://discourse.julialang.org/t/cant-load-a-shared-library/98621 "2023-05-14T02:58:25Z")

</div>

I have a shared library liba.so which requires /lib/x86\_64-linux-gnu/libcurl.so to run. bash\> ldd liba.so ... libcurl.so.4 =\> /lib/x86\_64-linux-gnu/libcurl.so.4 (0x00007f319ee74000) ... I use ccall to call a function i…

---

## [Local package precompilation fails for Julia 1.9.0](https://discourse.julialang.org/t/local-package-precompilation-fails-for-julia-1-9-0/98802)

<div class="topic-metadata">

**Author:** [@myersm0](https://discourse.julialang.org/u/myersm0)\
**Replies:** 4\
**Last updated:** [May 14, 2023, 1:39am UTC](https://discourse.julialang.org/t/local-package-precompilation-fails-for-julia-1-9-0/98802 "2023-05-14T01:39:02Z")

</div>

Upon upgrading to Julia 1.9.0, I can’t seem to create and load any locally developed package that includes a “using” or “import” statement. If I exclude using/import, it works fine. For example, I tried running through t…

---

## [FFTW doesn't work in a module](https://discourse.julialang.org/t/fftw-doesnt-work-in-a-module/98812)

<div class="topic-metadata">

**Author:** [@adamslc](https://discourse.julialang.org/u/adamslc)\
**Replies:** 1\
**Last updated:** [May 13, 2023, 8:10pm UTC](https://discourse.julialang.org/t/fftw-doesnt-work-in-a-module/98812 "2023-05-13T20:10:27Z")

</div>

FFTW has me thoroughly confused. Consider the following code: using FFTW fft(rand(10)) module Testing using FFTW f() = fft(rand(10)) export f end using .Testing f() The fft in the global scope works just fine. Howev…

---

## [Deleting Part of Artifact](https://discourse.julialang.org/t/deleting-part-of-artifact/98801)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 2\
**Last updated:** [May 13, 2023, 7:49pm UTC](https://discourse.julialang.org/t/deleting-part-of-artifact/98801 "2023-05-13T19:49:13Z")

</div>

I have a package that depends on a subdirectory of a release of a GitHub project. The GitHub release format is convenient — it’s provided as a tar.gz file, which Artifacts supports! That’s all fine. The expanded artifac…

---

## [Is there a way to quickly get elevation/altitude given longitude and latitude?](https://discourse.julialang.org/t/is-there-a-way-to-quickly-get-elevation-altitude-given-longitude-and-latitude/98781)

<div class="topic-metadata">

**Author:** [@schwob](https://discourse.julialang.org/u/schwob)\
**Replies:** 3\
**Last updated:** [May 13, 2023, 7:22pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-quickly-get-elevation-altitude-given-longitude-and-latitude/98781 "2023-05-13T19:22:45Z")

</div>

I have a data frame with longitude and latitude, and I would like to obtain the elevation/altitude for each point. At the moment, I use the R package geonames, which is a functional API for geonames.org. For example: u…

---

## [Load time of TimeZones](https://discourse.julialang.org/t/load-time-of-timezones/98805)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 0\
**Last updated:** [May 13, 2023, 6:54pm UTC](https://discourse.julialang.org/t/load-time-of-timezones/98805 "2023-05-13T18:54:52Z")

</div>

I am trying to reduce the load time of my packages, and found that TimeZones.jl does not behave well: julia\> @time import TimeZones 0.592166 seconds (362.80 k allocations: 25.915 MiB, 71.02% compilation time) using J…

---

## [Can CUDA beat LoopVectorization/make this CUDA code faster?](https://discourse.julialang.org/t/can-cuda-beat-loopvectorization-make-this-cuda-code-faster/98804)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 0\
**Last updated:** [May 13, 2023, 6:38pm UTC](https://discourse.julialang.org/t/can-cuda-beat-loopvectorization-make-this-cuda-code-faster/98804 "2023-05-13T18:38:36Z")

</div>

I have the following code, which has very nice performance on the CPU: using LoopVectorization: @turbo function dilation\_loop\_vec!(out\_cpu, inp\_cpu, ker\_cpu) @turbo thread=true for i in eachindex(out\_cpu) v…

---

## [Matrix chain multiplication with arbitrary number of matrices](https://discourse.julialang.org/t/matrix-chain-multiplication-with-arbitrary-number-of-matrices/98794)

<div class="topic-metadata">

**Author:** [@Frisus95](https://discourse.julialang.org/u/Frisus95)\
**Replies:** 7\
**Last updated:** [May 13, 2023, 5:16pm UTC](https://discourse.julialang.org/t/matrix-chain-multiplication-with-arbitrary-number-of-matrices/98794 "2023-05-13T17:16:17Z")

</div>

Hi everyone, I want to multiply (or contract) an arbitrary number of matrices. As an example, the naive version with 4 matrices could be written as: m1 = rand(10,10) m2 = rand(10,10) m3 = rand(10,10) m4 = rand(10,10) …

---

## [How to apply replace to whole DataFrame like in Python?](https://discourse.julialang.org/t/how-to-apply-replace-to-whole-dataframe-like-in-python/98797)

<div class="topic-metadata">

**Author:** [@hungpham3112](https://discourse.julialang.org/u/hungpham3112)\
**Replies:** 7\
**Last updated:** [May 13, 2023, 5:05pm UTC](https://discourse.julialang.org/t/how-to-apply-replace-to-whole-dataframe-like-in-python/98797 "2023-05-13T17:05:07Z")

</div>

To replace a character in df in Python we can: df.replace("?", np.nan, inplace = True) but it seems Julia not support replace to the whole DataFrame replace(df, "?" =\> missing) returns: MethodError: no method match…

---

## [Suggestions for converting raw RTF (rich text format) to plain text](https://discourse.julialang.org/t/suggestions-for-converting-raw-rtf-rich-text-format-to-plain-text/98568)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 11\
**Last updated:** [May 13, 2023, 4:01pm UTC](https://discourse.julialang.org/t/suggestions-for-converting-raw-rtf-rich-text-format-to-plain-text/98568 "2023-05-13T16:01:52Z")

</div>

I am going to be pulling some data from an IBM DB2 database that is stored as CLOB data. It’s Rich Text Format (RTF) text data and what I want to do is convert it to plain text. Here’s an example of what it looks like: …

---

## [Doesn't capturing groups within non capturing groups work in regex?](https://discourse.julialang.org/t/doesnt-capturing-groups-within-non-capturing-groups-work-in-regex/98029)

<div class="topic-metadata">

**Author:** [@Euhan](https://discourse.julialang.org/u/Euhan)\
**Replies:** 5\
**Last updated:** [May 13, 2023, 2:53pm UTC](https://discourse.julialang.org/t/doesnt-capturing-groups-within-non-capturing-groups-work-in-regex/98029 "2023-05-13T14:53:26Z")

</div>

I’m looking to capture a pattern like "=2.4.7.9\_" and be able to extract the numbers. I try to match it with r"=(\\d+)(:\\.(\\d+))\*\_" but that doesn’t seem to work. I expect each number to end up in a capture group but ins…

---

## [How to achieve interactive analysis based on mouse-selected data in Genie with plotlyjs](https://discourse.julialang.org/t/how-to-achieve-interactive-analysis-based-on-mouse-selected-data-in-genie-with-plotlyjs/98789)

<div class="topic-metadata">

**Author:** [@tiZ](https://discourse.julialang.org/u/tiZ)\
**Replies:** 0\
**Last updated:** [May 13, 2023, 10:31am UTC](https://discourse.julialang.org/t/how-to-achieve-interactive-analysis-based-on-mouse-selected-data-in-genie-with-plotlyjs/98789 "2023-05-13T10:31:07Z")

</div>

Hi, I have a Genie demo app that contains two figures: a scatter plot and a box plot. My goal is to enable the box plot to update according to the data points I select in the scatter plot when I circle them with the mou…

---

## [GC going nuts](https://discourse.julialang.org/t/gc-going-nuts/93447)

<div class="topic-metadata">

**Author:** [@mwlidar](https://discourse.julialang.org/u/mwlidar)\
**Replies:** 18\
**Last updated:** [May 13, 2023, 9:07am UTC](https://discourse.julialang.org/t/gc-going-nuts/93447 "2023-05-13T09:07:53Z")

</div>

I have workload where I process larger datasets (a few GB) iteratively. After adjusting some parameters the processing is repeated within the same REPL session. After two or three rounds all slows down and switching on G…

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

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