# General Usage

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

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

**Page:** 607

---

## [LoadError: DimensionMismatch("arrays could not be broadcast to a common size; got a dimension with lengths 11 and 12"](https://discourse.julialang.org/t/loaderror-dimensionmismatch-arrays-could-not-be-broadcast-to-a-common-size-got-a-dimension-with-lengths-11-and-12/60189)

<div class="topic-metadata">

**Author:** [@ancrene2](https://discourse.julialang.org/u/ancrene2)\
**Replies:** 1\
**Last updated:** [April 28, 2021, 7:27pm UTC](https://discourse.julialang.org/t/loaderror-dimensionmismatch-arrays-could-not-be-broadcast-to-a-common-size-got-a-dimension-with-lengths-11-and-12/60189 "2021-04-28T19:27:29Z")

</div>

I think I understand what the error is, but I can’t find where I made the mistake. Can anyone help? LoadError: DimensionMismatch(“arrays could not be broadcast to a common size; got a dimension with lengths 11 and 12”) …

---

## [Distributed loop and possible memory leak](https://discourse.julialang.org/t/distributed-loop-and-possible-memory-leak/60174)

<div class="topic-metadata">

**Author:** [@ovt](https://discourse.julialang.org/u/ovt)\
**Replies:** 0\
**Last updated:** [April 28, 2021, 3:06pm UTC](https://discourse.julialang.org/t/distributed-loop-and-possible-memory-leak/60174 "2021-04-28T15:06:09Z")

</div>

Hello, I’m trying to distribute some computation in a for loop among my procs. Here is what I tried: using Distributed addprocs(5) @everywhere begin using LinearAlgebra using SharedArrays using BenchmarkTools using Infi…

---

## [Rocket (Reactive Programming) Actor to Actor Message Passing, etc](https://discourse.julialang.org/t/rocket-reactive-programming-actor-to-actor-message-passing-etc/59947)

<div class="topic-metadata">

**Author:** [@Jack](https://discourse.julialang.org/u/Jack)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 4:55pm UTC](https://discourse.julialang.org/t/rocket-reactive-programming-actor-to-actor-message-passing-etc/59947 "2021-04-28T16:55:04Z")

</div>

Greetings. I found this amazing package as a framework for reactive programming. I have a few questions about the best practice for some patterns. Actor to Actor message passing. The actor subscribes to an observable.…

---

## [LoadError: MethodError: objects of type Float64 are not callable](https://discourse.julialang.org/t/loaderror-methoderror-objects-of-type-float64-are-not-callable/60181)

<div class="topic-metadata">

**Author:** [@ancrene](https://discourse.julialang.org/u/ancrene)\
**Replies:** 1\
**Last updated:** [April 28, 2021, 4:38pm UTC](https://discourse.julialang.org/t/loaderror-methoderror-objects-of-type-float64-are-not-callable/60181 "2021-04-28T16:38:21Z")

</div>

I’m working with SDEs. I’m very new to Julia so I’m just messing around with preexisting code to learn. Here is the error: LoadError: MethodError: objects of type Float64 are not callable in expression starting at \[nam…

---

## [Insert missing/nan elements in BitMatrix](https://discourse.julialang.org/t/insert-missing-nan-elements-in-bitmatrix/60179)

<div class="topic-metadata">

**Author:** [@Emmanouil\_Bakirtzis](https://discourse.julialang.org/u/Emmanouil_Bakirtzis)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 4:28pm UTC](https://discourse.julialang.org/t/insert-missing-nan-elements-in-bitmatrix/60179 "2021-04-28T16:28:48Z")

</div>

In Julia 1.6, I create a boolean array x= trues(3,2) and I want to reflect that an element is missing (or nan if it is compatible). I tried the following but they return errors x\[2,2\] = missing x\[2,2\] = NaN Is there …

---

## [I keep getting a syntax error saying my function needs and end, but I don't know why?](https://discourse.julialang.org/t/i-keep-getting-a-syntax-error-saying-my-function-needs-and-end-but-i-dont-know-why/60177)

<div class="topic-metadata">

**Author:** [@ancrene](https://discourse.julialang.org/u/ancrene)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 4:00pm UTC](https://discourse.julialang.org/t/i-keep-getting-a-syntax-error-saying-my-function-needs-and-end-but-i-dont-know-why/60177 "2021-04-28T16:00:33Z")

</div>

Below is the code. This is the error I get: ERROR: LoadError: syntax: incomplete: “function” at \[name\]COVID\_Project.jl:17 requires end using InstantiateFromURL using LinearAlgebra, Statistics, Random, SparseArrays usi…

---

## [Reading 12 bit integers from file](https://discourse.julialang.org/t/reading-12-bit-integers-from-file/60173)

<div class="topic-metadata">

**Author:** [@Shawly](https://discourse.julialang.org/u/Shawly)\
**Replies:** 4\
**Last updated:** [April 28, 2021, 3:42pm UTC](https://discourse.julialang.org/t/reading-12-bit-integers-from-file/60173 "2021-04-28T15:42:20Z")

</div>

I am new to Julia and trying to port some code from Matlab. I have an image file saved as a raw binary file with 12 bit precision. In Matlab I can use fread (Read data from binary file - MATLAB fread - MathWorks United K…

---

## [Is it possible to split a project in two?](https://discourse.julialang.org/t/is-it-possible-to-split-a-project-in-two/59214)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 3:18pm UTC](https://discourse.julialang.org/t/is-it-possible-to-split-a-project-in-two/59214 "2021-04-28T15:18:55Z")

</div>

What I want to do is this: I want to have the same project in two environments. In one environment I would only have names that functioned as calls for the model to compile and in the other environment I would have the c…

---

## [WARNING: using Gaston.plot](https://discourse.julialang.org/t/warning-using-gaston-plot/60101)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 5\
**Last updated:** [April 28, 2021, 2:00pm UTC](https://discourse.julialang.org/t/warning-using-gaston-plot/60101 "2021-04-28T14:00:07Z")

</div>

How to avoid this alert? WARNING: using Gaston.plot in module Main conflicts with an existing identifier. WARNING: using Gaston.figure in module Main conflicts with an existing identifier. (@v1.5) pkg\>\> st Gaston Stat…

---

## [Hessian matrix of ML model](https://discourse.julialang.org/t/hessian-matrix-of-ml-model/59933)

<div class="topic-metadata">

**Author:** [@March-08](https://discourse.julialang.org/u/March-08)\
**Replies:** 9\
**Last updated:** [April 28, 2021, 1:32pm UTC](https://discourse.julialang.org/t/hessian-matrix-of-ml-model/59933 "2021-04-28T13:32:13Z")

</div>

Hi. I would like to compute the Hessian matrix of my Flux model. I tried something like this without success: n = 100 X = rand(2, n) Y = rand(1, n) model = Chain(Dense(2,2),Dense(2,1)) loss(x,y) = Flux.mse(model(x),y…

---

## [How to deal with Julia Out of memory problem](https://discourse.julialang.org/t/how-to-deal-with-julia-out-of-memory-problem/60140)

<div class="topic-metadata">

**Author:** [@james1](https://discourse.julialang.org/u/james1)\
**Replies:** 5\
**Last updated:** [April 28, 2021, 11:40am UTC](https://discourse.julialang.org/t/how-to-deal-with-julia-out-of-memory-problem/60140 "2021-04-28T11:40:58Z")

</div>

LoadError: OutOfMemoryError() in expression starting at C:\\Users\\12984\\Desktop\\Interaction.jl:123 When I ran the program, I ran out of memory, as shown in the above statement. I tried to clean up the previous saved var…

---

## [Type stability for piecewise defined functions with expensive parts](https://discourse.julialang.org/t/type-stability-for-piecewise-defined-functions-with-expensive-parts/59790)

<div class="topic-metadata">

**Author:** [@alpharho](https://discourse.julialang.org/u/alpharho)\
**Replies:** 8\
**Last updated:** [April 28, 2021, 11:34am UTC](https://discourse.julialang.org/t/type-stability-for-piecewise-defined-functions-with-expensive-parts/59790 "2021-04-28T11:34:25Z")

</div>

The function function f(x) if x \< 0 return 0 end return expensive\_function(x) end Is not type-stable (in most cases). Is there a clean way to make it stable and generic, while staying performant for…

---

## [Seemingly large permformance regression on "^" power operator in \>=1.6](https://discourse.julialang.org/t/seemingly-large-permformance-regression-on-power-operator-in-1-6/60156)

<div class="topic-metadata">

**Author:** [@smpurkis](https://discourse.julialang.org/u/smpurkis)\
**Replies:** 2\
**Last updated:** [April 28, 2021, 9:52am UTC](https://discourse.julialang.org/t/seemingly-large-permformance-regression-on-power-operator-in-1-6/60156 "2021-04-28T09:52:32Z")

</div>

Hello, I was doing a benchmark between Julia and a few other programming languages (Python, c++), when I was surprised to see Julia being slow compared to previous versions. A quick benchmark between Julia 1.6.1 (1.6.0 …

---

## [Autodiff: calculate just the diagonal of the Hessian](https://discourse.julialang.org/t/autodiff-calculate-just-the-diagonal-of-the-hessian/22893)

<div class="topic-metadata">

**Author:** [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)\
**Replies:** 6\
**Last updated:** [April 8, 2019, 6:36am UTC](https://discourse.julialang.org/t/autodiff-calculate-just-the-diagonal-of-the-hessian/22893 "2019-04-08T06:36:02Z")

</div>

Given a function f(x) from R^2 → R, is there an efficient way to calculate just the diagonal entries of the Hessian matrix using any of the autodiff tools? I know that at the function’s max, all the off-diagonal partials…

---

## [Dataframe parses differently if data is passed in columns vs as an array](https://discourse.julialang.org/t/dataframe-parses-differently-if-data-is-passed-in-columns-vs-as-an-array/60130)

<div class="topic-metadata">

**Author:** [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Replies:** 3\
**Last updated:** [April 28, 2021, 8:35am UTC](https://discourse.julialang.org/t/dataframe-parses-differently-if-data-is-passed-in-columns-vs-as-an-array/60130 "2021-04-28T08:35:25Z")

</div>

Is it expected behavior that the DataFrames constructor will return different results if the data is passed in by column or as a matrix? In the former case the type of the column is more precisely inferred. In the latter…

---

## [How do I "wrap" a table object (in Luxor) around a torus (donut)?](https://discourse.julialang.org/t/how-do-i-wrap-a-table-object-in-luxor-around-a-torus-donut/59892)

<div class="topic-metadata">

**Author:** [@AndresCasillas](https://discourse.julialang.org/u/AndresCasillas)\
**Replies:** 5\
**Last updated:** [April 28, 2021, 7:35am UTC](https://discourse.julialang.org/t/how-do-i-wrap-a-table-object-in-luxor-around-a-torus-donut/59892 "2021-04-28T07:35:41Z")

</div>

I´m currently working on a Jupyter file and with Julia version 1.5.3 on a Windows computer, using Luxor. I have an array of arrays and a function (dibujar\_matriz) which creates a table based on the entries of each array. …

---

## [Warning: could not download https://pkg.julialang.org/registries](https://discourse.julialang.org/t/warning-could-not-download-https-pkg-julialang-org-registries/60147)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 1\
**Last updated:** [April 28, 2021, 7:08am UTC](https://discourse.julialang.org/t/warning-could-not-download-https-pkg-julialang-org-registries/60147 "2021-04-28T07:08:16Z")

</div>

I have managed to install some packages on Julia 1.6.1. But I get the following alert: Warning: could not download https://pkg.julialang.org/registries (@v1.6) pkg\> add ColorSchemes Updating registry at \`C:\\Users\\…

---

## [Is it possible to do a simple example of using Arrow.jl to pass data from/to Python?](https://discourse.julialang.org/t/is-it-possible-to-do-a-simple-example-of-using-arrow-jl-to-pass-data-from-to-python/60146)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 3\
**Last updated:** [April 28, 2021, 5:08am UTC](https://discourse.julialang.org/t/is-it-possible-to-do-a-simple-example-of-using-arrow-jl-to-pass-data-from-to-python/60146 "2021-04-28T05:08:17Z")

</div>

Say I am using PyCall.jl to start a python session. Can I receive an arrow vector from python without having to write it to disk? What’s the mechanism to do so? A simple MWE would be highly appreciated! Also, if I call…

---

## [Expected 72X speedup, observed 1.1X](https://discourse.julialang.org/t/expected-72x-speedup-observed-1-1x/60071)

<div class="topic-metadata">

**Author:** [@PhilipDLoewen](https://discourse.julialang.org/u/PhilipDLoewen)\
**Replies:** 5\
**Last updated:** [April 28, 2021, 4:50am UTC](https://discourse.julialang.org/t/expected-72x-speedup-observed-1-1x/60071 "2021-04-28T04:50:41Z")

</div>

I dreamed up a simple-looking task that I thought multithreading could accelerate. Running the file below (I named it threadbench.jl) proved me wrong: with 72 cores and 72 threads, the timings are not appreciably better …

---

## [Using DrWatson.jl with Slurm: Best practice tipps](https://discourse.julialang.org/t/using-drwatson-jl-with-slurm-best-practice-tipps/40352)

<div class="topic-metadata">

**Author:** [@volkerkarle](https://discourse.julialang.org/u/volkerkarle)\
**Replies:** 9\
**Last updated:** [April 27, 2021, 9:08pm UTC](https://discourse.julialang.org/t/using-drwatson-jl-with-slurm-best-practice-tipps/40352 "2021-04-27T21:08:37Z")

</div>

Dear folks, Following my last question, I am now trying to set up dr.watson.jl for my routines on a cluster. I wonder if someone has experience on this matter? For running a job the following things happen: I have a j…

---

## [Advice for parallel computation](https://discourse.julialang.org/t/advice-for-parallel-computation/60087)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 6\
**Last updated:** [April 27, 2021, 8:44pm UTC](https://discourse.julialang.org/t/advice-for-parallel-computation/60087 "2021-04-27T20:44:29Z")

</div>

Hi, I am trying to solve a big PDE, and I want to parallelize a finite difference. I am seeking some advice on how to do this. At some point I do the following using PDEPackage # struct that contains the parameters pd…

---

## [Mutating fields in StructArrays](https://discourse.julialang.org/t/mutating-fields-in-structarrays/60106)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 11\
**Last updated:** [April 27, 2021, 8:20pm UTC](https://discourse.julialang.org/t/mutating-fields-in-structarrays/60106 "2021-04-27T20:20:18Z")

</div>

I am starting to use StructArrays in a package, and the benefits clearly outweigh the costs. However, there is one thing that I have, for the moment, to let go, which is the mutation of fields using the most natural synt…

---

## [Huge difference in performance between two programmes](https://discourse.julialang.org/t/huge-difference-in-performance-between-two-programmes/60116)

<div class="topic-metadata">

**Author:** [@encendre](https://discourse.julialang.org/u/encendre)\
**Replies:** 7\
**Last updated:** [April 27, 2021, 7:02pm UTC](https://discourse.julialang.org/t/huge-difference-in-performance-between-two-programmes/60116 "2021-04-27T19:02:24Z")

</div>

I’m sorry for the not very descriptive title but I couldn’t find a better way to phrase it I have two similar programmes with a huge difference in performance let function useless() end @time let s = 0 for n i…

---

## [Dealing with NaN's](https://discourse.julialang.org/t/dealing-with-nans/60086)

<div class="topic-metadata">

**Author:** [@statspy](https://discourse.julialang.org/u/statspy)\
**Replies:** 21\
**Last updated:** [April 27, 2021, 4:59pm UTC](https://discourse.julialang.org/t/dealing-with-nans/60086 "2021-04-27T16:59:01Z")

</div>

Hello, I am trying to filter a dataframe to exclude NaN’a values but not working so far. How can i deal with NaN’s? I am trying: filter(!isnan(df.salary)) What are my options to deal with NaN’s? Thanks

---

## [Problems with GR.plot, but may be environment related](https://discourse.julialang.org/t/problems-with-gr-plot-but-may-be-environment-related/32423)

<div class="topic-metadata">

**Author:** [@Andrzej\_Ceglowski](https://discourse.julialang.org/u/Andrzej_Ceglowski)\
**Replies:** 5\
**Last updated:** [April 27, 2021, 2:19pm UTC](https://discourse.julialang.org/t/problems-with-gr-plot-but-may-be-environment-related/32423 "2021-04-27T14:19:26Z")

</div>

After an Atom restart I cannot get plots to run without error messages. The following REPL code and errors are indicative: julia\> plot(rand(10)) Error showing value of type Plots.Plot{Plots.GRBackend}: ERROR: SystemE…

---

## [Domain error at the integrand using QuadGK](https://discourse.julialang.org/t/domain-error-at-the-integrand-using-quadgk/60076)

<div class="topic-metadata">

**Author:** [@leopdsf](https://discourse.julialang.org/u/leopdsf)\
**Replies:** 1\
**Last updated:** [April 27, 2021, 3:20pm UTC](https://discourse.julialang.org/t/domain-error-at-the-integrand-using-quadgk/60076 "2021-04-27T15:20:26Z")

</div>

Hello, everyone! I am trying to perform the numerical integration of the function \\tanh^2(z) using QuadGK.jl with the following code using Plots using QuadGK k(z) = tanh(z)^2 plot(k) Q = quadgk(k,-Inf,Inf) but when I …

---

## [Error broadcasting string getproperty using StructArrays](https://discourse.julialang.org/t/error-broadcasting-string-getproperty-using-structarrays/60109)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 4\
**Last updated:** [April 27, 2021, 2:42pm UTC](https://discourse.julialang.org/t/error-broadcasting-string-getproperty-using-structarrays/60109 "2021-04-27T14:42:33Z")

</div>

Another issue with my migration to StructArrays. There is one problem I don’t understand when trying to broadcast a function that gets a property and this property, specifically, is of type String. For example: julia\> s…

---

## [How to reach a function definition](https://discourse.julialang.org/t/how-to-reach-a-function-definition/60102)

<div class="topic-metadata">

**Author:** [@akhil\_teja](https://discourse.julialang.org/u/akhil_teja)\
**Replies:** 7\
**Last updated:** [April 27, 2021, 1:59pm UTC](https://discourse.julialang.org/t/how-to-reach-a-function-definition/60102 "2021-04-27T13:59:57Z")

</div>

I was just going through the github repo of Plots.jl and in it I was trying to find the function definition KW (Line number 52: https://github.com/JuliaPlots/Plots.jl/blob/1ceb3a561f5e9f20471636865180d603d09753ed/src/plo…

---

## [Reading only some results files in some folder](https://discourse.julialang.org/t/reading-only-some-results-files-in-some-folder/60089)

<div class="topic-metadata">

**Author:** [@roi.holtzman](https://discourse.julialang.org/u/roi.holtzman)\
**Replies:** 0\
**Last updated:** [April 27, 2021, 9:17am UTC](https://discourse.julialang.org/t/reading-only-some-results-files-in-some-folder/60089 "2021-04-27T09:17:07Z")

</div>

I am using the package DrWatson to run simulations. I have one script writing many results files to some folder. Now I want to be able to read only some of these files (e.g. one of them) and not all of them. I am usua…

---

## [@eval vs defining on module](https://discourse.julialang.org/t/eval-vs-defining-on-module/60083)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 1\
**Last updated:** [April 27, 2021, 7:53am UTC](https://discourse.julialang.org/t/eval-vs-defining-on-module/60083 "2021-04-27T07:53:31Z")

</div>

In this question, users want to change the behavior of a function in Base. What’s the difference between this post’s suggestion of @eval Base begin path\_color = :red function print\_stackframe(io, i, frame::StackFrame…

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

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