# General Usage

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

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

**Page:** 697

---

## [IOError: stat: operation not permitted when import new package](https://discourse.julialang.org/t/ioerror-stat-operation-not-permitted-when-import-new-package/47425)

<div class="topic-metadata">

**Author:** [@byteb](https://discourse.julialang.org/u/byteb)\
**Replies:** 1\
**Last updated:** [September 29, 2020, 7:45am UTC](https://discourse.julialang.org/t/ioerror-stat-operation-not-permitted-when-import-new-package/47425 "2020-09-29T07:45:28Z")

</div>

I have a Windows VM with two users: Administrator access Local user account (non-admin) access I have Julia installed in this Windows VM under the C:\\Julia folder. The Administrator use can install package and import …

---

## [Passing ARGS to multiple workers](https://discourse.julialang.org/t/passing-args-to-multiple-workers/47457)

<div class="topic-metadata">

**Author:** [@nkashaev](https://discourse.julialang.org/u/nkashaev)\
**Replies:** 2\
**Last updated:** [September 29, 2020, 2:36am UTC](https://discourse.julialang.org/t/passing-args-to-multiple-workers/47457 "2020-09-29T02:36:57Z")

</div>

I am trying to pass an argument from the terminal to a program that uses multiple cores. But ARGS appear to be visible only on the first worker. How can I push ARGS to all workers? For example, suppose test.jl contains …

---

## [How is my code selecting dispatch for constructor?](https://discourse.julialang.org/t/how-is-my-code-selecting-dispatch-for-constructor/47442)

<div class="topic-metadata">

**Author:** [@Aroeira](https://discourse.julialang.org/u/Aroeira)\
**Replies:** 1\
**Last updated:** [September 29, 2020, 12:14am UTC](https://discourse.julialang.org/t/how-is-my-code-selecting-dispatch-for-constructor/47442 "2020-09-29T00:14:32Z")

</div>

Hello, I need some help in understanding how Julia is selecting the constructor for my struct. Here is a brief context: I’ve been trying to think of ways to reduce the number of methods I have to code for a somewhat com…

---

## [Macro @everywhere](https://discourse.julialang.org/t/macro-everywhere/17917)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 16\
**Last updated:** [September 28, 2020, 5:33pm UTC](https://discourse.julialang.org/t/macro-everywhere/17917 "2020-09-28T17:33:15Z")

</div>

I tried running some scripts that use @everywhere. And I receive the following Alert: LoadError: LoadError: UndefVarError: @everywhere not defined in expression starting at D: \\ Julia SoftWare \\ Julia Scripts \\ julia…

---

## [How to test @inbounds / @boundscheck behavior?](https://discourse.julialang.org/t/how-to-test-inbounds-boundscheck-behavior/47419)

<div class="topic-metadata">

**Author:** [@platawiec](https://discourse.julialang.org/u/platawiec)\
**Replies:** 1\
**Last updated:** [September 28, 2020, 4:42pm UTC](https://discourse.julialang.org/t/how-to-test-inbounds-boundscheck-behavior/47419 "2020-09-28T16:42:52Z")

</div>

My understanding is that \]test will test a module with check-bounds=yes. However, one of the things I’d like to test is that when a user uses @inbounds, the function I create is no longer elided, in other words the sect…

---

## [Literals as expressions](https://discourse.julialang.org/t/literals-as-expressions/47415)

<div class="topic-metadata">

**Author:** [@mikepol](https://discourse.julialang.org/u/mikepol)\
**Replies:** 4\
**Last updated:** [September 28, 2020, 4:36pm UTC](https://discourse.julialang.org/t/literals-as-expressions/47415 "2020-09-28T16:36:25Z")

</div>

Hi, I’m trying to represent a literal as an Expr object, without success: julia\> :(5) |\> typeof Int64 julia\> Meta.parse("5") |\> typeof Int64 julia\> function foo(e::Expr) e end julia\> foo(:(5)) ERROR: MethodError: no …

---

## [Getting "UndefVarError: N0f8 not defined" error using @distributed](https://discourse.julialang.org/t/getting-undefvarerror-n0f8-not-defined-error-using-distributed/47230)

<div class="topic-metadata">

**Author:** [@libensvivit](https://discourse.julialang.org/u/libensvivit)\
**Replies:** 2\
**Last updated:** [September 28, 2020, 4:18pm UTC](https://discourse.julialang.org/t/getting-undefvarerror-n0f8-not-defined-error-using-distributed/47230 "2020-09-28T16:18:01Z")

</div>

using Distributed @everywhere using Colors; @sync @distributed for i = 1:10 zeros(RGB{N0f8}, 10, 10); end I’m having error running this code, why my workers don’t see the Colors module?

---

## [ERROR: LoadError: indexed assignment not defined for FloatRange{Float64}](https://discourse.julialang.org/t/error-loaderror-indexed-assignment-not-defined-for-floatrange-float64/1668)

<div class="topic-metadata">

**Author:** [@phillefjonk](https://discourse.julialang.org/u/phillefjonk)\
**Replies:** 8\
**Last updated:** [September 28, 2020, 4:14pm UTC](https://discourse.julialang.org/t/error-loaderror-indexed-assignment-not-defined-for-floatrange-float64/1668 "2020-09-28T16:14:35Z")

</div>

Why does this not work: xVector=0:0.01:2\*pi; yVector=0.0\*xVector; for n=1:length(xVector) yVector\[n\] = sin(xVector\[n\]) end plot(xVector, yVector) What is the correct way to do this?

---

## [Handy Script finding non-isbits fields](https://discourse.julialang.org/t/handy-script-finding-non-isbits-fields/47402)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 2\
**Last updated:** [September 28, 2020, 2:24pm UTC](https://discourse.julialang.org/t/handy-script-finding-non-isbits-fields/47402 "2020-09-28T14:24:21Z")

</div>

For performance optimization it is useful for your types to be isbits. But you can’t be isbits if you have any fields that are not. I made a quick script for tracking them down It turned out to need to be more complex…

---

## [Multiplying a 3d array by a scalar?](https://discourse.julialang.org/t/multiplying-a-3d-array-by-a-scalar/47376)

<div class="topic-metadata">

**Author:** [@amca01](https://discourse.julialang.org/u/amca01)\
**Replies:** 6\
**Last updated:** [September 28, 2020, 1:56pm UTC](https://discourse.julialang.org/t/multiplying-a-3d-array-by-a-scalar/47376 "2020-09-28T13:56:42Z")

</div>

I have an array A of size M,N,P, and a vector v of size P. And I want to multiply each “plane” A\[:,:,i\] of the array by v\[i\]. I can do this in a loop, or with two calls to reshape. But is there any way of doing it dir…

---

## [Correct way to dereference large memory?](https://discourse.julialang.org/t/correct-way-to-dereference-large-memory/47395)

<div class="topic-metadata">

**Author:** [@Ibb](https://discourse.julialang.org/u/Ibb)\
**Replies:** 6\
**Last updated:** [September 28, 2020, 1:34pm UTC](https://discourse.julialang.org/t/correct-way-to-dereference-large-memory/47395 "2020-09-28T13:34:02Z")

</div>

I want to read binary files into some large tuples by Ref, but my julia stuck at code below. julia\> a = Ref{NTuple{36000, UInt8}}() julia\> a\[\] #julia v1.5.2 will stuck here

---

## [A way to initialize an array without specifying its eltype in advance?](https://discourse.julialang.org/t/a-way-to-initialize-an-array-without-specifying-its-eltype-in-advance/47379)

<div class="topic-metadata">

**Author:** [@tomohiro\_soejima](https://discourse.julialang.org/u/tomohiro_soejima)\
**Replies:** 12\
**Last updated:** [September 28, 2020, 9:33am UTC](https://discourse.julialang.org/t/a-way-to-initialize-an-array-without-specifying-its-eltype-in-advance/47379 "2020-09-28T09:33:55Z")

</div>

Hi Often I would like to initialize an array without specifying an eltype in advance, even though I know all elements of the array will have the same concrete type. By way of example, function makesomearray() arr =…

---

## [Subarray view and parent indexing](https://discourse.julialang.org/t/subarray-view-and-parent-indexing/47388)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 0\
**Last updated:** [September 28, 2020, 3:39am UTC](https://discourse.julialang.org/t/subarray-view-and-parent-indexing/47388 "2020-09-28T03:39:03Z")

</div>

This snippet: using ImageMorphology a = reshape(collect(1:36), 6, 6) labels = label\_components(a .\> 16, trues(3,3)) box = component\_boxes(labels)\[2\] returns a bounding box: 2-element Array{Tuple{Int64,Int64},1}: (1,…

---

## [Short circuit evaluations documentation when using assignment statement](https://discourse.julialang.org/t/short-circuit-evaluations-documentation-when-using-assignment-statement/47358)

<div class="topic-metadata">

**Author:** [@rjmoses](https://discourse.julialang.org/u/rjmoses)\
**Replies:** 4\
**Last updated:** [September 28, 2020, 7:52am UTC](https://discourse.julialang.org/t/short-circuit-evaluations-documentation-when-using-assignment-statement/47358 "2020-09-28T07:52:56Z")

</div>

I love the idea of short circuit evaluations. Took me a while to figure out why a piece of code wasn’t working–short circuit evaluation documentation in the Manual section lacks clarity when using an assignment on the r…

---

## [Trying to understand how getindex works with vectors](https://discourse.julialang.org/t/trying-to-understand-how-getindex-works-with-vectors/47391)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [September 28, 2020, 5:44am UTC](https://discourse.julialang.org/t/trying-to-understand-how-getindex-works-with-vectors/47391 "2020-09-28T05:44:27Z")

</div>

I am trying to track down the functions that are being called when I’m evaluating julia\> A = 1:4 1:4 julia\> A\[A .\> 2\] 2-element Array{Int64,1}: 3 4 This starts with function getindex(A::AbstractArray, I...) @\_p…

---

## [Short functions or not: where would Julia fit?](https://discourse.julialang.org/t/short-functions-or-not-where-would-julia-fit/47327)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 14\
**Last updated:** [September 28, 2020, 3:11am UTC](https://discourse.julialang.org/t/short-functions-or-not-where-would-julia-fit/47327 "2020-09-28T03:11:26Z")

</div>

Are short functions a code smell?

---

## [Fast copy from stream to IOBuffer?](https://discourse.julialang.org/t/fast-copy-from-stream-to-iobuffer/42099)

<div class="topic-metadata">

**Author:** [@bobcassels](https://discourse.julialang.org/u/bobcassels)\
**Replies:** 7\
**Last updated:** [September 28, 2020, 12:49am UTC](https://discourse.julialang.org/t/fast-copy-from-stream-to-iobuffer/42099 "2020-09-28T00:49:54Z")

</div>

I need to read parts of a (binary) stream, and concatenate them, so I can read from that concatenated buffer. I’m reconstructing a thing that was packetized into segments. I see I can do write(iob, read(s, ...)), but I …

---

## [Can this random matrix simulation be sped up?](https://discourse.julialang.org/t/can-this-random-matrix-simulation-be-sped-up/47277)

<div class="topic-metadata">

**Author:** [@patrick](https://discourse.julialang.org/u/patrick)\
**Replies:** 16\
**Last updated:** [September 27, 2020, 11:09pm UTC](https://discourse.julialang.org/t/can-this-random-matrix-simulation-be-sped-up/47277 "2020-09-27T23:09:19Z")

</div>

I am a Julia novice and converted the following program from Python (for a simple practice exercise). It computes a N by N random matrix of quaternions, drawn from the Gaussian distribution, and then computes the smalles…

---

## [Matrix vector multiplication](https://discourse.julialang.org/t/matrix-vector-multiplication/47356)

<div class="topic-metadata">

**Author:** [@j\_tanu](https://discourse.julialang.org/u/j_tanu)\
**Replies:** 4\
**Last updated:** [September 27, 2020, 4:50pm UTC](https://discourse.julialang.org/t/matrix-vector-multiplication/47356 "2020-09-27T16:50:10Z")

</div>

I am doing a dense matrix-vector multiplication in a 64 core workstation. The order of the matrix is 11000. By default, BLAS is using only 8 threads. I have changed both the BLAS & JULIA(1.5.1) NUM\_THREADS and getting th…

---

## [TLS Libraries](https://discourse.julialang.org/t/tls-libraries/47268)

<div class="topic-metadata">

**Author:** [@cshenton](https://discourse.julialang.org/u/cshenton)\
**Replies:** 2\
**Last updated:** [September 27, 2020, 3:48pm UTC](https://discourse.julialang.org/t/tls-libraries/47268 "2020-09-27T15:48:40Z")

</div>

Are there any widely used TLS libraries in Julia, even non pure ones? The sockets API in stdlib is great but my use case isn’t over LAN so I need proper crypto and google searches don’t turn up an obvious choice for TLS…

---

## [Variable rate jumps diffeq?](https://discourse.julialang.org/t/variable-rate-jumps-diffeq/42356)

<div class="topic-metadata">

**Author:** [@mcreel](https://discourse.julialang.org/u/mcreel)\
**Replies:** 7\
**Last updated:** [September 27, 2020, 3:06pm UTC](https://discourse.julialang.org/t/variable-rate-jumps-diffeq/42356 "2020-09-27T15:06:01Z")

</div>

I’m trying to get a variable rate jump to work. I am using ## jump in price #rate1(u,p,t) = λ0 # constant jump rate rate1(u,p,t) = λ0.\*exp(u\[2\]) # volatility dependent jump rate # jump is normal with st. dev. equal to …

---

## [Nested lambda functions overhead: ideas for algebra of functions](https://discourse.julialang.org/t/nested-lambda-functions-overhead-ideas-for-algebra-of-functions/47335)

<div class="topic-metadata">

**Author:** [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Replies:** 9\
**Last updated:** [September 27, 2020, 2:49pm UTC](https://discourse.julialang.org/t/nested-lambda-functions-overhead-ideas-for-algebra-of-functions/47335 "2020-09-27T14:49:35Z")

</div>

I have an implementation of algebraic operations (addition, multiplication) with use-defined 1d functions for the purpose of the LLH fitting. The modular construction of PDFs is nice and handy, but I noticed a significa…

---

## [Pkg Error: Expected LinearAlgebra to be registered](https://discourse.julialang.org/t/pkg-error-expected-linearalgebra-to-be-registered/47315)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [September 27, 2020, 4:27am UTC](https://discourse.julialang.org/t/pkg-error-expected-linearalgebra-to-be-registered/47315 "2020-09-27T04:27:10Z")

</div>

I am trying to test the master branch of OffsetArrays.jl on julia 1.5.2 and encountering a strange error that I’ve not seen before. \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org …

---

## [Comparing GMM results](https://discourse.julialang.org/t/comparing-gmm-results/47322)

<div class="topic-metadata">

**Author:** [@DShiu](https://discourse.julialang.org/u/DShiu)\
**Replies:** 8\
**Last updated:** [September 26, 2020, 9:09pm UTC](https://discourse.julialang.org/t/comparing-gmm-results/47322 "2020-09-26T21:09:36Z")

</div>

I am working on implementing a linear GMM estimator in Julia. As a first step, I compare 2 ways of getting parameter estimates: numerically minimizing the loss function function LossFn(θ, y, X, Z) W = diagm(0 =\> one…

---

## [How to create an app from a Julia code that is writing and using other Julia files inside itself?](https://discourse.julialang.org/t/how-to-create-an-app-from-a-julia-code-that-is-writing-and-using-other-julia-files-inside-itself/47301)

<div class="topic-metadata">

**Author:** [@AmirHosein](https://discourse.julialang.org/u/AmirHosein)\
**Replies:** 2\
**Last updated:** [September 26, 2020, 7:01pm UTC](https://discourse.julialang.org/t/how-to-create-an-app-from-a-julia-code-that-is-writing-and-using-other-julia-files-inside-itself/47301 "2020-09-26T19:01:57Z")

</div>

I will explain my question in details using a super simple toy example in below. The structure of the code is as the following. Everything is in a folder called “Test\_making\_app”. This folder contains two julia files an…

---

## [Unable to add stdlib packages to environment in julia 1.5.2](https://discourse.julialang.org/t/unable-to-add-stdlib-packages-to-environment-in-julia-1-5-2/47328)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [September 26, 2020, 5:58pm UTC](https://discourse.julialang.org/t/unable-to-add-stdlib-packages-to-environment-in-julia-1-5-2/47328 "2020-09-26T17:58:14Z")

</div>

I have just downloaded Julia 1.5.2, and I’m facing a strange issue: \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | \_ \_ \_| |\_ \_\_ \_ | Type "?" for help, "\]?" for Pkg …

---

## [Multiple Dispatch - Call Abstract Type Function](https://discourse.julialang.org/t/multiple-dispatch-call-abstract-type-function/47311)

<div class="topic-metadata">

**Author:** [@akhil\_teja](https://discourse.julialang.org/u/akhil_teja)\
**Replies:** 2\
**Last updated:** [September 26, 2020, 3:12pm UTC](https://discourse.julialang.org/t/multiple-dispatch-call-abstract-type-function/47311 "2020-09-26T15:12:46Z")

</div>

I’m new to Julia and I have a problem with multiple dispatch. Consider below code: abstract type A end struct A1\<:A end struct A2\<:A end foo(a::A) = println("It's A") function foo(a::A1) # Do Something with A1 ty…

---

## [Brackets as an operator](https://discourse.julialang.org/t/brackets-as-an-operator/47305)

<div class="topic-metadata">

**Author:** [@Mikhail\_Kagalenko](https://discourse.julialang.org/u/Mikhail_Kagalenko)\
**Replies:** 10\
**Last updated:** [September 26, 2020, 12:55pm UTC](https://discourse.julialang.org/t/brackets-as-an-operator/47305 "2020-09-26T12:55:24Z")

</div>

Is there a way to define an operator not as a symbol, but as brackets? An example: a commutator \[a::MyType, b::Mytype\] = a\*b - b\*a

---

## [Segmentation fault in dot function](https://discourse.julialang.org/t/segmentation-fault-in-dot-function/47308)

<div class="topic-metadata">

**Author:** [@nebula](https://discourse.julialang.org/u/nebula)\
**Replies:** 3\
**Last updated:** [September 26, 2020, 12:32pm UTC](https://discourse.julialang.org/t/segmentation-fault-in-dot-function/47308 "2020-09-26T12:32:36Z")

</div>

Code : using LinearAlgebra function main() len = 100000 a = rand(Float64, len) b = rand(Float64, len) for i in 1:len u = @view a\[1:i\] b = b .- b\[1\] v = @view b\[i:-1:1\] b\[…

---

## [Connecting to sybase ase databases](https://discourse.julialang.org/t/connecting-to-sybase-ase-databases/46934)

<div class="topic-metadata">

**Author:** [@Hartshorn](https://discourse.julialang.org/u/Hartshorn)\
**Replies:** 6\
**Last updated:** [September 26, 2020, 12:10pm UTC](https://discourse.julialang.org/t/connecting-to-sybase-ase-databases/46934 "2020-09-26T12:10:59Z")

</div>

I have an interest in attempting to use Julia with a sybase database. Just looking for some ideas on if this might be possible / impossible or more of a challenge than its worth. Anyone with experience attempting this? …

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

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