# General Usage

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

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

**Page:** 878

---

## [Changing the values of a subvector returned by a function doesn't change the original vector.](https://discourse.julialang.org/t/changing-the-values-of-a-subvector-returned-by-a-function-doesnt-change-the-original-vector/22746)

<div class="topic-metadata">

**Author:** [@matteoneri](https://discourse.julialang.org/u/matteoneri)\
**Replies:** 11\
**Last updated:** [April 7, 2019, 9:41pm UTC](https://discourse.julialang.org/t/changing-the-values-of-a-subvector-returned-by-a-function-doesnt-change-the-original-vector/22746 "2019-04-07T21:41:25Z")

</div>

If I modify a subselection af an array, the array itself is modified (I assume the subselection is a reference to the same values. This behaviour is expected. 1×4 Array{Int64,2}: 1 2 3 4 julia\> v\[\[1 2\]\] = \[5 5\] 1×2…

---

## [Fastest Approach to reading Binary Files](https://discourse.julialang.org/t/fastest-approach-to-reading-binary-files/22888)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 2\
**Last updated:** [April 7, 2019, 8:33pm UTC](https://discourse.julialang.org/t/fastest-approach-to-reading-binary-files/22888 "2019-04-07T20:33:08Z")

</div>

Hey guys! I am using Julia 1.1 to read binary vtk files, in which some parameters are known and their corresponding filetype. My brother has made a script which utilizes the “readuntil” functionality to detect the attri…

---

## [A way to obtain the value and derivatives with ForwardDiff?](https://discourse.julialang.org/t/a-way-to-obtain-the-value-and-derivatives-with-forwarddiff/22862)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 4\
**Last updated:** [April 7, 2019, 7:00pm UTC](https://discourse.julialang.org/t/a-way-to-obtain-the-value-and-derivatives-with-forwarddiff/22862 "2019-04-07T19:00:41Z")

</div>

I have a function using ForwardDiff a(x) = 2x #(in reality this is a long function) dadx(x) = ForwardDiff.derivative(a, x) P(x) = a(x) +x\*dadx(x) ForwardDiff calculates at the same time the value and the derivative, th…

---

## [Using expression in output cell from Jupyter ](https://discourse.julialang.org/t/using-expression-in-output-cell-from-jupyter/22877)

<div class="topic-metadata">

**Author:** [@Dmitry\_Makarov](https://discourse.julialang.org/u/Dmitry_Makarov)\
**Replies:** 3\
**Last updated:** [April 7, 2019, 6:12pm UTC](https://discourse.julialang.org/t/using-expression-in-output-cell-from-jupyter/22877 "2019-04-07T18:12:45Z")

</div>

Hi, Using Sympy, I solved a parametric equation in Jupyter and got output cell of the form: { (a+b)/c } This is just an intermediate step, and I’d like to use this formula in subsequent input cells. But I am unable t…

---

## [Differences between a library and a module in julia?](https://discourse.julialang.org/t/differences-between-a-library-and-a-module-in-julia/22879)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [April 7, 2019, 3:38pm UTC](https://discourse.julialang.org/t/differences-between-a-library-and-a-module-in-julia/22879 "2019-04-07T15:38:41Z")

</div>

I’m mainly interested in the Base library in Julia. It looks like I can add my defined method as the following. julia\> import Base julia\> function Base.rand() println("my base") end I tried help?\> …

---

## [Isupercase with String Array how tu use?](https://discourse.julialang.org/t/isupercase-with-string-array-how-tu-use/22870)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 11\
**Last updated:** [April 7, 2019, 3:18pm UTC](https://discourse.julialang.org/t/isupercase-with-string-array-how-tu-use/22870 "2019-04-07T15:18:01Z")

</div>

isupercase with String Array how tu use ? How to convet Array a to Array of Char? julia\> a 3-element Array{String,1}: “a” “5” “A” julia\> isuppercase.(a) ERROR: MethodError: no method matching isuppercase(::String…

---

## ["ARPACKException: unspecified ARPACK error" when doing SVD of sparse matrix](https://discourse.julialang.org/t/arpackexception-unspecified-arpack-error-when-doing-svd-of-sparse-matrix/22753)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 5\
**Last updated:** [April 7, 2019, 2:26pm UTC](https://discourse.julialang.org/t/arpackexception-unspecified-arpack-error-when-doing-svd-of-sparse-matrix/22753 "2019-04-07T14:26:38Z")

</div>

I get the error ARPACKException: unspecified ARPACK error: when trying to find the SVD of a sparsematrix tildeK. SVD = svds(tildeK, nsv=2)\[1\]; ERROR: ARPACKException: unspecified ARPACK error: 1 Stacktrace: \[1\] aupd…

---

## [FFmpeg isn't found](https://discourse.julialang.org/t/ffmpeg-isnt-found/22769)

<div class="topic-metadata">

**Author:** [@Hugo\_276](https://discourse.julialang.org/u/Hugo_276)\
**Replies:** 4\
**Last updated:** [April 7, 2019, 1:52pm UTC](https://discourse.julialang.org/t/ffmpeg-isnt-found/22769 "2019-04-07T13:52:51Z")

</div>

Hi I’m trying to use Juno for Atom on Windonws 10 64 using the following code using Plots anim = Animation() p = plot(\[sin,cos\], 0, π, size=(300,300)) scatter!(\[0\], \[sin,cos\]) for i in 0:0.1:π p\[3\] = \[i\], \[sin(i)\] …

---

## [UndefValError in Julia](https://discourse.julialang.org/t/undefvalerror-in-julia/22867)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [April 7, 2019, 9:29am UTC](https://discourse.julialang.org/t/undefvalerror-in-julia/22867 "2019-04-07T09:29:44Z")

</div>

\_/ |\\\_\_'\_|\_|\_|\\\_\_'\_| | Official https://julialang.org/ release |\_\_/ | julia\> rand(MersenneTwister(0), Dict(1=\>2, 3=\>4)) ERROR: UndefVarError: MersenneTwister not defined Stacktrace: \[1\] top-level sc…

---

## [Basic I/O and more](https://discourse.julialang.org/t/basic-i-o-and-more/20940)

<div class="topic-metadata">

**Author:** [@binarygcd](https://discourse.julialang.org/u/binarygcd)\
**Replies:** 6\
**Last updated:** [April 7, 2019, 9:17am UTC](https://discourse.julialang.org/t/basic-i-o-and-more/20940 "2019-04-07T09:17:34Z")

</div>

Hi Everyone. I have some simple questions. 1 - What is the best(time and space wise) way to read 3 integers in a single line from stdin or a file? How about if there are arbitrary numbers of integers in a line and you n…

---

## [ERROR: Unsatisfiable requirements detected for package DebuggerFramework \[67417a49\]](https://discourse.julialang.org/t/error-unsatisfiable-requirements-detected-for-package-debuggerframework-67417a49/22866)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [April 7, 2019, 9:15am UTC](https://discourse.julialang.org/t/error-unsatisfiable-requirements-detected-for-package-debuggerframework-67417a49/22866 "2019-04-07T09:15:23Z")

</div>

\_/ |\\\_\_'\_|\_|\_|\\\_\_'\_| | Official https://julialang.org/ release |\_\_/ | julia\> import Pkg julia\> Pkg.add("Random") Updating registry at \`~/.julia/registries/General\` Updating git-repo \`https://gi…

---

## [What is rand(big(1:6))?](https://discourse.julialang.org/t/what-is-rand-big-1-6/22865)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 8\
**Last updated:** [April 7, 2019, 9:10am UTC](https://discourse.julialang.org/t/what-is-rand-big-1-6/22865 "2019-04-07T09:10:50Z")

</div>

I’m reading the Julia documentation following this link: https://fredrikekre.github.io/stdlib/Random.html and I encounter this one line of code: rand(big(1:6)) Somehow I can not find out this big(1:6)? Could anyone te…

---

## [length(Iterators.flatten(...)) not working](https://discourse.julialang.org/t/length-iterators-flatten-not-working/22846)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 7\
**Last updated:** [April 7, 2019, 8:49am UTC](https://discourse.julialang.org/t/length-iterators-flatten-not-working/22846 "2019-04-07T08:49:14Z")

</div>

using julia 1.1.0 the example taken from the documentation Iteration utilities · The Julia Language works, however while collect works, length throughs an error julia\> collect(Iterators.flatten((1:2, 8:9))) 4-element Ar…

---

## [The elements in the uninitialised array / vector?](https://discourse.julialang.org/t/the-elements-in-the-uninitialised-array-vector/22864)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 4\
**Last updated:** [April 7, 2019, 8:07am UTC](https://discourse.julialang.org/t/the-elements-in-the-uninitialised-array-vector/22864 "2019-04-07T08:07:14Z")

</div>

This is probably a simple question. The code is this: julia\> Vector{Float64}(undef,3) The output: 3-element Array{Float64,1}: 6.92297776986275e-310 6.92297776986354e-310 6.92297776986433e-310 I do not know what is ex…

---

## [Saving Decisiontree model using JLD and Load issue.](https://discourse.julialang.org/t/saving-decisiontree-model-using-jld-and-load-issue/22840)

<div class="topic-metadata">

**Author:** [@NaaG\_Balakrish](https://discourse.julialang.org/u/NaaG_Balakrish)\
**Replies:** 2\
**Last updated:** [April 7, 2019, 6:43am UTC](https://discourse.julialang.org/t/saving-decisiontree-model-using-jld-and-load-issue/22840 "2019-04-07T06:43:54Z")

</div>

Hi All, Good day. I built a DecisionTree model using Iris dataset. Below is the model output. DecisionTreeClassifier max\_depth: -1 min\_samples\_leaf: 1 min\_samples\_split: 2 min\_purity\_…

---

## [Issue arising from QR decomposition changes between 0.6 to 0.7](https://discourse.julialang.org/t/issue-arising-from-qr-decomposition-changes-between-0-6-to-0-7/17791)

<div class="topic-metadata">

**Author:** [@omalled](https://discourse.julialang.org/u/omalled)\
**Replies:** 7\
**Last updated:** [April 7, 2019, 1:42am UTC](https://discourse.julialang.org/t/issue-arising-from-qr-decomposition-changes-between-0-6-to-0-7/17791 "2019-04-07T01:42:15Z")

</div>

I have an implementation of Algorithm 4 from this paper that works on julia 0.6, but is failing on julia 0.7. The crux of the issue can be demonstrated with these two lines of code: U, T = qr(randn(10, 5))#analogous to …

---

## [Using WebIO with IJulia on AWS sever](https://discourse.julialang.org/t/using-webio-with-ijulia-on-aws-sever/22847)

<div class="topic-metadata">

**Author:** [@orhan\_abar](https://discourse.julialang.org/u/orhan_abar)\
**Replies:** 0\
**Last updated:** [April 6, 2019, 6:45pm UTC](https://discourse.julialang.org/t/using-webio-with-ijulia-on-aws-sever/22847 "2019-04-06T18:45:43Z")

</div>

Hello, I am developing the CurricularAnalytics toolbox and I am using Blink for terminal usage and WebIO scope for IJulia. It works fine at my local machine. But when create a server running Jupyter notebook it doesn’t …

---

## [How to use ~ in a Cmd](https://discourse.julialang.org/t/how-to-use-in-a-cmd/22844)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 1\
**Last updated:** [April 6, 2019, 6:25pm UTC](https://discourse.julialang.org/t/how-to-use-in-a-cmd/22844 "2019-04-06T18:25:32Z")

</div>

my goal is to run a command like ranger ~/.julia/ --choosefile=$(joinpath(homedir(),".julia")) however, i get this error when I try to use ~ in the path names julia\> run(\`ranger $("~/.julia/")\`) Inaccessible paths: \['…

---

## [Generating matrix random variables in Multi-Threaded mode with Distributions](https://discourse.julialang.org/t/generating-matrix-random-variables-in-multi-threaded-mode-with-distributions/22802)

<div class="topic-metadata">

**Author:** [@krenova](https://discourse.julialang.org/u/krenova)\
**Replies:** 2\
**Last updated:** [April 6, 2019, 3:17am UTC](https://discourse.julialang.org/t/generating-matrix-random-variables-in-multi-threaded-mode-with-distributions/22802 "2019-04-06T03:17:26Z")

</div>

I now understand (from Multi-threading) that I need to generate random seeds for each thread to avoid race conditions if I wish to speed up the generation of independent random variables. One good and straightforward way…

---

## [Pinv of matrix transpose?](https://discourse.julialang.org/t/pinv-of-matrix-transpose/22704)

<div class="topic-metadata">

**Author:** [@tawheeler](https://discourse.julialang.org/u/tawheeler)\
**Replies:** 5\
**Last updated:** [April 6, 2019, 2:13am UTC](https://discourse.julialang.org/t/pinv-of-matrix-transpose/22704 "2019-04-06T02:13:10Z")

</div>

I tried to use pinv on a transposed matrix and it surprisingly err’d out. What is the correct way to go about this? julia\> using LinearAlgebra julia\> A = rand(3,2) 3×2 Array{Float64,2}: 0.384492 0.512766 0.894825 0.8…

---

## [Fastest quadratic mixing rule?](https://discourse.julialang.org/t/fastest-quadratic-mixing-rule/22785)

<div class="topic-metadata">

**Author:** [@longemen3000](https://discourse.julialang.org/u/longemen3000)\
**Replies:** 2\
**Last updated:** [April 6, 2019, 12:55am UTC](https://discourse.julialang.org/t/fastest-quadratic-mixing-rule/22785 "2019-04-06T00:55:07Z")

</div>

I’m in need of a good mixing rule function. A mixing rule is a type of of weighed mean. if we have a property p and some weights x, a mixing rule is like this: p\_mixing = sum(op(pi,pj)\*xi\*xj for i,j = 1:N) the op(pi,pj…

---

## [How does constant propagation work?](https://discourse.julialang.org/t/how-does-constant-propagation-work/22735)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 5\
**Last updated:** [April 5, 2019, 8:46pm UTC](https://discourse.julialang.org/t/how-does-constant-propagation-work/22735 "2019-04-05T20:46:56Z")

</div>

Let’s say I start with the following: julia\> function f(x, y) if y \> 10 x + 1 else x \* 2 end end f (generic function with 1 method) julia\> @code\_warntype f(2, 20…

---

## [Error when adding. Pkg.add("ImageInTerminal")](https://discourse.julialang.org/t/error-when-adding-pkg-add-imageinterminal/22810)

<div class="topic-metadata">

**Author:** [@GERSON\_EZEQUIEL\_HERN](https://discourse.julialang.org/u/GERSON_EZEQUIEL_HERN)\
**Replies:** 1\
**Last updated:** [April 5, 2019, 7:48pm UTC](https://discourse.julialang.org/t/error-when-adding-pkg-add-imageinterminal/22810 "2019-04-05T19:48:59Z")

</div>

I’m trying to add ImageInTerminal I get an error, could someone help me solve it? julia\> Pkg.add("ImageInTerminal") Resolving package versions... Cloning \[d8c32880-2388-543b-8c61-d9f865259254\] ImageInTerminal from…

---

## [Add File or directory src / asset / segmentation / horse.jpg on Julia](https://discourse.julialang.org/t/add-file-or-directory-src-asset-segmentation-horse-jpg-on-julia/22811)

<div class="topic-metadata">

**Author:** [@GERSON\_EZEQUIEL\_HERN](https://discourse.julialang.org/u/GERSON_EZEQUIEL_HERN)\
**Replies:** 1\
**Last updated:** [April 5, 2019, 7:45pm UTC](https://discourse.julialang.org/t/add-file-or-directory-src-asset-segmentation-horse-jpg-on-julia/22811 "2019-04-05T19:45:07Z")

</div>

add File or directory src / asset / segmentation / horse.jpg on Julia. julia\> using Images, ImageView julia\> img = load("src/assets/segmentation/horse.jpg") Error encountered while loading "src/assets/segmentation/hors…

---

## [Multi-dimensional JuMP variable - setting the name](https://discourse.julialang.org/t/multi-dimensional-jump-variable-setting-the-name/22806)

<div class="topic-metadata">

**Author:** [@sakshi-mishra](https://discourse.julialang.org/u/sakshi-mishra)\
**Replies:** 2\
**Last updated:** [April 5, 2019, 5:20pm UTC](https://discourse.julialang.org/t/multi-dimensional-jump-variable-setting-the-name/22806 "2019-04-05T17:20:54Z")

</div>

Creating a JuMP variable using @variable macro in JuMP: @variable(model, x\[1:87, 1:5, 1:3\]) trying to set its name using JuMP.set\_name method. Problem: able to set the name of one variable in this multi-dimensional v…

---

## [Declare Union type as a function of which packages are installed](https://discourse.julialang.org/t/declare-union-type-as-a-function-of-which-packages-are-installed/22799)

<div class="topic-metadata">

**Author:** [@tpoisot](https://discourse.julialang.org/u/tpoisot)\
**Replies:** 4\
**Last updated:** [April 5, 2019, 4:57pm UTC](https://discourse.julialang.org/t/declare-union-type-as-a-function-of-which-packages-are-installed/22799 "2019-04-05T16:57:25Z")

</div>

Here’s my use case: I have a series of parametric types, Foo{T}, and I would like them to accept different values of T depending on whether or not some packages are installed. My current code is as follows: \_allowed\_sp…

---

## [Performance of filling an array](https://discourse.julialang.org/t/performance-of-filling-an-array/22788)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 9\
**Last updated:** [April 5, 2019, 3:53pm UTC](https://discourse.julialang.org/t/performance-of-filling-an-array/22788 "2019-04-05T15:53:18Z")

</div>

Ways to fill an array and performance. Peculiar to me that f6! does less allocations than the others and that f4! – f6! are faster than f1!. Is there an “official” way to fill an array? Does the performance difference …

---

## [Outer broadcasting?](https://discourse.julialang.org/t/outer-broadcasting/22701)

<div class="topic-metadata">

**Author:** [@tim](https://discourse.julialang.org/u/tim)\
**Replies:** 11\
**Last updated:** [April 5, 2019, 2:18pm UTC](https://discourse.julialang.org/t/outer-broadcasting/22701 "2019-04-05T14:18:19Z")

</div>

Hi, I would like to do something like the outer product for general operations. Basically, I f I have a function f(x1, x2, \[...\], xn) = \[...\] and I provide it with n arrays a1 … an as input, then I would like to apply…

---

## [Problem in the installing Julia 0.7](https://discourse.julialang.org/t/problem-in-the-installing-julia-0-7/22800)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 0\
**Last updated:** [April 5, 2019, 2:12pm UTC](https://discourse.julialang.org/t/problem-in-the-installing-julia-0-7/22800 "2019-04-05T14:12:50Z")

</div>

Hello Users, I am with a problem when I try to install the Julia version 0.7. The installer nomally run but when start the installation, a problem is reported: Anyone could help me, please?

---

## [GitError(Code:ERROR, Class:SSL, unexpected return value from ssl handshake -9806)](https://discourse.julialang.org/t/giterror-code-error-class-ssl-unexpected-return-value-from-ssl-handshake-9806/22781)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 3\
**Last updated:** [April 5, 2019, 1:59pm UTC](https://discourse.julialang.org/t/giterror-code-error-class-ssl-unexpected-return-value-from-ssl-handshake-9806/22781 "2019-04-05T13:59:49Z")

</div>

Hi, I wiped out my .julia and running \] up or \] add https://github.com/jheinen/GR.jl gives (v1.1) pkg\> add https://github.com/jheinen/GR.jl Cloning git-repo \`https://github.com/jheinen/GR.jl\` ERROR: failed to clone …

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

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