# General Usage

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

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

**Page:** 685

---

## [Publish code](https://discourse.julialang.org/t/publish-code/49195)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 5\
**Last updated:** [October 29, 2020, 12:21am UTC](https://discourse.julialang.org/t/publish-code/49195 "2020-10-29T00:21:38Z")

</div>

In addition to the documentation in the docs/ directory, I would like to “publish” all Julia files in my Julia package to a PDF. Is there any common / preferred way to publish Julia code with syntax highlighting? I’m loo…

---

## [Compat/Optim incremental compilation broken](https://discourse.julialang.org/t/compat-optim-incremental-compilation-broken/34818)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 4\
**Last updated:** [October 28, 2020, 9:40pm UTC](https://discourse.julialang.org/t/compat-optim-incremental-compilation-broken/34818 "2020-10-28T21:40:41Z")

</div>

When precompiling a package, the following error is shown: \[ Info: Precompiling CollegeStrat \[17dbbba3-c303-53a0-b454-635a51d7dd41\] WARNING: Method definition dot(Any, Any, Any) in module Compat at /Users/lutz/.julia/pa…

---

## [Multiple dispatch with more than 4 methods blocks type inference](https://discourse.julialang.org/t/multiple-dispatch-with-more-than-4-methods-blocks-type-inference/49066)

<div class="topic-metadata">

**Author:** [@schaerfo](https://discourse.julialang.org/u/schaerfo)\
**Replies:** 15\
**Last updated:** [October 28, 2020, 9:29pm UTC](https://discourse.julialang.org/t/multiple-dispatch-with-more-than-4-methods-blocks-type-inference/49066 "2020-10-28T21:29:40Z")

</div>

Consider the following code: using InteractiveUtils struct A end struct B end g(r::A, s::A, t::A, u::A) = 1 g(r::B, s::A, t::A, u::A) = 2 g(r::B, s::A, t::B, u::A) = 3 g(r::B, s::B, t::A, u::A) = 4 g(r::B, s::B, t::B,…

---

## [Accelerating the calculation of minimum distance between points, annotating which is the point](https://discourse.julialang.org/t/accelerating-the-calculation-of-minimum-distance-between-points-annotating-which-is-the-point/49200)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 9\
**Last updated:** [October 28, 2020, 8:38pm UTC](https://discourse.julialang.org/t/accelerating-the-calculation-of-minimum-distance-between-points-annotating-which-is-the-point/49200 "2020-10-28T20:38:53Z")

</div>

I am writing a package that needs to compute the minimum distance between sets of coordinates in space of atoms (ComplexMixtures). I am already using cell lists, but at the very end the one finishes with the problem of c…

---

## [Taking gradients of minibatch gradient with Flux](https://discourse.julialang.org/t/taking-gradients-of-minibatch-gradient-with-flux/49193)

<div class="topic-metadata">

**Author:** [@a\_garval](https://discourse.julialang.org/u/a_garval)\
**Replies:** 0\
**Last updated:** [October 28, 2020, 5:50pm UTC](https://discourse.julialang.org/t/taking-gradients-of-minibatch-gradient-with-flux/49193 "2020-10-28T17:50:36Z")

</div>

Hey, I’m trying to implement minibatching in a Neural ODE system. I calculate the gradient for each batch with the following code: using DiffEqFlux, OrdinaryDiffEq, Flux, Optim, Plots, LinearAlgebra, Distributions od…

---

## [Matrix multiplication on multiple dimensions](https://discourse.julialang.org/t/matrix-multiplication-on-multiple-dimensions/49181)

<div class="topic-metadata">

**Author:** [@danicaratelli](https://discourse.julialang.org/u/danicaratelli)\
**Replies:** 8\
**Last updated:** [October 28, 2020, 4:11pm UTC](https://discourse.julialang.org/t/matrix-multiplication-on-multiple-dimensions/49181 "2020-10-28T16:11:25Z")

</div>

I want to multiply each matrix along one dimension of a mutli-dimensional matrix by another matrix. Is there a way to do it quickly in one go? See example below. Thank you in advance! #first factor: multi-dimensional m…

---

## [Idiomatic storage for intermediate calculations](https://discourse.julialang.org/t/idiomatic-storage-for-intermediate-calculations/49138)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 8\
**Last updated:** [October 28, 2020, 5:20pm UTC](https://discourse.julialang.org/t/idiomatic-storage-for-intermediate-calculations/49138 "2020-10-28T17:20:30Z")

</div>

I’m writing a module that’s numerically intensive (aren’t we all?), and I’m running into an issue where I seem to be fighting the language… which makes me suspect I’m doing it wrong. Specifically, I want to have a struc…

---

## [Mezzanine like framework](https://discourse.julialang.org/t/mezzanine-like-framework/49189)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 0\
**Last updated:** [October 28, 2020, 4:50pm UTC](https://discourse.julialang.org/t/mezzanine-like-framework/49189 "2020-10-28T16:50:57Z")

</div>

Hi, I am wondering if there is something close to mezzanine (django) but made ( i guess) with Genie.jl. Does anybody knows? Thank you, Romain

---

## [Interpolation with matrices](https://discourse.julialang.org/t/interpolation-with-matrices/49058)

<div class="topic-metadata">

**Author:** [@gregory](https://discourse.julialang.org/u/gregory)\
**Replies:** 13\
**Last updated:** [October 28, 2020, 3:15pm UTC](https://discourse.julialang.org/t/interpolation-with-matrices/49058 "2020-10-28T15:15:06Z")

</div>

Using Interpolations x = rand(50,5)\*2 .- 1 # Fake input data y = rand(50) # Fake output data itp = interpolate((x,),y, BSpline(Linear())) ERROR: MethodError: no method matching interpolate(::Tuple{Array{Float64,1}},…

---

## [Dynamically Create a Function - Initial Idea with eval failed due to World Age Issue](https://discourse.julialang.org/t/dynamically-create-a-function-initial-idea-with-eval-failed-due-to-world-age-issue/49139)

<div class="topic-metadata">

**Author:** [@roflmaostc](https://discourse.julialang.org/u/roflmaostc)\
**Replies:** 19\
**Last updated:** [October 28, 2020, 2:51pm UTC](https://discourse.julialang.org/t/dynamically-create-a-function-initial-idea-with-eval-failed-due-to-world-age-issue/49139 "2020-10-28T14:51:42Z")

</div>

Hey all, I’m struggling to implement a certain problem. My current situation is the following: Some parts of my project consist of using Tullio functions. Since my arrays can be of arbitrary dimensions and I want to ap…

---

## [Getting mp4 animations from Plots.jl to work in Firefox, Safari, etc.?](https://discourse.julialang.org/t/getting-mp4-animations-from-plots-jl-to-work-in-firefox-safari-etc/49072)

<div class="topic-metadata">

**Author:** [@PolarizedPoutine](https://discourse.julialang.org/u/PolarizedPoutine)\
**Replies:** 4\
**Last updated:** [October 28, 2020, 1:06pm UTC](https://discourse.julialang.org/t/getting-mp4-animations-from-plots-jl-to-work-in-firefox-safari-etc/49072 "2020-10-28T13:06:44Z")

</div>

We’ve been using Plots.jl to create mp4 animations for Literate.jl examples (they work beautifully together!) but recently noticed that the mp4 animations do not show up in Firefox or Safari but do show up in Chrome. Ex…

---

## [How to GC a SharedArray](https://discourse.julialang.org/t/how-to-gc-a-sharedarray/48699)

<div class="topic-metadata">

**Author:** [@ianshmean](https://discourse.julialang.org/u/ianshmean)\
**Replies:** 6\
**Last updated:** [October 28, 2020, 9:23am UTC](https://discourse.julialang.org/t/how-to-gc-a-sharedarray/48699 "2020-10-28T09:23:08Z")

</div>

What’s the right way to garbage collect a SharedArray? This doesn’t work. Julia consumes 8 GB memory indefinitely (Version 1.6.0-DEV.1237) using SharedArrays begin a = SharedArray{Float64}(10000000) @distributed…

---

## [Parallel/multithreading version of linear regression](https://discourse.julialang.org/t/parallel-multithreading-version-of-linear-regression/48771)

<div class="topic-metadata">

**Author:** [@Antonina\_Klyuyeva](https://discourse.julialang.org/u/Antonina_Klyuyeva)\
**Replies:** 19\
**Last updated:** [October 28, 2020, 1:28am UTC](https://discourse.julialang.org/t/parallel-multithreading-version-of-linear-regression/48771 "2020-10-28T01:28:09Z")

</div>

Hi there, I’m new to Julia. I implemented regression model with interactions using Julia GLM package: Reg = lm(@formula(dep\_var ~ var1&var2&var3), data, true). But fitting this formula requires a lot of RAM (\> 80 GB)…

---

## [Sizehint! a Dict with a BigInt size not possible?](https://discourse.julialang.org/t/sizehint-a-dict-with-a-bigint-size-not-possible/49151)

<div class="topic-metadata">

**Author:** [@malacroi](https://discourse.julialang.org/u/malacroi)\
**Replies:** 8\
**Last updated:** [October 27, 2020, 11:25pm UTC](https://discourse.julialang.org/t/sizehint-a-dict-with-a-bigint-size-not-possible/49151 "2020-10-27T23:25:54Z")

</div>

I’m using a dictionary to store some values indexed by integer partitions of 40. Since I know that there are 37338 of them, I attempted to sizehint! the dictionary, but instead of manually entering 37338, I used a funct…

---

## [Changing numerical base and other math tools/functions](https://discourse.julialang.org/t/changing-numerical-base-and-other-math-tools-functions/49137)

<div class="topic-metadata">

**Author:** [@Renan\_Rabelo](https://discourse.julialang.org/u/Renan_Rabelo)\
**Replies:** 6\
**Last updated:** [October 27, 2020, 8:32pm UTC](https://discourse.julialang.org/t/changing-numerical-base-and-other-math-tools-functions/49137 "2020-10-27T20:32:18Z")

</div>

Is there any packages to fast change numerical base, like to binary or octal, without using a custom function? I have some algorithms that I coded myself, but definitely there is faster algorithms to do so. Any help? I…

---

## [Can't get WEBIO to work](https://discourse.julialang.org/t/cant-get-webio-to-work/49143)

<div class="topic-metadata">

**Author:** [@Hyako\_Issei](https://discourse.julialang.org/u/Hyako_Issei)\
**Replies:** 2\
**Last updated:** [October 27, 2020, 7:52pm UTC](https://discourse.julialang.org/t/cant-get-webio-to-work/49143 "2020-10-27T19:52:16Z")

</div>

Im trying to create an interactive plot in julia with a slider but It throws the following error: Unable to load WebIO. Please make sure WebIO works for your Jupyter client. In the Julia terminal I try to install WEBIO…

---

## [SymPy.jl vs SymEngine.jl vs Reduce.jl vs](https://discourse.julialang.org/t/sympy-jl-vs-symengine-jl-vs-reduce-jl-vs/10381)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 23\
**Last updated:** [October 27, 2020, 7:10pm UTC](https://discourse.julialang.org/t/sympy-jl-vs-symengine-jl-vs-reduce-jl-vs/10381 "2020-10-27T19:10:14Z")

</div>

Has anyone made a serious comparison of the Symbolic Math packages we a currently have? (others?) There is a little (off topic) discussion here

---

## [Entering code to Reduce.jl](https://discourse.julialang.org/t/entering-code-to-reduce-jl/48965)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 3\
**Last updated:** [October 27, 2020, 7:00pm UTC](https://discourse.julialang.org/t/entering-code-to-reduce-jl/48965 "2020-10-27T19:00:54Z")

</div>

In the Reduce tetorial it gives examples of how to do things, like expand a function u=(x+y+z)^3 using u:=(x+y+z)^3 using Reduce u:=(x+y+z) this gives a syntax error u = literalpower(^(x+y+z),cor apply type (val 3) …

---

## [Loading Reduce.jl into Weave is going really slow](https://discourse.julialang.org/t/loading-reduce-jl-into-weave-is-going-really-slow/49080)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 5\
**Last updated:** [October 27, 2020, 7:00pm UTC](https://discourse.julialang.org/t/loading-reduce-jl-into-weave-is-going-really-slow/49080 "2020-10-27T19:00:21Z")

</div>

when I have a using Reduce and I try to weave it, it weaves really slow. I want to use reduce, for things like expanding, but it won’t load. what all affects the speed and ability of packages to load into Julia Markdow…

---

## [Iterating through all possibilities](https://discourse.julialang.org/t/iterating-through-all-possibilities/49060)

<div class="topic-metadata">

**Author:** [@JoeS](https://discourse.julialang.org/u/JoeS)\
**Replies:** 2\
**Last updated:** [October 27, 2020, 3:45pm UTC](https://discourse.julialang.org/t/iterating-through-all-possibilities/49060 "2020-10-27T15:45:00Z")

</div>

I have 2 Dataframes, dfV and dvS That are dataframes that look like the following: 2 rows × 9 columns (omitted printing of 2 columns) ||column|pt1|pt2|…|pt8| | — | — | — | — | ||String|Float64|Float64|…|Float64| |1…

---

## [Assert that 2D-Array never reduce to vector?](https://discourse.julialang.org/t/assert-that-2d-array-never-reduce-to-vector/49117)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 11\
**Last updated:** [October 27, 2020, 3:05pm UTC](https://discourse.julialang.org/t/assert-that-2d-array-never-reduce-to-vector/49117 "2020-10-27T15:05:13Z")

</div>

If I have a 2-D array A and idx is an index vector or value, and I want to assert that A\[idx,:\] be a 2D array (even if idx is a number), is there an easy way to do this without always having to divide into cases where …

---

## [JuliaAudio-LibsndFile Help needed](https://discourse.julialang.org/t/juliaaudio-libsndfile-help-needed/48613)

<div class="topic-metadata">

**Author:** [@Ashwani\_Rathee](https://discourse.julialang.org/u/Ashwani_Rathee)\
**Replies:** 2\
**Last updated:** [October 27, 2020, 12:12pm UTC](https://discourse.julialang.org/t/juliaaudio-libsndfile-help-needed/48613 "2020-10-27T12:12:28Z")

</div>

Hey guys,I am exploring the audio library LibSndFile.jl and WAV.jl and when writing a julia script,I wanted the info printed after load(filename) as a string(can be done by redirect stdout i think)…or better if I can …

---

## [Limit the usage of packages from outside the Manifest.toml](https://discourse.julialang.org/t/limit-the-usage-of-packages-from-outside-the-manifest-toml/49110)

<div class="topic-metadata">

**Author:** [@Adam\_Glos](https://discourse.julialang.org/u/Adam_Glos)\
**Replies:** 3\
**Last updated:** [October 27, 2020, 12:11pm UTC](https://discourse.julialang.org/t/limit-the-usage-of-packages-from-outside-the-manifest-toml/49110 "2020-10-27T12:11:21Z")

</div>

I prepared a Manifest.toml by activating the directory activate . I added some packages and having activated environment, I go back to Julia environment. However I’m still able to access packages which has not been inclu…

---

## [RefValue errors with LibSerialPort](https://discourse.julialang.org/t/refvalue-errors-with-libserialport/49049)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 7\
**Last updated:** [October 27, 2020, 11:39am UTC](https://discourse.julialang.org/t/refvalue-errors-with-libserialport/49049 "2020-10-27T11:39:50Z")

</div>

I’m honestly not sure if this has something to do with LibSerialPort or if it’s just me, hence the Discourse post as opposed to an issue… I’m repeatedly reading off of a serial port inside an async loop, and while tryin…

---

## [Supported (Latex like) fontfamilies Plots.jl GR.jl](https://discourse.julialang.org/t/supported-latex-like-fontfamilies-plots-jl-gr-jl/22938)

<div class="topic-metadata">

**Author:** [@YoungFaithful](https://discourse.julialang.org/u/YoungFaithful)\
**Replies:** 8\
**Last updated:** [October 27, 2020, 11:35am UTC](https://discourse.julialang.org/t/supported-latex-like-fontfamilies-plots-jl-gr-jl/22938 "2020-10-27T11:35:17Z")

</div>

Hi all, I’m trying to figure out which fontfamilies can be used with Plots.jl using GR.jl. Is it system dependent? I am looking specifically for a “Computer Modern” like family. I couldn’t find a list or explanation wha…

---

## [BSON Loading Flux NN model - error - reference to NNlib](https://discourse.julialang.org/t/bson-loading-flux-nn-model-error-reference-to-nnlib/49112)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 0\
**Last updated:** [October 27, 2020, 11:29am UTC](https://discourse.julialang.org/t/bson-loading-flux-nn-model-error-reference-to-nnlib/49112 "2020-10-27T11:29:21Z")

</div>

Hi. I am trying to use BSON.@load within DaemonMode.jl DaemonMode.jl has acknowledged reference issues arising from: “…DaemonMode uses a module to encapsulate the code…” but for example in the case of ‘include’ this i…

---

## [Replacement for Dict, is anyone using isslotfilled?](https://discourse.julialang.org/t/replacement-for-dict-is-anyone-using-isslotfilled/48810)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 22\
**Last updated:** [October 27, 2020, 9:26am UTC](https://discourse.julialang.org/t/replacement-for-dict-is-anyone-using-isslotfilled/48810 "2020-10-27T09:26:05Z")

</div>

Hi, I’m looking into replacing Dict in Julia with an ordered implementation. I hear people would like that, any objections? Actually I already did that, and it works for me, but not for all methods older Dict provided. …

---

## [How to assign tuples to struct?](https://discourse.julialang.org/t/how-to-assign-tuples-to-struct/49094)

<div class="topic-metadata">

**Author:** [@SonLe](https://discourse.julialang.org/u/SonLe)\
**Replies:** 3\
**Last updated:** [October 27, 2020, 6:27am UTC](https://discourse.julialang.org/t/how-to-assign-tuples-to-struct/49094 "2020-10-27T06:27:04Z")

</div>

Hi everyone, I struggle with this issue. Let say I have a tuple of 5 elements, a = (100, 50, 0.05, 0.05, false, true) and a struct is defined as, struct PortfolioInfo num\_stock::Int64 num\_rndreturn::Int64 …

---

## [Image IO and processing efficiency: sequential versus bulk](https://discourse.julialang.org/t/image-io-and-processing-efficiency-sequential-versus-bulk/48975)

<div class="topic-metadata">

**Author:** [@jakewilliami](https://discourse.julialang.org/u/jakewilliami)\
**Replies:** 9\
**Last updated:** [October 27, 2020, 1:25am UTC](https://discourse.julialang.org/t/image-io-and-processing-efficiency-sequential-versus-bulk/48975 "2020-10-27T01:25:31Z")

</div>

I have an algorithm that loads and processes images. There are two ways of doing this: Load all images together, and process them all together (bulk); or One-by-one, load and process the images (sequential). I have c…

---

## [Enforcing Schema on Data Frame Passed as Function Argument](https://discourse.julialang.org/t/enforcing-schema-on-data-frame-passed-as-function-argument/49020)

<div class="topic-metadata">

**Author:** [@gyrfalcon](https://discourse.julialang.org/u/gyrfalcon)\
**Replies:** 7\
**Last updated:** [October 27, 2020, 12:24am UTC](https://discourse.julialang.org/t/enforcing-schema-on-data-frame-passed-as-function-argument/49020 "2020-10-27T00:24:54Z")

</div>

I have been working on some code where DataFrame structures seem to apply quite well. However, I was wondering if it is possible to enforce at a minimum a certain pattern of data types, if not both data types and column …

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

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