# General Usage

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

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

**Page:** 769

---

## [Interact.jl live reload](https://discourse.julialang.org/t/interact-jl-live-reload/35109)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 4\
**Last updated:** [April 6, 2020, 7:49am UTC](https://discourse.julialang.org/t/interact-jl-live-reload/35109 "2020-04-06T07:49:38Z")

</div>

Hi! I’m trying out Interact.jl and use Mux as they suggest for serving the web page: ui = ... WebIO.webio\_serve(Mux.page("/", req -\> ui), 8000) What I don’t understand is how to get “live reload” or something similar? …

---

## [Type Stability for Distinct Returns](https://discourse.julialang.org/t/type-stability-for-distinct-returns/37076)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 7\
**Last updated:** [April 6, 2020, 7:11am UTC](https://discourse.julialang.org/t/type-stability-for-distinct-returns/37076 "2020-04-06T07:11:10Z")

</div>

I have the following situation. I am iterating something (i.e., numerical integration) forward in time, and sometimes I want to return the full trajectory of values at the intermediate steps, while other times I want to…

---

## [Type Instability with AbstractArray](https://discourse.julialang.org/t/type-instability-with-abstractarray/37074)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 2\
**Last updated:** [April 5, 2020, 11:12pm UTC](https://discourse.julialang.org/t/type-instability-with-abstractarray/37074 "2020-04-05T23:12:46Z")

</div>

Consider the following code: using Random mutable struct mystate{Tq} x::AbstractArray{Tq,1} end function update!(state::mystate{Tq}) where Tq @. state.x\[1\] = 0.5 \* state.x\[2\] + randn(); @. state.x\[2\] = -0…

---

## [Problem with Type of Vector of Colors/Colorants](https://discourse.julialang.org/t/problem-with-type-of-vector-of-colors-colorants/37072)

<div class="topic-metadata">

**Author:** [@mlanghinrichs](https://discourse.julialang.org/u/mlanghinrichs)\
**Replies:** 4\
**Last updated:** [April 5, 2020, 8:57pm UTC](https://discourse.julialang.org/t/problem-with-type-of-vector-of-colors-colorants/37072 "2020-04-05T20:57:35Z")

</div>

Hi all, I’m trying to write a function that accepts an 1d-array/vector of Colors. I want to use the most abstract type Colorant from ColorTypes.jl; i.e. like this: using Colors using ColorTypes function test(colors::V…

---

## [Why zip behaves differently in list comprehension?](https://discourse.julialang.org/t/why-zip-behaves-differently-in-list-comprehension/17119)

<div class="topic-metadata">

**Author:** [@sirex](https://discourse.julialang.org/u/sirex)\
**Replies:** 6\
**Last updated:** [April 5, 2020, 7:18pm UTC](https://discourse.julialang.org/t/why-zip-behaves-differently-in-list-comprehension/17119 "2020-04-05T19:18:51Z")

</div>

Here is what I got: julia\> for i in zip(1:3, 2:5) println(i) end (1, 2) (2, 3) (3, 4) julia\> \[i for i in zip(1:3, 2:5)\] ERROR: DimensionMismatch("dimensions must match") Why zip works differently in …

---

## [How to deserialize inside a module](https://discourse.julialang.org/t/how-to-deserialize-inside-a-module/37020)

<div class="topic-metadata">

**Author:** [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Replies:** 3\
**Last updated:** [April 5, 2020, 6:49pm UTC](https://discourse.julialang.org/t/how-to-deserialize-inside-a-module/37020 "2020-04-05T18:49:35Z")

</div>

Consider the following scenario: I define a custom type and a function in Main: mutable struct MyType x f end my\_f(x) = 2x v = MyType(2,my\_f) using Serialization serialize("v.a",v) I create an instance of tha…

---

## [Entrys with Gtk](https://discourse.julialang.org/t/entrys-with-gtk/37008)

<div class="topic-metadata">

**Author:** [@luanvehe9123](https://discourse.julialang.org/u/luanvehe9123)\
**Replies:** 3\
**Last updated:** [April 5, 2020, 11:06am UTC](https://discourse.julialang.org/t/entrys-with-gtk/37008 "2020-04-05T11:06:09Z")

</div>

Hello I am new in this software, I am designing an interfaz using Gtk, but I have some problems using entrys, I can´t do that my variables saves when I enter the numerical value in an entry. Help me please.

---

## [How to return the value and the weight of sampled element?](https://discourse.julialang.org/t/how-to-return-the-value-and-the-weight-of-sampled-element/36992)

<div class="topic-metadata">

**Author:** [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Replies:** 5\
**Last updated:** [April 5, 2020, 5:37am UTC](https://discourse.julialang.org/t/how-to-return-the-value-and-the-weight-of-sampled-element/36992 "2020-04-05T05:37:49Z")

</div>

I want to sample 1 element from values with specified weights: values=\[1,3,6,7,9\] weights=\[0.1,0,4,0.3,0.1,0.1\] I need to have access to the element sampled but also to its weight in weights. With the command using S…

---

## [NLopt: Finding errors in objective function](https://discourse.julialang.org/t/nlopt-finding-errors-in-objective-function/37018)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 7\
**Last updated:** [April 4, 2020, 10:43pm UTC](https://discourse.julialang.org/t/nlopt-finding-errors-in-objective-function/37018 "2020-04-04T22:43:59Z")

</div>

When the objective function throws an exception, NLopt catches it and halts the optimization gracefully. The NLopt run produces no indication that anything went wrong, except for the FORCED\_STOP return value. How can I…

---

## [Plot Nedelec edge elements (Makie)](https://discourse.julialang.org/t/plot-nedelec-edge-elements-makie/36988)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 2\
**Last updated:** [April 4, 2020, 8:29pm UTC](https://discourse.julialang.org/t/plot-nedelec-edge-elements-makie/36988 "2020-04-04T20:29:23Z")

</div>

How can I plot Nedelec finite element data in Julia, preferably with Makie? So far, I’ve been using the standard Lagrangian finite elements which can be plotted with nodal data points using Makie. Now, I’d like to plot t…

---

## [Specify both an upper and a lower bound in Project.toml?](https://discourse.julialang.org/t/specify-both-an-upper-and-a-lower-bound-in-project-toml/37027)

<div class="topic-metadata">

**Author:** [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Replies:** 3\
**Last updated:** [April 4, 2020, 7:57pm UTC](https://discourse.julialang.org/t/specify-both-an-upper-and-a-lower-bound-in-project-toml/37027 "2020-04-04T19:57:59Z")

</div>

How do you specify numeric values for both an upper and a lower bound for a package in Project.toml? In particular, I would like to specify that a package is compatible with 1.90 ≤ PyCall \< 2. My first thought was PyC…

---

## [SharedArrays at Ditributed, what wrong?](https://discourse.julialang.org/t/sharedarrays-at-ditributed-what-wrong/37030)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 0\
**Last updated:** [April 4, 2020, 7:32pm UTC](https://discourse.julialang.org/t/sharedarrays-at-ditributed-what-wrong/37030 "2020-04-04T19:32:22Z")

</div>

This code not copmpute , what wrong ? Function badaj55() take vector with 8 Floats and Return tuple with Float. julia\> typeof(granice) SharedArray{Float64,2} julia\> typeof(test) SharedArray{Float64,1} julia\> typeof(t…

---

## [Can't write to distributed array](https://discourse.julialang.org/t/cant-write-to-distributed-array/36978)

<div class="topic-metadata">

**Author:** [@eaubanel](https://discourse.julialang.org/u/eaubanel)\
**Replies:** 2\
**Last updated:** [April 4, 2020, 1:39pm UTC](https://discourse.julialang.org/t/cant-write-to-distributed-array/36978 "2020-04-04T13:39:25Z")

</div>

I’ve been experimenting with distributed arrays. I can create them just fine, but when I try to have a worker write to a part of a distributed array that it owns, I get an setindex! not defined for DArray error. Here’s …

---

## [Function for clearing console in Juno](https://discourse.julialang.org/t/function-for-clearing-console-in-juno/2803)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 5\
**Last updated:** [April 4, 2020, 4:40am UTC](https://discourse.julialang.org/t/function-for-clearing-console-in-juno/2803 "2020-04-04T04:40:50Z")

</div>

Hi- I am wondering if there is a way to clear the console in Juno via a function call. For example, it is possible to clear the REPL with the following function: clear() = run(@static is\_unix() ? clear : cmd /c cls) …

---

## [Printf as a dependency missing? It is there!](https://discourse.julialang.org/t/printf-as-a-dependency-missing-it-is-there/36998)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 1\
**Last updated:** [April 4, 2020, 2:49am UTC](https://discourse.julialang.org/t/printf-as-a-dependency-missing-it-is-there/36998 "2020-04-04T02:49:34Z")

</div>

This really puzzles me. There is this error message: $ ~/AppData/Local/Programs/Julia/Julia-1.4.0/bin/julia.exe run.jl Activating environment at \`C:\\Users\\PKrysl\\Documents\\work\\RunMultimaterialVibEP.jl\\Project.toml\` ┌ …

---

## [Empty a queue](https://discourse.julialang.org/t/empty-a-queue/36991)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 5\
**Last updated:** [April 4, 2020, 1:39am UTC](https://discourse.julialang.org/t/empty-a-queue/36991 "2020-04-04T01:39:55Z")

</div>

Apparently, there is no way to empty! a queue. Doc for DataStructures.jl shows an empty! method for a stack, but not for a queue. It is quite difficult to tell what sort of beast a queue is since it wraps dequeue. Whe…

---

## [Activating a shared named environment via JULIA\_PROJECT?](https://discourse.julialang.org/t/activating-a-shared-named-environment-via-julia-project/36975)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 9\
**Last updated:** [April 3, 2020, 8:26pm UTC](https://discourse.julialang.org/t/activating-a-shared-named-environment-via-julia-project/36975 "2020-04-03T20:26:38Z")

</div>

Is there a way to activate a shared named environment via $JULIA\_PROJECT or julia --project, without using the absolute path? So, an equivalent to \] activate --shared myenv?

---

## [Pass a 1-D view to a function defined for Array{Float,1}?](https://discourse.julialang.org/t/pass-a-1-d-view-to-a-function-defined-for-array-float-1/36977)

<div class="topic-metadata">

**Author:** [@mleprovost](https://discourse.julialang.org/u/mleprovost)\
**Replies:** 7\
**Last updated:** [April 3, 2020, 7:36pm UTC](https://discourse.julialang.org/t/pass-a-1-d-view-to-a-function-defined-for-array-float-1/36977 "2020-04-03T19:36:58Z")

</div>

Hello, I would like to pass a view of an Array{Float64,1} to a function defined for Array{Float64,1}, however I got a type-error by proceeding this way. Is there a generic type that includes Array{Float64,1} and its Sub…

---

## [Import types "above" a module with ..: for consistency and brevity?](https://discourse.julialang.org/t/import-types-above-a-module-with-for-consistency-and-brevity/36754)

<div class="topic-metadata">

**Author:** [@tuckermcclure](https://discourse.julialang.org/u/tuckermcclure)\
**Replies:** 7\
**Last updated:** [April 3, 2020, 7:02pm UTC](https://discourse.julialang.org/t/import-types-above-a-module-with-for-consistency-and-brevity/36754 "2020-04-03T19:02:01Z")

</div>

You can import stuff from “above” with ..Thing, such as: module Mod # Define some common types. struct T1; field::Int64; end struct T2; field::Float64; end # Define a sub module. Maybe this would even live in a differ…

---

## [Currying and constant propagation, Base.@pure](https://discourse.julialang.org/t/currying-and-constant-propagation-base-pure/36908)

<div class="topic-metadata">

**Author:** [@AndiMD](https://discourse.julialang.org/u/AndiMD)\
**Replies:** 4\
**Last updated:** [April 3, 2020, 6:02pm UTC](https://discourse.julialang.org/t/currying-and-constant-propagation-base-pure/36908 "2020-04-03T18:02:03Z")

</div>

Dear Julians, I have a generic model function with many parameters. I want to hold subsets of these parameters constant, and obtain well-specialized methods on a reduced parameter set. Unfortunately, in many cases, no …

---

## [Slow performance with Julia on optimization problems](https://discourse.julialang.org/t/slow-performance-with-julia-on-optimization-problems/36917)

<div class="topic-metadata">

**Author:** [@bandaya](https://discourse.julialang.org/u/bandaya)\
**Replies:** 2\
**Last updated:** [April 3, 2020, 5:20pm UTC](https://discourse.julialang.org/t/slow-performance-with-julia-on-optimization-problems/36917 "2020-04-03T17:20:54Z")

</div>

I am getting slow performance with JuliaDB when I run optimization problems. I store data for all simulations in one CSV file for each set of data, and then filter it for the relevant simulation and make a call to the op…

---

## [What is the best way to manipulete with the fourier images of the functions](https://discourse.julialang.org/t/what-is-the-best-way-to-manipulete-with-the-fourier-images-of-the-functions/36976)

<div class="topic-metadata">

**Author:** [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Replies:** 0\
**Last updated:** [April 3, 2020, 4:46pm UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-manipulete-with-the-fourier-images-of-the-functions/36976 "2020-04-03T16:46:35Z")

</div>

I would like to calculate a combined probability density function from components using their Fourier images, g(x) = \\int\_{-\\infty}^{\\infty} \\mathrm{d}t \\, f(t)^N\\, e^{-ixt}, \\qquad N=100 f(t) = \\int\_{-1}^{1} \\rho\_0(…

---

## [Working with BigInt type](https://discourse.julialang.org/t/working-with-bigint-type/36935)

<div class="topic-metadata">

**Author:** [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Replies:** 2\
**Last updated:** [April 3, 2020, 3:32pm UTC](https://discourse.julialang.org/t/working-with-bigint-type/36935 "2020-04-03T15:32:43Z")

</div>

I have a set of p=100 covariates with some covariance matrix given for example by: using LinearAlgebra L=Symmetric(rand(100,100)) I need to extract submatrices from L and perform some operations. However, I have a very…

---

## [Installation of Julia in atom](https://discourse.julialang.org/t/installation-of-julia-in-atom/36966)

<div class="topic-metadata">

**Author:** [@hamza](https://discourse.julialang.org/u/hamza)\
**Replies:** 1\
**Last updated:** [April 3, 2020, 3:19pm UTC](https://discourse.julialang.org/t/installation-of-julia-in-atom/36966 "2020-04-03T15:19:27Z")

</div>

I tried to run Julia in my windows but I installed with atom and Python. The program runs but the images do not appear. What is the problem?

---

## [\[Error\] Calling function of a dict from in a Task](https://discourse.julialang.org/t/error-calling-function-of-a-dict-from-in-a-task/36946)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 6\
**Last updated:** [April 3, 2020, 3:17pm UTC](https://discourse.julialang.org/t/error-calling-function-of-a-dict-from-in-a-task/36946 "2020-04-03T15:17:17Z")

</div>

I want to call all function that I put in a dict. So far that works great. But as soon as I add another function the task fails. julia\> d = Dict() Dict{Any,Any} with 0 entries julia\> d\[1\] = (()-\>"1", ()) (var"#21#22"(…

---

## [How close is StaticCompile?](https://discourse.julialang.org/t/how-close-is-staticcompile/36880)

<div class="topic-metadata">

**Author:** [@peter.wolf](https://discourse.julialang.org/u/peter.wolf)\
**Replies:** 6\
**Last updated:** [April 3, 2020, 2:25pm UTC](https://discourse.julialang.org/t/how-close-is-staticcompile/36880 "2020-04-03T14:25:44Z")

</div>

Hello, I am new to the Julia community, and I want to thank you for making a terrific language, wonderful free tools, and very supportive experts that answer questions quickly on Slack and Stack Overflow. I am a big fan. …

---

## [Multithreading mystery](https://discourse.julialang.org/t/multithreading-mystery/36922)

<div class="topic-metadata">

**Author:** [@GunnarFarneback](https://discourse.julialang.org/u/GunnarFarneback)\
**Replies:** 3\
**Last updated:** [April 3, 2020, 7:12am UTC](https://discourse.julialang.org/t/multithreading-mystery/36922 "2020-04-03T07:12:22Z")

</div>

Is this a bug or am I misusing/misunderstanding @sync/@spawn? julia\> function f() x = 0 @sync while x \< 3 @spawn println(x) x += 1 end end f (generic…

---

## [Do I need to define a random Sampler?](https://discourse.julialang.org/t/do-i-need-to-define-a-random-sampler/36925)

<div class="topic-metadata">

**Author:** [@ChandlerKilpatrick1](https://discourse.julialang.org/u/ChandlerKilpatrick1)\
**Replies:** 3\
**Last updated:** [April 3, 2020, 5:27am UTC](https://discourse.julialang.org/t/do-i-need-to-define-a-random-sampler/36925 "2020-04-03T05:27:15Z")

</div>

Hey all, I am getting the following error when I run my code: ERROR: LoadError: MethodError: no method matching &(::TagState, ::UInt8) Closest candidates are: &(::Any, ::Any, ::Any, ::Any...) at operators.jl:529 &(:…

---

## [Interpreting LOAD\_PATH in 1.0](https://discourse.julialang.org/t/interpreting-load-path-in-1-0/13529)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 3\
**Last updated:** [April 3, 2020, 5:20am UTC](https://discourse.julialang.org/t/interpreting-load-path-in-1-0/13529 "2020-04-03T05:20:06Z")

</div>

What does the @ sign mean? I tried to look it up from the manual but couldn’t find it… julia\> LOAD\_PATH 3-element Array{String,1}: "@" "@v#.#" "@stdlib"

---

## [A Julia library comparable to pysimplegui (simple graphical user interface)](https://discourse.julialang.org/t/a-julia-library-comparable-to-pysimplegui-simple-graphical-user-interface/36907)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 6\
**Last updated:** [April 2, 2020, 7:35pm UTC](https://discourse.julialang.org/t/a-julia-library-comparable-to-pysimplegui-simple-graphical-user-interface/36907 "2020-04-02T19:35:15Z")

</div>

Hello, I wonder if a Julia library comparable to pysimplegui exists. I’m looking for a “pure” Julia solution… ie not using PyCall. Kind regards PS : repository GitHub - PySimpleGUI/PySimpleGUI: Launched in 2018. It's…

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

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