# General Usage

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

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

**Page:** 993

---

## [CLI tools for Julia?](https://discourse.julialang.org/t/cli-tools-for-julia/9445)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 3\
**Last updated:** [March 2, 2018, 9:53am UTC](https://discourse.julialang.org/t/cli-tools-for-julia/9445 "2018-03-02T09:53:15Z")

</div>

I was wondering if there is any CLI(command line interface) tools for julia. like npm for node, gem for ruby, pip for python. Julia itself has a package manager and some macros in REPL (@which, @edit, etc.). But there i…

---

## [New findfirst behaviour - type unstable or no?](https://discourse.julialang.org/t/new-findfirst-behaviour-type-unstable-or-no/9403)

<div class="topic-metadata">

**Author:** [@Ward9250](https://discourse.julialang.org/u/Ward9250)\
**Replies:** 4\
**Last updated:** [March 1, 2018, 9:28pm UTC](https://discourse.julialang.org/t/new-findfirst-behaviour-type-unstable-or-no/9403 "2018-03-01T21:28:05Z")

</div>

In 0.6 findfirst(::Function, ::A) would return the index of the first element that caused the predicate function to return true, and 0 if it is not present. Now it returns ‘nothing’… of type ‘Nothing’, so will this cause…

---

## [error using \`@everywhere\` in conjunction with \`using\`](https://discourse.julialang.org/t/error-using-everywhere-in-conjunction-with-using/9431)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 0\
**Last updated:** [March 1, 2018, 9:58pm UTC](https://discourse.julialang.org/t/error-using-everywhere-in-conjunction-with-using/9431 "2018-03-01T21:58:27Z")

</div>

I have a very weird bug that has just popped up. After adding my workers (through the SLURM workload manager - this part is good), I can’t seem to execute @everywhere using \[packagename\]. This never happened before. My …

---

## [Why Julia is fast in interpreter but slow when dealing with files ](https://discourse.julialang.org/t/why-julia-is-fast-in-interpreter-but-slow-when-dealing-with-files/9385)

<div class="topic-metadata">

**Author:** [@arnuld](https://discourse.julialang.org/u/arnuld)\
**Replies:** 11\
**Last updated:** [March 1, 2018, 8:49pm UTC](https://discourse.julialang.org/t/why-julia-is-fast-in-interpreter-but-slow-when-dealing-with-files/9385 "2018-03-01T20:49:11Z")

</div>

I have this program written in a file: using HTTP using JSON function pingserver() const addr = "http://localhost:4212/" const bdata = """{"type":"PING"}""" res = HTTP.post(addr, body=bdata) println(St…

---

## [Setting max exposure](https://discourse.julialang.org/t/setting-max-exposure/9417)

<div class="topic-metadata">

**Author:** [@dhislop](https://discourse.julialang.org/u/dhislop)\
**Replies:** 3\
**Last updated:** [March 1, 2018, 6:10pm UTC](https://discourse.julialang.org/t/setting-max-exposure/9417 "2018-03-01T18:10:02Z")

</div>

I am trying to make lists of names given certain input parameters of performance and want to look at the variance distribution but in my code I tend to get the same names over and over as high performers. Instead what I …

---

## [Issue with a GtkReactive example](https://discourse.julialang.org/t/issue-with-a-gtkreactive-example/9171)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 10\
**Last updated:** [March 1, 2018, 6:05pm UTC](https://discourse.julialang.org/t/issue-with-a-gtkreactive-example/9171 "2018-03-01T18:05:36Z")

</div>

Can you please try this drawing example from GtkReactive: include(joinpath(Pkg.dir("GtkReactive"), "examples/drawing.jl")) It runs without any errors/warnings but for some reason it does not draw anything (lines are su…

---

## [Type of function arguments ignored](https://discourse.julialang.org/t/type-of-function-arguments-ignored/9422)

<div class="topic-metadata">

**Author:** [@mvhulten](https://discourse.julialang.org/u/mvhulten)\
**Replies:** 4\
**Last updated:** [March 1, 2018, 5:19pm UTC](https://discourse.julialang.org/t/type-of-function-arguments-ignored/9422 "2018-03-01T17:19:01Z")

</div>

julia\> function myplus(x::UInt,y::UInt) x+y end myplus (generic function with 2 methods) julia\> myplus(3,-4) -1 julia\> myplus(im,-4π) == im+-4π true Since I “declared” x and y as natural numbers, sho…

---

## [Why is the Iterator interface slow and allocates too much memory?](https://discourse.julialang.org/t/why-is-the-iterator-interface-slow-and-allocates-too-much-memory/9418)

<div class="topic-metadata">

**Author:** [@mbeltagy](https://discourse.julialang.org/u/mbeltagy)\
**Replies:** 2\
**Last updated:** [March 1, 2018, 3:56pm UTC](https://discourse.julialang.org/t/why-is-the-iterator-interface-slow-and-allocates-too-much-memory/9418 "2018-03-01T15:56:51Z")

</div>

I wanted to build an iterator that performs some none trivial operation on two arrays. In this simple example I wanted to get the boolean output of the element wise comparison x\_i^2+y\_i^2\>2y\_i^2 n\_samples=100\_000 # A …

---

## [Sum + squeeze as one function](https://discourse.julialang.org/t/sum-squeeze-as-one-function/2471)

<div class="topic-metadata">

**Author:** [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Replies:** 11\
**Last updated:** [March 1, 2018, 2:01pm UTC](https://discourse.julialang.org/t/sum-squeeze-as-one-function/2471 "2018-03-01T14:01:19Z")

</div>

Is there a built-in version of sum(A, dims) that automatically squeezes the summed out dimension? Something like: sumsqueeze(A, dim) = squeeze(sum(A, dim), dim) Surely, I can just combine 2 functions, but in my use cas…

---

## [Travis woes: warning accessibility bus and segmentation fault](https://discourse.julialang.org/t/travis-woes-warning-accessibility-bus-and-segmentation-fault/9362)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 9\
**Last updated:** [March 1, 2018, 1:15pm UTC](https://discourse.julialang.org/t/travis-woes-warning-accessibility-bus-and-segmentation-fault/9362 "2018-03-01T13:15:42Z")

</div>

Hi CI wizards, I’m having some trouble with Travis and was wondering if someone could lend me some wisdom. I’m getting a few of these warnings: \*\* (julia:6922): WARNING \*\*: Error retrieving accessibility bus address: …

---

## [Adding \`@time\` to a function gets rid of type-instability and makes code run 6x fast?!](https://discourse.julialang.org/t/adding-time-to-a-function-gets-rid-of-type-instability-and-makes-code-run-6x-fast/9413)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 7\
**Last updated:** [March 1, 2018, 12:46pm UTC](https://discourse.julialang.org/t/adding-time-to-a-function-gets-rid-of-type-instability-and-makes-code-run-6x-fast/9413 "2018-03-01T12:46:43Z")

</div>

I am developing a function and I find it hard to boil down to MWE. But the weird thing is the function runs in about 13 seconds, so I try to @time various part of the program and the code runs in 2 seconds. There is not…

---

## [Identify button modifiers in Gtk](https://discourse.julialang.org/t/identify-button-modifiers-in-gtk/9411)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 6\
**Last updated:** [March 1, 2018, 12:43pm UTC](https://discourse.julialang.org/t/identify-button-modifiers-in-gtk/9411 "2018-03-01T12:43:46Z")

</div>

tl;dr: How can I reliably test which modifier a user is pressing while clicking the mouse? I’m using ImageView.imshow as a GUI to select points on an image. The functionalities already baked-in in imshow (zoom, pan, ann…

---

## [An explanation of LoadError: DomainError:?](https://discourse.julialang.org/t/an-explanation-of-loaderror-domainerror/9408)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 3\
**Last updated:** [March 1, 2018, 11:08am UTC](https://discourse.julialang.org/t/an-explanation-of-loaderror-domainerror/9408 "2018-03-01T11:08:10Z")

</div>

DomainError help is: The arguments to a function or constructor are outside the valid domain. But I’m not sure of what constitutes “valid” and what the “domain” is? I’m passing passing a macro generated struct as a …

---

## [Colorbar label in Plots.jl](https://discourse.julialang.org/t/colorbar-label-in-plots-jl/9400)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 0\
**Last updated:** [February 28, 2018, 10:35pm UTC](https://discourse.julialang.org/t/colorbar-label-in-plots-jl/9400 "2018-02-28T22:35:07Z")

</div>

How do I set a label for the colorbar when using Plots.jl

---

## [Git certificate errors](https://discourse.julialang.org/t/git-certificate-errors/9350)

<div class="topic-metadata">

**Author:** [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Replies:** 4\
**Last updated:** [February 28, 2018, 6:10pm UTC](https://discourse.julialang.org/t/git-certificate-errors/9350 "2018-02-28T18:10:03Z")

</div>

All of a sudden I’ve been having trouble installing packages. This began with an attempt of installing Adapt ERROR: Cannot clone Adapt from https://github.com/MikeInnes/Adapt.jl.git. user cancelled certificate check: pr…

---

## [Customizing console display of the information within an abstract type instance](https://discourse.julialang.org/t/customizing-console-display-of-the-information-within-an-abstract-type-instance/9391)

<div class="topic-metadata">

**Author:** [@hockey-model-julia](https://discourse.julialang.org/u/hockey-model-julia)\
**Replies:** 1\
**Last updated:** [February 28, 2018, 4:14pm UTC](https://discourse.julialang.org/t/customizing-console-display-of-the-information-within-an-abstract-type-instance/9391 "2018-02-28T16:14:39Z")

</div>

This question is probably applicable to multiple packages, but the example I am familiar with and want to somewhat replicate is from the HypothosisTests package. When an instance of a HypothesisTests.OneSampleTTest is p…

---

## [How to properly use read!?](https://discourse.julialang.org/t/how-to-properly-use-read/9372)

<div class="topic-metadata">

**Author:** [@Liso](https://discourse.julialang.org/u/Liso)\
**Replies:** 3\
**Last updated:** [February 28, 2018, 2:57pm UTC](https://discourse.julialang.org/t/how-to-properly-use-read/9372 "2018-02-28T14:57:41Z")

</div>

MWE: julia\> open("/tmp/tst", "w") do f write(f, ones(Int64, 2)) end 16 julia\> a = Array{Int64}(uninitialized, 4) 4-element Array{Int64,1}: 140008466987408 140008481884256 140008466986384 0 julia\> rr …

---

## [HDF5 add/build fails on Windows 8 with Julia 0.6.0](https://discourse.julialang.org/t/hdf5-add-build-fails-on-windows-8-with-julia-0-6-0/5746)

<div class="topic-metadata">

**Author:** [@js135005](https://discourse.julialang.org/u/js135005)\
**Replies:** 7\
**Last updated:** [February 28, 2018, 9:15am UTC](https://discourse.julialang.org/t/hdf5-add-build-fails-on-windows-8-with-julia-0-6-0/5746 "2018-02-28T09:15:23Z")

</div>

This is happening with a clean initial installation. Two colleagues of mine have just encountered this problem and I have been able to replicate it as shown below. I’ve never opened an issue on github but will try to do …

---

## [How do you hijack keyboard controls in Jupyter using Julia?](https://discourse.julialang.org/t/how-do-you-hijack-keyboard-controls-in-jupyter-using-julia/9327)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 3\
**Last updated:** [February 28, 2018, 6:25am UTC](https://discourse.julialang.org/t/how-do-you-hijack-keyboard-controls-in-jupyter-using-julia/9327 "2018-02-28T06:25:02Z")

</div>

Let’s say you’re building a game in Jupyter using Julia. Eventually, you’ll need to use the arrow keys to move something around a maze (or play 2048) What is the best way to highjack keyboard controls? The idea would…

---

## [""" vs #= =# comment](https://discourse.julialang.org/t/vs-comment/8774)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 12\
**Last updated:** [February 27, 2018, 10:47pm UTC](https://discourse.julialang.org/t/vs-comment/8774 "2018-02-27T22:47:05Z")

</div>

I always thought that """ Test """ is the same as #= Test =# But it looks like """ is only used in front of functions to document them, correct? I realized this as I found out that """ Test """ """ Test 2 …

---

## [Build error](https://discourse.julialang.org/t/build-error/9375)

<div class="topic-metadata">

**Author:** [@kern](https://discourse.julialang.org/u/kern)\
**Replies:** 3\
**Last updated:** [February 27, 2018, 8:11pm UTC](https://discourse.julialang.org/t/build-error/9375 "2018-02-27T20:11:08Z")

</div>

I am getting build errors for IJulia, PyCall, MbedTLS, Homebrew and ZMQ with Pkg.update(). The error in each case is: LoadError: MethodError: convert(::Type{Union{Array{String,N} where N, Void}}, ::Void) is ambiguous. …

---

## [Volume 2: warning accessibility bus and segmentation fault on Travis](https://discourse.julialang.org/t/volume-2-warning-accessibility-bus-and-segmentation-fault-on-travis/9370)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 4\
**Last updated:** [February 27, 2018, 7:46pm UTC](https://discourse.julialang.org/t/volume-2-warning-accessibility-bus-and-segmentation-fault-on-travis/9370 "2018-02-27T19:46:18Z")

</div>

So this is in reference to I thought that the lack of ffmpeg on Travis caused the warnings and segmentation fault reported on in that post, but I was wrong. Here’s the log of my most recent tests. I’m convinced that it…

---

## [Julia 0.6 and 0.7 living together in harmony in one environment](https://discourse.julialang.org/t/julia-0-6-and-0-7-living-together-in-harmony-in-one-environment/9343)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 5\
**Last updated:** [February 27, 2018, 3:25pm UTC](https://discourse.julialang.org/t/julia-0-6-and-0-7-living-together-in-harmony-in-one-environment/9343 "2018-02-27T15:25:49Z")

</div>

Currently they are not doing this. I have Julia 0.7 installed with JULIA\_BINDIR set and its libraries added to the LD\_LIBRARY\_PATH and it’s working just fine. I have Julia 0.6 installed elsewhere with an alias to its e…

---

## [Automatic conversion with convert()](https://discourse.julialang.org/t/automatic-conversion-with-convert/9358)

<div class="topic-metadata">

**Author:** [@Robert\_Honig](https://discourse.julialang.org/u/Robert_Honig)\
**Replies:** 2\
**Last updated:** [February 27, 2018, 1:49pm UTC](https://discourse.julialang.org/t/automatic-conversion-with-convert/9358 "2018-02-27T13:49:58Z")

</div>

I have the following code: struct Foo foo::String end convert(::Type{String}, x::Foo) = x.foo String(Foo("bar")) This gives me the following error: ERROR: MethodError: Cannot convert an object of type Foo to an o…

---

## [Different behaviour between CSV.write() and DataFrame's writetable()](https://discourse.julialang.org/t/different-behaviour-between-csv-write-and-dataframes-writetable/9364)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 0\
**Last updated:** [February 27, 2018, 12:32pm UTC](https://discourse.julialang.org/t/different-behaviour-between-csv-write-and-dataframes-writetable/9364 "2018-02-27T12:32:39Z")

</div>

I am using writetable() at the moment to create write CSVs from my DataFrames and it works just fine. Since writetable() will be deprecated as soon as Pkg.update() will give me DataFrames 0.11, I want to use CSV.write() …

---

## [Julia Project - AIMA - GSOC2018](https://discourse.julialang.org/t/julia-project-aima-gsoc2018/9213)

<div class="topic-metadata">

**Author:** [@Panagiotis\_Petropoul](https://discourse.julialang.org/u/Panagiotis_Petropoul)\
**Replies:** 5\
**Last updated:** [February 27, 2018, 10:32am UTC](https://discourse.julialang.org/t/julia-project-aima-gsoc2018/9213 "2018-02-27T10:32:07Z")

</div>

Hallo, having gone through many of the projects, AIMA project seemed very intersesting to me. I am a third year student in the Department of Informatics and Telecommunications at the University of Athens. During the cur…

---

## [ResumableFunctions typing issue](https://discourse.julialang.org/t/resumablefunctions-typing-issue/9132)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 3\
**Last updated:** [February 26, 2018, 11:32pm UTC](https://discourse.julialang.org/t/resumablefunctions-typing-issue/9132 "2018-02-26T23:32:53Z")

</div>

@oxinabox - thanks for the great Lazy Sequences blog post. ResumableFunctions is a really cool package but I was curious why it ended up being slower than the Channel implementation for generating primes. I did some be…

---

## [Index inside a comprehension is boxed](https://discourse.julialang.org/t/index-inside-a-comprehension-is-boxed/9315)

<div class="topic-metadata">

**Author:** [@BenLauwens](https://discourse.julialang.org/u/BenLauwens)\
**Replies:** 5\
**Last updated:** [February 26, 2018, 10:34pm UTC](https://discourse.julialang.org/t/index-inside-a-comprehension-is-boxed/9315 "2018-02-26T22:34:51Z")

</div>

Hi I got a bug report for ResumableFunctions and after some analysis the problem appeared to be the boxing of an integer used as an index in a comprehension. Minimal example showing the boxing of the variable i functi…

---

## [Support for other package without requiring it](https://discourse.julialang.org/t/support-for-other-package-without-requiring-it/7612)

<div class="topic-metadata">

**Author:** [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Replies:** 11\
**Last updated:** [February 26, 2018, 10:21pm UTC](https://discourse.julialang.org/t/support-for-other-package-without-requiring-it/7612 "2018-02-26T22:21:53Z")

</div>

Is there a way to provide support for the types from another package without actually requiring that package? For example, say I wanted to make the following type in my package: struct Foo{T\<:Real} \<: AbstractArray{T,2}…

---

## [Git / SSL Errors while installing packages](https://discourse.julialang.org/t/git-ssl-errors-while-installing-packages/9347)

<div class="topic-metadata">

**Author:** [@SylvainCorlay](https://discourse.julialang.org/u/SylvainCorlay)\
**Replies:** 7\
**Last updated:** [February 26, 2018, 9:19pm UTC](https://discourse.julialang.org/t/git-ssl-errors-while-installing-packages/9347 "2018-02-26T21:19:03Z")

</div>

I have been getting the following error upon installation of any Julia package in all my CI builds for a couple of hours. INFO: Cloning METADATA from https://github.com/JuliaLang/METADATA.jl ERROR: GitError(Code:ERROR, …

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

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