# General Usage

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

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

**Page:** 1012

---

## [What is the difference between in scope and loaded](https://discourse.julialang.org/t/what-is-the-difference-between-in-scope-and-loaded/7452)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 3\
**Last updated:** [December 3, 2017, 5:41am UTC](https://discourse.julialang.org/t/what-is-the-difference-between-in-scope-and-loaded/7452 "2017-12-03T05:41:17Z")

</div>

In the docs of parallel computing (https://docs.julialang.org/en/stable/manual/parallel-computing/#Code-Availability-and-Loading-Packages-1), there’s a sentence using DummyModule causes the module to be loaded on all pr…

---

## [Why "using" instead of "use"?](https://discourse.julialang.org/t/why-using-instead-of-use/7401)

<div class="topic-metadata">

**Author:** [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Replies:** 7\
**Last updated:** [December 3, 2017, 4:35am UTC](https://discourse.julialang.org/t/why-using-instead-of-use/7401 "2017-12-03T04:35:05Z")

</div>

Out of curiosity, when loading a module, why do we use using Foo instead of use Foo? I found this looks inconsistent because we use import Foo instead of importing Foo. Is there any implication here?

---

## [What if a package consisted of multiple top-level files?](https://discourse.julialang.org/t/what-if-a-package-consisted-of-multiple-top-level-files/7465)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 19\
**Last updated:** [December 3, 2017, 3:25am UTC](https://discourse.julialang.org/t/what-if-a-package-consisted-of-multiple-top-level-files/7465 "2017-12-03T03:25:27Z")

</div>

It seems to me that it might make sense to have a package consist of multiple (dozens?) related files that the user does not necessarily need all at once. What is the standard mechanism for dealing with this? (Is th…

---

## [Comparing random sequences between Julia, Numpy, MATLAB](https://discourse.julialang.org/t/comparing-random-sequences-between-julia-numpy-matlab/7459)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 3\
**Last updated:** [December 2, 2017, 7:46pm UTC](https://discourse.julialang.org/t/comparing-random-sequences-between-julia-numpy-matlab/7459 "2017-12-02T19:46:58Z")

</div>

Is there a way to set the rng’s in Julia, Numpy, and MATLAB to produce the same sequence? I’m not looking to do something fancy with multithreading, I just want to compare/debug output where all codes are producing the…

---

## [New idea: importable operators](https://discourse.julialang.org/t/new-idea-importable-operators/7457)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 1\
**Last updated:** [December 2, 2017, 7:06pm UTC](https://discourse.julialang.org/t/new-idea-importable-operators/7457 "2017-12-02T19:06:42Z")

</div>

Since the feature freeze is coming up… (a trivial restricted/easy to implement pre-support should be possible). I have two possible uses for importable operators. a) Instead of A’ to transpose a matrix, Aᵀ was propose…

---

## [Multiple linear regression with weights](https://discourse.julialang.org/t/multiple-linear-regression-with-weights/7449)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 10\
**Last updated:** [December 2, 2017, 3:01pm UTC](https://discourse.julialang.org/t/multiple-linear-regression-with-weights/7449 "2017-12-02T15:01:48Z")

</div>

Background: I’m trying to fit a 2D symmetric Gaussian to a an image of a point source. So I have an image of a light source, it’s Gaussian in shape, and I want to find it’s exact center and get a measure of how good the …

---

## [Notepad++ and Julia](https://discourse.julialang.org/t/notepad-and-julia/1979)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 2\
**Last updated:** [December 2, 2017, 12:47pm UTC](https://discourse.julialang.org/t/notepad-and-julia/1979 "2017-12-02T12:47:42Z")

</div>

Hello, I’d like to use Notepad++ as editor for Julia I noticed this topic Redirecting to Google Groups and this old gist https://gist.github.com/catawbasam/3858496 It could be a good idea to create a repository for n…

---

## [How to improve Plots.jl's look](https://discourse.julialang.org/t/how-to-improve-plots-jls-look/7409)

<div class="topic-metadata">

**Author:** [@111](https://discourse.julialang.org/u/111)\
**Replies:** 45\
**Last updated:** [December 1, 2017, 9:41pm UTC](https://discourse.julialang.org/t/how-to-improve-plots-jls-look/7409 "2017-12-01T21:41:38Z")

</div>

I used Plots for some time, and am quiet unsatisfied with the figure quality. The tutorial gives us some example, which shows its simplicity. However, none of those figures are publication-quality. I reproduced these plo…

---

## [Function with unordered parameter list](https://discourse.julialang.org/t/function-with-unordered-parameter-list/7383)

<div class="topic-metadata">

**Author:** [@JLT](https://discourse.julialang.org/u/JLT)\
**Replies:** 10\
**Last updated:** [December 1, 2017, 7:04pm UTC](https://discourse.julialang.org/t/function-with-unordered-parameter-list/7383 "2017-12-01T19:04:21Z")

</div>

First, a bit of background. I am currently trying to implement a function which takes as parameters a Particle object, as well as three ParticleType objects, and attempts to decay the initial particle into three particl…

---

## [Trying PkgBenchmark.jl again](https://discourse.julialang.org/t/trying-pkgbenchmark-jl-again/7429)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 5\
**Last updated:** [December 1, 2017, 5:34pm UTC](https://discourse.julialang.org/t/trying-pkgbenchmark-jl-again/7429 "2017-12-01T17:34:15Z")

</div>

I got to a point where I need to keep track of performance improvements in my packages, specially with new releases of Julia coming up. The PkgBenchmark.jl package proposes a nice interface similar to Base.Test for bench…

---

## [Should macros observe mutable global state, e.g. method tables?](https://discourse.julialang.org/t/should-macros-observe-mutable-global-state-e-g-method-tables/7405)

<div class="topic-metadata">

**Author:** [@helgee](https://discourse.julialang.org/u/helgee)\
**Replies:** 4\
**Last updated:** [December 1, 2017, 5:34pm UTC](https://discourse.julialang.org/t/should-macros-observe-mutable-global-state-e-g-method-tables/7405 "2017-12-01T17:34:23Z")

</div>

My package Convertible.jl currently uses generated functions to enable multi-step type conversions at runtime. The problem is that I achieved this by calling methods within the generated function body, i.e. I am observin…

---

## [How to improve Plots.jl default appearance](https://discourse.julialang.org/t/how-to-improve-plots-jl-default-appearance/7441)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [December 1, 2017, 4:53pm UTC](https://discourse.julialang.org/t/how-to-improve-plots-jl-default-appearance/7441 "2017-12-01T16:53:23Z")

</div>

from How to improve Plots.jl's look I used Plots for some time, and am quiet unsatisfied with the figure quality. The tutorial38 gives us some example, which shows its simplicity. However, none of those figures are pu…

---

## [Interesting Eval Problem](https://discourse.julialang.org/t/interesting-eval-problem/7428)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 11\
**Last updated:** [December 1, 2017, 2:49pm UTC](https://discourse.julialang.org/t/interesting-eval-problem/7428 "2017-12-01T14:49:03Z")

</div>

Hi guys, I am having a incorrect eval result. Can you help me with this? type EE x::Int end type DD x::Float64 y::EE end ex = quote x = $(Expr(:new, Int64, 1)) …

---

## [Pkg.update() error: "There is no tracking information for the current branch"](https://discourse.julialang.org/t/pkg-update-error-there-is-no-tracking-information-for-the-current-branch/7431)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 1\
**Last updated:** [December 1, 2017, 10:50am UTC](https://discourse.julialang.org/t/pkg-update-error-there-is-no-tracking-information-for-the-current-branch/7431 "2017-12-01T10:50:14Z")

</div>

I have some packages that I made with just some code that I reuse in multiple applications, but I don’t really want to maintain them in any good way. Now when I run Pkg.update(), I get an error: GitError(Code:ERROR, C…

---

## [@pyimport struct as pystruct?](https://discourse.julialang.org/t/pyimport-struct-as-pystruct/7424)

<div class="topic-metadata">

**Author:** [@improbable22](https://discourse.julialang.org/u/improbable22)\
**Replies:** 0\
**Last updated:** [December 1, 2017, 12:01am UTC](https://discourse.julialang.org/t/pyimport-struct-as-pystruct/7424 "2017-12-01T00:01:50Z")

</div>

I am trying to use a package which contains @pyimport struct. If I understand right, this would have been OK on some older versions of Julia, but now struct is a reserved word and so this gives errors. EDIT – nevermind,…

---

## [How to parameterize a producer?](https://discourse.julialang.org/t/how-to-parameterize-a-producer/7416)

<div class="topic-metadata">

**Author:** [@albertas-jn](https://discourse.julialang.org/u/albertas-jn)\
**Replies:** 1\
**Last updated:** [November 30, 2017, 8:37pm UTC](https://discourse.julialang.org/t/how-to-parameterize-a-producer/7416 "2017-11-30T20:37:15Z")

</div>

The manual on Tasks (aka Coroutines) explains how to create a producer and use it with a Channel. https://docs.julialang.org/en/latest/manual/control-flow/#man-tasks-1 Then, it says “A common pattern is for the produce…

---

## [Graph visualisation in Julia](https://discourse.julialang.org/t/graph-visualisation-in-julia/7366)

<div class="topic-metadata">

**Author:** [@veryevilwitch](https://discourse.julialang.org/u/veryevilwitch)\
**Replies:** 5\
**Last updated:** [November 30, 2017, 8:21pm UTC](https://discourse.julialang.org/t/graph-visualisation-in-julia/7366 "2017-11-30T20:21:39Z")

</div>

Hi All! I am trying to generate some Watts- Strogatz graphs in julia and I have a problem of a picture not showing up anywhere. I generated a network and tried to plot it using gplot(), but instead of a picture I get s…

---

## [Unsafe\_store! sometimes slower than arrays' setindex!?](https://discourse.julialang.org/t/unsafe-store-sometimes-slower-than-arrays-setindex/7166)

<div class="topic-metadata">

**Author:** [@rfourquet](https://discourse.julialang.org/u/rfourquet)\
**Replies:** 15\
**Last updated:** [November 30, 2017, 4:45pm UTC](https://discourse.julialang.org/t/unsafe-store-sometimes-slower-than-arrays-setindex/7166 "2017-11-30T16:45:37Z")

</div>

While trying to fix the FIXMEs in “base/random/RNGs.jl”, I saw performance degraded in a very unexpected way. Basically it amounts to the following benchmark. I would be grateful if someone can point to me a workaround w…

---

## [Docstrings: variable names with Unicode inline math](https://discourse.julialang.org/t/docstrings-variable-names-with-unicode-inline-math/7412)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 0\
**Last updated:** [November 30, 2017, 2:33pm UTC](https://discourse.julialang.org/t/docstrings-variable-names-with-unicode-inline-math/7412 "2017-11-30T14:33:20Z")

</div>

The manual recommends that Unicode chars are used for inline math between \`\`...\`\`s in docstrings, eg "foo makes sure that \`\`α \< β\`\`" foo(α, β) = @assert α \< β instead of \\alpha and \\beta. I understand that this is usef…

---

## [Create initialized arrays of structs](https://discourse.julialang.org/t/create-initialized-arrays-of-structs/7394)

<div class="topic-metadata">

**Author:** [@Andrea\_Pagnani](https://discourse.julialang.org/u/Andrea_Pagnani)\
**Replies:** 2\
**Last updated:** [November 30, 2017, 9:51am UTC](https://discourse.julialang.org/t/create-initialized-arrays-of-structs/7394 "2017-11-30T09:51:13Z")

</div>

Dearests, today I found a disturbing (yet documented … ) behavior of julia. Let’s see: struct T a::Vector{Int}; end T(N) = T(zeros(Int,N)) Now aiming at a Vector of initialized Ts I (mistakenly) did a julia\> x=fill(T…

---

## [How to use destructuring assignment with macro?](https://discourse.julialang.org/t/how-to-use-destructuring-assignment-with-macro/7385)

<div class="topic-metadata">

**Author:** [@ta2gch](https://discourse.julialang.org/u/ta2gch)\
**Replies:** 10\
**Last updated:** [November 29, 2017, 6:21pm UTC](https://discourse.julialang.org/t/how-to-use-destructuring-assignment-with-macro/7385 "2017-11-29T18:21:24Z")

</div>

I expect this macro to define variables with same characters, but it doesn’t work. How should I write this? macro chars(cs...) return :( $(esc(cs)) = $(map(c-\>string(c)\[1\], cs)) ) end @chars a b c # is '(a,b,c) = …

---

## [Interrupt with Ctrl+c not working](https://discourse.julialang.org/t/interrupt-with-ctrl-c-not-working/7361)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 8\
**Last updated:** [November 29, 2017, 5:02pm UTC](https://discourse.julialang.org/t/interrupt-with-ctrl-c-not-working/7361 "2017-11-29T17:02:30Z")

</div>

Is there any reason why I can’t interrupt my code with Ctrl+c sometimes? It doesn’t seem to work with parallel stuff where I can use Ctrl+d to interrupt but in my case it doesn’t work at all. Added some stuff to my cod…

---

## [Strange behavior, when constant is redefined inside a function](https://discourse.julialang.org/t/strange-behavior-when-constant-is-redefined-inside-a-function/4326)

<div class="topic-metadata">

**Author:** [@DrKrar](https://discourse.julialang.org/u/DrKrar)\
**Replies:** 25\
**Last updated:** [November 29, 2017, 4:37pm UTC](https://discourse.julialang.org/t/strange-behavior-when-constant-is-redefined-inside-a-function/4326 "2017-11-29T16:37:31Z")

</div>

julia\> module m const z=-1 export f function f(x) global const z=x println(z) println(m.z) end end m julia\> using m if we try to call f it response in a dual way. while give warning but its value accessed …

---

## [collect(Iterators.take(itr, 10)) returns a Vector of Any (instead of Vector of Date or DateTime)](https://discourse.julialang.org/t/collect-iterators-take-itr-10-returns-a-vector-of-any-instead-of-vector-of-date-or-datetime/7373)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 4\
**Last updated:** [November 29, 2017, 10:49am UTC](https://discourse.julialang.org/t/collect-iterators-take-itr-10-returns-a-vector-of-any-instead-of-vector-of-date-or-datetime/7373 "2017-11-29T10:49:00Z")

</div>

Hello, I’m working on adjuster functions https://docs.julialang.org/en/stable/manual/dates/#Adjuster-Functions-1 and would like to build an iterator of Date (or DateTime) respecting some date adjusting rules. Here is …

---

## [Best way to to handle DataFrames and write legible code](https://discourse.julialang.org/t/best-way-to-to-handle-dataframes-and-write-legible-code/7368)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 3\
**Last updated:** [November 29, 2017, 10:36am UTC](https://discourse.julialang.org/t/best-way-to-to-handle-dataframes-and-write-legible-code/7368 "2017-11-29T10:36:32Z")

</div>

What is the best way to get data out of DataFrames/save data in DataFrames and keep code legible? I quickly have the problem that my code looks something like this: df\_special\_dataframe\[(df\_special\_dataframe\[:Date\].\>=Ye…

---

## [Thread overhead variability across machines](https://discourse.julialang.org/t/thread-overhead-variability-across-machines/7320)

<div class="topic-metadata">

**Author:** [@alee](https://discourse.julialang.org/u/alee)\
**Replies:** 13\
**Last updated:** [November 28, 2017, 11:51pm UTC](https://discourse.julialang.org/t/thread-overhead-variability-across-machines/7320 "2017-11-28T23:51:14Z")

</div>

I am being hit by large overheads associated with running Threads.@threads for on one machine, and I don’t understand the source of the issue. Here is minimal working example code in a file called threadOverhead.jl usin…

---

## [\`foldl\` vs \`foldr\`: matrix multiplication order](https://discourse.julialang.org/t/foldl-vs-foldr-matrix-multiplication-order/7367)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 5\
**Last updated:** [November 28, 2017, 7:46pm UTC](https://discourse.julialang.org/t/foldl-vs-foldr-matrix-multiplication-order/7367 "2017-11-28T19:46:41Z")

</div>

Sorry, but isn’t this suppose to give different results, namely A\*B and B\*A ??? julia\> A = rand(3,3) 3x3 Array{Float64,2}: 0.601317 0.0789842 0.624138 0.3137 0.134492 0.600118 0.350883 0.306819 0.930303 ju…

---

## [Autocompletion of Julia scripts in Shell prompts](https://discourse.julialang.org/t/autocompletion-of-julia-scripts-in-shell-prompts/7364)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 2\
**Last updated:** [November 28, 2017, 7:25pm UTC](https://discourse.julialang.org/t/autocompletion-of-julia-scripts-in-shell-prompts/7364 "2017-11-28T19:25:48Z")

</div>

By any chance do you have a workaround in Bash for autocompleting Julia scripts upon pressing TAB? My current system installation of Julia is a simple symbolic link to the binary built from the sources, and I am not sur…

---

## [Higher-order function argument types](https://discourse.julialang.org/t/higher-order-function-argument-types/7348)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 3\
**Last updated:** [November 28, 2017, 5:00pm UTC](https://discourse.julialang.org/t/higher-order-function-argument-types/7348 "2017-11-28T17:00:15Z")

</div>

When I use a function as an argument, is there type information available that includes its domain and range? It would be great to be able to do something like this: function Nullable(f :: Function{X,Y}) nx -\> beg…

---

## [How to understand expression interpolation](https://discourse.julialang.org/t/how-to-understand-expression-interpolation/7351)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 6\
**Last updated:** [November 28, 2017, 3:18pm UTC](https://discourse.julialang.org/t/how-to-understand-expression-interpolation/7351 "2017-11-28T15:18:59Z")

</div>

Look at the following two code snippets. module Foo export @bar struct foo end macro bar(ex) temp = foo eval(current\_module(), :($temp)) return esc(ex) end end using Foo @bar :(Here) module Fo…

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

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