# General Usage

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

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

**Page:** 457

---

## [How do I wait for a Plots.jl window to be closed?](https://discourse.julialang.org/t/how-do-i-wait-for-a-plots-jl-window-to-be-closed/80122)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 2\
**Last updated:** [April 27, 2022, 4:01pm UTC](https://discourse.julialang.org/t/how-do-i-wait-for-a-plots-jl-window-to-be-closed/80122 "2022-04-27T16:01:23Z")

</div>

Is there something similar to plt.show(block=true) from matplotlib in Plots.jl. I would prefer a solution for the GR backend. Maybe a call which is waiting for all windows / gui threads to be closed? using Plots p=plo…

---

## [Ideal number of BLAS threads](https://discourse.julialang.org/t/ideal-number-of-blas-threads/79197)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 10\
**Last updated:** [April 27, 2022, 2:43pm UTC](https://discourse.julialang.org/t/ideal-number-of-blas-threads/79197 "2022-04-27T14:43:22Z")

</div>

Hi, I am planning to run a heavy series of matrix operations on a cluster and I was wondering what’s the ideal number of BLAS threads I should use. Assume that I have a machine with 20 cores and 8-16 GB of RAM per core.…

---

## [LsqFit x axis samples vs data](https://discourse.julialang.org/t/lsqfit-x-axis-samples-vs-data/80141)

<div class="topic-metadata">

**Author:** [@youcann](https://discourse.julialang.org/u/youcann)\
**Replies:** 0\
**Last updated:** [April 27, 2022, 2:23pm UTC](https://discourse.julialang.org/t/lsqfit-x-axis-samples-vs-data/80141 "2022-04-27T14:23:31Z")

</div>

Hey, i’ve tried to fit a Gaussian pulse to some experimental data. When i use x=range(), the result looks resonable, with x equals the actual data, the fit does not work. Any help is appreciated. (Can i include Pluto…

---

## [Milstein method in DifferentialEquations.jl or other](https://discourse.julialang.org/t/milstein-method-in-differentialequations-jl-or-other/80107)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 4\
**Last updated:** [April 27, 2022, 12:54pm UTC](https://discourse.julialang.org/t/milstein-method-in-differentialequations-jl-or-other/80107 "2022-04-27T12:54:21Z")

</div>

I am trying to use a Milstein method in DifferentialEquations.jl to solve a stochastic differential equation \\mathrm{d}X(t)=f(X(t))\\mathrm{d}t + g(X(t))\\mathrm{d}W(t), where the Milstein method is defined by X\_{n+1}=X\_n…

---

## [Should I use \`\]add\` or \`\]develop\` to access local packages from my main environment?](https://discourse.julialang.org/t/should-i-use-add-or-develop-to-access-local-packages-from-my-main-environment/80115)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 8\
**Last updated:** [April 27, 2022, 12:09pm UTC](https://discourse.julialang.org/t/should-i-use-add-or-develop-to-access-local-packages-from-my-main-environment/80115 "2022-04-27T12:09:56Z")

</div>

Scenario: I have a package, say Widgets, which exists in a public Github repository (but not in the Julia package repo) at github.com/maxkapur/Widgets. I have also git cloned Widgets to my home folder for development pu…

---

## [How to carry out a sum over data indexed by time and grouped by year and month?](https://discourse.julialang.org/t/how-to-carry-out-a-sum-over-data-indexed-by-time-and-grouped-by-year-and-month/80071)

<div class="topic-metadata">

**Author:** [@Hugo](https://discourse.julialang.org/u/Hugo)\
**Replies:** 5\
**Last updated:** [April 27, 2022, 5:47am UTC](https://discourse.julialang.org/t/how-to-carry-out-a-sum-over-data-indexed-by-time-and-grouped-by-year-and-month/80071 "2022-04-27T05:47:24Z")

</div>

Hello, everyone I am new to Julia and I’m trying to carry out the task of grouping a variable by year and month and then summing for each month and year along the duration of a time-index variable. I know how to do thi…

---

## [Installation of ForneyLab](https://discourse.julialang.org/t/installation-of-forneylab/80093)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 0\
**Last updated:** [April 26, 2022, 10:16pm UTC](https://discourse.julialang.org/t/installation-of-forneylab/80093 "2022-04-26T22:16:19Z")

</div>

I was using ForneyLab with Atom 1.6 on my M1 Macbook Air. All was well, except for the standard development errors. At some point, using ForneyLab generated an error on Jupyterlab, and eventually in Atom. I removed and r…

---

## [GraphMakie with scale](https://discourse.julialang.org/t/graphmakie-with-scale/79961)

<div class="topic-metadata">

**Author:** [@Yuri\_Mizusawa](https://discourse.julialang.org/u/Yuri_Mizusawa)\
**Replies:** 3\
**Last updated:** [April 26, 2022, 10:18pm UTC](https://discourse.julialang.org/t/graphmakie-with-scale/79961 "2022-04-26T22:18:58Z")

</div>

I am using the GraphMakie to make graphs, it is working very well, but I wanted to know if there is a way to add scale to the graphs, similar to a scatter plot. I tryed the documentation but did’t find anything about it…

---

## [Jacobian of Symbolic Matrix multiplications](https://discourse.julialang.org/t/jacobian-of-symbolic-matrix-multiplications/80002)

<div class="topic-metadata">

**Author:** [@achrafmam2](https://discourse.julialang.org/u/achrafmam2)\
**Replies:** 2\
**Last updated:** [April 26, 2022, 9:06pm UTC](https://discourse.julialang.org/t/jacobian-of-symbolic-matrix-multiplications/80002 "2022-04-26T21:06:47Z")

</div>

Hi, Consider the following operation M \* x where A is a matrix and x a vector. I want to know if we can do the following using the Symbolics package. Calculate the Jacobian of M \* x with respect to M\[1\], M\[2\], \\dots . …

---

## [How to filter a DataFrame of DateTime data by the time of day?](https://discourse.julialang.org/t/how-to-filter-a-dataframe-of-datetime-data-by-the-time-of-day/79958)

<div class="topic-metadata">

**Author:** [@phantom](https://discourse.julialang.org/u/phantom)\
**Replies:** 9\
**Last updated:** [April 26, 2022, 8:30pm UTC](https://discourse.julialang.org/t/how-to-filter-a-dataframe-of-datetime-data-by-the-time-of-day/79958 "2022-04-26T20:30:36Z")

</div>

Suppose you have an array of Dataframes. Each Dataframe contains the time and date of the datapoint in the DateTime format. Is there a way to filter/ remove rows from the DataFrame based on the time of day the data is …

---

## [How to pass ARGS to multiple processes?](https://discourse.julialang.org/t/how-to-pass-args-to-multiple-processes/80075)

<div class="topic-metadata">

**Author:** [@JedPhillips](https://discourse.julialang.org/u/JedPhillips)\
**Replies:** 4\
**Last updated:** [April 26, 2022, 6:17pm UTC](https://discourse.julialang.org/t/how-to-pass-args-to-multiple-processes/80075 "2022-04-26T18:17:54Z")

</div>

I’m trying to pass command line arguments to a script that calls multiple processes, but I can’t seem to have the other processes access these arguments. Here’s a simple example: using Distributed addprocs(1) @everywher…

---

## [Can I set the default operation of a sparse Matrix to not store zeros?](https://discourse.julialang.org/t/can-i-set-the-default-operation-of-a-sparse-matrix-to-not-store-zeros/80007)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 7\
**Last updated:** [April 26, 2022, 3:59pm UTC](https://discourse.julialang.org/t/can-i-set-the-default-operation-of-a-sparse-matrix-to-not-store-zeros/80007 "2022-04-26T15:59:58Z")

</div>

I am building a sparse matrix II, however, when I assign some of its elements by zeros they are being stored with zero values unless I use dropzeros(II). 1- Why using sparse(II) below not dropping zeros from II? 2- Is …

---

## [National Vulnerability database issues](https://discourse.julialang.org/t/national-vulnerability-database-issues/79938)

<div class="topic-metadata">

**Author:** [@Allan\_Baker](https://discourse.julialang.org/u/Allan_Baker)\
**Replies:** 6\
**Last updated:** [April 26, 2022, 3:49pm UTC](https://discourse.julialang.org/t/national-vulnerability-database-issues/79938 "2022-04-26T15:49:38Z")

</div>

My Company uses an automated FOSS scanner that appears to track the national vulnerability database. I’ll have to dig around for more details. It complains about Julia’s full dependency packages found on julialang.org …

---

## [Why are ref's in structs type unstable?](https://discourse.julialang.org/t/why-are-refs-in-structs-type-unstable/80041)

<div class="topic-metadata">

**Author:** [@tr00](https://discourse.julialang.org/u/tr00)\
**Replies:** 4\
**Last updated:** [April 26, 2022, 2:39pm UTC](https://discourse.julialang.org/t/why-are-refs-in-structs-type-unstable/80041 "2022-04-26T14:39:15Z")

</div>

Hello Julia Community, I’ve just came across a small code example which isn’t type stable according to @code\_warntype but clearly should be, at least according to my understanding of refs. Here is the example: julia\> …

---

## [Dispatch on lambda functions](https://discourse.julialang.org/t/dispatch-on-lambda-functions/80064)

<div class="topic-metadata">

**Author:** [@jj-404](https://discourse.julialang.org/u/jj-404)\
**Replies:** 5\
**Last updated:** [April 26, 2022, 2:22pm UTC](https://discourse.julialang.org/t/dispatch-on-lambda-functions/80064 "2022-04-26T14:22:05Z")

</div>

Hi, is there a way to dispatch on lambda functions? It seems that lambda’s don’t have a specific type for themselves (unlike Functions), but are rather uniquely typed with a counter (var"#29#30"). I would like to dispatc…

---

## [Handling multiple files at the same time](https://discourse.julialang.org/t/handling-multiple-files-at-the-same-time/80037)

<div class="topic-metadata">

**Author:** [@Drachta](https://discourse.julialang.org/u/Drachta)\
**Replies:** 6\
**Last updated:** [April 26, 2022, 10:49am UTC](https://discourse.julialang.org/t/handling-multiple-files-at-the-same-time/80037 "2022-04-26T10:49:13Z")

</div>

Hello, I wish to replace some occurrence in a file and save it under a new file. The following does what I need, but it reads the entire file before making the substitution. Is there a better way to do this ? some\_var…

---

## [LoadError: CUDA error: invalid device ordinal. Version:Julia](https://discourse.julialang.org/t/loaderror-cuda-error-invalid-device-ordinal-version-julia/79863)

<div class="topic-metadata">

**Author:** [@munozdjp](https://discourse.julialang.org/u/munozdjp)\
**Replies:** 1\
**Last updated:** [April 26, 2022, 7:51am UTC](https://discourse.julialang.org/t/loaderror-cuda-error-invalid-device-ordinal-version-julia/79863 "2022-04-26T07:51:22Z")

</div>

When i follow the tutorial on: I run julia -i run/run\_nf.jl And I obtain the following error: shell\> julia -i run/run\_nf.jl /usr/share/modules/init/bash: eval: line 43: syntax error near unexpected token (' /usr…

---

## [Dependencies "4 skipped during auto due to previous errors"](https://discourse.julialang.org/t/dependencies-4-skipped-during-auto-due-to-previous-errors/79862)

<div class="topic-metadata">

**Author:** [@munozdjp](https://discourse.julialang.org/u/munozdjp)\
**Replies:** 9\
**Last updated:** [April 26, 2022, 7:48am UTC](https://discourse.julialang.org/t/dependencies-4-skipped-during-auto-due-to-previous-errors/79862 "2022-04-26T07:48:00Z")

</div>

When I follow the tutorial on : When I instantiate in julia: (image attached): I obtain the following errors: Do someone knows how to fix the problem of these dependencies?

---

## [Creating a new tuple from an existing one](https://discourse.julialang.org/t/creating-a-new-tuple-from-an-existing-one/80034)

<div class="topic-metadata">

**Author:** [@johnbb](https://discourse.julialang.org/u/johnbb)\
**Replies:** 5\
**Last updated:** [April 26, 2022, 7:41am UTC](https://discourse.julialang.org/t/creating-a-new-tuple-from-an-existing-one/80034 "2022-04-26T07:41:17Z")

</div>

Is there a general way to create a new tuple from an existing one of any length where one the element is set to something else?

---

## [Limiting tab autocompletion in REPL?](https://discourse.julialang.org/t/limiting-tab-autocompletion-in-repl/80028)

<div class="topic-metadata">

**Author:** [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Replies:** 0\
**Last updated:** [April 26, 2022, 3:29am UTC](https://discourse.julialang.org/t/limiting-tab-autocompletion-in-repl/80028 "2022-04-26T03:29:28Z")

</div>

I’ve occasionally found myself pressing TAB twice in the REPL, either at the prompt or after whitespace, and getting the full list of loaded symbols dumped into the buffer (and scrolls away other information I’m using ne…

---

## [How to use MPI.jl to scatter a matrix to a 2D processor grid?](https://discourse.julialang.org/t/how-to-use-mpi-jl-to-scatter-a-matrix-to-a-2d-processor-grid/80013)

<div class="topic-metadata">

**Author:** [@Neo](https://discourse.julialang.org/u/Neo)\
**Replies:** 1\
**Last updated:** [April 25, 2022, 11:24pm UTC](https://discourse.julialang.org/t/how-to-use-mpi-jl-to-scatter-a-matrix-to-a-2d-processor-grid/80013 "2022-04-25T23:24:58Z")

</div>

For example, I have a 5 by 5 matrix A = \[1, 2, 3, 4, 5; 1, 2, 3, 4, 5; 1, 2, 3, 4, 5; 1, 2, 3, 4, 5; 1, 2 ,3 ,4, 5\] and I want to scatter A to four processors like \[2,3; 4, 5\]. More precisely, I want to broadcast \[1,2…

---

## [Why are my higher order functions a million times slower than they should be?](https://discourse.julialang.org/t/why-are-my-higher-order-functions-a-million-times-slower-than-they-should-be/80021)

<div class="topic-metadata">

**Author:** [@Lilith](https://discourse.julialang.org/u/Lilith)\
**Replies:** 7\
**Last updated:** [April 26, 2022, 12:41am UTC](https://discourse.julialang.org/t/why-are-my-higher-order-functions-a-million-times-slower-than-they-should-be/80021 "2022-04-26T00:41:25Z")

</div>

While this example looks highly constructed, I ran into this performance issue in real code and got this as a MWE. I expect a slight penalty for calling a function dynamically (i.e. \_slow instead of the constant slow) bu…

---

## [How do I use an @sync inside a macro](https://discourse.julialang.org/t/how-do-i-use-an-sync-inside-a-macro/80023)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 0\
**Last updated:** [April 26, 2022, 12:40am UTC](https://discourse.julialang.org/t/how-do-i-use-an-sync-inside-a-macro/80023 "2022-04-26T00:40:10Z")

</div>

I’d like to understand how I could use @sync inside a macro instead of using fetch. Below is a simple example with some code borrowed from Base src (and butchered). How would I do it? function yuck( iter, lbody, n ) …

---

## [Known Security Vulnerabilities](https://discourse.julialang.org/t/known-security-vulnerabilities/67828)

<div class="topic-metadata">

**Author:** [@hmray2025](https://discourse.julialang.org/u/hmray2025)\
**Replies:** 8\
**Last updated:** [April 25, 2022, 8:21pm UTC](https://discourse.julialang.org/t/known-security-vulnerabilities/67828 "2022-04-25T20:21:55Z")

</div>

Is there any comprehensive list of known security vulnerabilities or associated strengths with Julia? I’m working with the DoD to enable ML applications for data science and am hoping to use Julia in our implementation. …

---

## [Plot a plot with subplot, given plots](https://discourse.julialang.org/t/plot-a-plot-with-subplot-given-plots/80011)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 5\
**Last updated:** [April 25, 2022, 8:06pm UTC](https://discourse.julialang.org/t/plot-a-plot-with-subplot-given-plots/80011 "2022-04-25T20:06:59Z")

</div>

I don’t know how to better describe this. Given: p1 = plot(rand(10)) p2 = plot(rand(10)) is there a way to use p1 and p2 to produce a two-subplot figure? Something like: p = plot(layout=(2,1)) plot!(p, p1, subplot=1)…

---

## [Declare functions of type](https://discourse.julialang.org/t/declare-functions-of-type/80006)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 0\
**Last updated:** [April 25, 2022, 6:53pm UTC](https://discourse.julialang.org/t/declare-functions-of-type/80006 "2022-04-25T18:53:32Z")

</div>

Moved from another thread Let’s say you want to know the methods to modify a Dict. In e.g. rust you can find those methods in the documentation of the Dict datatype. But if you execute apropos(“Dict”) in Julia you find…

---

## [Tracing Functions: Problem printing parameter values](https://discourse.julialang.org/t/tracing-functions-problem-printing-parameter-values/80003)

<div class="topic-metadata">

**Author:** [@Mark\_Nahabedian](https://discourse.julialang.org/u/Mark_Nahabedian)\
**Replies:** 0\
**Last updated:** [April 25, 2022, 5:58pm UTC](https://discourse.julialang.org/t/tracing-functions-problem-printing-parameter-values/80003 "2022-04-25T17:58:19Z")

</div>

I’m trying to implement a function tracing facility in Julia. Each time the designated function is called I want to log the parameters and return values. I have something partially working that is checked in at @tra…

---

## [Where are parameters stored within ForneyLab](https://discourse.julialang.org/t/where-are-parameters-stored-within-forneylab/79999)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 0\
**Last updated:** [April 25, 2022, 5:15pm UTC](https://discourse.julialang.org/t/where-are-parameters-stored-within-forneylab/79999 "2022-04-25T17:15:51Z")

</div>

Consider the following code snippet: using ForneyLab g = FactorGraph() @RV x ~ Bernoulli(0.7) My question is: in what data structure is 0.7 stored? I found that Bernoulli is a struct by examining the ForneyLab source c…

---

## [Json/bson dsl](https://discourse.julialang.org/t/json-bson-dsl/79940)

<div class="topic-metadata">

**Author:** [@dodoplus](https://discourse.julialang.org/u/dodoplus)\
**Replies:** 1\
**Last updated:** [April 25, 2022, 3:16pm UTC](https://discourse.julialang.org/t/json-bson-dsl/79940 "2022-04-25T15:16:44Z")

</div>

Hi, I’ve been playing a bit with Mongoc which is a thin layer on top of the MongoDB C library. MongoDB is leaning heavily into JSON, which makes for non-intuitive code (from the Mongoc docs): create\_indexes\_cmd = Mongo…

---

## [Spooky action at distance not applicable to vectors?](https://discourse.julialang.org/t/spooky-action-at-distance-not-applicable-to-vectors/79602)

<div class="topic-metadata">

**Author:** [@A\_C](https://discourse.julialang.org/u/A_C)\
**Replies:** 14\
**Last updated:** [April 25, 2022, 3:08pm UTC](https://discourse.julialang.org/t/spooky-action-at-distance-not-applicable-to-vectors/79602 "2022-04-25T15:08:55Z")

</div>

I have been using Julia for all my codes. I was explaining all the advantages of Julia over Python to my lab members and one of them decided to give it a try. Since I had stumbled over scoping rules when I started, I war…

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

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