# General Usage

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

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

**Page:** 713

---

## [DifferentialEquations.jl, Error: Exponentiation yielding a complex result requires a complex argument](https://discourse.julialang.org/t/differentialequations-jl-error-exponentiation-yielding-a-complex-result-requires-a-complex-argument/44935)

<div class="topic-metadata">

**Author:** [@Gregers](https://discourse.julialang.org/u/Gregers)\
**Replies:** 6\
**Last updated:** [August 17, 2020, 2:28pm UTC](https://discourse.julialang.org/t/differentialequations-jl-error-exponentiation-yielding-a-complex-result-requires-a-complex-argument/44935 "2020-08-17T14:28:56Z")

</div>

Hey, I am trying to solve a boundary value problem using DifferentialEquations.jl. Unfortunately, I get the error: “DomainError with -117.96192353385844: Exponentiation yielding a complex result requires a complex ar…

---

## [Understanding how HTTP works](https://discourse.julialang.org/t/understanding-how-http-works/44980)

<div class="topic-metadata">

**Author:** [@Bucephalus](https://discourse.julialang.org/u/Bucephalus)\
**Replies:** 12\
**Last updated:** [August 17, 2020, 2:11pm UTC](https://discourse.julialang.org/t/understanding-how-http-works/44980 "2020-08-17T14:11:42Z")

</div>

I’m trying to learn programming in Julia. i’m using this package HTTP.jl can anybody explain why this first request won’t work for me, however the second one straight out of the documentation for HTTP.jl works? This…

---

## [Reloading by re-executing include() doesn't seem to work](https://discourse.julialang.org/t/reloading-by-re-executing-include-doesnt-seem-to-work/45075)

<div class="topic-metadata">

**Author:** [@akdor1154](https://discourse.julialang.org/u/akdor1154)\
**Replies:** 4\
**Last updated:** [August 17, 2020, 12:23pm UTC](https://discourse.julialang.org/t/reloading-by-re-executing-include-doesnt-seem-to-work/45075 "2020-08-17T12:23:23Z")

</div>

Hey all, I’m trying to run a reloading workflow just one step in complexity above the basic workflow as described in the manual. :slight\_smile: I have a MWE which I believe fits the same pattern as given in the manual,…

---

## [Speed up simple product accumulator loop](https://discourse.julialang.org/t/speed-up-simple-product-accumulator-loop/44920)

<div class="topic-metadata">

**Author:** [@stst](https://discourse.julialang.org/u/stst)\
**Replies:** 6\
**Last updated:** [August 17, 2020, 7:52am UTC](https://discourse.julialang.org/t/speed-up-simple-product-accumulator-loop/44920 "2020-08-17T07:52:42Z")

</div>

Hello Julia community, I need help with speeding up an inner loop in a larger project (running on Julia 1.5.0). Here is a MWE. The loop accumulates multiplicatively into a vector. using BenchmarkTools function signal1…

---

## [What is the bool in a module expr?](https://discourse.julialang.org/t/what-is-the-bool-in-a-module-expr/45079)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 1\
**Last updated:** [August 17, 2020, 6:31am UTC](https://discourse.julialang.org/t/what-is-the-bool-in-a-module-expr/45079 "2020-08-17T06:31:46Z")

</div>

A module expr contains a Bool as the first arg julia\> :(module A end).args 3-element Array{Any,1}: true :A quote #= none:1 =# #= none:1 =# end What is it for? How would you name it?

---

## [Speeding up creation of maximum mask array](https://discourse.julialang.org/t/speeding-up-creation-of-maximum-mask-array/45001)

<div class="topic-metadata">

**Author:** [@vkv](https://discourse.julialang.org/u/vkv)\
**Replies:** 11\
**Last updated:** [August 17, 2020, 6:01am UTC](https://discourse.julialang.org/t/speeding-up-creation-of-maximum-mask-array/45001 "2020-08-17T06:01:48Z")

</div>

I’ve a program where it needs a mask array which is created by filling all column-wise maxima positions with 1 and others with 0. I want the mask to have only one 1 filled per column. I can do this by x = rand(3, 3); m…

---

## [ForwardDiff.jl and its Dual Type question](https://discourse.julialang.org/t/forwarddiff-jl-and-its-dual-type-question/45071)

<div class="topic-metadata">

**Author:** [@Jaepil\_Lee](https://discourse.julialang.org/u/Jaepil_Lee)\
**Replies:** 4\
**Last updated:** [August 17, 2020, 4:23am UTC](https://discourse.julialang.org/t/forwarddiff-jl-and-its-dual-type-question/45071 "2020-08-17T04:23:58Z")

</div>

Hello fellow Julia users, I want to ask a question using ForwardDiff.jl. using LinearAlgebra, Statistics, Distributions, Random using Optim, ForwardDiff using Optim: converged, maximum, maximizer, minimizer, iterations…

---

## [Performance and allocation issue with arrays of functions (v1.5)](https://discourse.julialang.org/t/performance-and-allocation-issue-with-arrays-of-functions-v1-5/45013)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 6\
**Last updated:** [August 17, 2020, 2:44am UTC](https://discourse.julialang.org/t/performance-and-allocation-issue-with-arrays-of-functions-v1-5/45013 "2020-08-17T02:44:14Z")

</div>

I have an ODE type problem where I generate a sequence of values, x\_n, that, in principle, may be in a comparatively high dimensional space. Often, I don’t need to record teh full values, but rather, just some scalar va…

---

## [Buffer for CircularDeque](https://discourse.julialang.org/t/buffer-for-circulardeque/45041)

<div class="topic-metadata">

**Author:** [@Kruxigt](https://discourse.julialang.org/u/Kruxigt)\
**Replies:** 5\
**Last updated:** [August 16, 2020, 11:17pm UTC](https://discourse.julialang.org/t/buffer-for-circulardeque/45041 "2020-08-16T23:17:35Z")

</div>

Good day folks of Julialand! If I have something similar to the following function foo(x) w = 50 d = CircularDeque{Int64}(w) # Do some calculation based on x using d and return the result end for i in 1:10000…

---

## [Alter Date List in dd/mm/yyyy format to yyyy format](https://discourse.julialang.org/t/alter-date-list-in-dd-mm-yyyy-format-to-yyyy-format/45031)

<div class="topic-metadata">

**Author:** [@torieowers](https://discourse.julialang.org/u/torieowers)\
**Replies:** 4\
**Last updated:** [August 16, 2020, 10:24pm UTC](https://discourse.julialang.org/t/alter-date-list-in-dd-mm-yyyy-format-to-yyyy-format/45031 "2020-08-16T22:24:32Z")

</div>

Hi there! Could anyone help me alter a column of data (49019-element Array{String,1}:slight\_smile: to drop the dd/mm and just leave the year? I have tried working\_df\[!, :DATE\] |\> string |\> Date and I get the Error A…

---

## [Modules and namespaces](https://discourse.julialang.org/t/modules-and-namespaces/45027)

<div class="topic-metadata">

**Author:** [@Holdmycoffee](https://discourse.julialang.org/u/Holdmycoffee)\
**Replies:** 6\
**Last updated:** [August 16, 2020, 9:36pm UTC](https://discourse.julialang.org/t/modules-and-namespaces/45027 "2020-08-16T21:36:28Z")

</div>

Hey everyone, so I have a weird namespace issue. I import a struct “parameter” into a module QuadratureTypes, then import a function which takes an instance of parameter as input from QadratureTypes into another module, …

---

## [Julia not found in doom-emacs](https://discourse.julialang.org/t/julia-not-found-in-doom-emacs/45060)

<div class="topic-metadata">

**Author:** [@Sanji\_Vinsmoke](https://discourse.julialang.org/u/Sanji_Vinsmoke)\
**Replies:** 0\
**Last updated:** [August 16, 2020, 7:59pm UTC](https://discourse.julialang.org/t/julia-not-found-in-doom-emacs/45060 "2020-08-16T19:59:00Z")

</div>

I want to use julia in doom-emacs. But I can’t open REPL or run the code using C-c C-c. I have never used emacs before but it seems that it is quite good. Hence, can someone please help me with this? Thank you.

---

## [Random \`invalid commands\` in gnuplot.jl when using vscode](https://discourse.julialang.org/t/random-invalid-commands-in-gnuplot-jl-when-using-vscode/45057)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 1\
**Last updated:** [August 16, 2020, 7:41pm UTC](https://discourse.julialang.org/t/random-invalid-commands-in-gnuplot-jl-when-using-vscode/45057 "2020-08-16T19:41:43Z")

</div>

I am getting a weird error, and I can’t seem to reproduce it deterministically. From a fresh vscode julia repl, I select my code, and press ctrl-enter to execute it. It launches the REPL and runs the commands. I get the…

---

## [Mutable struct pitfall](https://discourse.julialang.org/t/mutable-struct-pitfall/44996)

<div class="topic-metadata">

**Author:** [@j2b2](https://discourse.julialang.org/u/j2b2)\
**Replies:** 17\
**Last updated:** [August 16, 2020, 5:17pm UTC](https://discourse.julialang.org/t/mutable-struct-pitfall/44996 "2020-08-16T17:17:58Z")

</div>

julia\> mutable struct S x::Int end julia\> a = S(3) S(3) julia\> b = a S(3) julia\> b.x = 5 5 julia\> a S(5) Where is it documented ? Every computer scientist is aware of the risks when writing b = a, and then modifiying el…

---

## [Plotting in Julia like Matlab plots](https://discourse.julialang.org/t/plotting-in-julia-like-matlab-plots/44997)

<div class="topic-metadata">

**Author:** [@sriharitn](https://discourse.julialang.org/u/sriharitn)\
**Replies:** 8\
**Last updated:** [August 16, 2020, 4:39pm UTC](https://discourse.julialang.org/t/plotting-in-julia-like-matlab-plots/44997 "2020-08-16T16:39:47Z")

</div>

I’m trying to plot 3D surface plot like the figure below (source: Wikipedia): Here is my attempt in julia; x = \[-2:0.05:2;\] y = \[-1:0.05:3;\] z = (1 .-x').^2 .+ 100 .\*(y.-x'.^2).^2 minZ = minimum(z\[:\]); maxZ = max…

---

## [Slightly generalised \`accumulate\`](https://discourse.julialang.org/t/slightly-generalised-accumulate/45039)

<div class="topic-metadata">

**Author:** [@willtebbutt](https://discourse.julialang.org/u/willtebbutt)\
**Replies:** 6\
**Last updated:** [August 16, 2020, 2:56pm UTC](https://discourse.julialang.org/t/slightly-generalised-accumulate/45039 "2020-08-16T14:56:16Z")

</div>

accumulate (a.k.a. scan, prefix etc) is great, but I’ve got a situation in which I need something very slightly different, and wonder whether anyone knows whether it has a name someone has already implemented it Speci…

---

## [Compilation of tips for speeding up computations](https://discourse.julialang.org/t/compilation-of-tips-for-speeding-up-computations/45033)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 1\
**Last updated:** [August 16, 2020, 1:10pm UTC](https://discourse.julialang.org/t/compilation-of-tips-for-speeding-up-computations/45033 "2020-08-16T13:10:47Z")

</div>

Every now and then someone posts a question asking about why Matlab/Python/C/Fortran is so much faster than Julia. The great community here is quickly to point out optimizations that can be used which result in a signifi…

---

## [Making vcat of splatted comprehension type-stable](https://discourse.julialang.org/t/making-vcat-of-splatted-comprehension-type-stable/43872)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 5\
**Last updated:** [August 16, 2020, 12:56pm UTC](https://discourse.julialang.org/t/making-vcat-of-splatted-comprehension-type-stable/43872 "2020-08-16T12:56:33Z")

</div>

Hi, I am looking for a way to make this kind of operation type-stable. There are many uses to structs with lists of callables but I can’t seem to find a way to make the concatenation of their outputs type-stable julia\> …

---

## [ERROR: LoadError: syntax: unexpected "\]"](https://discourse.julialang.org/t/error-loaderror-syntax-unexpected/45040)

<div class="topic-metadata">

**Author:** [@mamo](https://discourse.julialang.org/u/mamo)\
**Replies:** 2\
**Last updated:** [August 16, 2020, 12:33pm UTC](https://discourse.julialang.org/t/error-loaderror-syntax-unexpected/45040 "2020-08-16T12:33:36Z")

</div>

Help me please to identify the source of this error: ‘’'war\[k in 1:interval:length(TIME) if k\>=1+interval && k\<length(TIME)\], PL\[k\]==PL\[k-interval\]+sum(PROD\[o,f,p,j,t\] for o in O, f in F, p in PR\[f\], j in U, t in k:int…

---

## [ERROR: LoadError: syntax: invalid identifier name "&&"](https://discourse.julialang.org/t/error-loaderror-syntax-invalid-identifier-name/45034)

<div class="topic-metadata">

**Author:** [@mamo](https://discourse.julialang.org/u/mamo)\
**Replies:** 3\
**Last updated:** [August 16, 2020, 10:55am UTC](https://discourse.julialang.org/t/error-loaderror-syntax-invalid-identifier-name/45034 "2020-08-16T10:55:46Z")

</div>

Dear all, why it reports error with && in case below: sum((change\_cost\[k,l,j\]\*C\[k,l,j,t,t+1\]) for k in F, l in F, j in U, t in TIME: (t\<=length(TIME)-1) && (k != l)) Thanks!

---

## [Indicator constraints](https://discourse.julialang.org/t/indicator-constraints/45030)

<div class="topic-metadata">

**Author:** [@mamo](https://discourse.julialang.org/u/mamo)\
**Replies:** 0\
**Last updated:** [August 16, 2020, 9:34am UTC](https://discourse.julialang.org/t/indicator-constraints/45030 "2020-08-16T09:34:29Z")

</div>

This is an indicator constraint: cl23\[(f1,f2) in FO, j in U, t in TIME: t\<=end-15\], CL1\[f1,f2,j,t\]=0 ==\> FAS\[f1,j,t\]+FASa\[f2,j\]\<=1 is it possible for GLPK or CBC to handle it or should be transformed? Thanks, Marco

---

## [How to reduce memory allocation when looping over an array?](https://discourse.julialang.org/t/how-to-reduce-memory-allocation-when-looping-over-an-array/45022)

<div class="topic-metadata">

**Author:** [@niashvili](https://discourse.julialang.org/u/niashvili)\
**Replies:** 2\
**Last updated:** [August 16, 2020, 5:47am UTC](https://discourse.julialang.org/t/how-to-reduce-memory-allocation-when-looping-over-an-array/45022 "2020-08-16T05:47:23Z")

</div>

Hi guys, I have one main question with a given example and a couple other ones related to understanding some concepts. First, here’s the example function: function brownian\_paths(; paths=10^3, n=10^5, t=1, S0=100, μ=(S…

---

## [Is there a pgkdown equivalent in Julia for generating websites for packages?](https://discourse.julialang.org/t/is-there-a-pgkdown-equivalent-in-julia-for-generating-websites-for-packages/45025)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 1\
**Last updated:** [August 16, 2020, 6:52am UTC](https://discourse.julialang.org/t/is-there-a-pgkdown-equivalent-in-julia-for-generating-websites-for-packages/45025 "2020-08-16T06:52:59Z")

</div>

I see there is PkgPage.jl which generates a front page for a package. I wonder if there is a package that can glean all the function docs and generate document pages in Franklin.jl as well. The example in R is {pkgdown}…

---

## [Juno doesn't allow block execution when I change project path](https://discourse.julialang.org/t/juno-doesnt-allow-block-execution-when-i-change-project-path/45014)

<div class="topic-metadata">

**Author:** [@DShiu](https://discourse.julialang.org/u/DShiu)\
**Replies:** 1\
**Last updated:** [August 16, 2020, 3:54am UTC](https://discourse.julialang.org/t/juno-doesnt-allow-block-execution-when-i-change-project-path/45014 "2020-08-16T03:54:40Z")

</div>

My code becomes colorless and “Command+return” no longer executes a selected line of code. The code works if I run it in REPL.

---

## [Difference between Julia Coroutines, Multithreading, Multicore](https://discourse.julialang.org/t/difference-between-julia-coroutines-multithreading-multicore/44986)

<div class="topic-metadata">

**Author:** [@Palamedes](https://discourse.julialang.org/u/Palamedes)\
**Replies:** 3\
**Last updated:** [August 16, 2020, 3:51am UTC](https://discourse.julialang.org/t/difference-between-julia-coroutines-multithreading-multicore/44986 "2020-08-16T03:51:44Z")

</div>

Hola what are the differences between Julias Courotines (Green Threading), Multi-Threading and Multi-Core/Distributed Processing? Distributed is distributed over different machines. But what is the difference between c…

---

## [Cannot run parallel for loop when calling R code](https://discourse.julialang.org/t/cannot-run-parallel-for-loop-when-calling-r-code/45017)

<div class="topic-metadata">

**Author:** [@PatrickXie17](https://discourse.julialang.org/u/PatrickXie17)\
**Replies:** 4\
**Last updated:** [August 16, 2020, 3:17am UTC](https://discourse.julialang.org/t/cannot-run-parallel-for-loop-when-calling-r-code/45017 "2020-08-16T03:17:05Z")

</div>

Hi, I am recently moving my projects from R to Julia, and part of the code still relies on some R packages. I encountered problems when putting the R code inside the parallel for loop by using Threads.@threads. Below is …

---

## [Problems in use symbolic math](https://discourse.julialang.org/t/problems-in-use-symbolic-math/44957)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 24\
**Last updated:** [August 15, 2020, 9:52pm UTC](https://discourse.julialang.org/t/problems-in-use-symbolic-math/44957 "2020-08-15T21:52:21Z")

</div>

I am trying to use SymPy package to deal with symbolic math. For example: using SymPy x, y, z = symbols("x y z") z=(x^2+y^2)/(y^2+1); However, the error appears: x, y, z = symbols("x y z") ERROR: ArgumentError: ref of…

---

## [Is it worth to use Julia when you need several external non-Julia libraries?](https://discourse.julialang.org/t/is-it-worth-to-use-julia-when-you-need-several-external-non-julia-libraries/44991)

<div class="topic-metadata">

**Author:** [@ogreyesp](https://discourse.julialang.org/u/ogreyesp)\
**Replies:** 13\
**Last updated:** [August 15, 2020, 6:58pm UTC](https://discourse.julialang.org/t/is-it-worth-to-use-julia-when-you-need-several-external-non-julia-libraries/44991 "2020-08-15T18:58:34Z")

</div>

Suppose that I want to develop a project, but several features that I need does not still exist in Julia and I must to use several R libraries (let’s say that about 60-70% of the logic of my project lies in the R librari…

---

## [\`multiplot\` not working in Gnuplot.jl](https://discourse.julialang.org/t/multiplot-not-working-in-gnuplot-jl/44909)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 7\
**Last updated:** [August 15, 2020, 6:40pm UTC](https://discourse.julialang.org/t/multiplot-not-working-in-gnuplot-jl/44909 "2020-08-15T18:40:57Z")

</div>

Extreme beginner in Gnuplot, and trying to put a multiplot together. The code below is directly from the examples from the doc # Generate random numbers x = randn(1000); y = randn(1000); # Overall plot margins (normal…

---

## [Why is BLAS dot product so much faster than Julia loop?](https://discourse.julialang.org/t/why-is-blas-dot-product-so-much-faster-than-julia-loop/44994)

<div class="topic-metadata">

**Author:** [@JeffFessler](https://discourse.julialang.org/u/JeffFessler)\
**Replies:** 18\
**Last updated:** [August 15, 2020, 4:48pm UTC](https://discourse.julialang.org/t/why-is-blas-dot-product-so-much-faster-than-julia-loop/44994 "2020-08-15T16:48:19Z")

</div>

I wanted to illustrate the beauty of Julia for my class by showing the speed of a simple vector dot product, but to my surprise the Julia loop version was about 5x slower than the built-in dot() that (I think) calls BLAS…

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

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