# General Usage

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

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

**Page:** 854

---

## [Remote process can not call function](https://discourse.julialang.org/t/remote-process-can-not-call-function/25821)

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 7\
**Last updated:** [June 29, 2019, 9:56pm UTC](https://discourse.julialang.org/t/remote-process-can-not-call-function/25821 "2019-06-29T21:56:03Z")

</div>

Hi, this is my first try to setup remote processes in Julia and I am running into the following error: julia\> using Distributed julia\> @everywhere function worker(); println("Hi");end julia\> addprocs(\[("ip-address",1…

---

## [Getindex generator](https://discourse.julialang.org/t/getindex-generator/25843)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 3\
**Last updated:** [June 29, 2019, 7:25pm UTC](https://discourse.julialang.org/t/getindex-generator/25843 "2019-06-29T19:25:47Z")

</div>

I can’t find it, although I’m sure it’s been answered before: how do I (efficiently) access the 'n’th element of a generator? a = (i for i in 1:10^6) a\[3\]

---

## [Encoding UTF16 JSONs as UTF8](https://discourse.julialang.org/t/encoding-utf16-jsons-as-utf8/25833)

<div class="topic-metadata">

**Author:** [@Gavinclarke](https://discourse.julialang.org/u/Gavinclarke)\
**Replies:** 2\
**Last updated:** [June 29, 2019, 7:17pm UTC](https://discourse.julialang.org/t/encoding-utf16-jsons-as-utf8/25833 "2019-06-29T19:17:57Z")

</div>

I have a Jason I am getting with http.get. However, the Jason is encoded in UTF16 and I believe this is preventing it from being parsed correctly. what is the fasI am wondering what the best way to get, encode from UTF1…

---

## [Broadcasting in macros](https://discourse.julialang.org/t/broadcasting-in-macros/25797)

<div class="topic-metadata">

**Author:** [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Replies:** 4\
**Last updated:** [June 29, 2019, 4:37pm UTC](https://discourse.julialang.org/t/broadcasting-in-macros/25797 "2019-06-29T16:37:31Z")

</div>

What is wrong with this macro: julia\> macro lessthanthree(vec) return :($vec .\< 3) end @lessthanthree (macro with 1 method) julia\> @lessthanthree 1:6 ERROR: UndefVarError: .\< not defined Stacktrace: \[1\] …

---

## [Significant decrease in performance after seemingly irrelevant changes](https://discourse.julialang.org/t/significant-decrease-in-performance-after-seemingly-irrelevant-changes/25796)

<div class="topic-metadata">

**Author:** [@Tusike](https://discourse.julialang.org/u/Tusike)\
**Replies:** 16\
**Last updated:** [June 29, 2019, 3:29pm UTC](https://discourse.julialang.org/t/significant-decrease-in-performance-after-seemingly-irrelevant-changes/25796 "2019-06-29T15:29:57Z")

</div>

Hi! I recently revised some aspects of a large project I’m working on, just moving around some data/functions without altering the behavior of the code. However, it resulted in significant decrease in performance in see…

---

## [How to create/display multiple plot windows in GR.jl?](https://discourse.julialang.org/t/how-to-create-display-multiple-plot-windows-in-gr-jl/25817)

<div class="topic-metadata">

**Author:** [@Zhong\_Pan](https://discourse.julialang.org/u/Zhong_Pan)\
**Replies:** 4\
**Last updated:** [June 29, 2019, 11:58am UTC](https://discourse.julialang.org/t/how-to-create-display-multiple-plot-windows-in-gr-jl/25817 "2019-06-29T11:58:19Z")

</div>

I searched online and found no example of doing so; the API does not seem to contain function that supports this either. I already opened an issue at the GitHub project, but no response yet. But this feature is often ne…

---

## [Recommended env variables for most performant parallel/multithreading?](https://discourse.julialang.org/t/recommended-env-variables-for-most-performant-parallel-multithreading/25631)

<div class="topic-metadata">

**Author:** [@alvrg](https://discourse.julialang.org/u/alvrg)\
**Replies:** 3\
**Last updated:** [June 25, 2019, 3:00pm UTC](https://discourse.julialang.org/t/recommended-env-variables-for-most-performant-parallel-multithreading/25631 "2019-06-25T15:00:39Z")

</div>

Hi all, I have two questions. What are the recommended values of the env variables (JULIA\_NUM\_THREADS, MKL/OPENBLAS\_NUM\_THREADS, …) if I want to speed up my code using Threads.@threads? To what should I set those v…

---

## [Passing numpy arrays between python and Julia](https://discourse.julialang.org/t/passing-numpy-arrays-between-python-and-julia/25826)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 3\
**Last updated:** [June 29, 2019, 1:48am UTC](https://discourse.julialang.org/t/passing-numpy-arrays-between-python-and-julia/25826 "2019-06-29T01:48:16Z")

</div>

I am still new to Julia, so just wanted to incrementally test out some features. One thing I wanted to try was accelerating some python code I have by offloading it to Julia. The first scenario is simple. So I have a di…

---

## [Catching errors thrown by worker processes](https://discourse.julialang.org/t/catching-errors-thrown-by-worker-processes/25801)

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 9\
**Last updated:** [June 28, 2019, 9:51pm UTC](https://discourse.julialang.org/t/catching-errors-thrown-by-worker-processes/25801 "2019-06-28T21:51:34Z")

</div>

Hi there, I want to be informed of errors arising in Julia worker processes. Right now the following code does not inform me about the thrown error. The second println is obviously not executed. The feedback I get, e.g.…

---

## [How to retrive a data from Pointer](https://discourse.julialang.org/t/how-to-retrive-a-data-from-pointer/25815)

<div class="topic-metadata">

**Author:** [@arunkumar04](https://discourse.julialang.org/u/arunkumar04)\
**Replies:** 1\
**Last updated:** [June 28, 2019, 8:12pm UTC](https://discourse.julialang.org/t/how-to-retrive-a-data-from-pointer/25815 "2019-06-28T20:12:09Z")

</div>

I wrote a ccall function, which returns a struct. The function I wrote is ccall((:BinghamSample, "libbingsam.so"),bingham\_t,( Cdouble, Cdouble, Cdouble, Cint), 0, 0, 0, 10) struct bingham\_stats\_t dF::Ptr{Cdouble} …

---

## [Disable nested thread call](https://discourse.julialang.org/t/disable-nested-thread-call/25818)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 6\
**Last updated:** [June 28, 2019, 7:40pm UTC](https://discourse.julialang.org/t/disable-nested-thread-call/25818 "2019-06-28T19:40:26Z")

</div>

I’m wondering if it is possible to disable nested threaded call? e.g function foo() Threads.@threads for k in 1:120 # do something end end function baz() Threads.@threads for k in 1:120 foo() …

---

## [TagBot release missing](https://discourse.julialang.org/t/tagbot-release-missing/25773)

<div class="topic-metadata">

**Author:** [@monty](https://discourse.julialang.org/u/monty)\
**Replies:** 4\
**Last updated:** [June 28, 2019, 3:40pm UTC](https://discourse.julialang.org/t/tagbot-release-missing/25773 "2019-06-28T15:40:48Z")

</div>

A new release was merged: https://github.com/JuliaRegistries/General/pull/1607 but i do see the release automatically generated even though the TagBot is activated: https://github.com/madsjulia/GeostatInversion.jl/rel…

---

## [Why is Base.return\_types disables for builtin functions](https://discourse.julialang.org/t/why-is-base-return-types-disables-for-builtin-functions/25807)

<div class="topic-metadata">

**Author:** [@Christian\_Rorvik](https://discourse.julialang.org/u/Christian_Rorvik)\
**Replies:** 6\
**Last updated:** [June 28, 2019, 3:34pm UTC](https://discourse.julialang.org/t/why-is-base-return-types-disables-for-builtin-functions/25807 "2019-06-28T15:34:34Z")

</div>

Base.return\_types() doesn’t work for builtin functions (https://github.com/JuliaLang/julia/blob/master/base/reflection.jl#L1077). What’s the underlying reason for this? Wrapping the builtin is a workaround, but I’m wonde…

---

## [MethodError: no method matching -(::Int64, ::Array{Float64,1})](https://discourse.julialang.org/t/methoderror-no-method-matching-int64-array-float64-1/25806)

<div class="topic-metadata">

**Author:** [@aaron](https://discourse.julialang.org/u/aaron)\
**Replies:** 2\
**Last updated:** [June 28, 2019, 1:57pm UTC](https://discourse.julialang.org/t/methoderror-no-method-matching-int64-array-float64-1/25806 "2019-06-28T13:57:08Z")

</div>

Hi, I am a newbie in Julia, using version 1.1.1. MethodError: no method matching -(::Int64, ::Array{Float64,1}) What is wrong with the following code? x1 = collect(0:0.1:2) x2a = 1-0.5x1 x2b = ifelse(2-2x1.\>=0,2-2\*x…

---

## [Stream processing in Julia?](https://discourse.julialang.org/t/stream-processing-in-julia/25794)

<div class="topic-metadata">

**Author:** [@sairus7](https://discourse.julialang.org/u/sairus7)\
**Replies:** 1\
**Last updated:** [June 28, 2019, 1:43pm UTC](https://discourse.julialang.org/t/stream-processing-in-julia/25794 "2019-06-28T13:43:49Z")

</div>

I want to do stream processing in a pipe-style in several steps or layers (similar to deep learning or “Pipes and Filters” pattern), like this: b = f1(a) c = f2(b) d = f3(c) # or simply d = a |\> f1 |\> f2 |\> f3 But this…

---

## [Unpacking tuples in function call](https://discourse.julialang.org/t/unpacking-tuples-in-function-call/25771)

<div class="topic-metadata">

**Author:** [@dataDiver](https://discourse.julialang.org/u/dataDiver)\
**Replies:** 2\
**Last updated:** [June 28, 2019, 12:12pm UTC](https://discourse.julialang.org/t/unpacking-tuples-in-function-call/25771 "2019-06-28T12:12:25Z")

</div>

This is not a help request more of a pleasant observation. I was working with tuples and needed to create a function where the tuples would be unpacked and used separately, something like: function myFun(x::Int64, y::F…

---

## [Howto correctly (hijack) fill an array with formula over indices?](https://discourse.julialang.org/t/howto-correctly-hijack-fill-an-array-with-formula-over-indices/25673)

<div class="topic-metadata">

**Author:** [@o314](https://discourse.julialang.org/u/o314)\
**Replies:** 10\
**Last updated:** [June 28, 2019, 12:01pm UTC](https://discourse.julialang.org/t/howto-correctly-hijack-fill-an-array-with-formula-over-indices/25673 "2019-06-28T12:01:31Z")

</div>

It seems fill is built to handle static init value only. I am trying to write something like this A = reshape(1:6,(2,3)) fill((i,j)-\>10i+j,A) # or, if you prefer fill(A) do i,j; 10i+j end For now, i have got this one…

---

## [Question about importing dependencies of package](https://discourse.julialang.org/t/question-about-importing-dependencies-of-package/25790)

<div class="topic-metadata">

**Author:** [@KDr2](https://discourse.julialang.org/u/KDr2)\
**Replies:** 2\
**Last updated:** [June 28, 2019, 8:09am UTC](https://discourse.julialang.org/t/question-about-importing-dependencies-of-package/25790 "2019-06-28T08:09:19Z")

</div>

I am developing a Julia package, say “PackA.jl”. It depends on many other packages, for example, “JSON.jl”. I put JOSN both to Project.toml and REQUIRE. In the main source file, “PackA.jl”, there’s a line to use JSON: …

---

## [Performance: Building directed graph of game scores (0,0) -\> (0,1) etc](https://discourse.julialang.org/t/performance-building-directed-graph-of-game-scores-0-0-0-1-etc/25736)

<div class="topic-metadata">

**Author:** [@gabiteodoru](https://discourse.julialang.org/u/gabiteodoru)\
**Replies:** 9\
**Last updated:** [June 28, 2019, 6:17am UTC](https://discourse.julialang.org/t/performance-building-directed-graph-of-game-scores-0-0-0-1-etc/25736 "2019-06-28T06:17:55Z")

</div>

I’m building a directed graph of possible game scores from (0,0) up to a score of N, together with a dictionary pointing from the score to the corresponding node. I’d like to make it as efficient as possible. Currently …

---

## [Even though it is in Project.toml, travis-ci does not recognize package](https://discourse.julialang.org/t/even-though-it-is-in-project-toml-travis-ci-does-not-recognize-package/25782)

<div class="topic-metadata">

**Author:** [@holger](https://discourse.julialang.org/u/holger)\
**Replies:** 4\
**Last updated:** [June 28, 2019, 3:52am UTC](https://discourse.julialang.org/t/even-though-it-is-in-project-toml-travis-ci-does-not-recognize-package/25782 "2019-06-28T03:52:17Z")

</div>

I have updated my Project.toml file and would appreciate your help: When I try to run my tests on travis-ci, I get an error that the package JLD2 is not installed even though I have it in my Project.toml file \[extras\] a…

---

## [Efficient Implementation of Loop for Bootstrapping Statistics](https://discourse.julialang.org/t/efficient-implementation-of-loop-for-bootstrapping-statistics/25675)

<div class="topic-metadata">

**Author:** [@slakeon](https://discourse.julialang.org/u/slakeon)\
**Replies:** 5\
**Last updated:** [June 27, 2019, 11:39pm UTC](https://discourse.julialang.org/t/efficient-implementation-of-loop-for-bootstrapping-statistics/25675 "2019-06-27T23:39:19Z")

</div>

I am trying to build a loop for a standard recursive-design residual-based nonparametric bootstrap algorithm for a Vector Autoregression (VAR). However, so far, I’m struggling to find an efficient way of writing the algo…

---

## [Best practices for test-driven development with channels](https://discourse.julialang.org/t/best-practices-for-test-driven-development-with-channels/25775)

<div class="topic-metadata">

**Author:** [@Jasha10](https://discourse.julialang.org/u/Jasha10)\
**Replies:** 2\
**Last updated:** [June 27, 2019, 7:09pm UTC](https://discourse.julialang.org/t/best-practices-for-test-driven-development-with-channels/25775 "2019-06-27T19:09:32Z")

</div>

I’ve run into trouble with testing code that uses Channels. In particular, when using channels together with a producer / consumer function, I’ve found that it is difficult to pinpoint the part of the code that is incorr…

---

## [Error in Array](https://discourse.julialang.org/t/error-in-array/25770)

<div class="topic-metadata">

**Author:** [@ahmedbulbul52](https://discourse.julialang.org/u/ahmedbulbul52)\
**Replies:** 1\
**Last updated:** [June 27, 2019, 5:07pm UTC](https://discourse.julialang.org/t/error-in-array/25770 "2019-06-27T17:07:04Z")

</div>

ERROR: TypeError: fitdbm: in typeassert, expected Array{Int64,1}, got Array{Int64,2} in trainpartdbm function trainpartdbm(mat;partitions::Array{Array{Int64,1},1}=\[collect(1:size(mat)\[2\])\], nhiddens::Array{Int64,1}=\[s…

---

## [Plot some Well logs, correlations  ](https://discourse.julialang.org/t/plot-some-well-logs-correlations/21943)

<div class="topic-metadata">

**Author:** [@Santiago\_Cuervo](https://discourse.julialang.org/u/Santiago_Cuervo)\
**Replies:** 29\
**Last updated:** [June 27, 2019, 3:54pm UTC](https://discourse.julialang.org/t/plot-some-well-logs-correlations/21943 "2019-06-27T15:54:19Z")

</div>

I’d like to plot well logs in Julia in which i can analyize and make calculations like the image below. i’d like to know some tips to do that. For example, to plot a single well I think I need to use layouts for differen…

---

## [Why read(io::IOBuffer, String) does not work as expected](https://discourse.julialang.org/t/why-read-io-iobuffer-string-does-not-work-as-expected/25754)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 4\
**Last updated:** [June 27, 2019, 1:25pm UTC](https://discourse.julialang.org/t/why-read-io-iobuffer-string-does-not-work-as-expected/25754 "2019-06-27T13:25:52Z")

</div>

io = IOBuffer() write(io, "name, age \\n tom, 12") data = read(io, String) # return empty string, not as expected The following code works data = String( take!(io) ) # return \`name, age \\n tom, 12\` as expected Why…

---

## [Writing permissions denied](https://discourse.julialang.org/t/writing-permissions-denied/25759)

<div class="topic-metadata">

**Author:** [@MartaVanin](https://discourse.julialang.org/u/MartaVanin)\
**Replies:** 1\
**Last updated:** [June 27, 2019, 12:10pm UTC](https://discourse.julialang.org/t/writing-permissions-denied/25759 "2019-06-27T12:10:53Z")

</div>

Hi! I have been working with julia about one year now. From a couple of days, I can start and work on my .jl files for a while, saving them regularly. However, after a few saving actions, I suddenly I can’t save them a…

---

## [How to submit code coverage results to codecov/coveralls via GitLab CI?](https://discourse.julialang.org/t/how-to-submit-code-coverage-results-to-codecov-coveralls-via-gitlab-ci/25503)

<div class="topic-metadata">

**Author:** [@vlandau](https://discourse.julialang.org/u/vlandau)\
**Replies:** 13\
**Last updated:** [June 24, 2019, 7:57pm UTC](https://discourse.julialang.org/t/how-to-submit-code-coverage-results-to-codecov-coveralls-via-gitlab-ci/25503 "2019-06-24T19:57:36Z")

</div>

Hi everyone, I’m working on developing my first Julia package, and I want to make sure I have the code coverage aspect down before committing to developing and hosting the package on GitLab (which I prefer for a few rea…

---

## [Plot3d: how to set size of graph, or size of GIF file generated from one](https://discourse.julialang.org/t/plot3d-how-to-set-size-of-graph-or-size-of-gif-file-generated-from-one/25738)

<div class="topic-metadata">

**Author:** [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Replies:** 2\
**Last updated:** [June 26, 2019, 9:49pm UTC](https://discourse.julialang.org/t/plot3d-how-to-set-size-of-graph-or-size-of-gif-file-generated-from-one/25738 "2019-06-26T21:49:35Z")

</div>

Out of the answer I got from How to create an animation based on t, x, y and z data? - #6 by fusion809 I’ve now got Julia code that works in generating a 3D animation of chaotic attractors, like the Rossler Attractor. Th…

---

## [Understanding environments and projects](https://discourse.julialang.org/t/understanding-environments-and-projects/25741)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 1\
**Last updated:** [June 26, 2019, 8:21pm UTC](https://discourse.julialang.org/t/understanding-environments-and-projects/25741 "2019-06-26T20:21:25Z")

</div>

I have a few questions about environments and projects in julia’s package manager. I have read the documentation, so these questions are really about making sure I understand properly. Q1. In .julia/environments lists a…

---

## [Equivalent of Python if \_\_debug\_\_](https://discourse.julialang.org/t/equivalent-of-python-if-debug/25715)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 3\
**Last updated:** [June 26, 2019, 5:46pm UTC](https://discourse.julialang.org/t/equivalent-of-python-if-debug/25715 "2019-06-26T17:46:57Z")

</div>

In Python there is a feature for simple print style debugging to be switched on or off. If you run a Python script with the -O option then if \_\_debug\_\_: print variable, variable, variable Is there an equivalent …

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

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