# General Usage

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

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

**Page:** 693

---

## [Remote plotting using ssh and visual studio code](https://discourse.julialang.org/t/remote-plotting-using-ssh-and-visual-studio-code/48015)

<div class="topic-metadata">

**Author:** [@Dale\_James\_Black](https://discourse.julialang.org/u/Dale_James_Black)\
**Replies:** 2\
**Last updated:** [October 9, 2020, 6:28am UTC](https://discourse.julialang.org/t/remote-plotting-using-ssh-and-visual-studio-code/48015 "2020-10-09T06:28:20Z")

</div>

I am on a MacBook Pro and I am using visual studio code to ssh into my university cluster. I have XQuartz downloaded onto my MacBook and when I open up a basic terminal and remote into my cluster I can run commands like x…

---

## [Base.div vs Html.div - specialize or not?](https://discourse.julialang.org/t/base-div-vs-html-div-specialize-or-not/47776)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 29\
**Last updated:** [October 9, 2020, 12:25am UTC](https://discourse.julialang.org/t/base-div-vs-html-div-specialize-or-not/47776 "2020-10-09T00:25:10Z")

</div>

Dear Julians, I have a major dilemma. I’ve been going back and forth between how to handle this and I was wondering if there’s any best practice? There is a Html.div function which creates a HTML \<div\>...\</div\> element.…

---

## [Domain representation](https://discourse.julialang.org/t/domain-representation/47965)

<div class="topic-metadata">

**Author:** [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Replies:** 2\
**Last updated:** [October 8, 2020, 10:53pm UTC](https://discourse.julialang.org/t/domain-representation/47965 "2020-10-08T22:53:26Z")

</div>

Hi there! EDIT: I am trying to provide a type/structure overview, so please be patient if you want/need more details about my question I am writing a solver where I have to represent the domain of each variable. I was …

---

## [Generic code for elementwise minimum](https://discourse.julialang.org/t/generic-code-for-elementwise-minimum/22921)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 8\
**Last updated:** [October 8, 2020, 10:14pm UTC](https://discourse.julialang.org/t/generic-code-for-elementwise-minimum/22921 "2020-10-08T22:14:31Z")

</div>

I am wondering how to program a generic elementwise minimum of, say, vectors, with the following in mind: the result from an AbstractVector{T} is a T, eg SVector and Vector would be preserved. Data-generating MWE: usin…

---

## [Problem with optional argument with default value of missing](https://discourse.julialang.org/t/problem-with-optional-argument-with-default-value-of-missing/48002)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 2\
**Last updated:** [October 8, 2020, 9:25pm UTC](https://discourse.julialang.org/t/problem-with-optional-argument-with-default-value-of-missing/48002 "2020-10-08T21:25:29Z")

</div>

I have a small package CurrentPopulationSurvey.jl that I’m working on and in it I have the following function defined: function cpsdata(year::Int, month::Int, vars::Vector{String}=missing) data = readdlm(project\_pat…

---

## [Build.jl from command line vs. from Pkg.build()](https://discourse.julialang.org/t/build-jl-from-command-line-vs-from-pkg-build/48003)

<div class="topic-metadata">

**Author:** [@Graham\_Gill](https://discourse.julialang.org/u/Graham_Gill)\
**Replies:** 0\
**Last updated:** [October 8, 2020, 8:59pm UTC](https://discourse.julialang.org/t/build-jl-from-command-line-vs-from-pkg-build/48003 "2020-10-08T20:59:19Z")

</div>

In test/runtests.jl I have using Test using Logging using MyPackage #... but in test/Project.toml, MyPackage is not a dependency. I understand that when I’m in the main project folder and Pkg.activate("."), then Pkg.te…

---

## [Determine the scope of symbols in an Expr](https://discourse.julialang.org/t/determine-the-scope-of-symbols-in-an-expr/47993)

<div class="topic-metadata">

**Author:** [@Mason](https://discourse.julialang.org/u/Mason)\
**Replies:** 1\
**Last updated:** [October 8, 2020, 5:17pm UTC](https://discourse.julialang.org/t/determine-the-scope-of-symbols-in-an-expr/47993 "2020-10-08T17:17:48Z")

</div>

I asked about this on Zulip and cleaned it up and posted to Stack Overflow but I figure it might be helpful to cross pollinate here as well. I know I’ve wondered how to do this a few times, so probably other people have …

---

## [ANN: Data parallelism tutorial](https://discourse.julialang.org/t/ann-data-parallelism-tutorial/47824)

<div class="topic-metadata">

**Author:** [@tkf](https://discourse.julialang.org/u/tkf)\
**Replies:** 8\
**Last updated:** [October 8, 2020, 6:33pm UTC](https://discourse.julialang.org/t/ann-data-parallelism-tutorial/47824 "2020-10-08T18:33:44Z")

</div>

Hi, I just wrote A quick introduction to data parallelism in Julia! For a quick flavor of the tutorial, here is the table of contents: Getting julia and libraries Starting julia Starting julia with multiple worker p…

---

## [Memory allocation and @profile](https://discourse.julialang.org/t/memory-allocation-and-profile/47573)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 5\
**Last updated:** [October 8, 2020, 2:24pm UTC](https://discourse.julialang.org/t/memory-allocation-and-profile/47573 "2020-10-08T14:24:42Z")

</div>

@time shows that my program is doing a lot of memory allocation, much of which I could probably avoid. For example @time b2 = MyFirst.mysolve(f2, nhsub, nhsub.wtfast16yr) 1.998780 seconds (6.27 M allocations: 479.828 Mi…

---

## [Importing pmdarima using conda in julia](https://discourse.julialang.org/t/importing-pmdarima-using-conda-in-julia/47986)

<div class="topic-metadata">

**Author:** [@musman](https://discourse.julialang.org/u/musman)\
**Replies:** 0\
**Last updated:** [October 8, 2020, 2:16pm UTC](https://discourse.julialang.org/t/importing-pmdarima-using-conda-in-julia/47986 "2020-10-08T14:16:29Z")

</div>

Hi all, I am using Conda.add("pmdarima") command to import pmdarima in julia. However, I am getting the following error: PackagesNotFoundError: The following packages are not available from current channels: - pmd…

---

## [Launch Jupyter kernel with -e "using SomePackage" flag](https://discourse.julialang.org/t/launch-jupyter-kernel-with-e-using-somepackage-flag/47980)

<div class="topic-metadata">

**Author:** [@tikej](https://discourse.julialang.org/u/tikej)\
**Replies:** 1\
**Last updated:** [October 8, 2020, 1:37pm UTC](https://discourse.julialang.org/t/launch-jupyter-kernel-with-e-using-somepackage-flag/47980 "2020-10-08T13:37:56Z")

</div>

Hi, I’m trying to setup Jupyter kernel with some automatically loaded packages as a matter of convenience. Lets say I want to have Julia Jupyter kernels for: data (Statistics, DataFrames), plotting(UnicodePlots, PyPlot)…

---

## [Image loading in Gtk](https://discourse.julialang.org/t/image-loading-in-gtk/47977)

<div class="topic-metadata">

**Author:** [@libensvivit](https://discourse.julialang.org/u/libensvivit)\
**Replies:** 1\
**Last updated:** [October 8, 2020, 9:44am UTC](https://discourse.julialang.org/t/image-loading-in-gtk/47977 "2020-10-08T09:44:52Z")

</div>

I’m trying load an image in Gtk, so far I found GdkPixbuf() function in the source, that accepts filename as argument but I couldn’t make it work. I think image loading is not supported yet. using Gtk win = GtkWindow("…

---

## [Dense cell segmentation](https://discourse.julialang.org/t/dense-cell-segmentation/47728)

<div class="topic-metadata">

**Author:** [@tbenst](https://discourse.julialang.org/u/tbenst)\
**Replies:** 2\
**Last updated:** [October 8, 2020, 9:04am UTC](https://discourse.julialang.org/t/dense-cell-segmentation/47728 "2020-10-08T09:04:52Z")

</div>

Hello, I’m transferring a cell segmentation pipeline from python/skimage to Julia/Images.jl, and ran into some function calls that weren’t straightforward to translate. In particular: autolevel\_percentile skimage.morp…

---

## [How to benchmark my loss function with sciml\_train using different optimizers?](https://discourse.julialang.org/t/how-to-benchmark-my-loss-function-with-sciml-train-using-different-optimizers/47852)

<div class="topic-metadata">

**Author:** [@Alec\_4](https://discourse.julialang.org/u/Alec_4)\
**Replies:** 1\
**Last updated:** [October 8, 2020, 8:04am UTC](https://discourse.julialang.org/t/how-to-benchmark-my-loss-function-with-sciml-train-using-different-optimizers/47852 "2020-10-08T08:04:30Z")

</div>

Does anyone know some good way to benchmark my loss function trained with sciml\_train using different optimizers? Just like the way that WorkPrecisionSet() can do to show the performance differences due to using differen…

---

## [Julia 1.0.5: Using Pkg.add removes all \[extras\] dependencies from Manifest](https://discourse.julialang.org/t/julia-1-0-5-using-pkg-add-removes-all-extras-dependencies-from-manifest/47963)

<div class="topic-metadata">

**Author:** [@bluesmoon](https://discourse.julialang.org/u/bluesmoon)\
**Replies:** 0\
**Last updated:** [October 8, 2020, 3:30am UTC](https://discourse.julialang.org/t/julia-1-0-5-using-pkg-add-removes-all-extras-dependencies-from-manifest/47963 "2020-10-08T03:30:52Z")

</div>

julia\> versioninfo() Julia Version 1.0.5 Commit 3af96bcefc (2019-09-09 19:06 UTC) Platform Info: OS: Linux (x86\_64-pc-linux-gnu) CPU: Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz WORD\_SIZE: 64 LIBM: libopenlibm LL…

---

## [Specialising behaviour of subtypes; methods or properties?](https://discourse.julialang.org/t/specialising-behaviour-of-subtypes-methods-or-properties/47907)

<div class="topic-metadata">

**Author:** [@timquelch](https://discourse.julialang.org/u/timquelch)\
**Replies:** 4\
**Last updated:** [October 8, 2020, 1:06am UTC](https://discourse.julialang.org/t/specialising-behaviour-of-subtypes-methods-or-properties/47907 "2020-10-08T01:06:26Z")

</div>

I’m developing a tree-like structure where each node can have children of different types. Some of the types of nodes are limited in the types and number of the nodes shown below. abstract type Component end struct Com…

---

## [Pluto - Web sqlite error database is locked](https://discourse.julialang.org/t/pluto-web-sqlite-error-database-is-locked/47959)

<div class="topic-metadata">

**Author:** [@dalejordan](https://discourse.julialang.org/u/dalejordan)\
**Replies:** 0\
**Last updated:** [October 8, 2020, 12:59am UTC](https://discourse.julialang.org/t/pluto-web-sqlite-error-database-is-locked/47959 "2020-10-08T00:59:52Z")

</div>

Apparently, some lockfile didn’t get deleted when I left a session hanging… Anyone know where its kept so I cane delete it manually? Pluto spouts a long string of error messages and won’t start normally.

---

## [Plots.jl Plot Coordinates - An Adventure](https://discourse.julialang.org/t/plots-jl-plot-coordinates-an-adventure/32676)

<div class="topic-metadata">

**Author:** [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Replies:** 9\
**Last updated:** [October 7, 2020, 7:43pm UTC](https://discourse.julialang.org/t/plots-jl-plot-coordinates-an-adventure/32676 "2020-10-07T19:43:00Z")

</div>

So I am on an adventure… To turn Plots.jl into something that can be extended to interactivity via GTK, or really anything hosting a plot. So in order to do that, I think there are a lot of ways, but one of the most fun …

---

## [HTTP: Exact Routing](https://discourse.julialang.org/t/http-exact-routing/47912)

<div class="topic-metadata">

**Author:** [@Jea](https://discourse.julialang.org/u/Jea)\
**Replies:** 5\
**Last updated:** [October 7, 2020, 7:04pm UTC](https://discourse.julialang.org/t/http-exact-routing/47912 "2020-10-07T19:04:27Z")

</div>

I want to make an exact router for example. HTTP.@register(Router, "GET", "/hello", myFunction) If for example the url is /hello/any, not respond with the as /hello this without declare the route: /hello/any

---

## [Taking action based on Log Level](https://discourse.julialang.org/t/taking-action-based-on-log-level/47951)

<div class="topic-metadata">

**Author:** [@bmalham](https://discourse.julialang.org/u/bmalham)\
**Replies:** 0\
**Last updated:** [October 7, 2020, 6:53pm UTC](https://discourse.julialang.org/t/taking-action-based-on-log-level/47951 "2020-10-07T18:53:43Z")

</div>

Hello, What is the best way to take action based on log level? For example if I wanted to write the output from all log levels to a text file, but I also wanted to print any @err messages to stdout, what would be the be…

---

## [Dispatch Question](https://discourse.julialang.org/t/dispatch-question/47826)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 7\
**Last updated:** [October 7, 2020, 6:22pm UTC](https://discourse.julialang.org/t/dispatch-question/47826 "2020-10-07T18:22:08Z")

</div>

abstract type Def{T} end struct YY \<: Def{Number} end f1(x::Def{\<:T}) where T = T f2(x::Def{T}) where T = T julia\> f1(YY()) ERROR: UndefVarError: T not defined Stacktrace: \[1\] f1(::YY) at ./REPL\[3\]:1 \[2\] top-level s…

---

## [Enum versus abstract typing](https://discourse.julialang.org/t/enum-versus-abstract-typing/47941)

<div class="topic-metadata">

**Author:** [@davide-f](https://discourse.julialang.org/u/davide-f)\
**Replies:** 8\
**Last updated:** [October 7, 2020, 5:31pm UTC](https://discourse.julialang.org/t/enum-versus-abstract-typing/47941 "2020-10-07T17:31:22Z")

</div>

Hi, I am developing a code aiming at a good balance between speed, resources and generalizability. In my original code that was using only concrete assets, mainly, the code was relatively fast, about 68ms. Aiming to ge…

---

## [How do I throw an Exception with a given backtrace?](https://discourse.julialang.org/t/how-do-i-throw-an-exception-with-a-given-backtrace/47940)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 3\
**Last updated:** [October 7, 2020, 4:33pm UTC](https://discourse.julialang.org/t/how-do-i-throw-an-exception-with-a-given-backtrace/47940 "2020-10-07T16:33:21Z")

</div>

If I have aquired a backtrace, e.g. from backtrace() and i want to throw an exception that impersonates an exception being thrown with that backtrace, how do i do it?

---

## [Gnuplot.jl hangs on first run](https://discourse.julialang.org/t/gnuplot-jl-hangs-on-first-run/47946)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 0\
**Last updated:** [October 7, 2020, 4:29pm UTC](https://discourse.julialang.org/t/gnuplot-jl-hangs-on-first-run/47946 "2020-10-07T16:29:58Z")

</div>

I am really beginning to like gnuplot and switching over from R’s ggplot (although I still think ggplot might be more flexible and powerful). Anyways, I have a slight problem in the Julia wrapper Gnuplot.jl. It seems tha…

---

## [Plots -- xlims with x axis given by dates?](https://discourse.julialang.org/t/plots-xlims-with-x-axis-given-by-dates/47926)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 6\
**Last updated:** [October 7, 2020, 3:38pm UTC](https://discourse.julialang.org/t/plots-xlims-with-x-axis-given-by-dates/47926 "2020-10-07T15:38:34Z")

</div>

I’m plotting some data as a function of date, e.g., plot(date\_vector, data\_vector). I produce several plots with different pairs of date\_vector and data\_vector. So I’d like to use the same xlims in all plots. Specifying…

---

## [Simple web app controls LEDs connected to an RPI](https://discourse.julialang.org/t/simple-web-app-controls-leds-connected-to-an-rpi/34896)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 15\
**Last updated:** [October 7, 2020, 1:35pm UTC](https://discourse.julialang.org/t/simple-web-app-controls-leds-connected-to-an-rpi/34896 "2020-10-07T13:35:03Z")

</div>

I want a user to browse to a website, move one radio button and one slider, and a Raspberry Pi which is listening to that website will control a few LED strips connected to it depending on the user’s choices (the whole s…

---

## [How to plot circles with given radii using Plots](https://discourse.julialang.org/t/how-to-plot-circles-with-given-radii-using-plots/47845)

<div class="topic-metadata">

**Author:** [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Replies:** 12\
**Last updated:** [October 7, 2020, 12:46pm UTC](https://discourse.julialang.org/t/how-to-plot-circles-with-given-radii-using-plots/47845 "2020-10-07T12:46:12Z")

</div>

I want to create movies of biological cells which are represented as circles. My main problem is speed. Generating the videos I need takes more than 10 minutes. Currently, I am using this approach to plot circles How…

---

## [Resize! and multidimensional arrays](https://discourse.julialang.org/t/resize-and-multidimensional-arrays/47842)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 4\
**Last updated:** [October 7, 2020, 9:37am UTC](https://discourse.julialang.org/t/resize-and-multidimensional-arrays/47842 "2020-10-07T09:37:44Z")

</div>

Background We want to make use of adaptive mesh refinement (AMR) for our hyperbolic PDE solver package Trixi.jl. For us, the most natural data layout is given by multidimensional arrays. To use AMR, we need to resize! th…

---

## [Disable artifacts default download location?](https://discourse.julialang.org/t/disable-artifacts-default-download-location/47791)

<div class="topic-metadata">

**Author:** [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Replies:** 4\
**Last updated:** [October 7, 2020, 8:33am UTC](https://discourse.julialang.org/t/disable-artifacts-default-download-location/47791 "2020-10-07T08:33:07Z")

</div>

Hi, I have an Artifacts.toml with the following vanilla tarball artifact: \[artifactX\] git-tree-sha1 = \<generated through create\_artifact(d -\> path\_to\_manually\_downloaded\_tarball, artifact\_toml) \> lazy = true \[\[art…

---

## [Nested macros and esc](https://discourse.julialang.org/t/nested-macros-and-esc/47857)

<div class="topic-metadata">

**Author:** [@johnmyleswhite](https://discourse.julialang.org/u/johnmyleswhite)\
**Replies:** 18\
**Last updated:** [October 7, 2020, 8:10am UTC](https://discourse.julialang.org/t/nested-macros-and-esc/47857 "2020-10-07T08:10:33Z")

</div>

I have an example of nesting macros that makes me think I’m confused about how hygiene works. Here’s a minimal example: macro inner(e) println("In @inner") dump(e) @assert isa(e, Expr) && e.head == :$ e…

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

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