# General Usage

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

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

**Page:** 980

---

## [Plot a parameter space with Plots.jl possibly using contour()](https://discourse.julialang.org/t/plot-a-parameter-space-with-plots-jl-possibly-using-contour/10796)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 0\
**Last updated:** [May 9, 2018, 12:56pm UTC](https://discourse.julialang.org/t/plot-a-parameter-space-with-plots-jl-possibly-using-contour/10796 "2018-05-09T12:56:21Z")

</div>

Hey everyone, I am looking for the best way plotting a parameter space using Plots.jl. Essentially, I have a matrix of 0s and 1s and possibly a few other values. The outcome should look similar to a contour plot, but wi…

---

## [Gradients for recurrent models in Flux.jl](https://discourse.julialang.org/t/gradients-for-recurrent-models-in-flux-jl/10787)

<div class="topic-metadata">

**Author:** [@rcnlee](https://discourse.julialang.org/u/rcnlee)\
**Replies:** 0\
**Last updated:** [May 8, 2018, 7:40pm UTC](https://discourse.julialang.org/t/gradients-for-recurrent-models-in-flux-jl/10787 "2018-05-08T19:40:42Z")

</div>

In the flux.jl documentation, it says that I can get the gradients by declaring weights W as a param, calling back!(l), and then inspecting the grad field. How do I do this for a recurrent system? I want to get the seq…

---

## [Any reason why there's no \`reload(m::Module)\`?](https://discourse.julialang.org/t/any-reason-why-theres-no-reload-m-module/10783)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 4\
**Last updated:** [May 8, 2018, 6:53pm UTC](https://discourse.julialang.org/t/any-reason-why-theres-no-reload-m-module/10783 "2018-05-08T18:53:03Z")

</div>

If none, can we please have it - makes sense as the module is expected to be in scope since we want to reload it. And because, most annoyingly, reload(s::AbstractString) does not support module name autocomplete in the R…

---

## [Convenience macro for type type-stable re-assignment / increment?](https://discourse.julialang.org/t/convenience-macro-for-type-type-stable-re-assignment-increment/10765)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 8\
**Last updated:** [May 8, 2018, 4:29pm UTC](https://discourse.julialang.org/t/convenience-macro-for-type-type-stable-re-assignment-increment/10765 "2018-05-08T16:29:49Z")

</div>

I find that expressions like a = f(a, ...) a += f(...) can be a frequent source of nasty type instabilities. Nasty especially because they can lie dormant until generic code is suddenly used with a different numerical …

---

## [Julia: compiling strings](https://discourse.julialang.org/t/julia-compiling-strings/10764)

<div class="topic-metadata">

**Author:** [@paulobuchsbaum](https://discourse.julialang.org/u/paulobuchsbaum)\
**Replies:** 12\
**Last updated:** [May 8, 2018, 1:30pm UTC](https://discourse.julialang.org/t/julia-compiling-strings/10764 "2018-05-08T13:30:43Z")

</div>

I’m writing a stochastic simulation sofware in Julia. I need to store expressions in strings, because I want to save them in a spreadsheet or database, due to the ease of change, without having to directly change source…

---

## [Docstring for overwritten function - please remove this post](https://discourse.julialang.org/t/docstring-for-overwritten-function-please-remove-this-post/10778)

<div class="topic-metadata">

**Author:** [@Sam](https://discourse.julialang.org/u/Sam)\
**Replies:** 0\
**Last updated:** [May 8, 2018, 1:10pm UTC](https://discourse.julialang.org/t/docstring-for-overwritten-function-please-remove-this-post/10778 "2018-05-08T13:10:01Z")

</div>

Made two identical posts by mistake. See Docstring for overwritten function for exactly the same post. Moderators: please remove this post.

---

## [redefinition of typealias raises error](https://discourse.julialang.org/t/redefinition-of-typealias-raises-error/10776)

<div class="topic-metadata">

**Author:** [@tim](https://discourse.julialang.org/u/tim)\
**Replies:** 4\
**Last updated:** [May 8, 2018, 12:54pm UTC](https://discourse.julialang.org/t/redefinition-of-typealias-raises-error/10776 "2018-05-08T12:54:06Z")

</div>

Hi all, I am trying to define a type alias for a parametric type. Unfortuntately, when running the same line of code again, I get an error “invalid redefinition of constant …”. While that is generally okai (it’s constan…

---

## [Running console Julia app with small hardware and small Linux OS but with fast boot](https://discourse.julialang.org/t/running-console-julia-app-with-small-hardware-and-small-linux-os-but-with-fast-boot/10773)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 0\
**Last updated:** [May 8, 2018, 7:19am UTC](https://discourse.julialang.org/t/running-console-julia-app-with-small-hardware-and-small-linux-os-but-with-fast-boot/10773 "2018-05-08T07:19:55Z")

</div>

Hello, I wonder if some of you have ever try to run a Julia app on a small hardware (ARM device) with a small Linux OS. I don’t need GUI, just console app. But one important point is fast boot time. I know that Julia …

---

## [Detect key press (with input debounce and without terminal echo)](https://discourse.julialang.org/t/detect-key-press-with-input-debounce-and-without-terminal-echo/10772)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 0\
**Last updated:** [May 8, 2018, 6:12am UTC](https://discourse.julialang.org/t/detect-key-press-with-input-debounce-and-without-terminal-echo/10772 "2018-05-08T06:12:56Z")

</div>

Hello, I’d like to detect key press (with input debounce and without terminal echo) I did: using SFML dt = now() dt\_last = dt td\_debounce = Dates.Millisecond(500) while true if is\_key\_pressed(KeyCode.K) dt = n…

---

## [Weird Constructor Parameter Problem](https://discourse.julialang.org/t/weird-constructor-parameter-problem/10769)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 4\
**Last updated:** [May 8, 2018, 2:19am UTC](https://discourse.julialang.org/t/weird-constructor-parameter-problem/10769 "2018-05-08T02:19:55Z")

</div>

julia\> abstract type Environment end julia\> abstract type SymTable{mutability} \<: Environment end julia\> mutable struct BigSymTable{M\<:Bool} \<: SymTable{M} dict::Dict{Symbol,Any} BigSymTab…

---

## [Matrix permanent](https://discourse.julialang.org/t/matrix-permanent/10766)

<div class="topic-metadata">

**Author:** [@benkj](https://discourse.julialang.org/u/benkj)\
**Replies:** 7\
**Last updated:** [May 7, 2018, 10:26pm UTC](https://discourse.julialang.org/t/matrix-permanent/10766 "2018-05-07T22:26:02Z")

</div>

Any idea on how to improve the following code for computing the permanent of a matrix? I used the Glynn formula where delta is obtained via Gray code. # from https://stackoverflow.com/questions/34236332/c-code-for-gen…

---

## [Developing Pass-Through Types](https://discourse.julialang.org/t/developing-pass-through-types/10717)

<div class="topic-metadata">

**Author:** [@ccoffrin](https://discourse.julialang.org/u/ccoffrin)\
**Replies:** 9\
**Last updated:** [May 7, 2018, 9:14am UTC](https://discourse.julialang.org/t/developing-pass-through-types/10717 "2018-05-07T09:14:01Z")

</div>

A few times I have run into this situation, I would like to make a new type that only has one field, for example, struct Foo{T} bar::Vector{T} end The general case is that I would like instances of Foo to behave ju…

---

## [How to get the global variables?](https://discourse.julialang.org/t/how-to-get-the-global-variables/10748)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 4\
**Last updated:** [May 7, 2018, 4:31am UTC](https://discourse.julialang.org/t/how-to-get-the-global-variables/10748 "2018-05-07T04:31:13Z")

</div>

Hi, I was looking for a function, which gives the global variables available within the scope? Is there such a function. Thanks.

---

## [Getting variables defined with "global"](https://discourse.julialang.org/t/getting-variables-defined-with-global/10751)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 1\
**Last updated:** [May 7, 2018, 4:34am UTC](https://discourse.julialang.org/t/getting-variables-defined-with-global/10751 "2018-05-07T04:34:07Z")

</div>

Hi fellows, I am having difficulty getting the globally defined variables within a module. Here is an example: module DFT global a export f f()=44 end whos(DFT) …

---

## [String Distance Matrix](https://discourse.julialang.org/t/string-distance-matrix/10750)

<div class="topic-metadata">

**Author:** [@Samudra](https://discourse.julialang.org/u/Samudra)\
**Replies:** 1\
**Last updated:** [May 7, 2018, 3:34am UTC](https://discourse.julialang.org/t/string-distance-matrix/10750 "2018-05-07T03:34:33Z")

</div>

Hi, Anyone knows of a straight forward way of creating a String Distance Matrix like in stringdistmatrix(…) in R? /Samudra

---

## [How to compute expoents using JuMP?](https://discourse.julialang.org/t/how-to-compute-expoents-using-jump/10727)

<div class="topic-metadata">

**Author:** [@Noel\_Araujo](https://discourse.julialang.org/u/Noel_Araujo)\
**Replies:** 5\
**Last updated:** [May 7, 2018, 3:00am UTC](https://discourse.julialang.org/t/how-to-compute-expoents-using-jump/10727 "2018-05-07T03:00:43Z")

</div>

I’m trying to compute the best parameters of a surface using JuMP, a very basic example is: # variables x = linspace(1,4,100); y = linspace(1,4,100); # surface U = \[10 - x\[i\].^2 + y\[j\].^-2 for i=1:100, j=1:100\] # test s…

---

## [Changing the REPL prompt from startup file](https://discourse.julialang.org/t/changing-the-repl-prompt-from-startup-file/2151)

<div class="topic-metadata">

**Author:** [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Replies:** 21\
**Last updated:** [May 7, 2018, 2:56am UTC](https://discourse.julialang.org/t/changing-the-repl-prompt-from-startup-file/2151 "2018-05-07T02:56:12Z")

</div>

I know it’s currently possible to change the REPL prompt. The relevant mystic runes are: julia\> Base.active\_repl.interface.modes\[1\].prompt="v$VERSION\> " "v0.5.0\> " v0.5.0\> But I’d like to add this to the .juliarc.jl s…

---

## [Is it a bug in comprehension?](https://discourse.julialang.org/t/is-it-a-bug-in-comprehension/10725)

<div class="topic-metadata">

**Author:** [@mobius-eng](https://discourse.julialang.org/u/mobius-eng)\
**Replies:** 10\
**Last updated:** [May 6, 2018, 9:23pm UTC](https://discourse.julialang.org/t/is-it-a-bug-in-comprehension/10725 "2018-05-06T21:23:06Z")

</div>

I got… hmmm… let’s call interesting behavior with the comprehension but only in function: function foo(tmax, a, b, M, N) println("1: a=$a, b=$b, tmax = $tmax, M = $M, N = $N") tpts = \[ tmax/M\*i for i in 0:N \] …

---

## [Slow block of neural network](https://discourse.julialang.org/t/slow-block-of-neural-network/10716)

<div class="topic-metadata">

**Author:** [@economyboy](https://discourse.julialang.org/u/economyboy)\
**Replies:** 4\
**Last updated:** [May 6, 2018, 6:06pm UTC](https://discourse.julialang.org/t/slow-block-of-neural-network/10716 "2018-05-06T18:06:35Z")

</div>

I just translated a neuronal network from Python to Julia. It is already significantly faster than the Python NN, but written in Pascal it is still almost 20 times faster than the Julia version. By using the @time macro …

---

## [Pmap error with closure](https://discourse.julialang.org/t/pmap-error-with-closure/10691)

<div class="topic-metadata">

**Author:** [@EthanAnderes](https://discourse.julialang.org/u/EthanAnderes)\
**Replies:** 7\
**Last updated:** [May 6, 2018, 2:01pm UTC](https://discourse.julialang.org/t/pmap-error-with-closure/10691 "2018-05-06T14:01:01Z")

</div>

I’ve been getting an error having to do with pmap on closures that I don’t understand. Anyone know what is going on? addprocs(2) function gen\_f(a::T) where T f = x -\> T return f end f = gen\_f(1f0) f(1f0) # …

---

## [Ipopt finished with status Restoration\_Failed](https://discourse.julialang.org/t/ipopt-finished-with-status-restoration-failed/10723)

<div class="topic-metadata">

**Author:** [@j91148700](https://discourse.julialang.org/u/j91148700)\
**Replies:** 3\
**Last updated:** [May 6, 2018, 4:56am UTC](https://discourse.julialang.org/t/ipopt-finished-with-status-restoration-failed/10723 "2018-05-06T04:56:27Z")

</div>

I try to solve a nonlinear model predictive control problem about tracking certain trajectory. Following is the code and I don’t really understand the meaning of “WARNING: Ipopt finished with status Restoration\_Failed …

---

## [In place with multiple modified arguments](https://discourse.julialang.org/t/in-place-with-multiple-modified-arguments/10730)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 2\
**Last updated:** [May 5, 2018, 9:30pm UTC](https://discourse.julialang.org/t/in-place-with-multiple-modified-arguments/10730 "2018-05-05T21:30:15Z")

</div>

Is it valid to do in place operations on multiple arguments? I’m interested in writing a function of the form: function f!(x,y,p) # commands which change x and y x,y end where x and y are modified and p is some set of…

---

## [Catch line number](https://discourse.julialang.org/t/catch-line-number/10729)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 1\
**Last updated:** [May 5, 2018, 7:21pm UTC](https://discourse.julialang.org/t/catch-line-number/10729 "2018-05-05T19:21:09Z")

</div>

is there a way to determine on what file and line number an error has occurred that was tried-and-caught? (I don’t think a println(stacktrace()) gives me this, at least not in a way that I can recognize it. At the time…

---

## [Embedding Julia with Visual C++](https://discourse.julialang.org/t/embedding-julia-with-visual-c/10599)

<div class="topic-metadata">

**Author:** [@mackiem](https://discourse.julialang.org/u/mackiem)\
**Replies:** 2\
**Last updated:** [May 5, 2018, 3:06pm UTC](https://discourse.julialang.org/t/embedding-julia-with-visual-c/10599 "2018-05-05T15:06:12Z")

</div>

I’m new to Julia (but have a run a couple of tutorials), and I’m hoping to simply drop a .lib, and a .dll to my path, and with the headers get it working in Visual Studio, i.e. call the functions I’ve created for a linea…

---

## [Ipopt finished with status Restoration\_Failed(don't reply,posted twice)](https://discourse.julialang.org/t/ipopt-finished-with-status-restoration-failed-dont-reply-posted-twice/10724)

<div class="topic-metadata">

**Author:** [@j91148700](https://discourse.julialang.org/u/j91148700)\
**Replies:** 0\
**Last updated:** [May 5, 2018, 10:29am UTC](https://discourse.julialang.org/t/ipopt-finished-with-status-restoration-failed-dont-reply-posted-twice/10724 "2018-05-05T10:29:55Z")

</div>

I try to solve a nonlinear model predictive control problem about tracking certain trajectory. Following is the code and generally the result will be like \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*…

---

## [API to retrieve the docstring of a function](https://discourse.julialang.org/t/api-to-retrieve-the-docstring-of-a-function/10722)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 2\
**Last updated:** [May 5, 2018, 10:12am UTC](https://discourse.julialang.org/t/api-to-retrieve-the-docstring-of-a-function/10722 "2018-05-05T10:12:39Z")

</div>

I would like to programmatically get the docstring associated to a function – is that possible? On a related note, how can we apply reflection and introspection techniques to functions? In Julia functions are first-clas…

---

## [Precompile to different directories](https://discourse.julialang.org/t/precompile-to-different-directories/10699)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 5\
**Last updated:** [May 5, 2018, 9:16am UTC](https://discourse.julialang.org/t/precompile-to-different-directories/10699 "2018-05-05T09:16:44Z")

</div>

Is it possible in Pkg2 to soecify that packages in different loadoaths precompike to different directories?

---

## [Defined variables within a scope](https://discourse.julialang.org/t/defined-variables-within-a-scope/10721)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 1\
**Last updated:** [May 5, 2018, 6:31am UTC](https://discourse.julialang.org/t/defined-variables-within-a-scope/10721 "2018-05-05T06:31:29Z")

</div>

Hi, I want to get the variables defined within the current scope. Is there a function that does it? Thanks

---

## [Free parameters in function definitions](https://discourse.julialang.org/t/free-parameters-in-function-definitions/10714)

<div class="topic-metadata">

**Author:** [@habemus-papadum](https://discourse.julialang.org/u/habemus-papadum)\
**Replies:** 3\
**Last updated:** [May 5, 2018, 1:52am UTC](https://discourse.julialang.org/t/free-parameters-in-function-definitions/10714 "2018-05-05T01:52:40Z")

</div>

function foo(x) where {T} = x is valid in julia (v0.7) – but I’m not fully grokking this. foo is parameterized by T, but the signature of this method is ‘free’ of T – so how does julia interpret this? Is the T tag m…

---

## [How to get info about the system image?](https://discourse.julialang.org/t/how-to-get-info-about-the-system-image/10719)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 0\
**Last updated:** [May 4, 2018, 11:10pm UTC](https://discourse.julialang.org/t/how-to-get-info-about-the-system-image/10719 "2018-05-04T23:10:41Z")

</div>

Hi, I have build a system image following https://docs.julialang.org/en/release-0.4/devdocs/sysimg/ It works nicely and produce efficient AVX code. I wonder if I can recover information about the system image used for…

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

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