# General Usage

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

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

**Page:** 898

---

## [Neovim and LanguageServer](https://discourse.julialang.org/t/neovim-and-languageserver/20164)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 3\
**Last updated:** [January 30, 2019, 12:35am UTC](https://discourse.julialang.org/t/neovim-and-languageserver/20164 "2019-01-30T00:35:01Z")

</div>

Hi guys! Today I discover that we have a LanguageServer.jl package. However, I tried to install it with Neovim and all that I got was a Timeout message… Nothing worked, even the autocomplete. Can anyone help me?

---

## [PSA: replacement of ind2sub/sub2ind in Julia 0.7+](https://discourse.julialang.org/t/psa-replacement-of-ind2sub-sub2ind-in-julia-0-7/14666)

<div class="topic-metadata">

**Author:** [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Replies:** 35\
**Last updated:** [January 29, 2019, 5:11pm UTC](https://discourse.julialang.org/t/psa-replacement-of-ind2sub-sub2ind-in-julia-0-7/14666 "2019-01-29T17:11:20Z")

</div>

I’ve now seen a couple of cases where folks seem unhappy about the removal of the functions ind2sub and sub2ind. Some of the concerns may stem from the suggested replacement in the deprecation warning, as the replacement…

---

## [Attempting to assign to a pre-existing function name inside a function returns an UndefVarError](https://discourse.julialang.org/t/attempting-to-assign-to-a-pre-existing-function-name-inside-a-function-returns-an-undefvarerror/20199)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 4\
**Last updated:** [January 29, 2019, 4:56pm UTC](https://discourse.julialang.org/t/attempting-to-assign-to-a-pre-existing-function-name-inside-a-function-returns-an-undefvarerror/20199 "2019-01-29T16:56:53Z")

</div>

If I try to assign to a pre-existing function name in the global scope, I get a reasonable error: function foo(x) x end foo = foo(7) # ERROR: invalid redefinition of constant foo # Stacktrace: # \[1\] top-level scope…

---

## [Forcing @inline](https://discourse.julialang.org/t/forcing-inline/20225)

<div class="topic-metadata">

**Author:** [@rgankema](https://discourse.julialang.org/u/rgankema)\
**Replies:** 4\
**Last updated:** [January 29, 2019, 2:05pm UTC](https://discourse.julialang.org/t/forcing-inline/20225 "2019-01-29T14:05:15Z")

</div>

I’ve got a relatively large function, that I’d like to be inlined. Although I used the @inline annotation, the compiler apparently still decides that it’s not worth inlining. It might be right, but I really want to at le…

---

## [★ is not an operator](https://discourse.julialang.org/t/is-not-an-operator/20221)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 17\
**Last updated:** [January 29, 2019, 12:49pm UTC](https://discourse.julialang.org/t/is-not-an-operator/20221 "2019-01-29T12:49:06Z")

</div>

Just stumbled about the wish to use ★ as an operator. That does not work julia\> ★(a, b) = a + b ★ (generic function with 1 method) julia\> 1 ★ 3 ERROR: syntax: extra token "★" after end of expression when looking into j…

---

## [Running GC.gc() multiple times](https://discourse.julialang.org/t/running-gc-gc-multiple-times/20229)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 3\
**Last updated:** [January 29, 2019, 11:51am UTC](https://discourse.julialang.org/t/running-gc-gc-multiple-times/20229 "2019-01-29T11:51:51Z")

</div>

@ararslan said, about freeing memory: Try running gc() multiple times. It matches my experience that gc() needs to be called more than once. That was also true in SBCL. But why? Isn’t it a mark-and-sweep GC? All ac…

---

## [Is it always true that self-defined types/structs are quicker than using packages written by others? which do you prefer](https://discourse.julialang.org/t/is-it-always-true-that-self-defined-types-structs-are-quicker-than-using-packages-written-by-others-which-do-you-prefer/20142)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 3\
**Last updated:** [January 29, 2019, 8:35am UTC](https://discourse.julialang.org/t/is-it-always-true-that-self-defined-types-structs-are-quicker-than-using-packages-written-by-others-which-do-you-prefer/20142 "2019-01-29T08:35:27Z")

</div>

Hi, as the topic title goes, I hope this question is not naive. So what do you think then?

---

## [Matrix multiplication precision issue](https://discourse.julialang.org/t/matrix-multiplication-precision-issue/20172)

<div class="topic-metadata">

**Author:** [@Caesar\_KG](https://discourse.julialang.org/u/Caesar_KG)\
**Replies:** 13\
**Last updated:** [January 29, 2019, 8:35am UTC](https://discourse.julialang.org/t/matrix-multiplication-precision-issue/20172 "2019-01-29T08:35:20Z")

</div>

Why A1 and A2 have different precision and A1 != A2, though mathematically, they should have the same results. I’m wondering is there anything special about matrix slicing that would affect the precision? or the results …

---

## [Specifying keyword argument results in much slower code](https://discourse.julialang.org/t/specifying-keyword-argument-results-in-much-slower-code/20189)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 2\
**Last updated:** [January 29, 2019, 8:02am UTC](https://discourse.julialang.org/t/specifying-keyword-argument-results-in-much-slower-code/20189 "2019-01-29T08:02:57Z")

</div>

Hi, I noticed the performance regression in this simple test program of my package PseudoArcLengthContinuation.jl. I have a keyword argument which is only used for printing purposes so it should not affect the computati…

---

## [How to efficiently splat values into argument list?](https://discourse.julialang.org/t/how-to-efficiently-splat-values-into-argument-list/20177)

<div class="topic-metadata">

**Author:** [@ShnitzelKiller](https://discourse.julialang.org/u/ShnitzelKiller)\
**Replies:** 3\
**Last updated:** [January 28, 2019, 11:42pm UTC](https://discourse.julialang.org/t/how-to-efficiently-splat-values-into-argument-list/20177 "2019-01-28T23:42:17Z")

</div>

I’ve found that using generator syntax in argument lists seems to cause unwanted allocations. For example, I have a piece of code that does something very simple, taking the slices of a 3D array and turning them into RG…

---

## [Order theory: why isless is strict / issubset is loose by default?](https://discourse.julialang.org/t/order-theory-why-isless-is-strict-issubset-is-loose-by-default/20180)

<div class="topic-metadata">

**Author:** [@o314](https://discourse.julialang.org/u/o314)\
**Replies:** 5\
**Last updated:** [January 28, 2019, 10:55pm UTC](https://discourse.julialang.org/t/order-theory-why-isless-is-strict-issubset-is-loose-by-default/20180 "2019-01-28T22:55:49Z")

</div>

julia\> @test issubset(\[1,2\],\[1,2\]) # loose order Test Passed julia\> @test isless((1,2), (1,2)) == false # strict order Test Passed isless is defined in term of lexicographic order. scientific litterature (ben…

---

## [Check for undefined keyword](https://discourse.julialang.org/t/check-for-undefined-keyword/20193)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 3\
**Last updated:** [January 28, 2019, 9:37pm UTC](https://discourse.julialang.org/t/check-for-undefined-keyword/20193 "2019-01-28T21:37:10Z")

</div>

just stumbled upon julia’s keyword mechanism julia\> func(a; b::B) where B = a func (generic function with 1 method) julia\> func(1) ERROR: UndefKeywordError: keyword argument b not assigned Stacktrace: \[1\] func(::Int64…

---

## [What exactly is the meaning of \`\`\`!Matched\`\`\` in \`\`\`myFunction(::G,!Matched::M)\`\`\`?](https://discourse.julialang.org/t/what-exactly-is-the-meaning-of-matched-in-myfunction-g-matched-m/20145)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 3\
**Last updated:** [January 28, 2019, 9:14pm UTC](https://discourse.julialang.org/t/what-exactly-is-the-meaning-of-matched-in-myfunction-g-matched-m/20145 "2019-01-28T21:14:18Z")

</div>

MethodError: no method matching cG(::G, ::typeof(m)) Closest candidates are: cG(::G, !Matched::M) at /home/devel/Desktop/SDP\_me/g.jl:77 #initSim#155(::Bool, ::Bool, ::Bool, ::Bool, ::Function, ::String) at run\_c.jl:139…

---

## [JuliaDB - ML removed?](https://discourse.julialang.org/t/juliadb-ml-removed/20159)

<div class="topic-metadata">

**Author:** [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Replies:** 2\
**Last updated:** [January 28, 2019, 3:12am UTC](https://discourse.julialang.org/t/juliadb-ml-removed/20159 "2019-01-28T03:12:49Z")

</div>

Hi - I noticed with the latest update to JuliaDB that the ML/feature extraction part of the documentation has been removed. Is this being moved out of the package altogether?

---

## [ANN: LightQuery](https://discourse.julialang.org/t/ann-lightquery/16482)

<div class="topic-metadata">

**Author:** [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Replies:** 2\
**Last updated:** [January 28, 2019, 1:36am UTC](https://discourse.julialang.org/t/ann-lightquery/16482 "2019-01-28T01:36:50Z")

</div>

Hey, so this is actually a pretty cool one. If you’re an author of a query-like package, chances are, you only will need a few method wrappers to make your package compatible with LightQuery. Then, users can use LightQue…

---

## [Project environment](https://discourse.julialang.org/t/project-environment/20133)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 19\
**Last updated:** [January 27, 2019, 5:05pm UTC](https://discourse.julialang.org/t/project-environment/20133 "2019-01-27T17:05:42Z")

</div>

I have defined a project environment. One of the packages is listed in the Manifest file as \[\[H2Libjl\]\] deps = \["Arpack", "DelimitedFiles", "Distributed", "FinEtools", "JSON", "Libdl", "LinearAlgebra", "Random", "Sparse…

---

## [Code compatible to 1.0 and 0.6 - SOLVED -](https://discourse.julialang.org/t/code-compatible-to-1-0-and-0-6-solved/20150)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 4\
**Last updated:** [January 27, 2019, 3:45pm UTC](https://discourse.julialang.org/t/code-compatible-to-1-0-and-0-6-solved/20150 "2019-01-27T15:45:17Z")

</div>

The following code fails: if VERSION \>= v"0.7.0" ccall(:jl\_exit\_on\_sigint, Nothing, (Cint,), 0) else ccall(:jl\_exit\_on\_sigint, Void, (Cint,), 0) end with the warning on 0.7: WARNING: Base.Void is deprecated, use Not…

---

## [Is this an efficient way to write some information into a .csv file using julia?](https://discourse.julialang.org/t/is-this-an-efficient-way-to-write-some-information-into-a-csv-file-using-julia/20103)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 6\
**Last updated:** [January 27, 2019, 5:38am UTC](https://discourse.julialang.org/t/is-this-an-efficient-way-to-write-some-information-into-a-csv-file-using-julia/20103 "2019-01-27T05:38:17Z")

</div>

Is the following efficient? I was mainly concerned about the push! function. function writeToFile(filename::String, am::Vector{Am}) df=DataFrame(name1=Int\[\], name2=Int\[\], name3=Int\[\]) for a in am push!(df,\[a.name1,a…

---

## [Is this an efficient way to read a .csv file row by row?](https://discourse.julialang.org/t/is-this-an-efficient-way-to-read-a-csv-file-row-by-row/20056)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 9\
**Last updated:** [January 27, 2019, 5:34am UTC](https://discourse.julialang.org/t/is-this-an-efficient-way-to-read-a-csv-file-row-by-row/20056 "2019-01-27T05:34:51Z")

</div>

I have a .csv file and I’d like to read it row by row. The following is part of the code. Do you have better suggestions other than this? I’ve googled this, but the answers I found are quite old. \`\`\` df=CSV.read("the …

---

## [Julia environments with multiple workers](https://discourse.julialang.org/t/julia-environments-with-multiple-workers/20135)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 3\
**Last updated:** [January 27, 2019, 5:21am UTC](https://discourse.julialang.org/t/julia-environments-with-multiple-workers/20135 "2019-01-27T05:21:53Z")

</div>

How is the instantiation of an environment handled in multiple-worker settings? Should I run using Distributed @everywhere begin using Pkg Pkg.activate(".") end ? I do seem to get some warning messages about access t…

---

## [ArgumentError while using \`\`\`enumerate(CSV.File())\`\`\`: "..." is not a valid file](https://discourse.julialang.org/t/argumenterror-while-using-enumerate-csv-file-is-not-a-valid-file/20129)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [January 27, 2019, 5:08am UTC](https://discourse.julialang.org/t/argumenterror-while-using-enumerate-csv-file-is-not-a-valid-file/20129 "2019-01-27T05:08:22Z")

</div>

julia\> for (i,row) in enumerate(CSV.File("/home/devel/Desktop/SDP\_me/example/input/misc.csv")) println(i) end ERROR: ArgumentError: "/home/devel/Desktop/SDP\_me/example/input/misc.csv" is not a valid fil…

---

## [Way to make contour plot from 3 vectors?](https://discourse.julialang.org/t/way-to-make-contour-plot-from-3-vectors/20118)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 3\
**Last updated:** [January 27, 2019, 1:32am UTC](https://discourse.julialang.org/t/way-to-make-contour-plot-from-3-vectors/20118 "2019-01-27T01:32:21Z")

</div>

Just ran into this problem with Julia. It is a repeat of these questions though: Matlab:Make a contour plot with 3 vectors Create a contour plot from 3 vectors Contour plot with 3 vector Constructing a Contour Plot wit…

---

## [Dijkstra state?](https://discourse.julialang.org/t/dijkstra-state/20124)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [January 26, 2019, 8:53pm UTC](https://discourse.julialang.org/t/dijkstra-state/20124 "2019-01-26T20:53:22Z")

</div>

Hi, this is an easy task. I was wondering, what is the parameters of the dijkstra state in the following link: https://github.com/JuliaGraphs/LightGraphs.jl/blob/master/src/shortestpaths/dijkstra.jl struct DijkstraStat…

---

## [Invalid CPU name x86-64 error when building with MARCH=x86-64](https://discourse.julialang.org/t/invalid-cpu-name-x86-64-error-when-building-with-march-x86-64/20115)

<div class="topic-metadata">

**Author:** [@Pbellive](https://discourse.julialang.org/u/Pbellive)\
**Replies:** 4\
**Last updated:** [January 26, 2019, 8:05pm UTC](https://discourse.julialang.org/t/invalid-cpu-name-x86-64-error-when-building-with-march-x86-64/20115 "2019-01-26T20:05:40Z")

</div>

Hi all, I’m trying to build julia from source (up to date master branch commit cb7a569…) on a small cluster. This works fine with default options. However, the cluster nodes have different CPU types and I need a system …

---

## [Detection probability](https://discourse.julialang.org/t/detection-probability/20098)

<div class="topic-metadata">

**Author:** [@marouane](https://discourse.julialang.org/u/marouane)\
**Replies:** 8\
**Last updated:** [January 26, 2019, 5:12pm UTC](https://discourse.julialang.org/t/detection-probability/20098 "2019-01-26T17:12:44Z")

</div>

Hi Julia Community, i’m facing some problems with a code so i decided to run it part by part, and i have a problem with this code: function prob(q, na, mask) q0 = round(Int, q.\>0) m0 = round(Int, mask) …

---

## [Run markdown code blocks in Atom?](https://discourse.julialang.org/t/run-markdown-code-blocks-in-atom/20120)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 3\
**Last updated:** [January 26, 2019, 3:13pm UTC](https://discourse.julialang.org/t/run-markdown-code-blocks-in-atom/20120 "2019-01-26T15:13:33Z")

</div>

I quite enjoy the ability to run code blocks in a .jmd file directly inside atom. Would it somehow be possible to configure atom to run a ´´´julia ´´´ block in a regular markdown file (like README.md) in the same way? …

---

## [Only Specializing Broadcast on Likewise Types](https://discourse.julialang.org/t/only-specializing-broadcast-on-likewise-types/20117)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 1\
**Last updated:** [January 26, 2019, 3:27am UTC](https://discourse.julialang.org/t/only-specializing-broadcast-on-likewise-types/20117 "2019-01-26T03:27:56Z")

</div>

Okay, so I have this broadcast overload to do some crazy stuff on my array wrapper type A: struct A \<: AbstractVector{Float64} a::Vector{Float64} end Base.getindex(A::A,i...) = A.a\[i...\] Base.size(A::A) = size(A.a) …

---

## [How to get the row index of a csv file using \`\`\`for row in CSV.File(filename)\`\`\`?](https://discourse.julialang.org/t/how-to-get-the-row-index-of-a-csv-file-using-for-row-in-csv-file-filename/20113)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 2\
**Last updated:** [January 25, 2019, 11:47pm UTC](https://discourse.julialang.org/t/how-to-get-the-row-index-of-a-csv-file-using-for-row-in-csv-file-filename/20113 "2019-01-25T23:47:58Z")

</div>

Hi, I plan to read a .csv file using for row in CSV.File(filename) like the following: for row in CSV.File(filename) # parse the information stored in this row to a vector of my defined type end Now, I need to k…

---

## [How row-major-matrix format would have a better run-time performance?](https://discourse.julialang.org/t/how-row-major-matrix-format-would-have-a-better-run-time-performance/20092)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 6\
**Last updated:** [January 25, 2019, 10:08pm UTC](https://discourse.julialang.org/t/how-row-major-matrix-format-would-have-a-better-run-time-performance/20092 "2019-01-25T22:08:51Z")

</div>

Hi, I’m interested in the Dijkstra algorithm to find the shortest path. http://juliagraphs.github.io/LightGraphs.jl/latest/pathing.html#LightGraphs.dijkstra\_shortest\_paths When I was reading the documentation, I found t…

---

## [Addition to parameter of parametric type](https://discourse.julialang.org/t/addition-to-parameter-of-parametric-type/20059)

<div class="topic-metadata">

**Author:** [@maxtremblay](https://discourse.julialang.org/u/maxtremblay)\
**Replies:** 15\
**Last updated:** [January 25, 2019, 6:43pm UTC](https://discourse.julialang.org/t/addition-to-parameter-of-parametric-type/20059 "2019-01-25T18:43:20Z")

</div>

Hello, I want to create a struct X that has some parameter A that is an integer. Then, in that struct, I want to have two array, one of dimension A and one of dimension A + 2. Is there a nice way to implement it? Someth…

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

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