# General Usage

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

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

**Page:** 629

---

## [I got a really long error stack. I can't see the context and what the actual error](https://discourse.julialang.org/t/i-got-a-really-long-error-stack-i-cant-see-the-context-and-what-the-actual-error/57147)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 15, 2021, 12:08am UTC](https://discourse.julialang.org/t/i-got-a-really-long-error-stack-i-cant-see-the-context-and-what-the-actual-error/57147 "2021-03-15T00:08:49Z")

</div>

I got a really long error stack. I can’t see the context and what the actual error was in the REPL. How should I make the REPL “longer” so I can scroll up more to see the error and the context of the error? I’m using VSC…

---

## [Making string to float conversion faster?](https://discourse.julialang.org/t/making-string-to-float-conversion-faster/57146)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 16\
**Last updated:** [March 14, 2021, 11:31pm UTC](https://discourse.julialang.org/t/making-string-to-float-conversion-faster/57146 "2021-03-14T23:31:16Z")

</div>

i have to read a 50,000,000 line file and it’s currently taking about 1.5s/million lines, which means it takes on the order of 80s to pull in the whole file (I do have to mention that my fairly non-trivial math on the 50…

---

## [Couple of questions about namedpipes](https://discourse.julialang.org/t/couple-of-questions-about-namedpipes/57012)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 0\
**Last updated:** [March 12, 2021, 10:34am UTC](https://discourse.julialang.org/t/couple-of-questions-about-namedpipes/57012 "2021-03-12T10:34:31Z")

</div>

Hey All :slight\_smile: I’m trying to communicate from Julia to Python via namedpipes. I open a pipe in julia julia\> s = listen("\\\\\\\\.\\\\pipe\\\\p123") Sockets.PipeServer(Base.Libc.WindowsRawSocket(0x0000000000000708) acti…

---

## [Improvement on appending data using for loop](https://discourse.julialang.org/t/improvement-on-appending-data-using-for-loop/56686)

<div class="topic-metadata">

**Author:** [@FlatWhite17](https://discourse.julialang.org/u/FlatWhite17)\
**Replies:** 4\
**Last updated:** [March 14, 2021, 4:26pm UTC](https://discourse.julialang.org/t/improvement-on-appending-data-using-for-loop/56686 "2021-03-14T16:26:22Z")

</div>

Hi there, I’m from a non-CS background and new to Julia. My current project involves a matching process where for each treated unit (D=1), I need to find units in the donor space (D=0) that have variance of their outcom…

---

## [Problem invoking \`--bug-report=rr\` in a docker image. I have the following package](https://discourse.julialang.org/t/problem-invoking-bug-report-rr-in-a-docker-image-i-have-the-following-package/57134)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 14, 2021, 4:17pm UTC](https://discourse.julialang.org/t/problem-invoking-bug-report-rr-in-a-docker-image-i-have-the-following-package/57134 "2021-03-14T16:17:11Z")

</div>

Problem invoking --bug-report=rr in a docker image. I have the following packages installed in the Debian image: Status \`~/.julia/environments/v1.6/Project.toml\` \[bcf9a6e7\] BugReporting v0.1.3 \[7073ff75\] IJuli…

---

## [Best practice to combine Flux.jl and Convex.jl](https://discourse.julialang.org/t/best-practice-to-combine-flux-jl-and-convex-jl/57128)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 4\
**Last updated:** [March 14, 2021, 3:03pm UTC](https://discourse.julialang.org/t/best-practice-to-combine-flux-jl-and-convex-jl/57128 "2021-03-14T15:03:22Z")

</div>

I often use Convex.jl and Flux.jl. When I use them, it is really tough to combine them. Especially, I wanna train a network using Flux.jl when the loss function includes optimal values by solving optimisation problems u…

---

## [Matrix-Vector multiplication complex/real](https://discourse.julialang.org/t/matrix-vector-multiplication-complex-real/57129)

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 0\
**Last updated:** [March 14, 2021, 1:53pm UTC](https://discourse.julialang.org/t/matrix-vector-multiplication-complex-real/57129 "2021-03-14T13:53:18Z")

</div>

The functions executed for A\*y are different for A either real or complex.The first code uses BLAS gemv! (checked via @code\_native) A = rand(ComplexF64, n, n) y = rand(Float64, n) c = Vector{Complex64}(undef, n) mul!(…

---

## [Indexing assignment to arrays](https://discourse.julialang.org/t/indexing-assignment-to-arrays/57008)

<div class="topic-metadata">

**Author:** [@pshsr](https://discourse.julialang.org/u/pshsr)\
**Replies:** 4\
**Last updated:** [March 14, 2021, 12:37pm UTC](https://discourse.julialang.org/t/indexing-assignment-to-arrays/57008 "2021-03-14T12:37:13Z")

</div>

The documentation for indexing assignment in the Julia manual says that: If any index I\_k selects more than one location, then the right hand side X must be an array with the same shape as the result of indexing A\[I\_1,…

---

## [Fused broadcast cannot guess eltype](https://discourse.julialang.org/t/fused-broadcast-cannot-guess-eltype/57118)

<div class="topic-metadata">

**Author:** [@abraunst](https://discourse.julialang.org/u/abraunst)\
**Replies:** 1\
**Last updated:** [March 14, 2021, 12:35pm UTC](https://discourse.julialang.org/t/fused-broadcast-cannot-guess-eltype/57118 "2021-03-14T12:35:18Z")

</div>

x = sprand(10,10,0.1) z = Float64.(abs.(x)) gives MethodError: no method matching zero(::Type{Any}) Closest candidates are: zero(::Type{Union{Missing, T}}) where T at missing.jl:105 zero(!Matched::Union{Type{P}, P}…

---

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

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 19\
**Last updated:** [March 14, 2021, 10:14am UTC](https://discourse.julialang.org/t/vector-matrix-vector-multiplication/57087 "2021-03-14T10:14:19Z")

</div>

I want to calculate xMy, where M is a complex matrix given by M = (AB-CD)’ \* (AB-BC), and A,B,C,D are complex or real matrices, not of the same dimension, i.e. in general not square matrices. Some example matrices are gi…

---

## [Will using be deprecated in Julia 2.0?](https://discourse.julialang.org/t/will-using-be-deprecated-in-julia-2-0/57083)

<div class="topic-metadata">

**Author:** [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Replies:** 6\
**Last updated:** [March 14, 2021, 9:02am UTC](https://discourse.julialang.org/t/will-using-be-deprecated-in-julia-2-0/57083 "2021-03-14T09:02:09Z")

</div>

I saw this issue in Julia 2.0 milestone. https://github.com/JuliaLang/julia/issues/39235 I was wondering if using will be deprecated in favor of import in Julia 2.0. If that is the case, I will stop using the using righ…

---

## [Hey julians. I found this one a little tricky to fix. I have a rosenbrock function](https://discourse.julialang.org/t/hey-julians-i-found-this-one-a-little-tricky-to-fix-i-have-a-rosenbrock-function/57110)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 14, 2021, 7:26am UTC](https://discourse.julialang.org/t/hey-julians-i-found-this-one-a-little-tricky-to-fix-i-have-a-rosenbrock-function/57110 "2021-03-14T07:26:01Z")

</div>

Hey julians. I found this one a little tricky to fix. I have a rosenbrock function that takes 2 values and returns 1 value. So I was trying to run this as a comprehension, but I am getting out a (401,401) array, instead …

---

## [Problem with using IJulia](https://discourse.julialang.org/t/problem-with-using-ijulia/57086)

<div class="topic-metadata">

**Author:** [@Francesco-Cerutti](https://discourse.julialang.org/u/Francesco-Cerutti)\
**Replies:** 3\
**Last updated:** [March 14, 2021, 7:05am UTC](https://discourse.julialang.org/t/problem-with-using-ijulia/57086 "2021-03-14T07:05:17Z")

</div>

Hi, i’m new to the community and this is the first time using Julia languege, so i’m at the beginig. My problem is the follow: when I try to use IJulia the system answer me with this message : ERROR: LoadError: IJuli…

---

## [@benchmark resize! : no memory allocation?](https://discourse.julialang.org/t/benchmark-resize-no-memory-allocation/57112)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 5\
**Last updated:** [March 14, 2021, 6:49am UTC](https://discourse.julialang.org/t/benchmark-resize-no-memory-allocation/57112 "2021-03-14T06:49:55Z")

</div>

julia\> using BenchmarkTools julia\> x = zeros(10); julia\> @benchmark resize!($x, 10000) BenchmarkTools.Trial: memory estimate: 0 bytes allocs estimate: 0 -------------- minimum time: 2.499 ns (0.00% GC) …

---

## [sizeof(::Vector{Union{missing,T}}), and hypothetical size](https://discourse.julialang.org/t/sizeof-vector-union-missing-t-and-hypothetical-size/15271)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 12\
**Last updated:** [March 14, 2021, 6:42am UTC](https://discourse.julialang.org/t/sizeof-vector-union-missing-t-and-hypothetical-size/15271 "2021-03-14T06:42:51Z")

</div>

Two (related) questions: julia\> sizeof(vcat(ones(10), fill(missing, 10))) 160 but I expected 20\*9 because of the type tag, what am I missing? v"1.1.0-DEV.298". If I have a type T which is a Union, can I calculat…

---

## [A generic ’XPath’ suitable for YAML?](https://discourse.julialang.org/t/a-generic-xpath-suitable-for-yaml/57109)

<div class="topic-metadata">

**Author:** [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)\
**Replies:** 1\
**Last updated:** [March 14, 2021, 3:06am UTC](https://discourse.julialang.org/t/a-generic-xpath-suitable-for-yaml/57109 "2021-03-14T03:06:53Z")

</div>

\_\_\_\_ is toYAML as XPath is to XML? It sort of feels like this functionality is pretty generic, and I’m wondering if some package might help.

---

## [Luxor.jl for saving animated gifs?](https://discourse.julialang.org/t/luxor-jl-for-saving-animated-gifs/57107)

<div class="topic-metadata">

**Author:** [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)\
**Replies:** 0\
**Last updated:** [March 14, 2021, 2:46am UTC](https://discourse.julialang.org/t/luxor-jl-for-saving-animated-gifs/57107 "2021-03-14T02:46:52Z")

</div>

I’d like to save the ”Seam carving in action” in https://computationalthinking.mit.edu/Spring21/seam\_carving/ as an animated gif. (The last slider in the notebook.) Would Luxor.jl be a good tool for this?

---

## [Why is getindex not implemented for Iterators.ProductIterator?](https://discourse.julialang.org/t/why-is-getindex-not-implemented-for-iterators-productiterator/57065)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 16\
**Last updated:** [March 14, 2021, 12:58am UTC](https://discourse.julialang.org/t/why-is-getindex-not-implemented-for-iterators-productiterator/57065 "2021-03-14T00:58:50Z")

</div>

I find this behavior strange: s = Iterators.product(1:9, 10:19) c = collect(s) c\[5\] # works: (5, 10) s\[5\] # doesn't work ERROR: MethodError: no method matching getindex(::Base.Iterators.ProductIterator{Tuple{UnitRange{…

---

## [Alternative unit systems with Unitful.jl](https://discourse.julialang.org/t/alternative-unit-systems-with-unitful-jl/55359)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 14\
**Last updated:** [March 14, 2021, 12:52am UTC](https://discourse.julialang.org/t/alternative-unit-systems-with-unitful-jl/55359 "2021-03-14T00:52:36Z")

</div>

The docs for Unitful.jl describe how the package can be extended by defining new units and new unphysical dimensions. But there is no information about the correct procedure when one needs to alter the base dimensions an…

---

## [Display SVG in Jupyter notebook](https://discourse.julialang.org/t/display-svg-in-jupyter-notebook/3475)

<div class="topic-metadata">

**Author:** [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Replies:** 2\
**Last updated:** [March 13, 2021, 10:50pm UTC](https://discourse.julialang.org/t/display-svg-in-jupyter-notebook/3475 "2021-03-13T22:50:37Z")

</div>

I forgot how to do this. I have an SVG image in /tmp/t.svg and I want to display it in a Jupyter notebook. But as a graphic, not like this: I tried the obvious display(load("/tmp/t.svg")) but no luck: FileIO.File…

---

## [Free all packages at once](https://discourse.julialang.org/t/free-all-packages-at-once/57075)

<div class="topic-metadata">

**Author:** [@lferrant](https://discourse.julialang.org/u/lferrant)\
**Replies:** 1\
**Last updated:** [March 13, 2021, 8:52pm UTC](https://discourse.julialang.org/t/free-all-packages-at-once/57075 "2021-03-13T20:52:55Z")

</div>

Hi everyone, suppose I am deving several packages, say PkgA, PkgB, PkgC. Is there a shortcut (like free all or something) to free all packages at once without having to explicitly type all package names like in free Pkg…

---

## [I am getting\`\`\`using GadflyERROR: ArgumentError: Package Gadfly not found in cu](https://discourse.julialang.org/t/i-am-getting-using-gadflyerror-argumenterror-package-gadfly-not-found-in-cu/57088)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 13, 2021, 7:04pm UTC](https://discourse.julialang.org/t/i-am-getting-using-gadflyerror-argumenterror-package-gadfly-not-found-in-cu/57088 "2021-03-13T19:04:54Z")

</div>

I am getting using Gadfly ERROR: ArgumentError: Package Gadfly not found in current path: - Run \`import Pkg; Pkg.add("Gadfly")\` to install the Gadfly package. but I have julia&gt; ENV ENV Base.EnvDict with 29 entries:…

---

## [Select point from plot \[not hover needed\], Makie](https://discourse.julialang.org/t/select-point-from-plot-not-hover-needed-makie/57081)

<div class="topic-metadata">

**Author:** [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Replies:** 1\
**Last updated:** [March 13, 2021, 6:29pm UTC](https://discourse.julialang.org/t/select-point-from-plot-not-hover-needed-makie/57081 "2021-03-13T18:29:16Z")

</div>

Hello, while reading the documentation, I noticed that there is a section for interactivity and action on buttons, however I would like to know if it is possible to retrieve points from a plot by clicking on the plot?\[h…

---

## [How can I include a simple point on my graph using Plots.jl?](https://discourse.julialang.org/t/how-can-i-include-a-simple-point-on-my-graph-using-plots-jl/57058)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [March 13, 2021, 4:33pm UTC](https://discourse.julialang.org/t/how-can-i-include-a-simple-point-on-my-graph-using-plots-jl/57058 "2021-03-13T16:33:39Z")

</div>

How can I include a simple point on my graph using Plots.jl? Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate answer back to Slack, or pinging the …

---

## [Modifying ticks LScene (x,y,z) axis, Makie](https://discourse.julialang.org/t/modifying-ticks-lscene-x-y-z-axis-makie/57079)

<div class="topic-metadata">

**Author:** [@lazarusA](https://discourse.julialang.org/u/lazarusA)\
**Replies:** 2\
**Last updated:** [March 13, 2021, 3:41pm UTC](https://discourse.julialang.org/t/modifying-ticks-lscene-x-y-z-axis-makie/57079 "2021-03-13T15:41:19Z")

</div>

Hello, does anyone knows a quick way to modified the ticks in 3D plot? the following options don’t seem to work. axis = ax.scene\[OldAxis\] axis\[:xticks\] = (-1:1:1, \["start", "middle", "end"\]) axis\[:ticks\]\[:ranges\_label…

---

## [Sorting a sparse axis array](https://discourse.julialang.org/t/sorting-a-sparse-axis-array/57067)

<div class="topic-metadata">

**Author:** [@priod](https://discourse.julialang.org/u/priod)\
**Replies:** 0\
**Last updated:** [March 13, 2021, 11:00am UTC](https://discourse.julialang.org/t/sorting-a-sparse-axis-array/57067 "2021-03-13T11:00:00Z")

</div>

Hi, I am using the JuMP model, after the optimization process, I have a sparse axis array, I need to sort this array in the descending direction. How can I sort this? Thanking you in advance for the suggestions. The i…

---

## [Parse string to color](https://discourse.julialang.org/t/parse-string-to-color/56934)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 4\
**Last updated:** [March 13, 2021, 9:36am UTC](https://discourse.julialang.org/t/parse-string-to-color/56934 "2021-03-13T09:36:18Z")

</div>

Say I have a string "HSV(204,0.7,0.7)", how can I parse it to an instance of one of the ColorTypes types? MWE (I’m looking for function f): julia\> txt = "HSV(204,0.7,0.7)" "HSV(204,0.7,0.7)" julia\> f(txt) == HSV{Float…

---

## [How to extract flattened path data from SVG file](https://discourse.julialang.org/t/how-to-extract-flattened-path-data-from-svg-file/57027)

<div class="topic-metadata">

**Author:** [@arnief3](https://discourse.julialang.org/u/arnief3)\
**Replies:** 5\
**Last updated:** [March 13, 2021, 9:11am UTC](https://discourse.julialang.org/t/how-to-extract-flattened-path-data-from-svg-file/57027 "2021-03-13T09:11:11Z")

</div>

I have used the python library svgpathtools to accomplish this task in the past. Can anyone recommend a way to accomplish this in Julia or am I better off using svgpathtools via PyCall? I have been looking into Cairo.jl…

---

## [Parallelizing multiple Crank–Nicolson solvers](https://discourse.julialang.org/t/parallelizing-multiple-crank-nicolson-solvers/56861)

<div class="topic-metadata">

**Author:** [@jagot](https://discourse.julialang.org/u/jagot)\
**Replies:** 21\
**Last updated:** [March 13, 2021, 5:26am UTC](https://discourse.julialang.org/t/parallelizing-multiple-crank-nicolson-solvers/56861 "2021-03-13T05:26:41Z")

</div>

Problem I’m trying to parallelize my time propagator and not seeing very encouraging results. A simple part is where I exponentiate a lot of independent operators using Crank–Nicolson: b\_i = \\exp(-\\mathrm{i}\\delta t h…

---

## [Overhead of \`Threads.@threads\`](https://discourse.julialang.org/t/overhead-of-threads-threads/53964)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 30\
**Last updated:** [March 13, 2021, 4:01am UTC](https://discourse.julialang.org/t/overhead-of-threads-threads/53964 "2021-03-13T04:01:17Z")

</div>

There is a certain overhead of using \`Threads.@threads\` even if only a single threads is used.For example, running Julia v1.5.3 with julia --threads=1 yields julia\> using BenchmarkTools julia\> function foo\_serial…

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

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