# General Usage

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

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

**Page:** 643

---

## [Why is there a "Warning: Slow Fallback implementation" and a DimensionMismatch error?](https://discourse.julialang.org/t/why-is-there-a-warning-slow-fallback-implementation-and-a-dimensionmismatch-error/55283)

<div class="topic-metadata">

**Author:** [@SatvikDuddukuru](https://discourse.julialang.org/u/SatvikDuddukuru)\
**Replies:** 1\
**Last updated:** [February 16, 2021, 9:03am UTC](https://discourse.julialang.org/t/why-is-there-a-warning-slow-fallback-implementation-and-a-dimensionmismatch-error/55283 "2021-02-16T09:03:52Z")

</div>

I am trying to create a convolutional neural network to classify MNIST data with Flux in Julia. I downloaded the data as a csv from this link: MNIST in CSV | Kaggle. My code is below: using CSV using DataFrames using I…

---

## [Hierarchical merge on a Region Adjacency Graph](https://discourse.julialang.org/t/hierarchical-merge-on-a-region-adjacency-graph/51633)

<div class="topic-metadata">

**Author:** [@jsundram](https://discourse.julialang.org/u/jsundram)\
**Replies:** 5\
**Last updated:** [February 16, 2021, 2:21am UTC](https://discourse.julialang.org/t/hierarchical-merge-on-a-region-adjacency-graph/51633 "2021-02-16T02:21:53Z")

</div>

I’m super new to Julia, and am porting over a python program of mine to Julia to get a feel for the language. I’ve constructed a region adjacency graph (RAG) for an image using ImageSegmentation.region\_adjacency\_graph. I…

---

## [Define methods for packages without importing](https://discourse.julialang.org/t/define-methods-for-packages-without-importing/55353)

<div class="topic-metadata">

**Author:** [@rikh](https://discourse.julialang.org/u/rikh)\
**Replies:** 1\
**Last updated:** [February 15, 2021, 10:01pm UTC](https://discourse.julialang.org/t/define-methods-for-packages-without-importing/55353 "2021-02-15T22:01:19Z")

</div>

Say that I got a package Foo and want my package to include some methods especially for handling DataFrames, and plots from Plots and Gadfly. To do this, I could define something like module Foo import DataFrames impo…

---

## [Unable to add MakieLayout](https://discourse.julialang.org/t/unable-to-add-makielayout/55331)

<div class="topic-metadata">

**Author:** [@Carsten](https://discourse.julialang.org/u/Carsten)\
**Replies:** 1\
**Last updated:** [February 15, 2021, 9:46pm UTC](https://discourse.julialang.org/t/unable-to-add-makielayout/55331 "2021-02-15T21:46:27Z")

</div>

I’m unable to add MakieLayout. (@v1.5) pkg\> add MakieLayout#master Cloning git-repo \`https://github.com/jkrumbiegel/MakieLayout.jl.git\` Updating git-repo \`https://github.com/jkrumbiegel/MakieLayout.jl.git\` Reso…

---

## [Difference btween dot operator and operator?](https://discourse.julialang.org/t/difference-btween-dot-operator-and-operator/55304)

<div class="topic-metadata">

**Author:** [@Ravinder\_Ram](https://discourse.julialang.org/u/Ravinder_Ram)\
**Replies:** 14\
**Last updated:** [February 15, 2021, 6:57pm UTC](https://discourse.julialang.org/t/difference-btween-dot-operator-and-operator/55304 "2021-02-15T18:57:41Z")

</div>

what is difference between thse two exprresiion? 5 + 3 -----\> 8 5 .+ 3 -----\> 8 is there any benefit to put . before operator?

---

## [Is using Libc.free fine when a library doesn't have its own freeing function?](https://discourse.julialang.org/t/is-using-libc-free-fine-when-a-library-doesnt-have-its-own-freeing-function/55326)

<div class="topic-metadata">

**Author:** [@MasFlam](https://discourse.julialang.org/u/MasFlam)\
**Replies:** 2\
**Last updated:** [February 15, 2021, 4:47pm UTC](https://discourse.julialang.org/t/is-using-libc-free-fine-when-a-library-doesnt-have-its-own-freeing-function/55326 "2021-02-15T16:47:10Z")

</div>

The XCB library occasionally requires the user to free data by themselves using the libc free function. The documentation on Libc.free in Julia specifically says it shouldn’t be used to free data from external libraries …

---

## [Error calling Fortran from Julia](https://discourse.julialang.org/t/error-calling-fortran-from-julia/55292)

<div class="topic-metadata">

**Author:** [@Siel](https://discourse.julialang.org/u/Siel)\
**Replies:** 6\
**Last updated:** [February 15, 2021, 4:45pm UTC](https://discourse.julialang.org/t/error-calling-fortran-from-julia/55292 "2021-02-15T16:45:01Z")

</div>

I’ve been trying to make a very simple example of Julia calling fortran to work but it seems I’m missing something, right now what I’ve done is: Fortran code: module ipmf use, intrinsic :: iso\_c\_binding implicit no…

---

## [Error : "read: Connection reset by peer send: Broken pipe" during animation](https://discourse.julialang.org/t/error-read-connection-reset-by-peer-send-broken-pipe-during-animation/52552)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 2\
**Last updated:** [February 15, 2021, 4:34pm UTC](https://discourse.julialang.org/t/error-read-connection-reset-by-peer-send-broken-pipe-during-animation/52552 "2021-02-15T16:34:05Z")

</div>

I get the following strange error when trying the following simple animation task. using Plots; plt = plot3d( 1, xlim = (0, 1), ylim = (0, 1), zlim = (0, 1), title = "Lorenz Attractor", marker = 2, ); N=1000; A = rand(…

---

## [Package ZeroMQ\_jll does not have JLLWrappers in its dependencies](https://discourse.julialang.org/t/package-zeromq-jll-does-not-have-jllwrappers-in-its-dependencies/48807)

<div class="topic-metadata">

**Author:** [@sjoerdvanhoof](https://discourse.julialang.org/u/sjoerdvanhoof)\
**Replies:** 3\
**Last updated:** [February 15, 2021, 4:27pm UTC](https://discourse.julialang.org/t/package-zeromq-jll-does-not-have-jllwrappers-in-its-dependencies/48807 "2021-02-15T16:27:05Z")

</div>

Hi all, I am new to Julia and tried installing it on both a Windows PC as well as a Macbook. On both systems I get the same error, but if I google it, I cannot find any related problems. I installed julia 1.5.2 and con…

---

## [Callback function in DifferentialEquations](https://discourse.julialang.org/t/callback-function-in-differentialequations/55314)

<div class="topic-metadata">

**Author:** [@arif](https://discourse.julialang.org/u/arif)\
**Replies:** 1\
**Last updated:** [February 15, 2021, 1:32pm UTC](https://discourse.julialang.org/t/callback-function-in-differentialequations/55314 "2021-02-15T13:32:49Z")

</div>

I am trying to solve the Lane-Emden equations using DifferentialEquations. This is a system of two first order ODEs which are something like dtheta/dxi = psi, dpsi/dxi = -2 psi/xi - theta^n. I want to stop the integratio…

---

## [@threads tasks and Jupyter interrupt kernel](https://discourse.julialang.org/t/threads-tasks-and-jupyter-interrupt-kernel/55307)

<div class="topic-metadata">

**Author:** [@dnadlinger](https://discourse.julialang.org/u/dnadlinger)\
**Replies:** 0\
**Last updated:** [February 15, 2021, 11:04am UTC](https://discourse.julialang.org/t/threads-tasks-and-jupyter-interrupt-kernel/55307 "2021-02-15T11:04:08Z")

</div>

I am using Julia inside Jupyter (using IJulia.jl), and have some computationally intensive tasks distributed over several threads using a Threads.@threads for loop. Interrupting the kernel more often than not only seems…

---

## [Is it possible to generalize such function to arbitrary tuple size? I couldn't fin](https://discourse.julialang.org/t/is-it-possible-to-generalize-such-function-to-arbitrary-tuple-size-i-couldnt-fin/55305)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 2\
**Last updated:** [February 15, 2021, 10:44am UTC](https://discourse.julialang.org/t/is-it-possible-to-generalize-such-function-to-arbitrary-tuple-size-i-couldnt-fin/55305 "2021-02-15T10:44:13Z")

</div>

Is it possible to generalize such function to arbitrary tuple size? I couldn’t find relevant information in docs. function from\_vec(::Type{MyType{Tuple{T1, T2}}}, x) where {T1, T2} MyType((f(T1, x), f(T2, x))) end Not…

---

## [Best way to extract parts of arrays in a bigger array](https://discourse.julialang.org/t/best-way-to-extract-parts-of-arrays-in-a-bigger-array/55274)

<div class="topic-metadata">

**Author:** [@stebett](https://discourse.julialang.org/u/stebett)\
**Replies:** 2\
**Last updated:** [February 15, 2021, 8:38am UTC](https://discourse.julialang.org/t/best-way-to-extract-parts-of-arrays-in-a-bigger-array/55274 "2021-02-15T08:38:41Z")

</div>

Hello everyone, I’m wondering if anybody can find a better solution to this problem: I have 2 arrays of arrays: in the first one there are time series, and in the second one there are timepoints on those time series. M…

---

## [Plotting multivariable function stored in a 2d array](https://discourse.julialang.org/t/plotting-multivariable-function-stored-in-a-2d-array/55288)

<div class="topic-metadata">

**Author:** [@jigjig](https://discourse.julialang.org/u/jigjig)\
**Replies:** 2\
**Last updated:** [February 15, 2021, 8:11am UTC](https://discourse.julialang.org/t/plotting-multivariable-function-stored-in-a-2d-array/55288 "2021-02-15T08:11:32Z")

</div>

I am trying to plot the solution to a PDE, which is stored as a 2d array. I am wandering if there is a way to plot the solution as a 3d image. Thanks

---

## [What is the recommended way to do numerical integration in Julia — like \`NIntegrat](https://discourse.julialang.org/t/what-is-the-recommended-way-to-do-numerical-integration-in-julia-like-nintegrat/55237)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 3\
**Last updated:** [February 14, 2021, 11:16pm UTC](https://discourse.julialang.org/t/what-is-the-recommended-way-to-do-numerical-integration-in-julia-like-nintegrat/55237 "2021-02-14T23:16:25Z")

</div>

What is the recommended way to do numerical integration in Julia — like NIntegrate in Mathematica? Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate…

---

## [SafeTestsets - how to share test fixture](https://discourse.julialang.org/t/safetestsets-how-to-share-test-fixture/55266)

<div class="topic-metadata">

**Author:** [@adolgert](https://discourse.julialang.org/u/adolgert)\
**Replies:** 2\
**Last updated:** [February 14, 2021, 11:07pm UTC](https://discourse.julialang.org/t/safetestsets-how-to-share-test-fixture/55266 "2021-02-14T23:07:41Z")

</div>

Using SafeTestsets is a best practice for testing. This kind of TestSet keeps tests from interfering with each other, so I couldn’t define a function setup\_test() outside of @safetestset and use it inside the TestSet. I …

---

## [Pkg Automatically adding dependencies](https://discourse.julialang.org/t/pkg-automatically-adding-dependencies/55257)

<div class="topic-metadata">

**Author:** [@maajdl](https://discourse.julialang.org/u/maajdl)\
**Replies:** 3\
**Last updated:** [February 14, 2021, 8:52pm UTC](https://discourse.julialang.org/t/pkg-automatically-adding-dependencies/55257 "2021-02-14T20:52:05Z")

</div>

Hello I am a beginner-beginner to building a package. I understood what Pkg.add does and more or less why. I am a bit lazy. Would there be a way to Pkg.add automatically, based on the source code? Thanks, Mi…

---

## [Large idle memory usage](https://discourse.julialang.org/t/large-idle-memory-usage/20368)

<div class="topic-metadata">

**Author:** [@NS1](https://discourse.julialang.org/u/NS1)\
**Replies:** 6\
**Last updated:** [February 14, 2021, 7:56pm UTC](https://discourse.julialang.org/t/large-idle-memory-usage/20368 "2021-02-14T19:56:03Z")

</div>

Hi, I found that Julia has quite a large memory footprint in my machine, and wanted to ask if it’s normal. By opening Atom, a Julia process opens, with ~500 MB. When starting julia in the REPL, another process with sim…

---

## [Is it easy to call Go from Julia? What about Rust? What are the biggest challenges](https://discourse.julialang.org/t/is-it-easy-to-call-go-from-julia-what-about-rust-what-are-the-biggest-challenges/55243)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 6\
**Last updated:** [February 14, 2021, 7:01pm UTC](https://discourse.julialang.org/t/is-it-easy-to-call-go-from-julia-what-about-rust-what-are-the-biggest-challenges/55243 "2021-02-14T19:01:49Z")

</div>

Is it easy to call Go from Julia? What about Rust? What are the biggest challenges? What about the other direction, i.e. them calling Julia? I’m looking for two things. One is that I could do microservices in a modern l…

---

## [I'm trying to build my documentation but keep getting the following error\`\`\`ERROR](https://discourse.julialang.org/t/im-trying-to-build-my-documentation-but-keep-getting-the-following-error-error/55041)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 2\
**Last updated:** [February 14, 2021, 5:41pm UTC](https://discourse.julialang.org/t/im-trying-to-build-my-documentation-but-keep-getting-the-following-error-error/55041 "2021-02-14T17:41:33Z")

</div>

I’m trying to build my documentation but keep getting the following error ERROR: \`NonlinearSchrodinger=b3fbeaf7-5746-403c-a6b7-06939dc82746\` depends on \`TerminalLoggers\`, but no such entry exists in the manifest. I alr…

---

## [Can't parse AM/PM?](https://discourse.julialang.org/t/cant-parse-am-pm/55234)

<div class="topic-metadata">

**Author:** [@pyrex41](https://discourse.julialang.org/u/pyrex41)\
**Replies:** 5\
**Last updated:** [February 14, 2021, 2:34pm UTC](https://discourse.julialang.org/t/cant-parse-am-pm/55234 "2021-02-14T14:34:45Z")

</div>

I cannot seem to figure out how to parse a datetime string with am/pm: using Dates DateTime("2021-02-01 11:12AM EST", dateformat"y-m-d H:Mp xxx") gives this error: ERROR: ArgumentError: Unable to parse date time. Exp…

---

## [Can't access some default units in Unitful.jl](https://discourse.julialang.org/t/cant-access-some-default-units-in-unitful-jl/55235)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 3\
**Last updated:** [February 14, 2021, 1:22pm UTC](https://discourse.julialang.org/t/cant-access-some-default-units-in-unitful-jl/55235 "2021-02-14T13:22:27Z")

</div>

I am trying to use Gauss units for magnetic field: using Unitful B = 1u"Gauss" However, for some strange reason I get the error: ERROR: LoadError: ArgumentError: Symbol Gauss could not be found in unit modules Modul…

---

## [Understanding how Julia image and compilation works](https://discourse.julialang.org/t/understanding-how-julia-image-and-compilation-works/55208)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 2\
**Last updated:** [February 14, 2021, 12:32pm UTC](https://discourse.julialang.org/t/understanding-how-julia-image-and-compilation-works/55208 "2021-02-14T12:32:53Z")

</div>

Hey Julianners, Is there a good description on how does julia image → precompile image code compilation: code → runnable code works (and maybe Revise and SnoopCompile interference) Or is my question okay?

---

## [Recommended way to cache results of expensive functions?](https://discourse.julialang.org/t/recommended-way-to-cache-results-of-expensive-functions/55239)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 6\
**Last updated:** [February 14, 2021, 9:52am UTC](https://discourse.julialang.org/t/recommended-way-to-cache-results-of-expensive-functions/55239 "2021-02-14T09:52:59Z")

</div>

Suppose that I have a function f: Int --\> Float64 that conducts some expensive computation, but the integer inputs into f typically have only a very small number of possible values. I thus want to cache the results for s…

---

## [Embedding julia: libLLVM-9jl.so not found](https://discourse.julialang.org/t/embedding-julia-libllvm-9jl-so-not-found/55085)

<div class="topic-metadata">

**Author:** [@crbinz](https://discourse.julialang.org/u/crbinz)\
**Replies:** 18\
**Last updated:** [February 14, 2021, 12:52am UTC](https://discourse.julialang.org/t/embedding-julia-libllvm-9jl-so-not-found/55085 "2021-02-14T00:52:41Z")

</div>

I’m trying to compile a simple C++ program that embeds some julia code. I’ve gotten this to work on macOS, but when trying to compile on my CentOS machine, I get this warning, followed by lots of errors: /usr/bin/ld: wa…

---

## [Viewing a part of an array as a dictionary](https://discourse.julialang.org/t/viewing-a-part-of-an-array-as-a-dictionary/55233)

<div class="topic-metadata">

**Author:** [@circonflexe](https://discourse.julialang.org/u/circonflexe)\
**Replies:** 0\
**Last updated:** [February 13, 2021, 10:51pm UTC](https://discourse.julialang.org/t/viewing-a-part-of-an-array-as-a-dictionary/55233 "2021-02-13T22:51:37Z")

</div>

I have an array array (actually a Vector, to keep it simple), and I want to do work (let’s say call a function do\_work) on only those values indexed by some set S of indices of that vector. This subset has no reason to b…

---

## [How to check that a Symbol represents a function](https://discourse.julialang.org/t/how-to-check-that-a-symbol-represents-a-function/55124)

<div class="topic-metadata">

**Author:** [@maajdl](https://discourse.julialang.org/u/maajdl)\
**Replies:** 4\
**Last updated:** [February 13, 2021, 8:26pm UTC](https://discourse.julialang.org/t/how-to-check-that-a-symbol-represents-a-function/55124 "2021-02-13T20:26:04Z")

</div>

Hello I want to go through all the names in a module and find out those that represent a function. I tried something like: typeof(eval(:foo)) and in case :foo is a function, it returns: typeof(foo) From this I c…

---

## [Accessing every elements of an array except a certain range](https://discourse.julialang.org/t/accessing-every-elements-of-an-array-except-a-certain-range/55173)

<div class="topic-metadata">

**Author:** [@HoldenCaulfield](https://discourse.julialang.org/u/HoldenCaulfield)\
**Replies:** 10\
**Last updated:** [February 13, 2021, 8:05pm UTC](https://discourse.julialang.org/t/accessing-every-elements-of-an-array-except-a-certain-range/55173 "2021-02-13T20:05:25Z")

</div>

Hi all, I would like to access and modify the contents of an array except for a certain range. For instance, setting all elements of an array to value one, except for those elements whose indices are between 10-20 (like…

---

## [Same z-scale on plots3d with layout](https://discourse.julialang.org/t/same-z-scale-on-plots3d-with-layout/55221)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 0\
**Last updated:** [February 13, 2021, 6:22pm UTC](https://discourse.julialang.org/t/same-z-scale-on-plots3d-with-layout/55221 "2021-02-13T18:22:14Z")

</div>

Dear all, I have the following code to plot several curves in a layout form. using Plots plotly() pV = Vector{Any}(undef, 4); n=\[1,2,3,4\]; p=1 for i=1:2, j=1:2 z = n\[p\]\*t pV\[p\] = scatter3d(x,y,z,lw=1,ratio=1,m…

---

## [New concrete number type](https://discourse.julialang.org/t/new-concrete-number-type/55210)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 30\
**Last updated:** [February 13, 2021, 5:52pm UTC](https://discourse.julialang.org/t/new-concrete-number-type/55210 "2021-02-13T17:52:15Z")

</div>

Suppose that I want to define a new concrete type P (a probability). I want variables of type P to behave like floats except that e.g. passing a value of 1.1 to a function with argument of type P or assigning a value of…

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

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