# General Usage

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

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

**Page:** 900

---

## [Julia Atom editor does not show the plot](https://discourse.julialang.org/t/julia-atom-editor-does-not-show-the-plot/19945)

<div class="topic-metadata">

**Author:** [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Replies:** 3\
**Last updated:** [January 23, 2019, 2:12pm UTC](https://discourse.julialang.org/t/julia-atom-editor-does-not-show-the-plot/19945 "2019-01-23T14:12:44Z")

</div>

Hi, I’m using the current version JuliaPro 1.0.1.1 and try to create a histogram with StatPlots and output it in the editor Plots pane. But unfortunately I don’t see the graphic but this message: julia\> Atom.JunoEditor…

---

## [State of the Debugger](https://discourse.julialang.org/t/state-of-the-debugger/4308)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 20\
**Last updated:** [January 23, 2019, 1:09pm UTC](https://discourse.julialang.org/t/state-of-the-debugger/4308 "2019-01-23T13:09:09Z")

</div>

Hi there, I just wanted to ask about the state of the debugger in Julia. I am coming from Matlab and the debugger there is quite important for me to see where something is going wrong. For example, using NLsolve is a bi…

---

## [PackageCompiler and modules](https://discourse.julialang.org/t/packagecompiler-and-modules/19973)

<div class="topic-metadata">

**Author:** [@plapplop](https://discourse.julialang.org/u/plapplop)\
**Replies:** 3\
**Last updated:** [January 23, 2019, 12:23pm UTC](https://discourse.julialang.org/t/packagecompiler-and-modules/19973 "2019-01-23T12:23:43Z")

</div>

I’m trying to compile an old Julia 0.6 code of mine with PackageCompiler and I’m running into trouble with the following situation: module M type A a end export A end using M Base.@ccallable function julia\_main(ARGS::…

---

## [Precompile() for function with kwargs](https://discourse.julialang.org/t/precompile-for-function-with-kwargs/19857)

<div class="topic-metadata">

**Author:** [@orange\_si](https://discourse.julialang.org/u/orange_si)\
**Replies:** 4\
**Last updated:** [January 23, 2019, 11:10am UTC](https://discourse.julialang.org/t/precompile-for-function-with-kwargs/19857 "2019-01-23T11:10:15Z")

</div>

hi everyone, I am using julia 1.0.2, and try to precompile for function. precompile() works for function with args(no kwargs), but when have kwargs, it seems not worked, so how to precompile for function with kwargs? …

---

## [No error when using () for indexing inside a loop](https://discourse.julialang.org/t/no-error-when-using-for-indexing-inside-a-loop/19970)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 2\
**Last updated:** [January 23, 2019, 10:38am UTC](https://discourse.julialang.org/t/no-error-when-using-for-indexing-inside-a-loop/19970 "2019-01-23T10:38:19Z")

</div>

I accidentally came across this observation, when trying to create a symmetric matrix. julia\> versioninfo() Julia Version 1.1.0 Commit 80516ca202 (2019-01-21 21:24 UTC) Platform Info: OS: Linux (x86\_64-pc-linux-gnu) …

---

## [Registry updating twice](https://discourse.julialang.org/t/registry-updating-twice/19772)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 5\
**Last updated:** [January 23, 2019, 8:13am UTC](https://discourse.julialang.org/t/registry-updating-twice/19772 "2019-01-23T08:13:22Z")

</div>

When I run Pkg.update(), the registry seems to be updated twice, see below. This also happens with pkg mode: \] up Only happens with my v0.7.0 installation and not with v1.0.3 It seems harmless but something seems amis…

---

## [Why is it impossible to subtype a struct?](https://discourse.julialang.org/t/why-is-it-impossible-to-subtype-a-struct/19876)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 29\
**Last updated:** [January 23, 2019, 6:08am UTC](https://discourse.julialang.org/t/why-is-it-impossible-to-subtype-a-struct/19876 "2019-01-23T06:08:38Z")

</div>

Is there a deeper reason, why the following does not work? I guess a struct can only be a leaf in the type hierarchy. Is there a reason why this has to be like this? julia\> struct TypeA{T} data::T en…

---

## [How to get port number of ephemeral port?](https://discourse.julialang.org/t/how-to-get-port-number-of-ephemeral-port/19954)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 1\
**Last updated:** [January 23, 2019, 12:28am UTC](https://discourse.julialang.org/t/how-to-get-port-number-of-ephemeral-port/19954 "2019-01-23T00:28:48Z")

</div>

If I do, using Sockets l = listen(IPv4("127.0.0.1"),0) then I’ve created a socket to listen on ephemeral port. Is there a way from Julia to get the port number so I know where to connect to from the other process? Than…

---

## [How to "watch" for a condition asynchronously inside a function](https://discourse.julialang.org/t/how-to-watch-for-a-condition-asynchronously-inside-a-function/19934)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 4\
**Last updated:** [January 22, 2019, 10:53pm UTC](https://discourse.julialang.org/t/how-to-watch-for-a-condition-asynchronously-inside-a-function/19934 "2019-01-22T22:53:23Z")

</div>

I am working on an epidemiological agent-based model. Suppose I have an array of Agents mutable struct Human isinfected end agents = \[Human(i) for i = 1:10000\] When the simulation starts, I introduce a random infec…

---

## [Setproperty!/getproperty and broadcasting do not seem to work together](https://discourse.julialang.org/t/setproperty-getproperty-and-broadcasting-do-not-seem-to-work-together/19907)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 7\
**Last updated:** [January 22, 2019, 8:30pm UTC](https://discourse.julialang.org/t/setproperty-getproperty-and-broadcasting-do-not-seem-to-work-together/19907 "2019-01-22T20:30:30Z")

</div>

I can not make object.property .+= value work where property is implemented in setproperty!. Here is example code: struct MyStruct an\_array::Array{Int,1} end function Base.getproperty(s::MyStruct, name::Symbol) …

---

## [Writing my own custom-indexing array: type piracy from OffsetArrays methods](https://discourse.julialang.org/t/writing-my-own-custom-indexing-array-type-piracy-from-offsetarrays-methods/19939)

<div class="topic-metadata">

**Author:** [@sairus7](https://discourse.julialang.org/u/sairus7)\
**Replies:** 4\
**Last updated:** [January 22, 2019, 7:11pm UTC](https://discourse.julialang.org/t/writing-my-own-custom-indexing-array-type-piracy-from-offsetarrays-methods/19939 "2019-01-22T19:11:02Z")

</div>

I have implemented a simple circular buffer type similar to this, but with cumulative indexing, so that it has offset field that grows each time an element is pushed back to the full buffer. (That’s why I did not used …

---

## [Is this uniformly generating a number from a given interval?](https://discourse.julialang.org/t/is-this-uniformly-generating-a-number-from-a-given-interval/19938)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 10\
**Last updated:** [January 22, 2019, 7:08pm UTC](https://discourse.julialang.org/t/is-this-uniformly-generating-a-number-from-a-given-interval/19938 "2019-01-22T19:08:59Z")

</div>

The following is the code: julia\> rng = MersenneTwister(0) # here rng is random number generator MersenneTwister(UInt32\[0x00000000\], Base.dSFMT.DSFMT\_state(Int32\[748398797, 1073523691, -1738140313, 1073664641, -1492392…

---

## [How \`Pkg\` versioning works](https://discourse.julialang.org/t/how-pkg-versioning-works/19933)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 1\
**Last updated:** [January 22, 2019, 3:16pm UTC](https://discourse.julialang.org/t/how-pkg-versioning-works/19933 "2019-01-22T15:16:25Z")

</div>

Hello all, I was looking through the NEWS.md and noticed that the Pkg code is now coming from the Pkg repo, rather than getting copied into julia or whatever it was that was happening previously. This raised a number of…

---

## [Type matching with positional vs keyword arguments](https://discourse.julialang.org/t/type-matching-with-positional-vs-keyword-arguments/19854)

<div class="topic-metadata">

**Author:** [@lostella](https://discourse.julialang.org/u/lostella)\
**Replies:** 9\
**Last updated:** [January 22, 2019, 6:32am UTC](https://discourse.julialang.org/t/type-matching-with-positional-vs-keyword-arguments/19854 "2019-01-22T06:32:12Z")

</div>

Hi there, can anyone explain why the different behavior in the following two definitions? Note that in the first case all arguments are positional, whereas in the second case b is a keyword argument: julia\> f(a::C, b::R…

---

## [How to resolve type ambiguity with Optim results?](https://discourse.julialang.org/t/how-to-resolve-type-ambiguity-with-optim-results/19856)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 6\
**Last updated:** [January 22, 2019, 6:28am UTC](https://discourse.julialang.org/t/how-to-resolve-type-ambiguity-with-optim-results/19856 "2019-01-22T06:28:39Z")

</div>

I am optimizing a function inside another function. I need to obtain and save the results of that optimization. However the compiler does not infer the type of those results. I am obtaining these instances of Any in the @…

---

## [Proper place for dependencies (the deps folder)](https://discourse.julialang.org/t/proper-place-for-dependencies-the-deps-folder/19900)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 3\
**Last updated:** [January 22, 2019, 1:04am UTC](https://discourse.julialang.org/t/proper-place-for-dependencies-the-deps-folder/19900 "2019-01-22T01:04:23Z")

</div>

Consider the following: there is a package P, which depends on a library L in the C language. The library L is bundled with the package P. To use the package P, the user needs to get the library L compiled with the scrip…

---

## [Operations on numerical type parameters](https://discourse.julialang.org/t/operations-on-numerical-type-parameters/19896)

<div class="topic-metadata">

**Author:** [@abraunst](https://discourse.julialang.org/u/abraunst)\
**Replies:** 4\
**Last updated:** [January 21, 2019, 10:56pm UTC](https://discourse.julialang.org/t/operations-on-numerical-type-parameters/19896 "2019-01-21T22:56:15Z")

</div>

I’m sorry if this is a stupid question, but I could not find it in the docs (nor solve it myself). I have a type A parametrized with a number N. How can I make this work: struct A{N} x::Array{Float64, N-1} y…

---

## [Trouble with multiple dispatch on Arrays](https://discourse.julialang.org/t/trouble-with-multiple-dispatch-on-arrays/19884)

<div class="topic-metadata">

**Author:** [@srb](https://discourse.julialang.org/u/srb)\
**Replies:** 3\
**Last updated:** [January 21, 2019, 9:52pm UTC](https://discourse.julialang.org/t/trouble-with-multiple-dispatch-on-arrays/19884 "2019-01-21T21:52:58Z")

</div>

Im having some trouble understanding why the following does not work: julia\> f(x::Array{Integer,1}) = print("test") f (generic function with 1 method) julia\> f(\[1,3,3\]) ERROR: MethodError: no method matching f(::Array…

---

## [Spaces in arguments when running in cygwin shell?](https://discourse.julialang.org/t/spaces-in-arguments-when-running-in-cygwin-shell/19893)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 4\
**Last updated:** [January 21, 2019, 9:51pm UTC](https://discourse.julialang.org/t/spaces-in-arguments-when-running-in-cygwin-shell/19893 "2019-01-21T21:51:58Z")

</div>

I’m calling julia from the command line in a cygwin shell and ran into the following problem… julia argtest.jl -f '\\\\foo\\bar\\this baz.txt' argtest \["-f", "\\\\\\\\foo\\\\bar\\\\this", "baz.txt"\] too many arguments you can see …

---

## [Performance with nested QuadGK integrals](https://discourse.julialang.org/t/performance-with-nested-quadgk-integrals/19889)

<div class="topic-metadata">

**Author:** [@hjabird](https://discourse.julialang.org/u/hjabird)\
**Replies:** 2\
**Last updated:** [January 21, 2019, 9:49pm UTC](https://discourse.julialang.org/t/performance-with-nested-quadgk-integrals/19889 "2019-01-21T21:49:43Z")

</div>

I encountered a performance issue whilst working. I’ve managed to produce a minimal example of my code that reproduces a performance issue. I have a file bug.jl: import QuadGK function inner\_integrand() function in…

---

## [Repeated multiplication of square matrix](https://discourse.julialang.org/t/repeated-multiplication-of-square-matrix/19764)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 32\
**Last updated:** [January 21, 2019, 5:45pm UTC](https://discourse.julialang.org/t/repeated-multiplication-of-square-matrix/19764 "2019-01-21T17:45:18Z")

</div>

I’m currently implementing the following loop: a=computation() b = similar(a) b .= a for i=1:n b .= a \* b end i.e. a^n. I should mention that a is complex, and that the determinant of a is 1 to start. at the concl…

---

## [How to get the individual element of a defined enum type?](https://discourse.julialang.org/t/how-to-get-the-individual-element-of-a-defined-enum-type/19878)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [January 21, 2019, 3:47pm UTC](https://discourse.julialang.org/t/how-to-get-the-individual-element-of-a-defined-enum-type/19878 "2019-01-21T15:47:15Z")

</div>

This should be a rather simple question. The following is the code: Starting Julia... \_ \_ \_ \_(\_)\_ | A fresh approach to technical computing (\_) | (\_) (\_) | Documentation: https://d…

---

## [Proper Way to overload operators](https://discourse.julialang.org/t/proper-way-to-overload-operators/19872)

<div class="topic-metadata">

**Author:** [@srb](https://discourse.julialang.org/u/srb)\
**Replies:** 3\
**Last updated:** [January 21, 2019, 3:27pm UTC](https://discourse.julialang.org/t/proper-way-to-overload-operators/19872 "2019-01-21T15:27:15Z")

</div>

Hello, I have been recently using julia and I want to know what the “proper” way of overloading operators is. Right now whwat I’m doing is defining a module and, inside that module i have basically the following: mod…

---

## [while loop unexpected behaviour (at least for me :) )](https://discourse.julialang.org/t/while-loop-unexpected-behaviour-at-least-for-me/19873)

<div class="topic-metadata">

**Author:** [@AlexanderChen](https://discourse.julialang.org/u/AlexanderChen)\
**Replies:** 2\
**Last updated:** [January 21, 2019, 2:47pm UTC](https://discourse.julialang.org/t/while-loop-unexpected-behaviour-at-least-for-me/19873 "2019-01-21T14:47:11Z")

</div>

Hi All, I am learning Julia by implementing code from the book of ‘Genetic Algorithm in python’. Because I also want to learn more GA. This refers to finding magic squares via GA in Simulated Annealing(chapter 8). I ha…

---

## [How to generate a sequence of numbers in julia](https://discourse.julialang.org/t/how-to-generate-a-sequence-of-numbers-in-julia/19864)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 2\
**Last updated:** [January 21, 2019, 11:07am UTC](https://discourse.julialang.org/t/how-to-generate-a-sequence-of-numbers-in-julia/19864 "2019-01-21T11:07:46Z")

</div>

I found this link: How do you generate a regular non-integer sequence in julia? - Stack Overflow, so I was thinking to try it out. And then I was confused. Julia has exited. Press Enter to start a new session. Starting …

---

## [The length of a enum object in julia?](https://discourse.julialang.org/t/the-length-of-a-enum-object-in-julia/19865)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 3\
**Last updated:** [January 21, 2019, 10:41am UTC](https://discourse.julialang.org/t/the-length-of-a-enum-object-in-julia/19865 "2019-01-21T10:41:41Z")

</div>

I was wondering, is there a quick julia way to get the length of an enum type? For example, something like @enum P n h m l and then len(P) or length(P) would return 3? EDIT: one more side note, I do not quite unders…

---

## [Create a dataframe with two titles](https://discourse.julialang.org/t/create-a-dataframe-with-two-titles/19844)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 5\
**Last updated:** [January 21, 2019, 10:36am UTC](https://discourse.julialang.org/t/create-a-dataframe-with-two-titles/19844 "2019-01-21T10:36:46Z")

</div>

Julia DataFrames.jl seems like a really great way to manipulate data in a tabular form. https://juliadata.github.io/DataFrames.jl/stable/man/getting\_started.html I was just wondering, is there a simple way to create a da…

---

## [WARNING: eval from module Plots to SIMB, incremental compilation may be broken for this module](https://discourse.julialang.org/t/warning-eval-from-module-plots-to-simb-incremental-compilation-may-be-broken-for-this-module/19850)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 4\
**Last updated:** [January 21, 2019, 8:10am UTC](https://discourse.julialang.org/t/warning-eval-from-module-plots-to-simb-incremental-compilation-may-be-broken-for-this-module/19850 "2019-01-21T08:10:44Z")

</div>

I’m using Julia 0.7 to run a piece of code and get the following error message, WARNING: eval from module Plots to SIMB: Expr(:function, Expr(:call, :\_show, Expr(:::, :io, :IO), Expr(:::, Expr(:curly, :MIME, Expr(:c…

---

## [Simulate the transportation on the map using Julia](https://discourse.julialang.org/t/simulate-the-transportation-on-the-map-using-julia/19564)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 16\
**Last updated:** [January 21, 2019, 12:49am UTC](https://discourse.julialang.org/t/simulate-the-transportation-on-the-map-using-julia/19564 "2019-01-21T00:49:49Z")

</div>

I’m doing a project, part of which requires to simulate the transportation on the map of a certain area. After searching from the internet, I found the following two links related to map data simulation/visualisation. …

---

## [Docs (by Documenter) are not being updated in gh-pages branch](https://discourse.julialang.org/t/docs-by-documenter-are-not-being-updated-in-gh-pages-branch/19832)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 3\
**Last updated:** [January 21, 2019, 12:25am UTC](https://discourse.julialang.org/t/docs-by-documenter-are-not-being-updated-in-gh-pages-branch/19832 "2019-01-21T00:25:08Z")

</div>

I’ve notice that since a while (1 or 2 months?) my updates (in gh-pages branch) to a package documentation written with Documenter are not updated anymore. Any idea why? (example, latest and true latest) Thanks.

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

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