# General Usage

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

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

**Page:** 285

---

## [How to use the Julia Markdown Documents (.jmd)?](https://discourse.julialang.org/t/how-to-use-the-julia-markdown-documents-jmd/99797)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 4\
**Last updated:** [June 3, 2023, 12:34pm UTC](https://discourse.julialang.org/t/how-to-use-the-julia-markdown-documents-jmd/99797 "2023-06-03T12:34:45Z")

</div>

I learnt something about Julia Markdown Documents (.jmd) in the document of Julia for VS Code but I didn’t seem to be quite clear about what it is, how it works and when and where it is suitable to be used. Is there some…

---

## [About Neural Jump SDEs (Jump Diffusions) and Neural PDEs](https://discourse.julialang.org/t/about-neural-jump-sdes-jump-diffusions-and-neural-pdes/99790)

<div class="topic-metadata">

**Author:** [@ShijieZhang10](https://discourse.julialang.org/u/ShijieZhang10)\
**Replies:** 4\
**Last updated:** [June 2, 2023, 11:10pm UTC](https://discourse.julialang.org/t/about-neural-jump-sdes-jump-diffusions-and-neural-pdes/99790 "2023-06-02T23:10:06Z")

</div>

Hello everyone, I’m following the code from Chris about Neural Jumsp SDEs: https://www.juliabloggers.com/neural-jump-sdes-jump-diffusions-and-neural-pdes/ I tried to run the code in this blog but have the error message…

---

## [Sorted list or heaps?](https://discourse.julialang.org/t/sorted-list-or-heaps/99725)

<div class="topic-metadata">

**Author:** [@gxyau](https://discourse.julialang.org/u/gxyau)\
**Replies:** 14\
**Last updated:** [June 2, 2023, 8:27pm UTC](https://discourse.julialang.org/t/sorted-list-or-heaps/99725 "2023-06-02T20:27:32Z")

</div>

Hello again everyone. I am trying to maintain a sorted list of a custom structure, and broadcast a transformation onto the list whenever needed. Currently I am using BinaryMaxHeap in DataStructure, but it does not allow …

---

## [The value of a function's definition varies after a docstring is added](https://discourse.julialang.org/t/the-value-of-a-functions-definition-varies-after-a-docstring-is-added/99779)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 5\
**Last updated:** [June 2, 2023, 8:14pm UTC](https://discourse.julialang.org/t/the-value-of-a-functions-definition-varies-after-a-docstring-is-added/99779 "2023-06-02T20:14:29Z")

</div>

Run code: function sayHello() println("Hello, world!") end it returns sayHello (generic function with 1 method). Run code: """ Say hello world """ function sayHello() println("Hello, world!") end it return…

---

## [How write a dbf file](https://discourse.julialang.org/t/how-write-a-dbf-file/63930)

<div class="topic-metadata">

**Author:** [@Rafael\_Brus](https://discourse.julialang.org/u/Rafael_Brus)\
**Replies:** 2\
**Last updated:** [June 2, 2023, 5:06pm UTC](https://discourse.julialang.org/t/how-write-a-dbf-file/63930 "2023-06-02T17:06:44Z")

</div>

How write a dbf file from DataFrame?

---

## [Help me pls with method error](https://discourse.julialang.org/t/help-me-pls-with-method-error/99763)

<div class="topic-metadata">

**Author:** [@k.kirshin123](https://discourse.julialang.org/u/k.kirshin123)\
**Replies:** 12\
**Last updated:** [June 2, 2023, 4:41pm UTC](https://discourse.julialang.org/t/help-me-pls-with-method-error/99763 "2023-06-02T16:41:02Z")

</div>

I’m trying to implement the multiplication of two random matrices 100x100, but every time I get a method error, no matter what I do using MPI function multiply\_matrices() MPI.Init() comm = MPI.COMM\_WORLD r…

---

## [Reducing TTFX of a macro-focused package (\`DataPipes\`)](https://discourse.julialang.org/t/reducing-ttfx-of-a-macro-focused-package-datapipes/99776)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 0\
**Last updated:** [June 2, 2023, 4:15pm UTC](https://discourse.julialang.org/t/reducing-ttfx-of-a-macro-focused-package-datapipes/99776 "2023-06-02T16:15:25Z")

</div>

I’m trying to evaluate precompilation benefits for my packages, and understand what to run during precompilation for best results in different situations. This question is about macro-focused packages, taking DataPipes …

---

## [Problem rendering figures with Documenter.jl](https://discourse.julialang.org/t/problem-rendering-figures-with-documenter-jl/99773)

<div class="topic-metadata">

**Author:** [@peremato](https://discourse.julialang.org/u/peremato)\
**Replies:** 0\
**Last updated:** [June 2, 2023, 3:02pm UTC](https://discourse.julialang.org/t/problem-rendering-figures-with-documenter-jl/99773 "2023-06-02T15:02:06Z")

</div>

I’m having problems rendering figures (from Plots.jl) in the generated notebook documents. I do convert the Jupyter notebooks to MD and passed to the makedocs. It used to work but now the browser (Safary & Chrome) rende…

---

## [Question mark with dot operations](https://discourse.julialang.org/t/question-mark-with-dot-operations/99758)

<div class="topic-metadata">

**Author:** [@Betristor](https://discourse.julialang.org/u/Betristor)\
**Replies:** 6\
**Last updated:** [June 2, 2023, 3:00pm UTC](https://discourse.julialang.org/t/question-mark-with-dot-operations/99758 "2023-06-02T15:00:51Z")

</div>

I got such an example which quite confused me. ## Won't work a = \[1,2,3\] a .+= (true) ? \[1,1,1\] : 0 ## Functionable version a = \[1,2,3\] b = (true) ? \[1,1,1\] : 0 a .+= b The first version will report ERROR: TypeError: …

---

## [Lazy Callback](https://discourse.julialang.org/t/lazy-callback/99680)

<div class="topic-metadata">

**Author:** [@Cristian\_Duran](https://discourse.julialang.org/u/Cristian_Duran)\
**Replies:** 1\
**Last updated:** [June 2, 2023, 1:16pm UTC](https://discourse.julialang.org/t/lazy-callback/99680 "2023-06-02T13:16:59Z")

</div>

In the callback example provided on the readme of CPLEX.jl we have: # You can select where the callback is run if context\_id != CPX\_CALLBACKCONTEXT\_CANDIDATE return end and then ispoint\_p = Ref{Cint}() ret = CPXca…

---

## [Some questions on \`startup.jl\`](https://discourse.julialang.org/t/some-questions-on-startup-jl/99752)

<div class="topic-metadata">

**Author:** [@WuSiren](https://discourse.julialang.org/u/WuSiren)\
**Replies:** 3\
**Last updated:** [June 2, 2023, 9:19am UTC](https://discourse.julialang.org/t/some-questions-on-startup-jl/99752 "2023-06-02T09:19:50Z")

</div>

I am configuring the automatic start of OhMyREPL.jl. The document advise putting the following code in the .julia/config/startup.jl file: atreplinit() do repl try @eval using OhMyREPL println("OhMyRE…

---

## [Rescale a matrix between two limits](https://discourse.julialang.org/t/rescale-a-matrix-between-two-limits/99727)

<div class="topic-metadata">

**Author:** [@RDuarte](https://discourse.julialang.org/u/RDuarte)\
**Replies:** 9\
**Last updated:** [June 2, 2023, 8:06am UTC](https://discourse.julialang.org/t/rescale-a-matrix-between-two-limits/99727 "2023-06-02T08:06:33Z")

</div>

Dear all, I’m learning Julia and I would like to rescale a matriz between \[-1 and 1\]. In matlab I’m using rescale but i’m not sure it works in Julia. Do you have a clue of what can I use? Thanks in advance.

---

## [Advance mouse interaction with Makie?](https://discourse.julialang.org/t/advance-mouse-interaction-with-makie/99637)

<div class="topic-metadata">

**Author:** [@marianoarnaiz](https://discourse.julialang.org/u/marianoarnaiz)\
**Replies:** 3\
**Last updated:** [June 2, 2023, 7:11am UTC](https://discourse.julialang.org/t/advance-mouse-interaction-with-makie/99637 "2023-06-02T07:11:57Z")

</div>

Hi everyone. I have some signals that I need to process and I thought I would give it a go to make my own interpretation code. I have managed to plot my signals with GLMakie in a nice way and I can zoom and pan with th…

---

## [Time to create Union of types in Julia 1.9.0 vs Julia 1.8.5](https://discourse.julialang.org/t/time-to-create-union-of-types-in-julia-1-9-0-vs-julia-1-8-5/99712)

<div class="topic-metadata">

**Author:** [@mtyogi](https://discourse.julialang.org/u/mtyogi)\
**Replies:** 4\
**Last updated:** [June 2, 2023, 6:38am UTC](https://discourse.julialang.org/t/time-to-create-union-of-types-in-julia-1-9-0-vs-julia-1-8-5/99712 "2023-06-02T06:38:35Z")

</div>

Version info Julia installation. Updated v1.8.5 to v1.9.0 as follows: \]add UpdateJulia using UpdateJulia update\_julia() Issue Julia Version 1.8.5 Commit 17cfb8e65e (2023-01-08 06:45 UTC) Platform Info: OS: Windows…

---

## [How to replace code with string in julia](https://discourse.julialang.org/t/how-to-replace-code-with-string-in-julia/99654)

<div class="topic-metadata">

**Author:** [@Daptine](https://discourse.julialang.org/u/Daptine)\
**Replies:** 12\
**Last updated:** [June 2, 2023, 3:54am UTC](https://discourse.julialang.org/t/how-to-replace-code-with-string-in-julia/99654 "2023-06-02T03:54:57Z")

</div>

My goal: I want to write a function that can generate functions based on user input string without much performance hit. For example str = "x^2 + x^3" function gen\_func\_from\_str(str::String) function f(x) …

---

## [Hard Disk storage solution for a (large) array of matrices](https://discourse.julialang.org/t/hard-disk-storage-solution-for-a-large-array-of-matrices/99734)

<div class="topic-metadata">

**Author:** [@Mouad](https://discourse.julialang.org/u/Mouad)\
**Replies:** 12\
**Last updated:** [June 1, 2023, 9:33pm UTC](https://discourse.julialang.org/t/hard-disk-storage-solution-for-a-large-array-of-matrices/99734 "2023-06-01T21:33:02Z")

</div>

I just finished an enormous scientific simulation (billions of regressions, trillions of allocations). The final output are a few arrays of matrices: 100000-element Vector{Matrix{Float64}}. I am looking for a solution t…

---

## [Safely Analyzing Multiple Files with Multiple Threads](https://discourse.julialang.org/t/safely-analyzing-multiple-files-with-multiple-threads/99738)

<div class="topic-metadata">

**Author:** [@gus-pendleton](https://discourse.julialang.org/u/gus-pendleton)\
**Replies:** 2\
**Last updated:** [June 1, 2023, 7:30pm UTC](https://discourse.julialang.org/t/safely-analyzing-multiple-files-with-multiple-threads/99738 "2023-06-01T19:30:43Z")

</div>

Hello! I am writing functions which read multiple files of the same type, perform some analysis, and write results to a single object. I am unsure if the current way it is written is “safe” for multithreading. Here is a…

---

## [BinaryBuilder specifying strict dependencies versions](https://discourse.julialang.org/t/binarybuilder-specifying-strict-dependencies-versions/99739)

<div class="topic-metadata">

**Author:** [@vfonov](https://discourse.julialang.org/u/vfonov)\
**Replies:** 2\
**Last updated:** [June 1, 2023, 6:53pm UTC](https://discourse.julialang.org/t/binarybuilder-specifying-strict-dependencies-versions/99739 "2023-06-01T18:53:50Z")

</div>

I have a small binary package, that I am building with BinaryBuilder, it links to HDF5 and NetCDF4. I would like to specify exact versions of these packages, currently I am using following code: ... Dependency(Package…

---

## [Precompiling module each time without any change](https://discourse.julialang.org/t/precompiling-module-each-time-without-any-change/99711)

<div class="topic-metadata">

**Author:** [@peremato](https://discourse.julialang.org/u/peremato)\
**Replies:** 12\
**Last updated:** [June 1, 2023, 3:54pm UTC](https://discourse.julialang.org/t/precompiling-module-each-time-without-any-change/99711 "2023-06-01T15:54:42Z")

</div>

Since I migrated to Julia 1.9 I get a pre-compilation of the module I am developing each time I start a test script. This was not the case with 1.8, for which I had sometimes to force a recompilation by modifying some of…

---

## [Disable SentinelArrays for CSV.read](https://discourse.julialang.org/t/disable-sentinelarrays-for-csv-read/54843)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 8\
**Last updated:** [June 1, 2023, 1:53pm UTC](https://discourse.julialang.org/t/disable-sentinelarrays-for-csv-read/54843 "2023-06-01T13:53:21Z")

</div>

I’m reading a large CSV file of many Float64 values and then applying many possible transformations before doing a least squares fit. I noticed that the type is not plain Float64s despite there being no missing values: …

---

## [ForwardDiff.jl: Compute J\_f(x) \* f(x)](https://discourse.julialang.org/t/forwarddiff-jl-compute-j-f-x-f-x/99704)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 2\
**Last updated:** [June 1, 2023, 12:43pm UTC](https://discourse.julialang.org/t/forwarddiff-jl-compute-j-f-x-f-x/99704 "2023-06-01T12:43:15Z")

</div>

There are some discussions how to compute the Jacobian-vector product J\_f(x) \* y for a function f efficiently with ForwardDiff.jl, e.g., Calculating J\_f(x) . y efficiently · Issue #319 · JuliaDiff/ForwardDiff.jl · GitHub …

---

## [Hanging in ijl\_gc\_collect() when using adopted threads](https://discourse.julialang.org/t/hanging-in-ijl-gc-collect-when-using-adopted-threads/99221)

<div class="topic-metadata">

**Author:** [@peremato](https://discourse.julialang.org/u/peremato)\
**Replies:** 7\
**Last updated:** [June 1, 2023, 7:08am UTC](https://discourse.julialang.org/t/hanging-in-ijl-gc-collect-when-using-adopted-threads/99221 "2023-06-01T07:08:02Z")

</div>

When using the MT mode of Geant4.jl the main thread hangs in an infinite loop in ijl\_gc\_collect(). I am using latest 1.9 version of Julia on MacOS. The way it works is as follows: The main thread (Julia REPL) calls C+…

---

## [Find permutation of an array such that it is equal to another array](https://discourse.julialang.org/t/find-permutation-of-an-array-such-that-it-is-equal-to-another-array/85365)

<div class="topic-metadata">

**Author:** [@heindelj](https://discourse.julialang.org/u/heindelj)\
**Replies:** 10\
**Last updated:** [May 31, 2023, 8:08pm UTC](https://discourse.julialang.org/t/find-permutation-of-an-array-such-that-it-is-equal-to-another-array/85365 "2023-05-31T20:08:36Z")

</div>

I have a rather simple question that I’m surprised I haven’t been able to figure out easily. Suppose I have two arrays, A=\["A","C","B","C"\], and B=\["C","B","A","C"\]. Treat A as the correct sorted order of the array. Ho…

---

## [How to achieve good performance with Zygote.pushforward on a neural network](https://discourse.julialang.org/t/how-to-achieve-good-performance-with-zygote-pushforward-on-a-neural-network/55971)

<div class="topic-metadata">

**Author:** [@de-souza](https://discourse.julialang.org/u/de-souza)\
**Replies:** 3\
**Last updated:** [May 31, 2023, 3:21pm UTC](https://discourse.julialang.org/t/how-to-achieve-good-performance-with-zygote-pushforward-on-a-neural-network/55971 "2023-05-31T15:21:57Z")

</div>

Hello, I am trying to implement a neural network with a loss function that contains a derivative of the network with regards to its input. To be able to use Flux to update the weights of the network, the loss function …

---

## [Project CellStates in Gridap](https://discourse.julialang.org/t/project-cellstates-in-gridap/99387)

<div class="topic-metadata">

**Author:** [@christopherfear](https://discourse.julialang.org/u/christopherfear)\
**Replies:** 1\
**Last updated:** [May 31, 2023, 12:59pm UTC](https://discourse.julialang.org/t/project-cellstates-in-gridap/99387 "2023-05-31T12:59:41Z")

</div>

I am looking to project a CellState from the triangulation of a quad mesh created in gmsh. Triangles created in gmsh/ a domain of quads made in Gridap (with the domain and partition functions) work with no issues. The …

---

## [Inside closures, captured constructors are much slower than captured functions](https://discourse.julialang.org/t/inside-closures-captured-constructors-are-much-slower-than-captured-functions/99638)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 2\
**Last updated:** [May 31, 2023, 12:47pm UTC](https://discourse.julialang.org/t/inside-closures-captured-constructors-are-much-slower-than-captured-functions/99638 "2023-05-31T12:47:54Z")

</div>

I have noticed that inside function closures, using a captured variable with a type value as a constructor is much slower than using a variable with a function value. Consider the following (silly) example: function g(f…

---

## [Installing CUDA](https://discourse.julialang.org/t/installing-cuda/49224)

<div class="topic-metadata">

**Author:** [@asyrov](https://discourse.julialang.org/u/asyrov)\
**Replies:** 4\
**Last updated:** [May 31, 2023, 12:27pm UTC](https://discourse.julialang.org/t/installing-cuda/49224 "2023-05-31T12:27:33Z")

</div>

I’m trying to re-install CUDA package after first initial install failed (sorry to say, but I aborted first install by Cntrl+C while it was doing someing, not sure what). But now nothing I do helps. I reinstalled julia, …

---

## [List of packages imported with "using" in a module](https://discourse.julialang.org/t/list-of-packages-imported-with-using-in-a-module/99658)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 1\
**Last updated:** [May 31, 2023, 8:56am UTC](https://discourse.julialang.org/t/list-of-packages-imported-with-using-in-a-module/99658 "2023-05-31T08:56:24Z")

</div>

module A using B end is there somefunction(A) that returns a list which contains :B ? If B is imported, names does the job: module A import B end names(A, imported=true) # \[:A, :B\] I’d ideally like something that …

---

## [Latexstring + sprintf](https://discourse.julialang.org/t/latexstring-sprintf/99596)

<div class="topic-metadata">

**Author:** [@volkerkarle](https://discourse.julialang.org/u/volkerkarle)\
**Replies:** 1\
**Last updated:** [May 31, 2023, 8:32am UTC](https://discourse.julialang.org/t/latexstring-sprintf/99596 "2023-05-31T08:32:52Z")

</div>

Hello! For plotting I’m often using something similar to latexstring(@sprintf("a=%.3f \\\\beta, b=%.3f \\\\alpha",π, 1-π)) and I was wondering if somebody is using a better option or has an idea which 1) has something lik…

---

## [How to correctly design multi-thread cache that's transparent to user iteration?](https://discourse.julialang.org/t/how-to-correctly-design-multi-thread-cache-thats-transparent-to-user-iteration/99577)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 10\
**Last updated:** [May 31, 2023, 7:18am UTC](https://discourse.julialang.org/t/how-to-correctly-design-multi-thread-cache-thats-transparent-to-user-iteration/99577 "2023-05-31T07:18:16Z")

</div>

Runnable code and benchmark at this gist. This is a widespread pattern for columnar-storage access, usually each column is too large to fit in ram, so it’s chunked in to clusters, and each cluster is individually compre…

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

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