# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1999

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

**Page:** 2000

---

## [Why do use @spawnat and fetch?](https://discourse.julialang.org/t/why-do-use-spawnat-and-fetch/24014)

<div class="topic-metadata">

**Author:** [@Carol](https://discourse.julialang.org/u/Carol)\
**Replies:** 3\
**Last updated:** [May 9, 2019, 8:02am UTC](https://discourse.julialang.org/t/why-do-use-spawnat-and-fetch/24014 "2019-05-09T08:02:41Z")

</div>

Hi, I am learning parallel in Julia. And I saw below code of summing an array. Background: using Distributed using DistributedArrays addprocs(4) @everywhere using DistributedArrays a = rand(10^7) adist = distribute(a…

---

## [Exausitve list of Expr's heads](https://discourse.julialang.org/t/exausitve-list-of-exprs-heads/24000)

<div class="topic-metadata">

**Author:** [@Marco\_Chiaffarelli](https://discourse.julialang.org/u/Marco_Chiaffarelli)\
**Replies:** 2\
**Last updated:** [May 9, 2019, 7:16am UTC](https://discourse.julialang.org/t/exausitve-list-of-exprs-heads/24000 "2019-05-09T07:16:08Z")

</div>

As the title says, is there a place where I can find an exaustive list of the symbols that are admissible (that is they lead to valid code upon evaluation) as Expr.head values? I was looking at the following https://doc…

---

## [PyPlot install on OSX](https://discourse.julialang.org/t/pyplot-install-on-osx/20074)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 23\
**Last updated:** [May 9, 2019, 6:53am UTC](https://discourse.julialang.org/t/pyplot-install-on-osx/20074 "2019-05-09T06:53:04Z")

</div>

Dear, I’m having trouble installing PyPlot on OSX Mojave. This is Julia 1.1.0. Whenever I install PyPlot on a fresh Julia, it fails to plot anything from the REPL, no backend is used, an error is throwers to the screen …

---

## [Exporting variables from local scope introduced by macro](https://discourse.julialang.org/t/exporting-variables-from-local-scope-introduced-by-macro/24013)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 2\
**Last updated:** [May 9, 2019, 6:33am UTC](https://discourse.julialang.org/t/exporting-variables-from-local-scope-introduced-by-macro/24013 "2019-05-09T06:33:35Z")

</div>

I want to write a macro that, before the enclosed expressions is run, activates “unsafe mode” and deactivates this mode again afterwards, kind of like @unsafe\_mode my\_expr translating to unsafe(true) my\_expr unsafe(fa…

---

## [Flux networks as arguments in functions](https://discourse.julialang.org/t/flux-networks-as-arguments-in-functions/23988)

<div class="topic-metadata">

**Author:** [@charlesll](https://discourse.julialang.org/u/charlesll)\
**Replies:** 6\
**Last updated:** [May 8, 2019, 10:22pm UTC](https://discourse.julialang.org/t/flux-networks-as-arguments-in-functions/23988 "2019-05-08T22:22:25Z")

</div>

Hey, I recently opened an issue on Flux as there is something that needs clarification I think about using Flux with Julia’s functions. To summarize my issue: I have a project where I have various equations embedded in…

---

## [In-place fft](https://discourse.julialang.org/t/in-place-fft/23993)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 4\
**Last updated:** [May 8, 2019, 9:59pm UTC](https://discourse.julialang.org/t/in-place-fft/23993 "2019-05-08T21:59:59Z")

</div>

Hi, I am using the FFTW.jl package. If I have a vector, say x = rand(100) How can I compute its discrete Fourier transform values in-place ? The command fft(x) returns a new array but leaves x intact. This bring…

---

## [Something faster than for loops](https://discourse.julialang.org/t/something-faster-than-for-loops/24001)

<div class="topic-metadata">

**Author:** [@Aquaman](https://discourse.julialang.org/u/Aquaman)\
**Replies:** 27\
**Last updated:** [May 8, 2019, 9:25pm UTC](https://discourse.julialang.org/t/something-faster-than-for-loops/24001 "2019-05-08T21:25:47Z")

</div>

Dear All, I am an “old” programmer used to Fortran and Matlab. I can’t get rid of For and While loops, but I know Julia can do things much faster! I am using the following code n=5 p=5 m=5 A=rand(n,p) B=rand(p,m) C=z…

---

## [Not understanding the Julia/Juno workflow](https://discourse.julialang.org/t/not-understanding-the-julia-juno-workflow/23800)

<div class="topic-metadata">

**Author:** [@williamcol3](https://discourse.julialang.org/u/williamcol3)\
**Replies:** 5\
**Last updated:** [May 8, 2019, 8:53pm UTC](https://discourse.julialang.org/t/not-understanding-the-julia-juno-workflow/23800 "2019-05-08T20:53:57Z")

</div>

I recently started using Julia and I am really digging it. I am currently just trying to get comfortable with a practice project (writing a toy convolutional network using Flux.jl and using HTTP.jl to get the training da…

---

## [Automatic differentiation, adjoint methods, and linear systems of equations](https://discourse.julialang.org/t/automatic-differentiation-adjoint-methods-and-linear-systems-of-equations/23979)

<div class="topic-metadata">

**Author:** [@omalled](https://discourse.julialang.org/u/omalled)\
**Replies:** 4\
**Last updated:** [May 8, 2019, 7:43pm UTC](https://discourse.julialang.org/t/automatic-differentiation-adjoint-methods-and-linear-systems-of-equations/23979 "2019-05-08T19:43:17Z")

</div>

I am interested in differentiating things that are along the lines of what is described in section 2 of these notes where the linear systems are sparse. For several years, I have occasionally been checking out Julia’s AD…

---

## [JuMP problem with all\_variables](https://discourse.julialang.org/t/jump-problem-with-all-variables/24006)

<div class="topic-metadata">

**Author:** [@gbustosx](https://discourse.julialang.org/u/gbustosx)\
**Replies:** 2\
**Last updated:** [May 8, 2019, 7:42pm UTC](https://discourse.julialang.org/t/jump-problem-with-all-variables/24006 "2019-05-08T19:42:28Z")

</div>

Hi, I am trying to use all\_variables but I get the following error message: UndefVarError: all\_variables not defined Stacktrace: \[1\] getproperty(::Module, ::Symbol) at ./sysimg.jl:13 \[2\] top-level scope at In\[83\]:1 T…

---

## [Force the usage of precompiled modules without any check](https://discourse.julialang.org/t/force-the-usage-of-precompiled-modules-without-any-check/24007)

<div class="topic-metadata">

**Author:** [@samo](https://discourse.julialang.org/u/samo)\
**Replies:** 0\
**Last updated:** [May 8, 2019, 7:07pm UTC](https://discourse.julialang.org/t/force-the-usage-of-precompiled-modules-without-any-check/24007 "2019-05-08T19:07:11Z")

</div>

Question How can I force the usage of precompiled modules inside DEPOT\_PATH\[1\]/compiled/ without any check (for timestamps etc.)? Motivation This specific question came up in the much broader discussion “Run a julia a…

---

## [JuMP 0.18: how to obtain the root relaxation of a branch and cut model?](https://discourse.julialang.org/t/jump-0-18-how-to-obtain-the-root-relaxation-of-a-branch-and-cut-model/23997)

<div class="topic-metadata">

**Author:** [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Replies:** 2\
**Last updated:** [May 8, 2019, 3:16pm UTC](https://discourse.julialang.org/t/jump-0-18-how-to-obtain-the-root-relaxation-of-a-branch-and-cut-model/23997 "2019-05-08T15:16:27Z")

</div>

Dear community, as the title suggests, I want to obtain the root relaxation of a branch & cut algorithm. More precisely, if the relaxation is fractional I like to add violated cuts and resolve as long as no violated cut…

---

## [Parentheses in a macro invocation](https://discourse.julialang.org/t/parentheses-in-a-macro-invocation/22793)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [May 8, 2019, 2:45pm UTC](https://discourse.julialang.org/t/parentheses-in-a-macro-invocation/22793 "2019-05-08T14:45:48Z")

</div>

Suppose I have a macro that is called like @mac a, b, c = d (for a concrete example, think of Parameters.@unpack). What is the proper way of writing this with the () invocation form, ie how to complete @mac(a, ...) ?…

---

## [How to unroll tree traversal efficiently?](https://discourse.julialang.org/t/how-to-unroll-tree-traversal-efficiently/23994)

<div class="topic-metadata">

**Author:** [@jonalm](https://discourse.julialang.org/u/jonalm)\
**Replies:** 1\
**Last updated:** [May 8, 2019, 1:05pm UTC](https://discourse.julialang.org/t/how-to-unroll-tree-traversal-efficiently/23994 "2019-05-08T13:05:48Z")

</div>

Hi, Consider a number of intervals on the real line (Interval), defined by their endpoints. I want to calculate whether a given point x is inside any of these intervals. I’m actually interested in a more complex case in…

---

## [Efficient traversal of tree defined as nested structs](https://discourse.julialang.org/t/efficient-traversal-of-tree-defined-as-nested-structs/23772)

<div class="topic-metadata">

**Author:** [@jonalm](https://discourse.julialang.org/u/jonalm)\
**Replies:** 2\
**Last updated:** [May 8, 2019, 12:42pm UTC](https://discourse.julialang.org/t/efficient-traversal-of-tree-defined-as-nested-structs/23772 "2019-05-08T12:42:06Z")

</div>

Edit: this question has been reformulated here: How to unroll tree traversal efficiently? Dear Community, I would greatly appreciate some pointers to how I could speed up my code. Some background: I tried to write …

---

## [My Julia workflow](https://discourse.julialang.org/t/my-julia-workflow/23815)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 22\
**Last updated:** [May 8, 2019, 12:21pm UTC](https://discourse.julialang.org/t/my-julia-workflow/23815 "2019-05-08T12:21:23Z")

</div>

Hi guys! I have just published a post in my website describing my Julia workflow. This was necessary because I have mainly two kind of students: Ones that code everything without worrying performance tips at all, get …

---

## [Interpret \`NTuple{1024, UInt8}\` as a C string](https://discourse.julialang.org/t/interpret-ntuple-1024-uint8-as-a-c-string/23906)

<div class="topic-metadata">

**Author:** [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Replies:** 5\
**Last updated:** [May 8, 2019, 10:51am UTC](https://discourse.julialang.org/t/interpret-ntuple-1024-uint8-as-a-c-string/23906 "2019-05-08T10:51:12Z")

</div>

I am calling some C code. One of the structs has a field is of type char \[1024\], which Clang.jl turns into NTuple{1024,UInt8}. This is a null-terminated C string. How can I get a String-like thing from this without copy…

---

## [Strange behavior with deepcopy](https://discourse.julialang.org/t/strange-behavior-with-deepcopy/23342)

<div class="topic-metadata">

**Author:** [@Thuener](https://discourse.julialang.org/u/Thuener)\
**Replies:** 6\
**Last updated:** [May 8, 2019, 10:15am UTC](https://discourse.julialang.org/t/strange-behavior-with-deepcopy/23342 "2019-05-08T10:15:45Z")

</div>

I’m getting a strange behavior with deepcopy. Deepcopy is still not supported? There is any way to copy JuMP model? using JuMP, Clp m = Model(solver = ClpSolver()) @variable(m, 0 \<= x \<= 2 ) @variable(m, 0 \<= y \<= 30 …

---

## [What's the correct way of defining struct with an Integer Parameter?](https://discourse.julialang.org/t/whats-the-correct-way-of-defining-struct-with-an-integer-parameter/23974)

<div class="topic-metadata">

**Author:** [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Replies:** 9\
**Last updated:** [May 8, 2019, 9:54am UTC](https://discourse.julialang.org/t/whats-the-correct-way-of-defining-struct-with-an-integer-parameter/23974 "2019-05-08T09:54:34Z")

</div>

From the document, we know that In Julia, you can’t dispatch on a value such as true or false . However, you can dispatch on parametric types, and Julia allows you to include “plain bits” values (Types, Symbols, I…

---

## [Travis failure when Testing Required code on julia v1.0](https://discourse.julialang.org/t/travis-failure-when-testing-required-code-on-julia-v1-0/23986)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 9\
**Last updated:** [May 8, 2019, 8:57am UTC](https://discourse.julialang.org/t/travis-failure-when-testing-required-code-on-julia-v1-0/23986 "2019-05-08T08:57:54Z")

</div>

I can’t really understand the reason for the following build failure I suspect it might be related to me using Requires.jl to require a package ControlSystemIdentification.jl, which is listed as a test dependency in Pr…

---

## [Efficient vectorized matrix operations for 2D matrix slices of a 3D array?](https://discourse.julialang.org/t/efficient-vectorized-matrix-operations-for-2d-matrix-slices-of-a-3d-array/23679)

<div class="topic-metadata">

**Author:** [@huchiayu0517](https://discourse.julialang.org/u/huchiayu0517)\
**Replies:** 11\
**Last updated:** [May 8, 2019, 8:26am UTC](https://discourse.julialang.org/t/efficient-vectorized-matrix-operations-for-2d-matrix-slices-of-a-3d-array/23679 "2019-05-08T08:26:38Z")

</div>

Hello there, I’m trying to figure out how to do matrix operations for 2D slices of a 3D array whose shape is (3,3,N) where N is a large number (e.g. N=10^6). I’d like to write a vectorized code of C=A+B’ using loop fusi…

---

## [Visualisation in Julia](https://discourse.julialang.org/t/visualisation-in-julia/23962)

<div class="topic-metadata">

**Author:** [@Aquaman](https://discourse.julialang.org/u/Aquaman)\
**Replies:** 18\
**Last updated:** [May 8, 2019, 8:23am UTC](https://discourse.julialang.org/t/visualisation-in-julia/23962 "2019-05-08T08:23:30Z")

</div>

Dear All, I want to use the following plot function from Matlab in Julia. I could not find the correct commands of Julia to do this work. subplot(1,1,1) pcolor(con), shading interp, ... axis('off'), axis('e…

---

## [Png files to mp4](https://discourse.julialang.org/t/png-files-to-mp4/23978)

<div class="topic-metadata">

**Author:** [@Aquaman](https://discourse.julialang.org/u/Aquaman)\
**Replies:** 7\
**Last updated:** [May 8, 2019, 7:03am UTC](https://discourse.julialang.org/t/png-files-to-mp4/23978 "2019-05-08T07:03:33Z")

</div>

Dear All, how can I converts pngs files (fig1.png, fig2.png, … , fig10.png) to mp4. video using a very easy method in Julia? Best regards

---

## [How to add vector {Any} as new line do dlm files?](https://discourse.julialang.org/t/how-to-add-vector-any-as-new-line-do-dlm-files/23985)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 3\
**Last updated:** [May 8, 2019, 6:52am UTC](https://discourse.julialang.org/t/how-to-add-vector-any-as-new-line-do-dlm-files/23985 "2019-05-08T06:52:34Z")

</div>

vectors with numbers are writable byt vectors with string not ! How to write as new line to existing dlm file any vector from Array{Any} ? julia\> open("mytestfile.txt", "a") do io writedlm(io, A\[2,:\]') e…

---

## [Any way to remove "From worker"?](https://discourse.julialang.org/t/any-way-to-remove-from-worker/23604)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 2\
**Last updated:** [May 8, 2019, 6:03am UTC](https://discourse.julialang.org/t/any-way-to-remove-from-worker/23604 "2019-05-08T06:03:48Z")

</div>

I want to print some data in a distributed for-loop but I don’t really want to see these lines with the “from worker” prefix. Is there any way to get rid of it? From worker 3: hello From worker 4: world …

---

## [Embedding Julia C question](https://discourse.julialang.org/t/embedding-julia-c-question/19428)

<div class="topic-metadata">

**Author:** [@timmm](https://discourse.julialang.org/u/timmm)\
**Replies:** 1\
**Last updated:** [May 7, 2019, 2:28pm UTC](https://discourse.julialang.org/t/embedding-julia-c-question/19428 "2019-05-07T14:28:31Z")

</div>

Hi, I am struggling with the documentation on embedding Julia in C. Is there an obvious thing I am doing wrong? If I try the test example in: Embedding Julia · The Julia Language i.e. calling: JULIA\_DIR=/home/julia-1…

---

## [Calling C and Fortran Code (Julia documentation)](https://discourse.julialang.org/t/calling-c-and-fortran-code-julia-documentation/23981)

<div class="topic-metadata">

**Author:** [@Thuener](https://discourse.julialang.org/u/Thuener)\
**Replies:** 4\
**Last updated:** [May 8, 2019, 3:41am UTC](https://discourse.julialang.org/t/calling-c-and-fortran-code-julia-documentation/23981 "2019-05-08T03:41:55Z")

</div>

I have many questions about Memory Ownership in Calling C and Fortran Code · The Julia Language. One example, from this documentation we have: function sf\_bessel\_Jn\_array(nmin::Integer, nmax::Integer, x::Real) if n…

---

## [Read text file julia: fscanf in Julia:](https://discourse.julialang.org/t/read-text-file-julia-fscanf-in-julia/23980)

<div class="topic-metadata">

**Author:** [@Aquaman](https://discourse.julialang.org/u/Aquaman)\
**Replies:** 5\
**Last updated:** [May 7, 2019, 11:34pm UTC](https://discourse.julialang.org/t/read-text-file-julia-fscanf-in-julia/23980 "2019-05-07T23:34:38Z")

</div>

Hi everyone, How can I read text file in the following way (matlab) in Julia? or how can we use the similar function A = fscanf(fileID , formatSpec , sizeA ) in Julia? Matlab global ttn; ttn= fopen('test.txt','r'); %…

---

## [UNIX PID of julia process](https://discourse.julialang.org/t/unix-pid-of-julia-process/23977)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 2\
**Last updated:** [May 7, 2019, 8:06pm UTC](https://discourse.julialang.org/t/unix-pid-of-julia-process/23977 "2019-05-07T20:06:58Z")

</div>

Does anyone know of an easy way to get the process ID of the current julia process running on UNIX?

---

## [Arithmetic modulo primes](https://discourse.julialang.org/t/arithmetic-modulo-primes/23895)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 6\
**Last updated:** [May 7, 2019, 8:05pm UTC](https://discourse.julialang.org/t/arithmetic-modulo-primes/23895 "2019-05-07T20:05:48Z")

</div>

Hi Does Julia have a package for arithmetic modulo primes (Zp)? I found a repository for Mod(:val, :mod) (link) but that requires storing the prime as a field of each variable. I would like to instantiate variable fro…

[Previous page](https://discourse.julialang.org/latest.md?page=1998)

[Next page](https://discourse.julialang.org/latest.md?page=2000)
