# General Usage

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

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

**Page:** 325

---

## [Storing huge amount of data efficiently](https://discourse.julialang.org/t/storing-huge-amount-of-data-efficiently/94818)

<div class="topic-metadata">

**Author:** [@Dario-Rosa85](https://discourse.julialang.org/u/Dario-Rosa85)\
**Replies:** 15\
**Last updated:** [February 24, 2023, 9:21am UTC](https://discourse.julialang.org/t/storing-huge-amount-of-data-efficiently/94818 "2023-02-24T09:21:37Z")

</div>

Hello, I am performing some numerical computations and I have the necessity to run a huge (say, several thousand of iterations) for loop. Each iteration produces a certain amount of data that I need to store in the disk…

---

## [Is it possible to predict the serialized size of an object, without serializing it?](https://discourse.julialang.org/t/is-it-possible-to-predict-the-serialized-size-of-an-object-without-serializing-it/94769)

<div class="topic-metadata">

**Author:** [@cadaverous](https://discourse.julialang.org/u/cadaverous)\
**Replies:** 5\
**Last updated:** [February 24, 2023, 4:48am UTC](https://discourse.julialang.org/t/is-it-possible-to-predict-the-serialized-size-of-an-object-without-serializing-it/94769 "2023-02-24T04:48:18Z")

</div>

Hello all! I am pretty much brand new to Julia, and I am trying to write an interface between Julia and a C library that uses MPI. The problem I’m having is that the library needs to be able to pack Julia objects into a…

---

## [Copy. vs. deepcopy vs. .=](https://discourse.julialang.org/t/copy-vs-deepcopy-vs/95097)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 6\
**Last updated:** [February 23, 2023, 9:56pm UTC](https://discourse.julialang.org/t/copy-vs-deepcopy-vs/95097 "2023-02-23T21:56:59Z")

</div>

Despite many threads on this, I’m still confused. I want to avoid allocation but something is not working in my code. My setup is like the one below. Can someone explain the difference in this context, A = (rand(3),ran…

---

## [Adding packages present in custom sysimage into environment when running with that sysimage](https://discourse.julialang.org/t/adding-packages-present-in-custom-sysimage-into-environment-when-running-with-that-sysimage/95107)

<div class="topic-metadata">

**Author:** [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Replies:** 0\
**Last updated:** [February 23, 2023, 9:54pm UTC](https://discourse.julialang.org/t/adding-packages-present-in-custom-sysimage-into-environment-when-running-with-that-sysimage/95107 "2023-02-23T21:54:07Z")

</div>

I have a sysimage (which happens to include Makie, GLMakie, CairoMakie and MakieCore) which was built in a (temporary) environment where the Makie packages were included via \]develop --local. When I start Julia using the…

---

## [Fastest way to do memoization?](https://discourse.julialang.org/t/fastest-way-to-do-memoization/95100)

<div class="topic-metadata">

**Author:** [@linwaytin](https://discourse.julialang.org/u/linwaytin)\
**Replies:** 11\
**Last updated:** [February 23, 2023, 9:18pm UTC](https://discourse.julialang.org/t/fastest-way-to-do-memoization/95100 "2023-02-23T21:18:23Z")

</div>

I have a two-argument function, for which I want to cache the results. Currently I use a Dict to store the previous results. The performance is OK, but profiling said that a lot of time is taken by finding the index. …

---

## [Pola.rs vs DataFrames.jl](https://discourse.julialang.org/t/pola-rs-vs-dataframes-jl/95090)

<div class="topic-metadata">

**Author:** [@klwlevy](https://discourse.julialang.org/u/klwlevy)\
**Replies:** 8\
**Last updated:** [February 23, 2023, 6:36pm UTC](https://discourse.julialang.org/t/pola-rs-vs-dataframes-jl/95090 "2023-02-23T18:36:49Z")

</div>

There seems to be quite some activity in the Python community about using pola.rs to get fast dataframes, with the aid of Rust. As a frequent DataFrames.jl user, I would be curious to hear @bkamins opinion on this “compe…

---

## [Updating PlotlyJS plots in-place with new data](https://discourse.julialang.org/t/updating-plotlyjs-plots-in-place-with-new-data/94981)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 2\
**Last updated:** [February 23, 2023, 6:09pm UTC](https://discourse.julialang.org/t/updating-plotlyjs-plots-in-place-with-new-data/94981 "2023-02-23T18:09:24Z")

</div>

I am working with Plotly Dash to create a website, however some of the animation features of PlotlyJS do not seem to work completely. Right now I am having trouble with displaying the play button and a slider on the Dash…

---

## [Best method for (scalar) second derivative with ForwardDiff](https://discourse.julialang.org/t/best-method-for-scalar-second-derivative-with-forwarddiff/95039)

<div class="topic-metadata">

**Author:** [@fph](https://discourse.julialang.org/u/fph)\
**Replies:** 4\
**Last updated:** [February 23, 2023, 5:04pm UTC](https://discourse.julialang.org/t/best-method-for-scalar-second-derivative-with-forwarddiff/95039 "2023-02-23T17:04:23Z")

</div>

What is the best/most efficient method to find the first two derivatives of a scalar function with ForwardDiff? This old post suggests ForwardDiff.derivative(x -\> ForwardDiff.derivative(f, x), 1.0) to compute the seco…

---

## [TravisCI issue for a Julia package using PyPlot.jl](https://discourse.julialang.org/t/travisci-issue-for-a-julia-package-using-pyplot-jl/95079)

<div class="topic-metadata">

**Author:** [@kazuakiyama](https://discourse.julialang.org/u/kazuakiyama)\
**Replies:** 1\
**Last updated:** [February 23, 2023, 4:03pm UTC](https://discourse.julialang.org/t/travisci-issue-for-a-julia-package-using-pyplot-jl/95079 "2023-02-23T16:03:29Z")

</div>

Hi, I’m developing a Julia astronomy package on GitHub, and have a question regarding an issue in TravisCI’s github action for a package using PyPlot.jl. My package uses PyPlot.jl for visualizations of data. I’ve been f…

---

## [Plotting within a call function (MWE)](https://discourse.julialang.org/t/plotting-within-a-call-function-mwe/95087)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 2\
**Last updated:** [February 23, 2023, 3:53pm UTC](https://discourse.julialang.org/t/plotting-within-a-call-function-mwe/95087 "2023-02-23T15:53:00Z")

</div>

I am experimenting with callbacks, in particular, interactive plotting from within a callback. Here is my code, which runs, except that I do not see a plot displayed. I must be doing something wrong! I am working with Vi…

---

## [Getting the corresponding eigenvectors in arpack](https://discourse.julialang.org/t/getting-the-corresponding-eigenvectors-in-arpack/94492)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 23\
**Last updated:** [February 23, 2023, 2:25pm UTC](https://discourse.julialang.org/t/getting-the-corresponding-eigenvectors-in-arpack/94492 "2023-02-23T14:25:52Z")

</div>

I’m using the arpack eigs function to retrieve the 3 largest eigenvalues in an 8x8 matrix ,using the following call eigs(a, nev=3) works great and i get a vector of 3 eigenvalues. However i get an 8x3 matrix of eigenv…

---

## [Module fails at first run, but works at second run](https://discourse.julialang.org/t/module-fails-at-first-run-but-works-at-second-run/95007)

<div class="topic-metadata">

**Author:** [@Miroslav-Stimac](https://discourse.julialang.org/u/Miroslav-Stimac)\
**Replies:** 4\
**Last updated:** [February 23, 2023, 10:04am UTC](https://discourse.julialang.org/t/module-fails-at-first-run-but-works-at-second-run/95007 "2023-02-23T10:04:34Z")

</div>

Hello, I have a very strange behaviour with my program. When I start it for the first time, then it fails with an error message that is not very helpful. When I start it for the second time, then it completes without an…

---

## [Keyword Arguments and Type Stability](https://discourse.julialang.org/t/keyword-arguments-and-type-stability/94993)

<div class="topic-metadata">

**Author:** [@alfaromartino](https://discourse.julialang.org/u/alfaromartino)\
**Replies:** 11\
**Last updated:** [February 23, 2023, 9:23am UTC](https://discourse.julialang.org/t/keyword-arguments-and-type-stability/94993 "2023-02-23T09:23:44Z")

</div>

I need to remain flexible (I’m testing the code) and I ran into the following problem. MWE param = 2 x = rand(100) foo(x; β = param) = sum(x .\* β) @code\_warntype foo(x) # type unstable @code\_warntype fo…

---

## [Besides Revise.JL, what other packages are common parts of "expert" Julia workflow?](https://discourse.julialang.org/t/besides-revise-jl-what-other-packages-are-common-parts-of-expert-julia-workflow/95052)

<div class="topic-metadata">

**Author:** [@zeroexcuses](https://discourse.julialang.org/u/zeroexcuses)\
**Replies:** 3\
**Last updated:** [February 23, 2023, 9:16am UTC](https://discourse.julialang.org/t/besides-revise-jl-what-other-packages-are-common-parts-of-expert-julia-workflow/95052 "2023-02-23T09:16:15Z")

</div>

Besides Revise.JL, what other packages are common parts of “expert” Julia workflow ? I.e. if I’m to be proficient in Julia, what other packages do I need to learn to use ?

---

## [Query.jl fails handle CSV.Rows](https://discourse.julialang.org/t/query-jl-fails-handle-csv-rows/95063)

<div class="topic-metadata">

**Author:** [@purplesabbath](https://discourse.julialang.org/u/purplesabbath)\
**Replies:** 1\
**Last updated:** [February 23, 2023, 8:17am UTC](https://discourse.julialang.org/t/query-jl-fails-handle-csv-rows/95063 "2023-02-23T08:17:06Z")

</div>

I got an dataset too large for memory, I want to combine CSV.Rows and Query.jl to handle data, but after @groupby, I can’t use @map to summarize data. using DataFrames using CSV using Query data\_path = "D:\\\\chen\\\\det…

---

## [How to Detect Key Down Events?](https://discourse.julialang.org/t/how-to-detect-key-down-events/95011)

<div class="topic-metadata">

**Author:** [@Maddy](https://discourse.julialang.org/u/Maddy)\
**Replies:** 5\
**Last updated:** [February 23, 2023, 5:36am UTC](https://discourse.julialang.org/t/how-to-detect-key-down-events/95011 "2023-02-23T05:36:39Z")

</div>

I want to detect key presses while my main program loop runs. Say I’m computing loads of data and printing that in the REPL. I want to be able to detect any keys I press. For example, if the key ‘p’ is pressed, all the c…

---

## [String Handling Functions](https://discourse.julialang.org/t/string-handling-functions/95058)

<div class="topic-metadata">

**Author:** [@smashcoder2003](https://discourse.julialang.org/u/smashcoder2003)\
**Replies:** 7\
**Last updated:** [February 23, 2023, 4:52am UTC](https://discourse.julialang.org/t/string-handling-functions/95058 "2023-02-23T04:52:01Z")

</div>

Is there a package or module for string handling functions? Did anyone write a package or module for string handling?

---

## [What is a good way to write methods that help the user not mix up input order?](https://discourse.julialang.org/t/what-is-a-good-way-to-write-methods-that-help-the-user-not-mix-up-input-order/94803)

<div class="topic-metadata">

**Author:** [@philip](https://discourse.julialang.org/u/philip)\
**Replies:** 7\
**Last updated:** [February 23, 2023, 4:04am UTC](https://discourse.julialang.org/t/what-is-a-good-way-to-write-methods-that-help-the-user-not-mix-up-input-order/94803 "2023-02-23T04:04:47Z")

</div>

I’ve often encountered issues similar to Keyword argument types - what's going on? - #11 by sijo . I like to write methods with keyword arguments because I find them harder to silently screw up calling than positional ar…

---

## [PackageCompiler.jl: display functions seem to use a lot of memory](https://discourse.julialang.org/t/packagecompiler-jl-display-functions-seem-to-use-a-lot-of-memory/95053)

<div class="topic-metadata">

**Author:** [@jsjie](https://discourse.julialang.org/u/jsjie)\
**Replies:** 1\
**Last updated:** [February 23, 2023, 1:06am UTC](https://discourse.julialang.org/t/packagecompiler-jl-display-functions-seem-to-use-a-lot-of-memory/95053 "2023-02-23T01:06:52Z")

</div>

MWE: create a package with PkgTemplates add following packages: PackageCompiler Revise TimerOutputs. Revise is not used, I just get used to add it to every package. add the following code to SelfTest.jl: using TimerO…

---

## [\--track-allocation changes allocation behavior of code?](https://discourse.julialang.org/t/track-allocation-changes-allocation-behavior-of-code/95044)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 1\
**Last updated:** [February 22, 2023, 9:40pm UTC](https://discourse.julialang.org/t/track-allocation-changes-allocation-behavior-of-code/95044 "2023-02-22T21:40:32Z")

</div>

I made some code changes which I guessed would improve memory usage. @time shows a huge speedup, \> 10x, and a \>98% reduction in memory used. But when I use --track-allocation it seems as if my changes made things much w…

---

## [Defining my own \`next!\` but avoiding confict](https://discourse.julialang.org/t/defining-my-own-next-but-avoiding-confict/95035)

<div class="topic-metadata">

**Author:** [@scheinerman](https://discourse.julialang.org/u/scheinerman)\
**Replies:** 6\
**Last updated:** [February 22, 2023, 7:51pm UTC](https://discourse.julialang.org/t/defining-my-own-next-but-avoiding-confict/95035 "2023-02-22T19:51:10Z")

</div>

I would like to create a next! function for a custom type, but avoid conflict with other modules that might define next! as well. A very small example: module NextTest export Numb, next! mutable struct Numb val::…

---

## [Dropout in UDEs using SciML and Lux](https://discourse.julialang.org/t/dropout-in-udes-using-sciml-and-lux/94960)

<div class="topic-metadata">

**Author:** [@nina](https://discourse.julialang.org/u/nina)\
**Replies:** 6\
**Last updated:** [February 22, 2023, 5:32pm UTC](https://discourse.julialang.org/t/dropout-in-udes-using-sciml-and-lux/94960 "2023-02-22T17:32:49Z")

</div>

Dear all, I am trying to use a Dropout layer in the NN component of a UDE for parameter estimation. It does work if I use a setup based on Flux. However, if I switch to Lux I get an error message too long to be displaye…

---

## ["LoadError: Evaluation into the closed module" with Macro that generates new types and methods](https://discourse.julialang.org/t/loaderror-evaluation-into-the-closed-module-with-macro-that-generates-new-types-and-methods/94994)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 5\
**Last updated:** [February 22, 2023, 4:08pm UTC](https://discourse.julialang.org/t/loaderror-evaluation-into-the-closed-module-with-macro-that-generates-new-types-and-methods/94994 "2023-02-22T16:08:14Z")

</div>

I’m working on a package that allows users to define pipeline tasks in an ergonomic way and then schedules jobs and their dependencies with Dagger.jl. I have a macro that takes a user input like this: @Job begin na…

---

## [MPI and println inside imported modules](https://discourse.julialang.org/t/mpi-and-println-inside-imported-modules/95026)

<div class="topic-metadata">

**Author:** [@mesonepigreco](https://discourse.julialang.org/u/mesonepigreco)\
**Replies:** 4\
**Last updated:** [February 22, 2023, 3:57pm UTC](https://discourse.julialang.org/t/mpi-and-println-inside-imported-modules/95026 "2023-02-22T15:57:48Z")

</div>

Dear Juliawers, I’m using optimizing a function in julia which is parallelized using MPI. Each time I have to print something, I check if the rank is zero to avoid printing the text as many times as the number of proce…

---

## [Proper way to create sysimage with all dependencies of a given package](https://discourse.julialang.org/t/proper-way-to-create-sysimage-with-all-dependencies-of-a-given-package/91460)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 9\
**Last updated:** [February 22, 2023, 3:06pm UTC](https://discourse.julialang.org/t/proper-way-to-create-sysimage-with-all-dependencies-of-a-given-package/91460 "2023-02-22T15:06:37Z")

</div>

What’s the proper way to create a custom sysimage for the following situation: I am developing a package with at least a moderately large set of dependencies (Trixi.jl) and I would like to speed up startup latency by co…

---

## [Custom printing of struct getting printed before string](https://discourse.julialang.org/t/custom-printing-of-struct-getting-printed-before-string/95024)

<div class="topic-metadata">

**Author:** [@hshackle](https://discourse.julialang.org/u/hshackle)\
**Replies:** 2\
**Last updated:** [February 22, 2023, 2:57pm UTC](https://discourse.julialang.org/t/custom-printing-of-struct-getting-printed-before-string/95024 "2023-02-22T14:57:53Z")

</div>

I have a struct that I would like to define a custom way of printing it. This is done by overloading the Base.show function: struct customType a::Int b::Int end function Base.show(io::IO, state::customType) …

---

## [Splitpath on UNC shares](https://discourse.julialang.org/t/splitpath-on-unc-shares/95015)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 2\
**Last updated:** [February 22, 2023, 1:11pm UTC](https://discourse.julialang.org/t/splitpath-on-unc-shares/95015 "2023-02-22T13:11:58Z")

</div>

Is there a way to get also the server name split from the path? julia\> splitpath("\\\\\\\\svfae01-solid01\\\\SED\\\\SE") 2-element Vector{String}: "\\\\\\\\svfae01-solid01\\\\SED\\\\" "SE" I would like to get "\\\\\\\\svfae01-solid01\\…

---

## [Is static scheduling available in Julia multi-threading?](https://discourse.julialang.org/t/is-static-scheduling-available-in-julia-multi-threading/94970)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 0\
**Last updated:** [February 21, 2023, 4:28pm UTC](https://discourse.julialang.org/t/is-static-scheduling-available-in-julia-multi-threading/94970 "2023-02-21T16:28:05Z")

</div>

I want to use multi-threading (with @spawn/@thread) in a static scheduling to prevent threads jumping during the time-loop in this MWE, nthreads()=2 here: using .Threads function f\_spawn() thrs = \[Threads.@spawn begi…

---

## [VSCode and Julia 1.9.0-Beta4](https://discourse.julialang.org/t/vscode-and-julia-1-9-0-beta4/94977)

<div class="topic-metadata">

**Author:** [@Jake](https://discourse.julialang.org/u/Jake)\
**Replies:** 3\
**Last updated:** [February 22, 2023, 12:21pm UTC](https://discourse.julialang.org/t/vscode-and-julia-1-9-0-beta4/94977 "2023-02-22T12:21:04Z")

</div>

Any help appreciated in resolving the following problem. I have been using VSCode with Julia 1.8.5 and all has been well. Now I am trying 1.9.0-Beta4 and coming up with error messages. These are both in pop up window…

---

## [Design / impl / internals of Revise.jl?](https://discourse.julialang.org/t/design-impl-internals-of-revise-jl/95000)

<div class="topic-metadata">

**Author:** [@zeroexcuses](https://discourse.julialang.org/u/zeroexcuses)\
**Replies:** 1\
**Last updated:** [February 22, 2023, 8:22am UTC](https://discourse.julialang.org/t/design-impl-internals-of-revise-jl/95000 "2023-02-22T08:22:08Z")

</div>

Is there a resource describing the internal data structures of Revise.jl ? My current suspicions are: somewhere inside Revise.jl there is a directed acyclic graph there is some inotify-like watcher that tags nodes…

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

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