# General Usage

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

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

**Page:** 893

---

## [Subset tuples with macros](https://discourse.julialang.org/t/subset-tuples-with-macros/20834)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 10\
**Last updated:** [February 17, 2019, 9:01am UTC](https://discourse.julialang.org/t/subset-tuples-with-macros/20834 "2019-02-17T09:01:49Z")

</div>

The problem, I have some data stored in tuples and want to access it in a type stable way: x = ntuple(i -\> UInt8(i), 80) f(y) = y\[1:4\] @code\_warntype f(x) Returns an NTuple of undefined length. f(y) = (y\[1\], y\[2\], y\[3…

---

## [Any fix or fork of emmt/Xlib.jl working on Julia 1.x?](https://discourse.julialang.org/t/any-fix-or-fork-of-emmt-xlib-jl-working-on-julia-1-x/20885)

<div class="topic-metadata">

**Author:** [@sdothum](https://discourse.julialang.org/u/sdothum)\
**Replies:** 0\
**Last updated:** [February 17, 2019, 12:41am UTC](https://discourse.julialang.org/t/any-fix-or-fork-of-emmt-xlib-jl-working-on-julia-1-x/20885 "2019-02-17T00:41:36Z")

</div>

From what I can tell, Xlib.jl has been broken for some time. Am looking to cobble together a WM using Julia.

---

## [Parametric Outer Constructor](https://discourse.julialang.org/t/parametric-outer-constructor/20874)

<div class="topic-metadata">

**Author:** [@JaredCrean2](https://discourse.julialang.org/u/JaredCrean2)\
**Replies:** 3\
**Last updated:** [February 16, 2019, 9:53pm UTC](https://discourse.julialang.org/t/parametric-outer-constructor/20874 "2019-02-16T21:53:22Z")

</div>

Looking at #24909, I’m a little confused by constructor for PushVector. Here is simple example: struct Foo{T} a::Int end function Foo{T}() where {T} # what is this? return Foo{T}(1) end The function on the 4th l…

---

## [MethodError while running a command](https://discourse.julialang.org/t/methoderror-while-running-a-command/20873)

<div class="topic-metadata">

**Author:** [@venkat](https://discourse.julialang.org/u/venkat)\
**Replies:** 1\
**Last updated:** [February 16, 2019, 8:18pm UTC](https://discourse.julialang.org/t/methoderror-while-running-a-command/20873 "2019-02-16T20:18:37Z")

</div>

julia\> out\_io = IOBuffer() IOBuffer(data=UInt8\[...\], readable=true, writable=true, seekable=true, append=false, size=0, maxsize=Inf, ptr=1, mark=-1) julia\> err\_io = IOBuffer() IOBuffer(data=UInt8\[...\], readable=true, wr…

---

## [Is there a more efficient way to define an iterator through ordered tuples?](https://discourse.julialang.org/t/is-there-a-more-efficient-way-to-define-an-iterator-through-ordered-tuples/20819)

<div class="topic-metadata">

**Author:** [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Replies:** 7\
**Last updated:** [February 16, 2019, 7:17pm UTC](https://discourse.julialang.org/t/is-there-a-more-efficient-way-to-define-an-iterator-through-ordered-tuples/20819 "2019-02-16T19:17:37Z")

</div>

What I have so far is julia\> import Base: iterate, length julia\>…

---

## [Struggling to embed Julia in C](https://discourse.julialang.org/t/struggling-to-embed-julia-in-c/20861)

<div class="topic-metadata">

**Author:** [@Cian\_Hughes](https://discourse.julialang.org/u/Cian_Hughes)\
**Replies:** 0\
**Last updated:** [February 16, 2019, 2:57pm UTC](https://discourse.julialang.org/t/struggling-to-embed-julia-in-c/20861 "2019-02-16T14:57:20Z")

</div>

I’ve been attempting to embed julia in C so that i can use my julia module to do some pretty heavy physics computations and pass them to my colleagues existing program written in C. I started small with the embedding exa…

---

## [Workers process memory leaks v1.1.0](https://discourse.julialang.org/t/workers-process-memory-leaks-v1-1-0/20852)

<div class="topic-metadata">

**Author:** [@jamm](https://discourse.julialang.org/u/jamm)\
**Replies:** 1\
**Last updated:** [February 16, 2019, 8:42am UTC](https://discourse.julialang.org/t/workers-process-memory-leaks-v1-1-0/20852 "2019-02-16T08:42:04Z")

</div>

HI, Community! I faced with strange problem. It is probably a memory leak on worker process. I use command for running instance, like this: /opt/julia-1.1.0/bin/julia --project=/opt/seismo-api-gm-concave-module.jl --l…

---

## [DifferentialEquations.jl Error](https://discourse.julialang.org/t/differentialequations-jl-error/20482)

<div class="topic-metadata">

**Author:** [@Blue](https://discourse.julialang.org/u/Blue)\
**Replies:** 7\
**Last updated:** [February 16, 2019, 5:32am UTC](https://discourse.julialang.org/t/differentialequations-jl-error/20482 "2019-02-16T05:32:02Z")

</div>

I get the error MethodError: objects of type Float64 are not callable when trying to run sol = solve(prob). I have checked solutions to this error and none have worked. using DifferentialEquations const σ = 0.002; const…

---

## [Missing of a certain data type](https://discourse.julialang.org/t/missing-of-a-certain-data-type/20779)

<div class="topic-metadata">

**Author:** [@ahmetumutdurmus](https://discourse.julialang.org/u/ahmetumutdurmus)\
**Replies:** 5\
**Last updated:** [February 15, 2019, 10:37pm UTC](https://discourse.julialang.org/t/missing-of-a-certain-data-type/20779 "2019-02-15T22:37:34Z")

</div>

Hello, I have just read the documentation on missing values and while I can’t comment on performance issues I have found it very intuive. The documentation on missing starts as: Julia provides support for representing …

---

## [\`findmax\` bug?](https://discourse.julialang.org/t/findmax-bug/20818)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 14\
**Last updated:** [February 15, 2019, 8:51pm UTC](https://discourse.julialang.org/t/findmax-bug/20818 "2019-02-15T20:51:10Z")

</div>

On Julia v0.6.4 the following worked, but no longer on v0.7, v1.0.x and v1.1.0: a = rand(3) findmax( a\[j\] for j = 1:3 ) results in ERROR: MethodError: no method matching keys(::Base.Generator{UnitRange{Int64},getfield…

---

## [Question about Indexing with CartesianIndex](https://discourse.julialang.org/t/question-about-indexing-with-cartesianindex/20827)

<div class="topic-metadata">

**Author:** [@weech](https://discourse.julialang.org/u/weech)\
**Replies:** 1\
**Last updated:** [February 15, 2019, 7:22pm UTC](https://discourse.julialang.org/t/question-about-indexing-with-cartesianindex/20827 "2019-02-15T19:22:00Z")

</div>

Let’s say you have an array a = reshape(1:5\*10\*25, 5, 10, 25). Why does all(a\[CartesianIndex(1, 1), 1:end\] .== a\[CartesianIndex(1, 1), 1:10\] .== a\[1, 1, 1:10\]) return true? I would expect that a\[CartesianIndex(1, 1), 1:e…

---

## [Help reading @code\_warntype output](https://discourse.julialang.org/t/help-reading-code-warntype-output/20832)

<div class="topic-metadata">

**Author:** [@natemcintosh](https://discourse.julialang.org/u/natemcintosh)\
**Replies:** 1\
**Last updated:** [February 15, 2019, 7:20pm UTC](https://discourse.julialang.org/t/help-reading-code-warntype-output/20832 "2019-02-15T19:20:11Z")

</div>

I’m attempting to learn a bit about how to read the output of @code\_warntype If I have a function like function myGlob(pattern::Regex, to\_search::Vector{String})::Vector{String} """ Something similar to glob …

---

## [Strange error with coroutines](https://discourse.julialang.org/t/strange-error-with-coroutines/20815)

<div class="topic-metadata">

**Author:** [@zweiglimmergneis](https://discourse.julialang.org/u/zweiglimmergneis)\
**Replies:** 2\
**Last updated:** [February 15, 2019, 1:49pm UTC](https://discourse.julialang.org/t/strange-error-with-coroutines/20815 "2019-02-15T13:49:17Z")

</div>

I get an error filling a an array using two different Channels. Surprisingly, the error disappears by adding a debug println statement. I tried to set up a smaller example. However, with only one Channel the error could …

---

## [Open\_dialog with a transient parent](https://discourse.julialang.org/t/open-dialog-with-a-transient-parent/9334)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 15\
**Last updated:** [February 15, 2019, 1:54am UTC](https://discourse.julialang.org/t/open-dialog-with-a-transient-parent/9334 "2019-02-15T01:54:55Z")

</div>

How exactly do I use Gtk.open\_dialog from Gtk with a parent, and avoid this: Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged. Any MWE would be great, thanks!

---

## [Tab completion in Help - only works after Module dot](https://discourse.julialang.org/t/tab-completion-in-help-only-works-after-module-dot/20821)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 2\
**Last updated:** [February 15, 2019, 12:10pm UTC](https://discourse.julialang.org/t/tab-completion-in-help-only-works-after-module-dot/20821 "2019-02-15T12:10:13Z")

</div>

I was recently trying to work with Metalhead - the particular module is not important. I wanted to find all the functions exposed by Metalhead. In the ? help prompt I found that: ?Metalhead does nothing ?Metalhead. d…

---

## [How to change the font of GtkLabel?](https://discourse.julialang.org/t/how-to-change-the-font-of-gtklabel/20794)

<div class="topic-metadata">

**Author:** [@Carsten](https://discourse.julialang.org/u/Carsten)\
**Replies:** 2\
**Last updated:** [February 15, 2019, 10:41am UTC](https://discourse.julialang.org/t/how-to-change-the-font-of-gtklabel/20794 "2019-02-15T10:41:50Z")

</div>

How to change the font of GtkLabel? In particular I’m looking for greek characters.

---

## [Julia static compilation](https://discourse.julialang.org/t/julia-static-compilation/296)

<div class="topic-metadata">

**Author:** [@jesse](https://discourse.julialang.org/u/jesse)\
**Replies:** 38\
**Last updated:** [February 15, 2019, 10:02am UTC](https://discourse.julialang.org/t/julia-static-compilation/296 "2019-02-15T10:02:49Z")

</div>

Hi! I’m loving Julia and I have built optimization algorithms with it that are blazingly fast (runtime and development!) and I don’t see any reason to port them into C/C++ or similar for speed-up reasons. What I would n…

---

## [Calling Lapack's Jacobi SVD - dgesvj](https://discourse.julialang.org/t/calling-lapacks-jacobi-svd-dgesvj/20602)

<div class="topic-metadata">

**Author:** [@Snir\_Gazit](https://discourse.julialang.org/u/Snir_Gazit)\
**Replies:** 4\
**Last updated:** [February 15, 2019, 9:15am UTC](https://discourse.julialang.org/t/calling-lapacks-jacobi-svd-dgesvj/20602 "2019-02-15T09:15:40Z")

</div>

The current Julia SVD interface appears to support only “simple” and “divide and conquer”. Is there any simple way to call Jacobi’s methods – (dgesvj Lapack function)? If wrapping the Lapack function is the only viable …

---

## [Pyjulia local package](https://discourse.julialang.org/t/pyjulia-local-package/20807)

<div class="topic-metadata">

**Author:** [@mopg](https://discourse.julialang.org/u/mopg)\
**Replies:** 1\
**Last updated:** [February 15, 2019, 5:37am UTC](https://discourse.julialang.org/t/pyjulia-local-package/20807 "2019-02-15T05:37:47Z")

</div>

I’ve been trying to use the pyjulia package to call some local julia package from python, but haven’t had any luck. The following examples work (Interpolations is installed) from julia import Base from julia import Int…

---

## [Unable to start vscode REPL](https://discourse.julialang.org/t/unable-to-start-vscode-repl/20677)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 3\
**Last updated:** [February 15, 2019, 5:11am UTC](https://discourse.julialang.org/t/unable-to-start-vscode-repl/20677 "2019-02-15T05:11:05Z")

</div>

I’m having a problem with VSCode not being able to start the Julia REPL. From VSCode, it shows that the program had an exit status of 2. I copied the exact same command from VSCode and run it from a command prompt. It…

---

## [Is there a reason a \`MersenneTwister\` value is not broadcastable?](https://discourse.julialang.org/t/is-there-a-reason-a-mersennetwister-value-is-not-broadcastable/20774)

<div class="topic-metadata">

**Author:** [@fjarri](https://discourse.julialang.org/u/fjarri)\
**Replies:** 17\
**Last updated:** [February 15, 2019, 1:54am UTC](https://discourse.julialang.org/t/is-there-a-reason-a-mersennetwister-value-is-not-broadcastable/20774 "2019-02-15T01:54:44Z")

</div>

I have multiple functions with the same pattern: foo(rng::AbstractRNG, x::ValueType) = ... which are commonly applied to arrays as foo.(rng::AbstractRNG, a::Array{ValueType}) which is supposed to be equivalent to, e…

---

## [Error using isnan](https://discourse.julialang.org/t/error-using-isnan/20798)

<div class="topic-metadata">

**Author:** [@Erisme](https://discourse.julialang.org/u/Erisme)\
**Replies:** 3\
**Last updated:** [February 15, 2019, 1:46am UTC](https://discourse.julialang.org/t/error-using-isnan/20798 "2019-02-15T01:46:46Z")

</div>

Hi, I have trouble using the function isnan. I want to replace NaN value by 0. any help? julia\> a=\[1 2 3; 4 5 NaN\] 2×3 Array{Float64,2}: 1.0 2.0 3.0 4.0 5.0 NaN julia\> a\[isnan(a)\]=0 ERROR: MethodError: no me…

---

## [How to covert old package to use the new package manager](https://discourse.julialang.org/t/how-to-covert-old-package-to-use-the-new-package-manager/20797)

<div class="topic-metadata">

**Author:** [@lstagner](https://discourse.julialang.org/u/lstagner)\
**Replies:** 1\
**Last updated:** [February 14, 2019, 11:00pm UTC](https://discourse.julialang.org/t/how-to-covert-old-package-to-use-the-new-package-manager/20797 "2019-02-14T23:00:42Z")

</div>

How do you convert a package to use the new package system. using activate and adding packages will create the Project.toml file but it won’t have the name, uuid, version and author fields and generate complains that t…

---

## [@InexactError(T, value) =\> InexactError(funcname, T, value)](https://discourse.julialang.org/t/inexacterror-t-value-inexacterror-funcname-t-value/20772)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 0\
**Last updated:** [February 14, 2019, 2:01am UTC](https://discourse.julialang.org/t/inexacterror-t-value-inexacterror-funcname-t-value/20772 "2019-02-14T02:01:52Z")

</div>

InexactError expects three args to express “cannot convert value val to type T in function name”: InexactError(name::Symbol, T, val) I would like to use it this way throw(@InexactError(T, val)) where the name of the en…

---

## [Using a user defined system image in pyjulia](https://discourse.julialang.org/t/using-a-user-defined-system-image-in-pyjulia/20788)

<div class="topic-metadata">

**Author:** [@timmm](https://discourse.julialang.org/u/timmm)\
**Replies:** 1\
**Last updated:** [February 14, 2019, 8:18pm UTC](https://discourse.julialang.org/t/using-a-user-defined-system-image-in-pyjulia/20788 "2019-02-14T20:18:41Z")

</div>

When we start Julia with the $ ./Julia --help option, it says we can use the flag -J and point to a system image file. Is this possible to use such an image when calling Julia from python using pyjulia? (GitHub - Juli…

---

## [Macro to create struct according to existing variables' type and name](https://discourse.julialang.org/t/macro-to-create-struct-according-to-existing-variables-type-and-name/20793)

<div class="topic-metadata">

**Author:** [@vitreo12](https://discourse.julialang.org/u/vitreo12)\
**Replies:** 5\
**Last updated:** [February 14, 2019, 8:17pm UTC](https://discourse.julialang.org/t/macro-to-create-struct-according-to-existing-variables-type-and-name/20793 "2019-02-14T20:17:07Z")

</div>

Hello everyone, I was wondering if there was a way to define a macro @define that, given let a::Float64 = 0.5 b::Int64 = 1 @define MyStruct a b end would define a struct MyStruct with fields a::Float64 and b::Int64, a…

---

## [Issue with loop](https://discourse.julialang.org/t/issue-with-loop/20768)

<div class="topic-metadata">

**Author:** [@Erisme](https://discourse.julialang.org/u/Erisme)\
**Replies:** 8\
**Last updated:** [February 14, 2019, 6:16pm UTC](https://discourse.julialang.org/t/issue-with-loop/20768 "2019-02-14T18:16:15Z")

</div>

Hi, I need some help please, I have an error that i don’t understand how to fix it. Something that i can’t see. julia\> a=0 0 julia\> (a+=1 for i in 1:3) Base.Generator{UnitRange{Int64},getfield(Main, Symbol(“##3#4”))…

---

## [Background thread for periodic updates](https://discourse.julialang.org/t/background-thread-for-periodic-updates/20786)

<div class="topic-metadata">

**Author:** [@cedeerwe](https://discourse.julialang.org/u/cedeerwe)\
**Replies:** 3\
**Last updated:** [February 14, 2019, 4:13pm UTC](https://discourse.julialang.org/t/background-thread-for-periodic-updates/20786 "2019-02-14T16:13:53Z")

</div>

Hey guys, I am facing the following issue. I have two main processes: one which updates the state of some of the objects in a fixed interval (e.g. every 100 milliseconds), the other one which uses this state to perform…

---

## [Vector to NamedTuple?](https://discourse.julialang.org/t/vector-to-namedtuple/20683)

<div class="topic-metadata">

**Author:** [@goedman](https://discourse.julialang.org/u/goedman)\
**Replies:** 7\
**Last updated:** [February 14, 2019, 3:31pm UTC](https://discourse.julialang.org/t/vector-to-namedtuple/20683 "2019-02-14T15:31:07Z")

</div>

Hi, there are good examples to convert NamedTupes to Dict and vice versa etc. But in e.g. Optim’s minimize, I would like to go from a single vector to a NamedTuple.I was wondering if this case has a proven solution? I c…

---

## [Performance Regression on Micro-Benchmark (Calculus, ForwardDiff)](https://discourse.julialang.org/t/performance-regression-on-micro-benchmark-calculus-forwarddiff/20785)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 3\
**Last updated:** [February 14, 2019, 1:37pm UTC](https://discourse.julialang.org/t/performance-regression-on-micro-benchmark-calculus-forwarddiff/20785 "2019-02-14T13:37:55Z")

</div>

I noticed an unexpected performance regression when porting a package from 0.6.4 to 0.7 and reduced it to the following example script; output on v0.6.4, v0.7 and v1.0 are below. The performance of ForwardDiff is remarka…

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

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