# General Usage

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

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

**Page:** 1017

---

## [Homebrew installation failing in OSX Yosemite](https://discourse.julialang.org/t/homebrew-installation-failing-in-osx-yosemite/6855)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 2\
**Last updated:** [November 8, 2017, 4:28am UTC](https://discourse.julialang.org/t/homebrew-installation-failing-in-osx-yosemite/6855 "2017-11-08T04:28:38Z")

</div>

I want to install Homebrew, but the installation fails as below: julia\> versioninfo() Julia Version 0.6.0 Commit 903644385b (2017-06-19 13:05 UTC) Platform Info: OS: macOS (x86\_64-apple-darwin13.4.0) CPU: Intel(R) C…

---

## [Julia Windows download links for 0.6.1 are currently down](https://discourse.julialang.org/t/julia-windows-download-links-for-0-6-1-are-currently-down/6921)

<div class="topic-metadata">

**Author:** [@asampal](https://discourse.julialang.org/u/asampal)\
**Replies:** 5\
**Last updated:** [November 7, 2017, 10:51pm UTC](https://discourse.julialang.org/t/julia-windows-download-links-for-0-6-1-are-currently-down/6921 "2017-11-07T22:51:49Z")

</div>

The error result that is returned, indicates “Access Denied”.

---

## [Show value if test fails](https://discourse.julialang.org/t/show-value-if-test-fails/6940)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 1\
**Last updated:** [November 7, 2017, 10:27pm UTC](https://discourse.julialang.org/t/show-value-if-test-fails/6940 "2017-11-07T22:27:17Z")

</div>

If I run a = 15 @test a == 12 I get failure and Evaluated: 15 == 12 but if I run @test isapprox(a, 14.3) I don’t get the evaluated version of a which would be nice. A fix for that is @test a ≈ 14.3 But doesn’t wo…

---

## [Is there a bug in \`Dict\`?](https://discourse.julialang.org/t/is-there-a-bug-in-dict/6672)

<div class="topic-metadata">

**Author:** [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Replies:** 17\
**Last updated:** [November 7, 2017, 9:30pm UTC](https://discourse.julialang.org/t/is-there-a-bug-in-dict/6672 "2017-11-07T21:30:35Z")

</div>

Sorry in advance for the long post. I have some trouble with a bug in one of my program. I was able to reproduce it with a simpler code, and it seems to be related to the Dict structure. I am not sure if the problem is …

---

## [@edit Unknown editor: no line number information passed](https://discourse.julialang.org/t/edit-unknown-editor-no-line-number-information-passed/6938)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 2\
**Last updated:** [November 7, 2017, 6:43pm UTC](https://discourse.julialang.org/t/edit-unknown-editor-no-line-number-information-passed/6938 "2017-11-07T18:43:48Z")

</div>

It seems I have some bad config here. I am on a Mac, my editor is Sublime Text. How can I fix this? The editor opens the correct source file, but it doesn’t jump to the right line.

---

## [Why is this a BoundsError (passing keyword arguments wrong)](https://discourse.julialang.org/t/why-is-this-a-boundserror-passing-keyword-arguments-wrong/6936)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 2\
**Last updated:** [November 7, 2017, 6:41pm UTC](https://discourse.julialang.org/t/why-is-this-a-boundserror-passing-keyword-arguments-wrong/6936 "2017-11-07T18:41:40Z")

</div>

Here is a minimal example: f(x::Int; y::Int = 1) = x + y f(1; 2) This produces an error: which is not very informative. It doesn’t tell you line numbers, and from “BoundsError” I had a hard time figuring out that I …

---

## [Output-like print](https://discourse.julialang.org/t/output-like-print/6930)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 7\
**Last updated:** [November 7, 2017, 4:58pm UTC](https://discourse.julialang.org/t/output-like-print/6930 "2017-11-07T16:58:17Z")

</div>

Compare this: to this: or this: How can I “print” a value, to be formatted like it would if it was output (like in the first case)? The problem with just outputing (like in the first case) is that you can only …

---

## [Upgrades and uninstall in Windows 10](https://discourse.julialang.org/t/upgrades-and-uninstall-in-windows-10/6928)

<div class="topic-metadata">

**Author:** [@John\_Hearns](https://discourse.julialang.org/u/John_Hearns)\
**Replies:** 2\
**Last updated:** [November 7, 2017, 9:57am UTC](https://discourse.julialang.org/t/upgrades-and-uninstall-in-windows-10/6928 "2017-11-07T09:57:43Z")

</div>

This is perhaps a bit of a badly formed post. I use Julia on a Windows 10 laptop (I am lucky enough to have a nice HP Spectre with a 4K display). Twice now I have uninstalled Julia and have got into a tangle with not h…

---

## [How to ensure orthogonality of eigenvectors](https://discourse.julialang.org/t/how-to-ensure-orthogonality-of-eigenvectors/6924)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 4\
**Last updated:** [November 7, 2017, 8:03am UTC](https://discourse.julialang.org/t/how-to-ensure-orthogonality-of-eigenvectors/6924 "2017-11-07T08:03:53Z")

</div>

I have a Hermitian matrix A. Due to numerical errors, (A'-A)/2 is around 10^-17 and eig returns nonorthogonal eigenvectors. I don’t see a eigh function (from numpy) counterpart in julia. How can I ensure orthogonality of…

---

## [Writing a float to an IOStream in decimal notation](https://discourse.julialang.org/t/writing-a-float-to-an-iostream-in-decimal-notation/6927)

<div class="topic-metadata">

**Author:** [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Replies:** 4\
**Last updated:** [November 7, 2017, 7:58am UTC](https://discourse.julialang.org/t/writing-a-float-to-an-iostream-in-decimal-notation/6927 "2017-11-07T07:58:48Z")

</div>

Is there a way to force the decimal notation for floats for printing or writing in a file?

---

## [Functor abstract types](https://discourse.julialang.org/t/functor-abstract-types/4887)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 11\
**Last updated:** [November 7, 2017, 5:10am UTC](https://discourse.julialang.org/t/functor-abstract-types/4887 "2017-11-07T05:10:56Z")

</div>

Given a concrete type, one can define functor-like methods with: struct Foo end (f::Foo)(x) = 2x and use the object as a function: f = Foo() f(1) This doesn’t work with abstract types, however; even though they suppo…

---

## [Broadcasting assignment idea](https://discourse.julialang.org/t/broadcasting-assignment-idea/6918)

<div class="topic-metadata">

**Author:** [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Replies:** 0\
**Last updated:** [November 6, 2017, 9:34pm UTC](https://discourse.julialang.org/t/broadcasting-assignment-idea/6918 "2017-11-06T21:34:06Z")

</div>

Given A::AbstractMatrix and b::AbstractVector one can broadcast assignments like: A\[:,cols\] .= b.' where cols may be a container of valid indices… However, I would like to broadcast assignment where cols is, WLOG, Vect…

---

## [Redefining variables](https://discourse.julialang.org/t/redefining-variables/6911)

<div class="topic-metadata">

**Author:** [@oneandson](https://discourse.julialang.org/u/oneandson)\
**Replies:** 3\
**Last updated:** [November 6, 2017, 8:32pm UTC](https://discourse.julialang.org/t/redefining-variables/6911 "2017-11-06T20:32:40Z")

</div>

I am somewhat confused about the behavior when redefining variables, in particular why a second variable defined by a first variable changes when the first variable is redefined. Where can I read more about redefining va…

---

## [Operations on AxisArrays](https://discourse.julialang.org/t/operations-on-axisarrays/6906)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 2\
**Last updated:** [November 6, 2017, 8:04pm UTC](https://discourse.julialang.org/t/operations-on-axisarrays/6906 "2017-11-06T20:04:54Z")

</div>

Adding two axis arrays, with equal axes forgets the axes and results in an ordinary array. Same for other operations. Is this a bug or expected behaviour? Is there a recommended way to apply operations without forgetting…

---

## [Type Instability with MMatrix](https://discourse.julialang.org/t/type-instability-with-mmatrix/6905)

<div class="topic-metadata">

**Author:** [@IlyaOrson](https://discourse.julialang.org/u/IlyaOrson)\
**Replies:** 5\
**Last updated:** [November 6, 2017, 7:26pm UTC](https://discourse.julialang.org/t/type-instability-with-mmatrix/6905 "2017-11-06T19:26:16Z")

</div>

Hi! I am having some trouble with a weird type instability seems to appear in broadcast!() when I use it over a MMatrix from StaticArrays.jl but disappears if I use a normal Matrix. Here is my MWE: using StaticArrays, O…

---

## [Exactly what functions get compiled versions for specialized types?](https://discourse.julialang.org/t/exactly-what-functions-get-compiled-versions-for-specialized-types/6909)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 4\
**Last updated:** [November 6, 2017, 3:48pm UTC](https://discourse.julialang.org/t/exactly-what-functions-get-compiled-versions-for-specialized-types/6909 "2017-11-06T15:48:12Z")

</div>

If I define a function like: f(x) = x + 1 and then call it, f(1), I’ll get a compiled version that is specialized for Ints. Does this apply for all callables? For example, if I define a closure, f = (x -\> x + a), whe…

---

## [BusError: Are SharedArray s on virtual machines possible?](https://discourse.julialang.org/t/buserror-are-sharedarray-s-on-virtual-machines-possible/3199)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 7\
**Last updated:** [November 6, 2017, 2:28pm UTC](https://discourse.julialang.org/t/buserror-are-sharedarray-s-on-virtual-machines-possible/3199 "2017-11-06T14:28:23Z")

</div>

I have code that allocates SharedArrays on a machine. this works well on the computer in front of me, i.e. the physical machine in my office. I am having trouble runnign the same code though on a virtual machine inside a…

---

## [Generate new key](https://discourse.julialang.org/t/generate-new-key/6845)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 9\
**Last updated:** [November 6, 2017, 1:57pm UTC](https://discourse.julialang.org/t/generate-new-key/6845 "2017-11-06T13:57:54Z")

</div>

Is there a function/way to ask for a new unique key from an existing Dict that is not in already in the Dict? So I can safely assign to it knowing I’m not writing over something? Thanks!

---

## [Why 0^0 = 1?](https://discourse.julialang.org/t/why-0-0-1/6889)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 2\
**Last updated:** [November 5, 2017, 10:33pm UTC](https://discourse.julialang.org/t/why-0-0-1/6889 "2017-11-05T22:33:38Z")

</div>

0^0 is defined in Julia, and equals 1. Mathematically 0^0 is undefined.I think other programming languages leave it undefined, although Python sets 0^0 = 0 (which is insane in my opinion). To me it makes sense to make 0…

---

## [Pkg.update() prompts for git ssh key](https://discourse.julialang.org/t/pkg-update-prompts-for-git-ssh-key/6894)

<div class="topic-metadata">

**Author:** [@crbinz](https://discourse.julialang.org/u/crbinz)\
**Replies:** 0\
**Last updated:** [November 5, 2017, 3:22pm UTC](https://discourse.julialang.org/t/pkg-update-prompts-for-git-ssh-key/6894 "2017-11-05T15:22:46Z")

</div>

How do I figure out which package is responsible for this? julia\> Pkg.update() INFO: Updating METADATA... Private key location for 'git@github.com' \[/Users/cbinz/.ssh/id\_rsa\]: I’m only on master for a couple unregister…

---

## [Problems building Cairo](https://discourse.julialang.org/t/problems-building-cairo/6844)

<div class="topic-metadata">

**Author:** [@renec](https://discourse.julialang.org/u/renec)\
**Replies:** 4\
**Last updated:** [November 5, 2017, 11:17am UTC](https://discourse.julialang.org/t/problems-building-cairo/6844 "2017-11-05T11:17:22Z")

</div>

Hello, two days ago, after Pkg.update(), I cannot use Cairo any longer. All attempts to build the package results in the following error: “LoadError: could not spawn unxz -c /Users/Reinhard/.julia/v0.5/Cairo/deps/downl…

---

## [Slurping and splatting in JuMP](https://discourse.julialang.org/t/slurping-and-splatting-in-jump/6892)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 1\
**Last updated:** [November 5, 2017, 3:18am UTC](https://discourse.julialang.org/t/slurping-and-splatting-in-jump/6892 "2017-11-05T03:18:06Z")

</div>

I need to define a function that takes a large number of arguments. I am trying to follow JuMP documentation: All arguments to user-defined functions are scalars, not vectors. To define a function which takes a large n…

---

## [Function performance when passed as an argument vs. passed in a struct](https://discourse.julialang.org/t/function-performance-when-passed-as-an-argument-vs-passed-in-a-struct/6703)

<div class="topic-metadata">

**Author:** [@alee](https://discourse.julialang.org/u/alee)\
**Replies:** 8\
**Last updated:** [November 4, 2017, 11:40pm UTC](https://discourse.julialang.org/t/function-performance-when-passed-as-an-argument-vs-passed-in-a-struct/6703 "2017-11-04T23:40:01Z")

</div>

I am new to Julia, but have looked at the manual and searched online, and can’t seem to find the answer to this question. Apologies if I have missed it. Is there a recommended way to package together functions when call…

---

## [Zeroing elements of matrix A depending on matrix B. Fast?](https://discourse.julialang.org/t/zeroing-elements-of-matrix-a-depending-on-matrix-b-fast/6849)

<div class="topic-metadata">

**Author:** [@zenon](https://discourse.julialang.org/u/zenon)\
**Replies:** 19\
**Last updated:** [November 4, 2017, 7:19pm UTC](https://discourse.julialang.org/t/zeroing-elements-of-matrix-a-depending-on-matrix-b-fast/6849 "2017-11-04T19:19:54Z")

</div>

Hi, two matrices A, B, B has a bunch of zero elements, and I need to set A\[i,j\] = 0 wherever B\[i,j\] == 0 I hoped to use that B .!= 0 is a boolean matrix, and try something like (B .!= 0) .&& A but that’s bad syntax …

---

## [Source files with non-ascii names: how?](https://discourse.julialang.org/t/source-files-with-non-ascii-names-how/6827)

<div class="topic-metadata">

**Author:** [@foobar\_lv](https://discourse.julialang.org/u/foobar_lv)\
**Replies:** 6\
**Last updated:** [November 4, 2017, 4:41pm UTC](https://discourse.julialang.org/t/source-files-with-non-ascii-names-how/6827 "2017-11-04T16:41:43Z")

</div>

Is there a nice escaping rule that allows avoiding non-ascii characters in source-files? That is, some ancient tools and people cannot deal with anything that is not ascii-7-bit in source files, but want to interact wit…

---

## [How to set placeholder text for Gtk.jl widgets?](https://discourse.julialang.org/t/how-to-set-placeholder-text-for-gtk-jl-widgets/6874)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 0\
**Last updated:** [November 4, 2017, 1:58pm UTC](https://discourse.julialang.org/t/how-to-set-placeholder-text-for-gtk-jl-widgets/6874 "2017-11-04T13:58:48Z")

</div>

How do I set the grayed out background text that guides the user on what to input into say a textbox, GtkEntry?

---

## [Elementwise operation on array of tuples](https://discourse.julialang.org/t/elementwise-operation-on-array-of-tuples/6812)

<div class="topic-metadata">

**Author:** [@BenjaminBorn](https://discourse.julialang.org/u/BenjaminBorn)\
**Replies:** 8\
**Last updated:** [November 4, 2017, 9:50am UTC](https://discourse.julialang.org/t/elementwise-operation-on-array-of-tuples/6812 "2017-11-04T09:50:32Z")

</div>

I can apply round() elementwise to tuples as in the following example julia\> a = (1.234567,7.654321) (1.234567, 7.654321) julia\> typeof(a) Tuple{Float64,Float64} julia\> round.(a) (1.0, 8.0) However, this does not wo…

---

## [Parametric types with parameters left unspecified as struct fields](https://discourse.julialang.org/t/parametric-types-with-parameters-left-unspecified-as-struct-fields/6865)

<div class="topic-metadata">

**Author:** [@Pbellive](https://discourse.julialang.org/u/Pbellive)\
**Replies:** 3\
**Last updated:** [November 3, 2017, 7:56pm UTC](https://discourse.julialang.org/t/parametric-types-with-parameters-left-unspecified-as-struct-fields/6865 "2017-11-03T19:56:09Z")

</div>

Suppose I have a mutable struct with a field used to store a sparse matrix, e.g. mutable struct myStruct{Tv\<:Number,Ti\<:Integer} A::SparseMatrixCSC{Tv,Ti} end This works as expected for various combinations of Tv a…

---

## [What does p0 in curve\_fit of LsqFit package mean?](https://discourse.julialang.org/t/what-does-p0-in-curve-fit-of-lsqfit-package-mean/6861)

<div class="topic-metadata">

**Author:** [@jwu](https://discourse.julialang.org/u/jwu)\
**Replies:** 4\
**Last updated:** [November 3, 2017, 6:28pm UTC](https://discourse.julialang.org/t/what-does-p0-in-curve-fit-of-lsqfit-package-mean/6861 "2017-11-03T18:28:23Z")

</div>

In the LsqFit package, the curve\_fit function require a parameter called p0. what does it mean?

---

## [Can't install SharedArrays](https://discourse.julialang.org/t/cant-install-sharedarrays/6862)

<div class="topic-metadata">

**Author:** [@tpoisot](https://discourse.julialang.org/u/tpoisot)\
**Replies:** 1\
**Last updated:** [November 3, 2017, 6:13pm UTC](https://discourse.julialang.org/t/cant-install-sharedarrays/6862 "2017-11-03T18:13:02Z")

</div>

I am most likely missing something obvious here, but using Julia 0.6.0 on Fedora 26, I cannot install SharedArrays. julia\> using SharedArrays ERROR: ArgumentError: Module SharedArrays not found in current path. julia\> …

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

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