# General Usage

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

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

**Page:** 951

---

## [Help Testing Repl Modes](https://discourse.julialang.org/t/help-testing-repl-modes/13773)

<div class="topic-metadata">

**Author:** [@Mason](https://discourse.julialang.org/u/Mason)\
**Replies:** 5\
**Last updated:** [August 21, 2018, 4:34pm UTC](https://discourse.julialang.org/t/help-testing-repl-modes/13773 "2018-08-21T16:34:45Z")

</div>

I’m developing a package for letting others define their own REPL modes but before I can put it on METADATA I need to develop tests for it. Unfortunately, in order to actually perform tests on it, I need a running REPL w…

---

## [Union of missing and number](https://discourse.julialang.org/t/union-of-missing-and-number/13834)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 2\
**Last updated:** [August 21, 2018, 2:30pm UTC](https://discourse.julialang.org/t/union-of-missing-and-number/13834 "2018-08-21T14:30:47Z")

</div>

This is related to a SO question (here): Why does this work: foo(x::Vector{Union{Missing, T}}) where T\<:Number = sum(collect(skipmissing(x))) foo(\[1, 2, missing\]) \>\> 3 but not this bar(x::Vector{Union{Missing, \<:Numb…

---

## [Mysterious Subtyping](https://discourse.julialang.org/t/mysterious-subtyping/13825)

<div class="topic-metadata">

**Author:** [@1115](https://discourse.julialang.org/u/1115)\
**Replies:** 1\
**Last updated:** [August 21, 2018, 1:59pm UTC](https://discourse.julialang.org/t/mysterious-subtyping/13825 "2018-08-21T13:59:07Z")

</div>

I have an abstract parent type PrimitiveBlock from package Yao.jl In another package QuAlgorithmZoo.jl that depend on Yao.jl I defined a new type struct QFTBlock{N} \<: PrimitiveBlock{N,ComplexF64} end Now I am using Q…

---

## [Example for Dot operator overloading](https://discourse.julialang.org/t/example-for-dot-operator-overloading/13816)

<div class="topic-metadata">

**Author:** [@Sighoya](https://discourse.julialang.org/u/Sighoya)\
**Replies:** 4\
**Last updated:** [August 21, 2018, 10:46am UTC](https://discourse.julialang.org/t/example-for-dot-operator-overloading/13816 "2018-08-21T10:46:51Z")

</div>

Does anyone knows how to overload the dot operator?

---

## [Can I use hasmethod inside @generated function?](https://discourse.julialang.org/t/can-i-use-hasmethod-inside-generated-function/13645)

<div class="topic-metadata">

**Author:** [@tkf](https://discourse.julialang.org/u/tkf)\
**Replies:** 4\
**Last updated:** [August 21, 2018, 6:33am UTC](https://discourse.julialang.org/t/can-i-use-hasmethod-inside-generated-function/13645 "2018-08-21T06:33:56Z")

</div>

I thought the answer was no, since hasmethod is not pure. But unless I try very hard to break it (see struct B example below) I cannot invoke any suspicious bugs. From the example I wrote, it seems that using hasmethod …

---

## [Docs on parse-time, compile-time and run-time operations?](https://discourse.julialang.org/t/docs-on-parse-time-compile-time-and-run-time-operations/4955)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 6\
**Last updated:** [August 21, 2018, 4:51am UTC](https://discourse.julialang.org/t/docs-on-parse-time-compile-time-and-run-time-operations/4955 "2018-08-21T04:51:12Z")

</div>

Are there any references that explain what happens exactly at parse-time, compile-time and run-time inside of Julia for someone who is curious but without all the in-depth background? Something along the lines of the fol…

---

## [Resources for understanding Pkg3](https://discourse.julialang.org/t/resources-for-understanding-pkg3/13799)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 1\
**Last updated:** [August 21, 2018, 3:23am UTC](https://discourse.julialang.org/t/resources-for-understanding-pkg3/13799 "2018-08-21T03:23:31Z")

</div>

I’ve read the docs, watched the youtube video, spent two days trying to make it work, but my level of understanding is still abysmal. Are there other resources / posts to recommend? I get that it’s early days for Pkg3, a…

---

## [Terrible time getting anything openGL related to work](https://discourse.julialang.org/t/terrible-time-getting-anything-opengl-related-to-work/13767)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 2\
**Last updated:** [August 20, 2018, 10:52pm UTC](https://discourse.julialang.org/t/terrible-time-getting-anything-opengl-related-to-work/13767 "2018-08-20T22:52:15Z")

</div>

Hi, I’ve got a couple of examples that are supposed to simply draw a triangle and I keep getting a black screen. I was wondering if some kind person could run the following code, on v 0.7 and let me know if they get a …

---

## [Feature matching display](https://discourse.julialang.org/t/feature-matching-display/13731)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 1\
**Last updated:** [August 20, 2018, 9:33pm UTC](https://discourse.julialang.org/t/feature-matching-display/13731 "2018-08-20T21:33:16Z")

</div>

Hi! I am working on matching features between two images. Now I am trying to draw the matches I have obtained and for that I was reading this blogpost. I guess the post assumes that both the images are of same size but…

---

## [Problem building julia: version \`JL\_LLVM\_6.0' not found](https://discourse.julialang.org/t/problem-building-julia-version-jl-llvm-6-0-not-found/11545)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 3\
**Last updated:** [August 20, 2018, 8:23pm UTC](https://discourse.julialang.org/t/problem-building-julia-version-jl-llvm-6-0-not-found/11545 "2018-08-20T20:23:05Z")

</div>

I tried to build the current master of Julia and it fails with the following error: /home/jan/juliadev/usr/bin/julia: /usr/lib/x86\_64-linux-gnu/libLLVM-6.0.so: version \`JL\_LLVM\_6.0' not found (required by /home/jan/juli…

---

## [Fast Interpolations](https://discourse.julialang.org/t/fast-interpolations/13751)

<div class="topic-metadata">

**Author:** [@Juser](https://discourse.julialang.org/u/Juser)\
**Replies:** 15\
**Last updated:** [August 20, 2018, 6:27pm UTC](https://discourse.julialang.org/t/fast-interpolations/13751 "2018-08-20T18:27:39Z")

</div>

I need linear interpolation on a grid to be fast and work with ForwardDiff. The Interpolations.jl package appears to be extremely fast (especially for a large number of interpolations), however it is not compatible with …

---

## [Initialize an array with the type of a function return](https://discourse.julialang.org/t/initialize-an-array-with-the-type-of-a-function-return/13755)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 4\
**Last updated:** [August 20, 2018, 6:18pm UTC](https://discourse.julialang.org/t/initialize-an-array-with-the-type-of-a-function-return/13755 "2018-08-20T18:18:44Z")

</div>

Hello, I have the following setup: I want to initialize an array with a element-type which is given by a return type of a function. Something like this: A = Array{typeof(f(1))}(undef, 10) for 1 in 1:10 A\[i\] = f(i) …

---

## [Faulty Transpose and Adjoint Multiplication](https://discourse.julialang.org/t/faulty-transpose-and-adjoint-multiplication/13742)

<div class="topic-metadata">

**Author:** [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Replies:** 28\
**Last updated:** [August 20, 2018, 5:08pm UTC](https://discourse.julialang.org/t/faulty-transpose-and-adjoint-multiplication/13742 "2018-08-20T17:08:29Z")

</div>

a = transpose(\[-6.5\]) b = \[0, .95\]' Matrix(a) \* Matrix(b) # Calling \`Matrix\` a \* b # Without calling \`Matrix\` ERROR: DimensionMismatch("Cannot multiply two vectors") size(a) (1, 1) size(b) (1, 2) Is this intentional o…

---

## [Pkg environments, and branches](https://discourse.julialang.org/t/pkg-environments-and-branches/13775)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 0\
**Last updated:** [August 20, 2018, 4:53pm UTC](https://discourse.julialang.org/t/pkg-environments-and-branches/13775 "2018-08-20T16:53:40Z")

</div>

I have a package that depends on Feather#master (as in: st shows Feather v0.3.1+ #master). That package is currently the only package in v0.7: (v0.7) pkg\> st Status \`~/.julia/environments/v0.7/Project.toml\` \[78207…

---

## [Source Line number for runtime errors is way off](https://discourse.julialang.org/t/source-line-number-for-runtime-errors-is-way-off/13772)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 0\
**Last updated:** [August 20, 2018, 4:37pm UTC](https://discourse.julialang.org/t/source-line-number-for-runtime-errors-is-way-off/13772 "2018-08-20T16:37:57Z")

</div>

I just wonder if someone else has seen this. With one of my source files, 0.7 reports the line number where an error has occurred as off by more than 20 lines. Makes debugging mighty hard. I can’t figure out the patte…

---

## [Glvisualize suffering from bit rot, alternates?](https://discourse.julialang.org/t/glvisualize-suffering-from-bit-rot-alternates/13538)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 23\
**Last updated:** [August 20, 2018, 4:04pm UTC](https://discourse.julialang.org/t/glvisualize-suffering-from-bit-rot-alternates/13538 "2018-08-20T16:04:22Z")

</div>

I need something that will display “voxelized” graphics for some finite-difference code, i.e. I want to display the problem space in as the discrete blocks that make up the geometry. I thought GLvisualize would be perfe…

---

## [Pkg3 for package developers](https://discourse.julialang.org/t/pkg3-for-package-developers/13040)

<div class="topic-metadata">

**Author:** [@denizyuret](https://discourse.julialang.org/u/denizyuret)\
**Replies:** 9\
**Last updated:** [August 20, 2018, 3:08pm UTC](https://discourse.julialang.org/t/pkg3-for-package-developers/13040 "2018-08-20T15:08:37Z")

</div>

What are the steps to prepare an existing package for 0.7/1.0? Do we keep REQUIRE, add a new Project.toml, what is my UUID etc? To change dependencies do we use pkg\> add or do we modify REQUIRE? How do the two interac…

---

## ["We find that global names \[sic\] are frequently constants, and declaring them as such greatly improves performance"](https://discourse.julialang.org/t/we-find-that-global-names-sic-are-frequently-constants-and-declaring-them-as-such-greatly-improves-performance/13738)

<div class="topic-metadata">

**Author:** [@chrisjj](https://discourse.julialang.org/u/chrisjj)\
**Replies:** 8\
**Last updated:** [August 20, 2018, 1:28pm UTC](https://discourse.julialang.org/t/we-find-that-global-names-sic-are-frequently-constants-and-declaring-them-as-such-greatly-improves-performance/13738 "2018-08-20T13:28:10Z")

</div>

(From https://docs.julialang.org/en/stable/manual/performance-tips/#man-performance-tips-1 ) Really?? Does the compiler not itself determine that a global variable value is constant, and optimise accordingly?

---

## [Union{Nothing, T} vs Union{Nothing, Some{T}) -- I don't understand the utility of Some(nothing)](https://discourse.julialang.org/t/union-nothing-t-vs-union-nothing-some-t-i-dont-understand-the-utility-of-some-nothing/13639)

<div class="topic-metadata">

**Author:** [@galenlynch](https://discourse.julialang.org/u/galenlynch)\
**Replies:** 7\
**Last updated:** [August 20, 2018, 1:16pm UTC](https://discourse.julialang.org/t/union-nothing-t-vs-union-nothing-some-t-i-dont-understand-the-utility-of-some-nothing/13639 "2018-08-20T13:16:11Z")

</div>

I’m trying to figure out what to do with my code that uses Nullable. After looking at the documentation, some posts on here, and this blog post I don’t really understand when to use Union{Nothing, Some{T}} over Union{Not…

---

## [Is there any way to get ASTs' free vars and bound names when performing macros?](https://discourse.julialang.org/t/is-there-any-way-to-get-asts-free-vars-and-bound-names-when-performing-macros/13747)

<div class="topic-metadata">

**Author:** [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Replies:** 7\
**Last updated:** [August 20, 2018, 9:34am UTC](https://discourse.julialang.org/t/is-there-any-way-to-get-asts-free-vars-and-bound-names-when-performing-macros/13747 "2018-08-20T09:34:25Z")

</div>

@mymacro function (arg1, arg2) bound1 = arg1 + arg2 bound2 = bound1 + closure1 .... end Is there any builtin tool to supply this sort of analysis?

---

## [How does Pkg preview work?](https://discourse.julialang.org/t/how-does-pkg-preview-work/13752)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 2\
**Last updated:** [August 20, 2018, 9:04am UTC](https://discourse.julialang.org/t/how-does-pkg-preview-work/13752 "2018-08-20T09:04:52Z")

</div>

I canät seem to figure out how to make use of pkg preview. Here’s what I have tried (v1.0) pkg\> preview pkg"add DSP" ERROR: Wrong number of arguments (v1.0) pkg\> preview add ERROR: MethodError: Cannot \`convert\` an obje…

---

## [Missing \`\\\` method in Julia 1.0 (SparseMatrixCSC{Int64,Int64} \\ Vector{Float64})](https://discourse.julialang.org/t/missing-method-in-julia-1-0-sparsematrixcsc-int64-int64-vector-float64/13739)

<div class="topic-metadata">

**Author:** [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Replies:** 6\
**Last updated:** [August 20, 2018, 8:03am UTC](https://discourse.julialang.org/t/missing-method-in-julia-1-0-sparsematrixcsc-int64-int64-vector-float64/13739 "2018-08-20T08:03:54Z")

</div>

X::SparseMatrixCSC{Int64,Int64} y::Vector{Float64} X \\ y ERROR: MethodError: no method matching lu!(::SparseArrays.SparseMatrixCSC{Float64,Int64}, ::Val{false}; check=false) Is there a replacement for it in Julia 1.0?

---

## [Vector re-size](https://discourse.julialang.org/t/vector-re-size/13733)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 9\
**Last updated:** [August 20, 2018, 7:36am UTC](https://discourse.julialang.org/t/vector-re-size/13733 "2018-08-20T07:36:43Z")

</div>

So I have two vector of vectors like: matchings\_vec = Vector{Vector{Vector{Vector{Any}}}}(num\_tilt1) Minfoall\_vec = Vector{Vector{Vector{Vector{Vector{Vector{Float64}}}}}}(num\_tilt1) I defined it as: matchings\_vec …

---

## [Running terminal script mac osx to open web browser](https://discourse.julialang.org/t/running-terminal-script-mac-osx-to-open-web-browser/13153)

<div class="topic-metadata">

**Author:** [@Nakul\_Tiruviluamala](https://discourse.julialang.org/u/Nakul_Tiruviluamala)\
**Replies:** 6\
**Last updated:** [August 20, 2018, 7:27am UTC](https://discourse.julialang.org/t/running-terminal-script-mac-osx-to-open-web-browser/13153 "2018-08-20T07:27:04Z")

</div>

Hi guys, I am trying to have a shell command within a julia script. For instance, I am trying to open safari to a specific page. Any help would be greatly appreciated. Thanks! Nakul

---

## [Vector of vectors](https://discourse.julialang.org/t/vector-of-vectors/13748)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 1\
**Last updated:** [August 20, 2018, 5:51am UTC](https://discourse.julialang.org/t/vector-of-vectors/13748 "2018-08-20T05:51:50Z")

</div>

Hi everyone! I am trying to resize the inner vectors but I am confused as to what I am doing wrong. A = \[Vector{Any}() for i in 1:6\] and then: a, b, c, d = 3, 4, 5, 6 for tt = 1:6 a+=1 resize!(A\[tt\], a) f…

---

## [Differences between \`for i = 1:2, j = 1:3\` and \`for i = 1:2 for j = 1:3\` in comprehensions](https://discourse.julialang.org/t/differences-between-for-i-1-2-j-1-3-and-for-i-1-2-for-j-1-3-in-comprehensions/13744)

<div class="topic-metadata">

**Author:** [@xinhangliu](https://discourse.julialang.org/u/xinhangliu)\
**Replies:** 1\
**Last updated:** [August 20, 2018, 2:20am UTC](https://discourse.julialang.org/t/differences-between-for-i-1-2-j-1-3-and-for-i-1-2-for-j-1-3-in-comprehensions/13744 "2018-08-20T02:20:19Z")

</div>

Hi guys, I am confused about these two expressions, why are their results different? julia\> \[(i, j) for i = 1:2 for j = 1:3\] 6-element Array{Tuple{Int64,Int64},1}: (1, 1) (1, 2) (1, 3) (2, 1) (2, 2) (2, 3) julia\> …

---

## [Julia 0.6.3 and 0.6.4 stall on start up](https://discourse.julialang.org/t/julia-0-6-3-and-0-6-4-stall-on-start-up/13549)

<div class="topic-metadata">

**Author:** [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Replies:** 3\
**Last updated:** [August 20, 2018, 2:15am UTC](https://discourse.julialang.org/t/julia-0-6-3-and-0-6-4-stall-on-start-up/13549 "2018-08-20T02:15:38Z")

</div>

Julia 0.6.3 used to work just fine on my machine for quite some time, but since this morning it stalls after displaying the usual julia banner, i.e. I get to see \_ \_ \_(\_)\_ | A fresh approach to technical c…

---

## [Libdl.dlopen a dylib that depends on another dylib](https://discourse.julialang.org/t/libdl-dlopen-a-dylib-that-depends-on-another-dylib/13673)

<div class="topic-metadata">

**Author:** [@felipenoris](https://discourse.julialang.org/u/felipenoris)\
**Replies:** 4\
**Last updated:** [August 20, 2018, 2:06am UTC](https://discourse.julialang.org/t/libdl-dlopen-a-dylib-that-depends-on-another-dylib/13673 "2018-08-20T02:06:22Z")

</div>

I’m working on a fork of Mongo.jl and I set up a repo just to build the MongoDB C library, which provides the C libs libbson and libmongoc. I’m having trouble loading libmongoc dynamic library on OSX because of path iss…

---

## [Unexpectedly slow performance of "eigs" with a Hermitian view](https://discourse.julialang.org/t/unexpectedly-slow-performance-of-eigs-with-a-hermitian-view/13701)

<div class="topic-metadata">

**Author:** [@danielericparker](https://discourse.julialang.org/u/danielericparker)\
**Replies:** 6\
**Last updated:** [August 20, 2018, 1:28am UTC](https://discourse.julialang.org/t/unexpectedly-slow-performance-of-eigs-with-a-hermitian-view/13701 "2018-08-20T01:28:48Z")

</div>

Solving quantum mechanics problems numerically (via the so-called “exact diagonalization” method) requires finding the lowest several eigenvalue and eigenvector of a large sparse Hermitian matrix. Since one wants to do t…

---

## [Pkg: what do the colors and symbols mean when updating?](https://discourse.julialang.org/t/pkg-what-do-the-colors-and-symbols-mean-when-updating/13698)

<div class="topic-metadata">

**Author:** [@galenlynch](https://discourse.julialang.org/u/galenlynch)\
**Replies:** 3\
**Last updated:** [August 20, 2018, 12:29am UTC](https://discourse.julialang.org/t/pkg-what-do-the-colors-and-symbols-mean-when-updating/13698 "2018-08-20T00:29:34Z")

</div>

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

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