# General Usage

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

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

**Page:** 640

---

## [Can't add any package](https://discourse.julialang.org/t/cant-add-any-package/55753)

<div class="topic-metadata">

**Author:** [@HoldenCaulfield](https://discourse.julialang.org/u/HoldenCaulfield)\
**Replies:** 4\
**Last updated:** [February 22, 2021, 5:14am UTC](https://discourse.julialang.org/t/cant-add-any-package/55753 "2021-02-22T05:14:35Z")

</div>

Hello. I suddenly realized that I cannot add any Julia packages. For instance, when I try using Pkg; Pkg.add("Revise") I get the following error (I have Julia 1.5.3 installed and been able to add packages a few days ago …

---

## [Julia.exe (portable 64 bit nightly and 1.6 rc) are infected?](https://discourse.julialang.org/t/julia-exe-portable-64-bit-nightly-and-1-6-rc-are-infected/55757)

<div class="topic-metadata">

**Author:** [@Humphrey\_Lee](https://discourse.julialang.org/u/Humphrey_Lee)\
**Replies:** 8\
**Last updated:** [February 22, 2021, 4:44am UTC](https://discourse.julialang.org/t/julia-exe-portable-64-bit-nightly-and-1-6-rc-are-infected/55757 "2021-02-22T04:44:10Z")

</div>

Tried couple downloads and running the julia.exe (1.6.0 rc and nightly - portable 64 bit versions) downloaded from julialang.org. Each time, the Symantec on my system (Win10) caught it with SONAR.Dropper (Trojan?). Pleas…

---

## [Displaying using Plotly() in VSCode](https://discourse.julialang.org/t/displaying-using-plotly-in-vscode/55754)

<div class="topic-metadata">

**Author:** [@loki](https://discourse.julialang.org/u/loki)\
**Replies:** 0\
**Last updated:** [February 22, 2021, 1:20am UTC](https://discourse.julialang.org/t/displaying-using-plotly-in-vscode/55754 "2021-02-22T01:20:57Z")

</div>

I recently stumbled across the plotly() backend for plots and like the functionality as it is very similar to Matlab. However, when I try to plot something from a script or the REPL using vscode on Linux, it always requi…

---

## [Convert 2d matrix to 3d](https://discourse.julialang.org/t/convert-2d-matrix-to-3d/55752)

<div class="topic-metadata">

**Author:** [@stephenll](https://discourse.julialang.org/u/stephenll)\
**Replies:** 1\
**Last updated:** [February 22, 2021, 12:32am UTC](https://discourse.julialang.org/t/convert-2d-matrix-to-3d/55752 "2021-02-22T00:32:46Z")

</div>

I have a large matrix, n x m in size. I like to convert it to a 3d matrix, taking k rows at a time. n is always divisible by k. newmatrix’s dimensions should be ‘k x M x n/k’ newmatrix\[:,:,1\] .= bigmat\[1:k,:\] newmat…

---

## [First try seems a bit sluggish](https://discourse.julialang.org/t/first-try-seems-a-bit-sluggish/55741)

<div class="topic-metadata">

**Author:** [@FaradayEnt](https://discourse.julialang.org/u/FaradayEnt)\
**Replies:** 5\
**Last updated:** [February 21, 2021, 11:58pm UTC](https://discourse.julialang.org/t/first-try-seems-a-bit-sluggish/55741 "2021-02-21T23:58:26Z")

</div>

I’m an old ‘C’ programmer, but total NB here, so guess I’m doing something wrong. Would like to write an application requiring CSV file I/O so found the following sample code. I’m on Win 7, using 64 bit julia-1.5.3 dow…

---

## [Elliptical plot markers with specifiable height and width?](https://discourse.julialang.org/t/elliptical-plot-markers-with-specifiable-height-and-width/52109)

<div class="topic-metadata">

**Author:** [@forestacorn](https://discourse.julialang.org/u/forestacorn)\
**Replies:** 3\
**Last updated:** [February 21, 2021, 11:46pm UTC](https://discourse.julialang.org/t/elliptical-plot-markers-with-specifiable-height-and-width/52109 "2021-02-21T23:46:40Z")

</div>

I would like to create a plot using elliptical markers where the height and width of the elliptical marker can be specified, for each point in my case. My intention is for the height to represent standard deviation at t…

---

## [New Pkg: how to check if a package is installed?](https://discourse.julialang.org/t/new-pkg-how-to-check-if-a-package-is-installed/13141)

<div class="topic-metadata">

**Author:** [@crbinz](https://discourse.julialang.org/u/crbinz)\
**Replies:** 4\
**Last updated:** [February 21, 2021, 11:09pm UTC](https://discourse.julialang.org/t/new-pkg-how-to-check-if-a-package-is-installed/13141 "2021-02-21T23:09:59Z")

</div>

For instance, if one wants to use OhMyREPL automatically upon startup, the docs say to put if isdir(Pkg.dir("OhMyREPL")) @eval using OhMyREPL else warn("OhMyREPL not installed") end into ~/.juliarc.jl. Putting …

---

## [Is there some syntax for passing a generator to a function taking variadic args? e](https://discourse.julialang.org/t/is-there-some-syntax-for-passing-a-generator-to-a-function-taking-variadic-args-e/55743)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 21, 2021, 10:49pm UTC](https://discourse.julialang.org/t/is-there-some-syntax-for-passing-a-generator-to-a-function-taking-variadic-args-e/55743 "2021-02-21T22:49:23Z")

</div>

Is there some syntax for passing a generator to a function taking variadic args? e.g. hcat(\[i, i, i\] for i in 1:10) I know I can splat an array, but the intermediate array seems unnecessary hcat(\[\[i, i, i\[ for i in 1:…

---

## [Local scope in macro](https://discourse.julialang.org/t/local-scope-in-macro/55705)

<div class="topic-metadata">

**Author:** [@colinclout12](https://discourse.julialang.org/u/colinclout12)\
**Replies:** 13\
**Last updated:** [February 21, 2021, 10:47pm UTC](https://discourse.julialang.org/t/local-scope-in-macro/55705 "2021-02-21T22:47:32Z")

</div>

I’m trying to figure out how to make variables defined in a let expression be visible in a hygienic macro which is evaluated in that let expression. macro insertx(x) x end let y = 5 @insertx(y) end \>UndefVarError:…

---

## [Documentation suggestion - noteworthy differences to other languages page](https://discourse.julialang.org/t/documentation-suggestion-noteworthy-differences-to-other-languages-page/55734)

<div class="topic-metadata">

**Author:** [@billtubbs](https://discourse.julialang.org/u/billtubbs)\
**Replies:** 0\
**Last updated:** [February 21, 2021, 6:46pm UTC](https://discourse.julialang.org/t/documentation-suggestion-noteworthy-differences-to-other-languages-page/55734 "2021-02-21T18:46:47Z")

</div>

I have a suggested change to the Noteworthy differences from Python page in the documentation but thought a discussion would be appropriate first since I’m not a Julia expert. For me, one of the key differences between …

---

## [Make broadcasted function return Matrix instead of Array of Arrays](https://discourse.julialang.org/t/make-broadcasted-function-return-matrix-instead-of-array-of-arrays/55729)

<div class="topic-metadata">

**Author:** [@Uroc327](https://discourse.julialang.org/u/Uroc327)\
**Replies:** 2\
**Last updated:** [February 21, 2021, 5:52pm UTC](https://discourse.julialang.org/t/make-broadcasted-function-return-matrix-instead-of-array-of-arrays/55729 "2021-02-21T17:52:49Z")

</div>

I have a function returning a (fixed and known-length) array for some input: function bitlevels(n, x) l = reverse(digits(x, base=2)) \[repeat(\[0\], n - length(l)); l\] end When broadcasting this function to a vect…

---

## [Weird IJulia issue \[Help! I really \]](https://discourse.julialang.org/t/weird-ijulia-issue-help-i-really/54877)

<div class="topic-metadata">

**Author:** [@Jojo\_Dad](https://discourse.julialang.org/u/Jojo_Dad)\
**Replies:** 5\
**Last updated:** [February 21, 2021, 10:57am UTC](https://discourse.julialang.org/t/weird-ijulia-issue-help-i-really/54877 "2021-02-21T10:57:55Z")

</div>

I have a weird IJulia issue. I have just installed the newest version of Julia (I tried both 1.5.3 and 1.6.0-rc1, they have the same issue). I am stuck in this loop: /Users/reiner\_hase/.julia/conda/3/bin/jupyter noteboo…

---

## [Error in initial\_population of Evolutionary.jl](https://discourse.julialang.org/t/error-in-initial-population-of-evolutionary-jl/55610)

<div class="topic-metadata">

**Author:** [@umbe](https://discourse.julialang.org/u/umbe)\
**Replies:** 3\
**Last updated:** [February 21, 2021, 9:34am UTC](https://discourse.julialang.org/t/error-in-initial-population-of-evolutionary-jl/55610 "2021-02-21T09:34:01Z")

</div>

Hello everybody, I’m having a weird issue using the package Evolutionary.jl. I tried to write a minimal example of my problem but unluckily, being too much simplified, the issue does not appear. Anyway, I’ll try to exp…

---

## [Is this expected \`hash\`ing behaviour?\`\`\`julia&gt; a = \[rand(0:1, 200) for i in 1:](https://discourse.julialang.org/t/is-this-expected-hash-ing-behaviour-julia-gt-a-rand-0-1-200-for-i-in-1/55510)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 21, 2021, 4:38am UTC](https://discourse.julialang.org/t/is-this-expected-hash-ing-behaviour-julia-gt-a-rand-0-1-200-for-i-in-1/55510 "2021-02-21T04:38:35Z")

</div>

Is this expected hashing behaviour? julia&gt; a = \[rand(0:1, 200) for i in 1:10000\] julia&gt; b = deepcopy(a) julia&gt; a\[1\]\[1\] = 2 julia&gt; hash(a) == hash(b) true It seems to be different with smaller vectors: juli…

---

## [Can we have a unified LaTex output interface for StatsKit?](https://discourse.julialang.org/t/can-we-have-a-unified-latex-output-interface-for-statskit/55695)

<div class="topic-metadata">

**Author:** [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Replies:** 5\
**Last updated:** [February 21, 2021, 2:04am UTC](https://discourse.julialang.org/t/can-we-have-a-unified-latex-output-interface-for-statskit/55695 "2021-02-21T02:04:50Z")

</div>

It would be great if we could have a unified LaTex output interface for the packages in StatsKit, so we can conveniently convert tabular data, statistical test results, and regression results into LaTex.

---

## [Read large stream from STDIN](https://discourse.julialang.org/t/read-large-stream-from-stdin/55627)

<div class="topic-metadata">

**Author:** [@tferic](https://discourse.julialang.org/u/tferic)\
**Replies:** 5\
**Last updated:** [February 20, 2021, 9:38pm UTC](https://discourse.julialang.org/t/read-large-stream-from-stdin/55627 "2021-02-20T21:38:25Z")

</div>

Hi I would like to use Julia to process large logfiles piped into STDIN, in order to create reports. The amount of data is too big to fit into RAM, so I need to process every line by line while reading the stream of da…

---

## [Zygote gradient accumulation?](https://discourse.julialang.org/t/zygote-gradient-accumulation/55654)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 2\
**Last updated:** [February 20, 2021, 7:15pm UTC](https://discourse.julialang.org/t/zygote-gradient-accumulation/55654 "2021-02-20T19:15:24Z")

</div>

I ported a neural network from pytorch to Flux and now I am immediately out of GPU memory. I would like to better understand allocations in the backward pass in Flux/Zygote. Say I have the following toy function: func…

---

## [Constructor compilation error](https://discourse.julialang.org/t/constructor-compilation-error/55662)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 3\
**Last updated:** [February 20, 2021, 6:26pm UTC](https://discourse.julialang.org/t/constructor-compilation-error/55662 "2021-02-20T18:26:22Z")

</div>

I have this very naive custom data structure and an associated constructor: module MyModule struct MyStruct{TG,TF\<:AbstractFloat} g::TG Δt::TF end function MyStruct(g::TG, Δt::TF) where {TG, TF\<:AbstractFloat}…

---

## [Is there any way in Julia to perform string interpolation after the string is decl](https://discourse.julialang.org/t/is-there-any-way-in-julia-to-perform-string-interpolation-after-the-string-is-decl/55688)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 20, 2021, 5:37pm UTC](https://discourse.julialang.org/t/is-there-any-way-in-julia-to-perform-string-interpolation-after-the-string-is-decl/55688 "2021-02-20T17:37:12Z")

</div>

Is there any way in Julia to perform string interpolation after the string is declared? For example in python I can do: &gt; x = "Hello, {}" &gt; x.format("friend") 'Hello, friend' So I can declare x with placeholders…

---

## [Converting - for loop to Cuarray dot syntax](https://discourse.julialang.org/t/converting-for-loop-to-cuarray-dot-syntax/55679)

<div class="topic-metadata">

**Author:** [@naviinkapoor](https://discourse.julialang.org/u/naviinkapoor)\
**Replies:** 8\
**Last updated:** [February 20, 2021, 3:59pm UTC](https://discourse.julialang.org/t/converting-for-loop-to-cuarray-dot-syntax/55679 "2021-02-20T15:59:37Z")

</div>

Hello Everyone, I need help to convert the below code to carry dot syntax From for i=1:j a\[i\] = a\[i\] + a\[i+j\] end I converted it to a\[1:j\].=a\[1:j\].+a\[1:j+j\] , but it is not working

---

## [How to avoid allocations when multiplying numbers with missings](https://discourse.julialang.org/t/how-to-avoid-allocations-when-multiplying-numbers-with-missings/55393)

<div class="topic-metadata">

**Author:** [@bgctw](https://discourse.julialang.org/u/bgctw)\
**Replies:** 15\
**Last updated:** [February 20, 2021, 3:50pm UTC](https://discourse.julialang.org/t/how-to-avoid-allocations-when-multiplying-numbers-with-missings/55393 "2021-02-20T15:50:27Z")

</div>

Coming from R I have a hard time to use missings and ensure type stability. I guess that the following allocations in multiplication of numbers also relate to this issue. How can I avoid the memory allocations in the fo…

---

## [What is the usuage of CUDA.ones()?](https://discourse.julialang.org/t/what-is-the-usuage-of-cuda-ones/55680)

<div class="topic-metadata">

**Author:** [@naviinkapoor](https://discourse.julialang.org/u/naviinkapoor)\
**Replies:** 0\
**Last updated:** [February 20, 2021, 3:37pm UTC](https://discourse.julialang.org/t/what-is-the-usuage-of-cuda-ones/55680 "2021-02-20T15:37:49Z")

</div>

What is the usage of CUDA.ones()? And where we use this normally?

---

## [Any equivalent to Pandas read\_html() in DataFrames.jl?](https://discourse.julialang.org/t/any-equivalent-to-pandas-read-html-in-dataframes-jl/55674)

<div class="topic-metadata">

**Author:** [@clibassi](https://discourse.julialang.org/u/clibassi)\
**Replies:** 1\
**Last updated:** [February 20, 2021, 3:24pm UTC](https://discourse.julialang.org/t/any-equivalent-to-pandas-read-html-in-dataframes-jl/55674 "2021-02-20T15:24:51Z")

</div>

Hi all - Just wondering if there is an equivalent in Dataframes.jl to pandas’s read\_html() function for reading in HTML tables. I did some googling and looked through the docs and didn’t see anything - so I assume it’s …

---

## [Datastructure for two-way map](https://discourse.julialang.org/t/datastructure-for-two-way-map/52735)

<div class="topic-metadata">

**Author:** [@rikh](https://discourse.julialang.org/u/rikh)\
**Replies:** 12\
**Last updated:** [January 4, 2021, 4:18pm UTC](https://discourse.julialang.org/t/datastructure-for-two-way-map/52735 "2021-01-04T16:18:47Z")

</div>

Say that I have two vectors U and V defined as U = \["A", "D", "B"\] V = \["F", "G", "B"\] and I want to map from U to V, and V to U. Both vectors contain only unique elements. For a one-way mapping, this is easy via a Dic…

---

## [Hello all. I've been trying to use \`LsqFit\` to fit a hyperbolic tangent function t](https://discourse.julialang.org/t/hello-all-ive-been-trying-to-use-lsqfit-to-fit-a-hyperbolic-tangent-function-t/55649)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 2\
**Last updated:** [February 20, 2021, 7:33am UTC](https://discourse.julialang.org/t/hello-all-ive-been-trying-to-use-lsqfit-to-fit-a-hyperbolic-tangent-function-t/55649 "2021-02-20T07:33:17Z")

</div>

Hello all. I’ve been trying to use LsqFit to fit a hyperbolic tangent function to some data about terminal velocity in free fall. Using SciPy’s curve\_fit function, it seems to work fine. However, in Julia, it’s nowhere n…

---

## [Implicit nonlinear odes with variable mass matrix](https://discourse.julialang.org/t/implicit-nonlinear-odes-with-variable-mass-matrix/54499)

<div class="topic-metadata">

**Author:** [@clm](https://discourse.julialang.org/u/clm)\
**Replies:** 1\
**Last updated:** [February 20, 2021, 3:46am UTC](https://discourse.julialang.org/t/implicit-nonlinear-odes-with-variable-mass-matrix/54499 "2021-02-20T03:46:36Z")

</div>

Hi all. I’m quite new to Julia, moving over from Python and am mostly attracted by the more advanced differential equations solvers that let me incorporate mass matrices. I’m trying to use variable mass matrices in some …

---

## [Are there rational transfer functions available in Julia?](https://discourse.julialang.org/t/are-there-rational-transfer-functions-available-in-julia/55638)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 4\
**Last updated:** [February 20, 2021, 12:07am UTC](https://discourse.julialang.org/t/are-there-rational-transfer-functions-available-in-julia/55638 "2021-02-20T00:07:43Z")

</div>

Are there available rational transfer functions, possibly equivalent to MATLAB’s functions filter(b,1,x) and filter(b,a,x,zi) where zi are initial conditions for filter delays. Thanks in advance!

---

## [Type stability on Arrays of Arrays in nested for loops?](https://discourse.julialang.org/t/type-stability-on-arrays-of-arrays-in-nested-for-loops/55619)

<div class="topic-metadata">

**Author:** [@swishmas](https://discourse.julialang.org/u/swishmas)\
**Replies:** 16\
**Last updated:** [February 20, 2021, 12:01am UTC](https://discourse.julialang.org/t/type-stability-on-arrays-of-arrays-in-nested-for-loops/55619 "2021-02-20T00:01:52Z")

</div>

I was writing a function that would ideally be written as function ideal(supervec::Array{Array{Int64,1},1}, vec::Array{Int64,1}) return vcat(supervec\[vec\]) end But this takes a bit more time than I think is unn…

---

## [Hello, on my freshly installed julia v1.4.1 on Windows 10, when I do \`run(\`echo he](https://discourse.julialang.org/t/hello-on-my-freshly-installed-julia-v1-4-1-on-windows-10-when-i-do-run-echo-he/55655)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [February 19, 2021, 10:35pm UTC](https://discourse.julialang.org/t/hello-on-my-freshly-installed-julia-v1-4-1-on-windows-10-when-i-do-run-echo-he/55655 "2021-02-19T22:35:02Z")

</div>

Hello, on my freshly installed julia v1.4.1 on Windows 10, when I do run(echo hello) I get the following error, any idea what’s wrong ? run(\`echo hello\`) ERROR: IOError: could not spawn \`echo hello\`: no such file or dir…

---

## [Plots, text marker instead of markershape?](https://discourse.julialang.org/t/plots-text-marker-instead-of-markershape/55656)

<div class="topic-metadata">

**Author:** [@maajdl](https://discourse.julialang.org/u/maajdl)\
**Replies:** 1\
**Last updated:** [February 19, 2021, 10:26pm UTC](https://discourse.julialang.org/t/plots-text-marker-instead-of-markershape/55656 "2021-02-19T22:26:08Z")

</div>

Hello, Is it possible to write a number (or a text) as a marker instead of using a markershape ? Thanks Michel

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

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