# General Usage

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

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

**Page:** 1050

---

## [PyCall, pycall on python object that overloads \_\_call\_\_](https://discourse.julialang.org/t/pycall-pycall-on-python-object-that-overloads---call--/3746)

<div class="topic-metadata">

**Author:** [@ndbecker](https://discourse.julialang.org/u/ndbecker)\
**Replies:** 1\
**Last updated:** [May 16, 2017, 1:13pm UTC](https://discourse.julialang.org/t/pycall-pycall-on-python-object-that-overloads---call--/3746 "2017-05-16T13:13:14Z")

</div>

Can I use pycall to call a python object that overloads the call member? It doesn’t seem to work.

---

## [Broadcast in 0.6 changing abstractarray type?](https://discourse.julialang.org/t/broadcast-in-0-6-changing-abstractarray-type/3735)

<div class="topic-metadata">

**Author:** [@davidavdav](https://discourse.julialang.org/u/davidavdav)\
**Replies:** 1\
**Last updated:** [May 16, 2017, 7:25am UTC](https://discourse.julialang.org/t/broadcast-in-0-6-changing-abstractarray-type/3735 "2017-05-16T07:25:30Z")

</div>

Hello, I have been trying to get module NamedArrays up to scratch with Julia-0.6 in the past while. I am now stuck at a change in behaviour of broadcast(). In Julia-0.5 and NamedArrays, this used result in type NamedA…

---

## [Both FileIO and HDF5 export "filename"](https://discourse.julialang.org/t/both-fileio-and-hdf5-export-filename/3733)

<div class="topic-metadata">

**Author:** [@innerlee](https://discourse.julialang.org/u/innerlee)\
**Replies:** 2\
**Last updated:** [May 16, 2017, 7:05am UTC](https://discourse.julialang.org/t/both-fileio-and-hdf5-export-filename/3733 "2017-05-16T07:05:54Z")

</div>

julia\> using FileIO julia\> using HDF5 julia\> WARNING: both HDF5 and FileIO export "filename"; uses of it in module Main must be qual ified julia\> filename ERROR: UndefVarError: filename not defined The filename in tw…

---

## [How to force BinDeps to download binaries?](https://discourse.julialang.org/t/how-to-force-bindeps-to-download-binaries/2610)

<div class="topic-metadata">

**Author:** [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Replies:** 1\
**Last updated:** [May 15, 2017, 1:23am UTC](https://discourse.julialang.org/t/how-to-force-bindeps-to-download-binaries/2610 "2017-05-15T01:23:24Z")

</div>

I have this build.jl script that is meant to download Node.js and extract it under the deps folder in a package. This works great on my machine, but on appveyor it appears that BinDeps finds a node.exe installed on a sys…

---

## [How to compile AVX instructions](https://discourse.julialang.org/t/how-to-compile-avx-instructions/3705)

<div class="topic-metadata">

**Author:** [@goldfita](https://discourse.julialang.org/u/goldfita)\
**Replies:** 1\
**Last updated:** [May 14, 2017, 3:09pm UTC](https://discourse.julialang.org/t/how-to-compile-avx-instructions/3705 "2017-05-14T15:09:05Z")

</div>

I’m unable to reproduce this behavior. Is this similar in nature to my laptop being too recent, or do you have to build Julia from scratch to get AVX? julia\> foo(x,y,z) = muladd(-x,y,z) julia\> @code\_native foo(1.0,2.0,…

---

## [Negative Base and Negative Exponent](https://discourse.julialang.org/t/negative-base-and-negative-exponent/3674)

<div class="topic-metadata">

**Author:** [@mboutros](https://discourse.julialang.org/u/mboutros)\
**Replies:** 12\
**Last updated:** [May 14, 2017, 1:47pm UTC](https://discourse.julialang.org/t/negative-base-and-negative-exponent/3674 "2017-05-14T13:47:46Z")

</div>

Hello. I’ve spent some time reading about the reasons behind why Julia deals with negative exponents the way it does and I’m not interested in resurrecting that debate. I’m working on a script and I’ve run into a problem…

---

## [Calling python from another julia process](https://discourse.julialang.org/t/calling-python-from-another-julia-process/3702)

<div class="topic-metadata">

**Author:** [@TsurHerman](https://discourse.julialang.org/u/TsurHerman)\
**Replies:** 0\
**Last updated:** [May 14, 2017, 1:01pm UTC](https://discourse.julialang.org/t/calling-python-from-another-julia-process/3702 "2017-05-14T13:01:17Z")

</div>

I am trying to call python code from another julia process. I tried addprocs(1) import PyCall @everywhere using PyCall @everywhere @pyimport math as pymath a = pymath.sin(10) b = remotecall\_fetch(pymath.sin,2,10) but …

---

## [Hooks for autocompletion in REPL?](https://discourse.julialang.org/t/hooks-for-autocompletion-in-repl/3689)

<div class="topic-metadata">

**Author:** [@davidavdav](https://discourse.julialang.org/u/davidavdav)\
**Replies:** 0\
**Last updated:** [May 13, 2017, 11:10am UTC](https://discourse.julialang.org/t/hooks-for-autocompletion-in-repl/3689 "2017-05-13T11:10:28Z")

</div>

Hello, Are there any hooks for defining autocompletion for my own functions? Suppose I have func(enum::Symbol) and I enum can only have values :foo, :bar and :baz, is there a autocompletion hook somewhere in julia bas…

---

## [Julia pre-release versions and REQUIRE](https://discourse.julialang.org/t/julia-pre-release-versions-and-require/3685)

<div class="topic-metadata">

**Author:** [@sam81](https://discourse.julialang.org/u/sam81)\
**Replies:** 2\
**Last updated:** [May 13, 2017, 3:19am UTC](https://discourse.julialang.org/t/julia-pre-release-versions-and-require/3685 "2017-05-13T03:19:10Z")

</div>

suppose that I have a registered package that supports only the current development version of Julia and does not support the current stable version of Julia, so in REQUIRE I put: julia 0.y- wher 0.y is the current dev…

---

## [Re-including file doesn't overwrite function within array comprehension](https://discourse.julialang.org/t/re-including-file-doesnt-overwrite-function-within-array-comprehension/3687)

<div class="topic-metadata">

**Author:** [@fuzzybear3965](https://discourse.julialang.org/u/fuzzybear3965)\
**Replies:** 1\
**Last updated:** [May 13, 2017, 3:09am UTC](https://discourse.julialang.org/t/re-including-file-doesnt-overwrite-function-within-array-comprehension/3687 "2017-05-13T03:09:44Z")

</div>

First things first: julia\> versioninfo() Julia Version 0.5.2 Commit f4c6c9d (2017-05-06 16:34 UTC) Platform Info: OS: Windows (x86\_64-w64-mingw32) CPU: Intel(R) Core(TM) i5-5200U CPU @ 2.20GHz WORD\_SIZE: 64 BLAS…

---

## [Using Shared Arrays](https://discourse.julialang.org/t/using-shared-arrays/3670)

<div class="topic-metadata">

**Author:** [@Divyansh\_Srivastava](https://discourse.julialang.org/u/Divyansh_Srivastava)\
**Replies:** 4\
**Last updated:** [May 13, 2017, 12:12am UTC](https://discourse.julialang.org/t/using-shared-arrays/3670 "2017-05-13T00:12:39Z")

</div>

julia\> betweenness = SharedArray{Float64}(n\_v); julia\> @time for s in reverse(vs) if degree(g,s) \> 0 # this might be 1? state = dijkstra\_shortest\_paths(g, s; allpaths=true) if endpoints \_accumulate\_endpoints!(be…

---

## [Parametric Constructor in Julia 0.6](https://discourse.julialang.org/t/parametric-constructor-in-julia-0-6/3652)

<div class="topic-metadata">

**Author:** [@matthieu](https://discourse.julialang.org/u/matthieu)\
**Replies:** 7\
**Last updated:** [May 12, 2017, 7:31pm UTC](https://discourse.julialang.org/t/parametric-constructor-in-julia-0-6/3652 "2017-05-12T19:31:30Z")

</div>

I have a hard time defining a constructor for a parametric type struct Point{T} x::T y::T Point{T}(x,y) where {T} = new(x,y) end Point(0.0, 0.0) # ERROR: MethodError: no method matching Point(::Float64, ::Floa…

---

## [Is there a way to export an array as a gif in Julia?](https://discourse.julialang.org/t/is-there-a-way-to-export-an-array-as-a-gif-in-julia/3662)

<div class="topic-metadata">

**Author:** [@Arnaldur\_Bjarnason](https://discourse.julialang.org/u/Arnaldur_Bjarnason)\
**Replies:** 13\
**Last updated:** [May 12, 2017, 5:19pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-export-an-array-as-a-gif-in-julia/3662 "2017-05-12T17:19:32Z")

</div>

I have an array that can easily be reshaped to contain Colors.jl or any other type. All gif making utilities I have found are either a part of SFML.jl which is a bit overkill for me or a plotting package. I simply want t…

---

## [Check two iterators for equality without collecting](https://discourse.julialang.org/t/check-two-iterators-for-equality-without-collecting/3631)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 6\
**Last updated:** [May 12, 2017, 3:57pm UTC](https://discourse.julialang.org/t/check-two-iterators-for-equality-without-collecting/3631 "2017-05-12T15:57:40Z")

</div>

I am looking for simple syntax that would compare two iterators itr1, itr2 for elementwise equality without collecting, and break early if there is a difference. MWE: julia\> VERSION v"0.6.0-rc1.0" julia\> all(1:3 .== \[1…

---

## [Elegant way to initialise an array with discontinuous ranges](https://discourse.julialang.org/t/elegant-way-to-initialise-an-array-with-discontinuous-ranges/3671)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 4\
**Last updated:** [May 12, 2017, 2:04pm UTC](https://discourse.julialang.org/t/elegant-way-to-initialise-an-array-with-discontinuous-ranges/3671 "2017-05-12T14:04:33Z")

</div>

I need an array of integers with different values, e.g. \[2015, 2025-2030,2100\] What I am doing now: y = \[2015\]; append!(y,collect(2025:2030)); append!(y,2100) Is there a better way? (it would be nice collect(2015,2025…

---

## [Identical code produces different results. sometimes](https://discourse.julialang.org/t/identical-code-produces-different-results-sometimes/3658)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 12\
**Last updated:** [May 12, 2017, 1:23pm UTC](https://discourse.julialang.org/t/identical-code-produces-different-results-sometimes/3658 "2017-05-12T13:23:57Z")

</div>

I have a very strange bug in my program. The same code run in different sessions produces different results. It is impossible for me to produce a MWE because I cannot reproduce this behaviour in a small example. It only …

---

## [Problem preserving indexes using Query.jl and IndexedTables.jl](https://discourse.julialang.org/t/problem-preserving-indexes-using-query-jl-and-indexedtables-jl/3650)

<div class="topic-metadata">

**Author:** [@merl-dev](https://discourse.julialang.org/u/merl-dev)\
**Replies:** 2\
**Last updated:** [May 11, 2017, 5:25pm UTC](https://discourse.julialang.org/t/problem-preserving-indexes-using-query-jl-and-indexedtables-jl/3650 "2017-05-11T17:25:37Z")

</div>

When joining 2 IndexedTables some of the data columns end up as indexes. Am I missing something here, or is this an issue: julia\> using IndexedTables, IndexedTables.Table, Query julia\> dt1 = Table(Columns(id = collect…

---

## [Trouble defining \`broadcast\` method between custom array type and \`Number\`](https://discourse.julialang.org/t/trouble-defining-broadcast-method-between-custom-array-type-and-number/3643)

<div class="topic-metadata">

**Author:** [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Replies:** 3\
**Last updated:** [May 11, 2017, 5:08pm UTC](https://discourse.julialang.org/t/trouble-defining-broadcast-method-between-custom-array-type-and-number/3643 "2017-05-11T17:08:42Z")

</div>

Consider the following type definition for a custom array type (using 0.6.0-rc1): struct MyArr{T, N} \<: AbstractArray{T, N} x::Array{T, N} end Base.size(A::MyArr) = size(A.x) Base.IndexStyle(::Type{T}) where {T \<: …

---

## [Slow arithmetic on views of sparse matrices](https://discourse.julialang.org/t/slow-arithmetic-on-views-of-sparse-matrices/3644)

<div class="topic-metadata">

**Author:** [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Replies:** 12\
**Last updated:** [May 11, 2017, 1:35pm UTC](https://discourse.julialang.org/t/slow-arithmetic-on-views-of-sparse-matrices/3644 "2017-05-11T13:35:59Z")

</div>

I was profiling some code that was surprisingly slow, and it turned out that the source of the issue was a sum over a view into a large sparse matrix. Here is an MWE that recreates it: d = sprand(Bool,10000,10000, 0.01)…

---

## [Running Julia.exe from Mintty terminal](https://discourse.julialang.org/t/running-julia-exe-from-mintty-terminal/3638)

<div class="topic-metadata">

**Author:** [@musm](https://discourse.julialang.org/u/musm)\
**Replies:** 7\
**Last updated:** [May 11, 2017, 2:33am UTC](https://discourse.julialang.org/t/running-julia-exe-from-mintty-terminal/3638 "2017-05-11T02:33:46Z")

</div>

Has anyone tried or got this to work currently it just hangs the terminal mus@mus-laptop /mnt/c/Users/Mus $ julia-debug.exe --compile=no code missing for Base.Multimedia.Type(Type{Base.Multimedia.TextDisplay}, Base.IOS…

---

## [Memory allocation with Channels](https://discourse.julialang.org/t/memory-allocation-with-channels/3639)

<div class="topic-metadata">

**Author:** [@gasagna](https://discourse.julialang.org/u/gasagna)\
**Replies:** 0\
**Last updated:** [May 10, 2017, 10:23pm UTC](https://discourse.julialang.org/t/memory-allocation-with-channels/3639 "2017-05-10T22:23:38Z")

</div>

Hi all, I am playing with channels and I have this example code. # Example producer, will generate \`N\` element using function # \`ϕ\` and push them in a channel of size \`csize\` function Produce(ϕ, x₀::T, N::Int, csize::I…

---

## [Unnecessary(?) tuple allocation](https://discourse.julialang.org/t/unnecessary-tuple-allocation/3589)

<div class="topic-metadata">

**Author:** [@Snir\_Gazit](https://discourse.julialang.org/u/Snir_Gazit)\
**Replies:** 6\
**Last updated:** [May 10, 2017, 9:02pm UTC](https://discourse.julialang.org/t/unnecessary-tuple-allocation/3589 "2017-05-10T21:02:55Z")

</div>

Hi, I’m implementing a Monte Carlo algorithm in which the Markov chain state is defined by a site index (in two dimensions to be more concrete). The site index performs a random walk according to some given rules. The c…

---

## [Using a binary dependency statically linked to LLVM](https://discourse.julialang.org/t/using-a-binary-dependency-statically-linked-to-llvm/3627)

<div class="topic-metadata">

**Author:** [@isuruf](https://discourse.julialang.org/u/isuruf)\
**Replies:** 2\
**Last updated:** [May 10, 2017, 11:01am UTC](https://discourse.julialang.org/t/using-a-binary-dependency-statically-linked-to-llvm/3627 "2017-05-10T11:01:03Z")

</div>

I’m trying to use a C library that is linked to LLVM static libraries in Julia. I’m using BinDeps and Conda to download the C library, but I get the following error when building the Julia package julia\> Pkg.build("SymE…

---

## [Error while trying to install any packages](https://discourse.julialang.org/t/error-while-trying-to-install-any-packages/3626)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 1\
**Last updated:** [May 10, 2017, 8:20am UTC](https://discourse.julialang.org/t/error-while-trying-to-install-any-packages/3626 "2017-05-10T08:20:40Z")

</div>

Hi, A while ago I tried to install Plots.jl and it failed because of some errors. After that whenever I try to install any package in julia, I’m getting this error. julia\> Pkg.install( "ZMQ" ) ERROR: fixed packages int…

---

## [Help with parallelism](https://discourse.julialang.org/t/help-with-parallelism/3615)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 9\
**Last updated:** [May 9, 2017, 10:04pm UTC](https://discourse.julialang.org/t/help-with-parallelism/3615 "2017-05-09T22:04:35Z")

</div>

I have a large data structure g (passed in to my parent function) on which I would like to perform a large number (n = 1e4 to 1e6) of (moderately-expensive) functions with different arguments (argList). The function resu…

---

## [Julia REPL paste "magic" macro](https://discourse.julialang.org/t/julia-repl-paste-magic-macro/3610)

<div class="topic-metadata">

**Author:** [@joshbode](https://discourse.julialang.org/u/joshbode)\
**Replies:** 6\
**Last updated:** [May 9, 2017, 9:34pm UTC](https://discourse.julialang.org/t/julia-repl-paste-magic-macro/3610 "2017-05-09T21:34:14Z")

</div>

I use Python and Julia and use the REPL a lot in both. One thing I really like in the Python ecosystem is IPython (yes, I’m aware of IJulia :slight\_smile: ). One particular feature I use a lot of in IPython is the %pas…

---

## [Is it possible to create compiled executable?](https://discourse.julialang.org/t/is-it-possible-to-create-compiled-executable/3617)

<div class="topic-metadata">

**Author:** [@vejitatoja](https://discourse.julialang.org/u/vejitatoja)\
**Replies:** 9\
**Last updated:** [May 9, 2017, 6:42pm UTC](https://discourse.julialang.org/t/is-it-possible-to-create-compiled-executable/3617 "2017-05-09T18:42:52Z")

</div>

Is it possible to create compiled executable with my program written in julia, that i could take and run on another machine that doesn’t have julia installed?

---

## [Pkg installation error](https://discourse.julialang.org/t/pkg-installation-error/3407)

<div class="topic-metadata">

**Author:** [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Replies:** 7\
**Last updated:** [May 9, 2017, 3:53pm UTC](https://discourse.julialang.org/t/pkg-installation-error/3407 "2017-05-09T15:53:25Z")

</div>

I’ve been having the following error with installing NLopt, and have been advised this is an issue with julia rather than the package: https://github.com/JuliaOpt/NLopt.jl/issues/77#issuecomment-297778775

---

## [Sum of hadamard products](https://discourse.julialang.org/t/sum-of-hadamard-products/3531)

<div class="topic-metadata">

**Author:** [@pkofod](https://discourse.julialang.org/u/pkofod)\
**Replies:** 16\
**Last updated:** [May 9, 2017, 1:58pm UTC](https://discourse.julialang.org/t/sum-of-hadamard-products/3531 "2017-05-09T13:58:53Z")

</div>

Ayo ayo, time for everyone’s favorite Julia game: MakeItFast! I’m calculating a discounted value given a controlled Markov process, and for that I construct a matrix betaFP to be used in the context (I-betaFP)\\u. There …

---

## [Promotion rules - what about when you can't promote?](https://discourse.julialang.org/t/promotion-rules-what-about-when-you-cant-promote/3601)

<div class="topic-metadata">

**Author:** [@Ward9250](https://discourse.julialang.org/u/Ward9250)\
**Replies:** 2\
**Last updated:** [May 9, 2017, 11:21am UTC](https://discourse.julialang.org/t/promotion-rules-what-about-when-you-cant-promote/3601 "2017-05-09T11:21:38Z")

</div>

I’m writing some code for the first time dealing with promotion in julia. Specifically I’m trying to defining some promotion rules for Bio.jl, first a bit of background: BioJulia defines the following alphabet types: "…

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

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