# General Usage

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

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

**Page:** 1013

---

## [How to use glade with Juno?](https://discourse.julialang.org/t/how-to-use-glade-with-juno/7336)

<div class="topic-metadata">

**Author:** [@Ash\_S](https://discourse.julialang.org/u/Ash_S)\
**Replies:** 7\
**Last updated:** [November 28, 2017, 1:35pm UTC](https://discourse.julialang.org/t/how-to-use-glade-with-juno/7336 "2017-11-28T13:35:26Z")

</div>

I’m trying to make a GUI with julia so I tried using Glade since that was the builder recommended by Julia docs in this link. I tried using the code posted to connect the widgets to my code in Juno but keep getting a “gl…

---

## [Auto promote or convert](https://discourse.julialang.org/t/auto-promote-or-convert/7350)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 2\
**Last updated:** [November 28, 2017, 7:54am UTC](https://discourse.julialang.org/t/auto-promote-or-convert/7350 "2017-11-28T07:54:26Z")

</div>

Hi guys, I am looking for a way to do the following: julia\> type DD x::Int end julia\> type EE x::Int end julia\> function f(a::EE) println(a.x) end f (generic funct…

---

## [Appending \`!\` to names of callable objects (functors) that modify their argument?](https://discourse.julialang.org/t/appending-to-names-of-callable-objects-functors-that-modify-their-argument/7343)

<div class="topic-metadata">

**Author:** [@Sleort](https://discourse.julialang.org/u/Sleort)\
**Replies:** 11\
**Last updated:** [November 28, 2017, 7:31am UTC](https://discourse.julialang.org/t/appending-to-names-of-callable-objects-functors-that-modify-their-argument/7343 "2017-11-28T07:31:14Z")

</div>

Suppose I have defined struct MyFunctor x::Int end and I want to make MyFunctor objects callable in two ways, where one method modify the argument, say (f::MyFunctor)(y) = y + f.x (f::MyFunctor)(a, y) = push!(a, f…

---

## [Column-wise operations on matrices, allocating array views](https://discourse.julialang.org/t/column-wise-operations-on-matrices-allocating-array-views/7331)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 8\
**Last updated:** [November 27, 2017, 11:41pm UTC](https://discourse.julialang.org/t/column-wise-operations-on-matrices-allocating-array-views/7331 "2017-11-27T23:41:25Z")

</div>

Hi, I find myself needing to do column-wise operations on matrices a lot (i.e. on A\[:,j\]). Or, spoken differently, I would want to use my matrix almost like a Vector{SVector}, i.e. A\[j\]\[:\], which has identical data layo…

---

## [How to discover packages that are holding other packages from updating?](https://discourse.julialang.org/t/how-to-discover-packages-that-are-holding-other-packages-from-updating/7311)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 10\
**Last updated:** [November 27, 2017, 11:08pm UTC](https://discourse.julialang.org/t/how-to-discover-packages-that-are-holding-other-packages-from-updating/7311 "2017-11-27T23:08:11Z")

</div>

DataFrames v0.11.0 was released, but some package is holding me from updating it. Is there a canonical procedure documented somewhere for discovering these packages that are preventing updates?

---

## [NTuple length dependent on parameter of type](https://discourse.julialang.org/t/ntuple-length-dependent-on-parameter-of-type/7338)

<div class="topic-metadata">

**Author:** [@Ward9250](https://discourse.julialang.org/u/Ward9250)\
**Replies:** 2\
**Last updated:** [November 27, 2017, 4:16pm UTC](https://discourse.julialang.org/t/ntuple-length-dependent-on-parameter-of-type/7338 "2017-11-27T16:16:57Z")

</div>

Is it possible to have a type say: struct A{B} field::NTuple{N, Int} end Say B is always a number so A{5}, A{7} and so on. Is it possible to specify in the type definition that N depends on B, in some manner e.g: str…

---

## [Constant "type parameter" and inner constructor error message](https://discourse.julialang.org/t/constant-type-parameter-and-inner-constructor-error-message/7332)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [November 27, 2017, 2:21pm UTC](https://discourse.julialang.org/t/constant-type-parameter-and-inner-constructor-error-message/7332 "2017-11-27T14:21:19Z")

</div>

The following is an MWE from a typo that I made during refactoring some code: struct Foo{Float64} x::Int Foo() = new(1) end that gave the curious error message WARNING: deprecated syntax "inner constructor Foo…

---

## [Best practices for examples and CI](https://discourse.julialang.org/t/best-practices-for-examples-and-ci/7304)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 13\
**Last updated:** [November 27, 2017, 9:21am UTC](https://discourse.julialang.org/t/best-practices-for-examples-and-ci/7304 "2017-11-27T09:21:35Z")

</div>

I would like to include some worked examples in a package (distinct from unit tests). Where should they go? A subdirectory in docs (will that interfere with Documenter.jl?) or in tests? Is there a framework for run…

---

## [Pass by reference problem](https://discourse.julialang.org/t/pass-by-reference-problem/7329)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 3\
**Last updated:** [November 27, 2017, 8:32am UTC](https://discourse.julialang.org/t/pass-by-reference-problem/7329 "2017-11-27T08:32:26Z")

</div>

julia\> type RR x::Int end julia\> function tt(x,y) if (x+=y) \> 0 x else y end end tt (generic function with 1 method) julia\> import…

---

## [Pkg.update() ERROR: stat: unknown error (UNKNOWN)](https://discourse.julialang.org/t/pkg-update-error-stat-unknown-error-unknown/7316)

<div class="topic-metadata">

**Author:** [@cstook](https://discourse.julialang.org/u/cstook)\
**Replies:** 1\
**Last updated:** [November 27, 2017, 6:07am UTC](https://discourse.julialang.org/t/pkg-update-error-stat-unknown-error-unknown/7316 "2017-11-27T06:07:33Z")

</div>

Pkg.update fails with the following error. \_ \_ \_ \_(\_)\_ | A fresh approach to technical computing (\_) | (\_) (\_) | Documentation: https://docs.julialang.org \_ \_ \_| |\_ \_\_ \_ | …

---

## [Print expressions with ()s inserted for visualizing precedence](https://discourse.julialang.org/t/print-expressions-with-s-inserted-for-visualizing-precedence/7301)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [November 27, 2017, 1:17am UTC](https://discourse.julialang.org/t/print-expressions-with-s-inserted-for-visualizing-precedence/7301 "2017-11-27T01:17:14Z")

</div>

Sometimes I forget precedence rules and would like to see how an expression is parsed as a reminder. Eg if I have ex = parse("x isa Float64 || return false") then it would be nice to display it as (x isa Float64) || (…

---

## [Allocations in a copy! construct](https://discourse.julialang.org/t/allocations-in-a-copy-construct/7323)

<div class="topic-metadata">

**Author:** [@mforets](https://discourse.julialang.org/u/mforets)\
**Replies:** 4\
**Last updated:** [November 26, 2017, 4:42pm UTC](https://discourse.julialang.org/t/allocations-in-a-copy-construct/7323 "2017-11-26T16:42:43Z")

</div>

Consider the following variations of in-place copying: lower = 1.:3 upper = 12.:16 function a() points = zeros(100) allocs = @allocated copy!(points, \[lower\[1:end-1\]; upper\[1:end-1\]\]) println("case a: $allo…

---

## [Iterate over collection of tuples](https://discourse.julialang.org/t/iterate-over-collection-of-tuples/7321)

<div class="topic-metadata">

**Author:** [@Di11on](https://discourse.julialang.org/u/Di11on)\
**Replies:** 3\
**Last updated:** [November 26, 2017, 3:58pm UTC](https://discourse.julialang.org/t/iterate-over-collection-of-tuples/7321 "2017-11-26T15:58:41Z")

</div>

Hi folks, I am new to Julia and we are developing an open source framework for developing and using energy system optimization models. We are using JuMP. We have all been working mostly with GAMS untill now. We are usi…

---

## [Hard aliasing for types](https://discourse.julialang.org/t/hard-aliasing-for-types/7303)

<div class="topic-metadata">

**Author:** [@mikolajpp](https://discourse.julialang.org/u/mikolajpp)\
**Replies:** 14\
**Last updated:** [November 26, 2017, 12:50pm UTC](https://discourse.julialang.org/t/hard-aliasing-for-types/7303 "2017-11-26T12:50:56Z")

</div>

Hello there, Is it possible to hard alias primitive types? For example, I would like to have type MyNumber, on which I will do dispatch for custom arithmetic operators. The obvious solution is struct MyNumber n::Numb…

---

## [Helpful Tip: rename package on github to not having ".jl" and back (to make a permanent alias)](https://discourse.julialang.org/t/helpful-tip-rename-package-on-github-to-not-having-jl-and-back-to-make-a-permanent-alias/7315)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 4\
**Last updated:** [November 26, 2017, 2:13am UTC](https://discourse.julialang.org/t/helpful-tip-rename-package-on-github-to-not-having-jl-and-back-to-make-a-permanent-alias/7315 "2017-11-26T02:13:33Z")

</div>

Lets say: you have a package, Foo.jl, on github Now: if someone goes to github.com/your\_user\_name/foo it breaks and they get a 404 (they needed to add .jl to url) However: if you rename the package to Foo and th…

---

## [Call LAPACK's ZHEEV directly](https://discourse.julialang.org/t/call-lapacks-zheev-directly/7305)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 8\
**Last updated:** [November 25, 2017, 9:13pm UTC](https://discourse.julialang.org/t/call-lapacks-zheev-directly/7305 "2017-11-25T21:13:45Z")

</div>

I know that LAPACK wrappers can be found in Base.LinAlg.LAPACK. However, for example ZHEEV is missing there. I found zheesv in lapack.jl. There, zheesv!() is somehow created in an @eval for loop that I do not really unde…

---

## [How to get a new, independent, randomly initialized RNG](https://discourse.julialang.org/t/how-to-get-a-new-independent-randomly-initialized-rng/7310)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 1\
**Last updated:** [November 25, 2017, 8:06pm UTC](https://discourse.julialang.org/t/how-to-get-a-new-independent-randomly-initialized-rng/7310 "2017-11-25T20:06:58Z")

</div>

How can I get a randomly initialized RNG that is “independent” of Base.Random.GLOBAL\_RNG (in the sense that I can use them in different threads in parallel)? I thought of MersenneTwister(), but that is deprecated withou…

---

## [Duplicates in IndexedTables/JuliaDB](https://discourse.julialang.org/t/duplicates-in-indexedtables-juliadb/7306)

<div class="topic-metadata">

**Author:** [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Replies:** 5\
**Last updated:** [November 25, 2017, 7:27pm UTC](https://discourse.julialang.org/t/duplicates-in-indexedtables-juliadb/7306 "2017-11-25T19:27:12Z")

</div>

Hi, with a 2-D ndsparse table (with one value column), I am trying to select the max value for each of the 1st dimension of the index, but I am not really sure how to do that (groupby removes the second dimension, which …

---

## [Using Clang.jl with pre-built julia](https://discourse.julialang.org/t/using-clang-jl-with-pre-built-julia/7307)

<div class="topic-metadata">

**Author:** [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Replies:** 0\
**Last updated:** [November 25, 2017, 6:11pm UTC](https://discourse.julialang.org/t/using-clang-jl-with-pre-built-julia/7307 "2017-11-25T18:11:07Z")

</div>

Clang.jl needs clang/llmv-conf and libclang available, which is not a problem if you build julia locally (incl llmv etc.), but how to get the correct dependencies with a pre-built (download version) of julia?

---

## [Integration of Python with Julia](https://discourse.julialang.org/t/integration-of-python-with-julia/6304)

<div class="topic-metadata">

**Author:** [@gopal2017](https://discourse.julialang.org/u/gopal2017)\
**Replies:** 3\
**Last updated:** [November 25, 2017, 2:07pm UTC](https://discourse.julialang.org/t/integration-of-python-with-julia/6304 "2017-11-25T14:07:27Z")

</div>

Hi, I want to access data base with Python and want to transfer value retrieved by Python to Julia. Code is very common and available on internet. Pls check it is mentioned below: import pyodbc import DBConfig import nu…

---

## [A bug in ASTInterpreter2?](https://discourse.julialang.org/t/a-bug-in-astinterpreter2/6391)

<div class="topic-metadata">

**Author:** [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Replies:** 13\
**Last updated:** [November 25, 2017, 6:12am UTC](https://discourse.julialang.org/t/a-bug-in-astinterpreter2/6391 "2017-11-25T06:12:47Z")

</div>

Here is a MWE: macro add(num) addnum = parse("add"\*string(num)) return esc(quote $num(x...) = $addnum(x...) end) end @add(one) @add(two) function addone(k::Integer) k = k + 1 return k end func…

---

## [Boolean indexing deprecated?](https://discourse.julialang.org/t/boolean-indexing-deprecated/7299)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 2\
**Last updated:** [November 25, 2017, 2:27am UTC](https://discourse.julialang.org/t/boolean-indexing-deprecated/7299 "2017-11-25T02:27:31Z")

</div>

From the NEWS.md file: Using Bool values directly as indices is now deprecated and will be an error in the future. Convert them to Int before indexing if you intend to access index 1 for true and 0 for false. Does th…

---

## [Pyjulia in desperate need of attention form someone who knows what they're doing](https://discourse.julialang.org/t/pyjulia-in-desperate-need-of-attention-form-someone-who-knows-what-theyre-doing/2702)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 22\
**Last updated:** [November 24, 2017, 10:21pm UTC](https://discourse.julialang.org/t/pyjulia-in-desperate-need-of-attention-form-someone-who-knows-what-theyre-doing/2702 "2017-11-24T22:21:02Z")

</div>

pyjulia I thought I’d advertise this on here, since the repo on github is so neglected. There is practically no documentation, PR’s sit around forever without getting closed or merged, it’s not registered on PyPl and m…

---

## [Julia 0.7 Nightly Breaking Changes](https://discourse.julialang.org/t/julia-0-7-nightly-breaking-changes/7164)

<div class="topic-metadata">

**Author:** [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Replies:** 9\
**Last updated:** [November 24, 2017, 4:54pm UTC](https://discourse.julialang.org/t/julia-0-7-nightly-breaking-changes/7164 "2017-11-24T16:54:42Z")

</div>

The current nightly (2017-11-18) Version 0.7.0-DEV.2528 (Commit 6e4f2fa226) seems to break a few core packages like conda and IDE like IJulia, Juno, Atom. For those who wish to use the nightly versions for development I …

---

## [Unicode related error when reading a .csv](https://discourse.julialang.org/t/unicode-related-error-when-reading-a-csv/7132)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 19\
**Last updated:** [November 23, 2017, 11:19am UTC](https://discourse.julialang.org/t/unicode-related-error-when-reading-a-csv/7132 "2017-11-23T11:19:13Z")

</div>

Hi everyone, I get the following error message when trying to run readcsv(): at row 2, column 5 : UnicodeError: invalid character index) in readcsv at base\\datafmt.jl:619 in #readcsv#15 at base\\datafmt.jl:619 \<inlined\> …

---

## [Type inference on linspace fails when given Float32 arguments on 0.6.1?](https://discourse.julialang.org/t/type-inference-on-linspace-fails-when-given-float32-arguments-on-0-6-1/7281)

<div class="topic-metadata">

**Author:** [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Replies:** 3\
**Last updated:** [November 24, 2017, 11:56am UTC](https://discourse.julialang.org/t/type-inference-on-linspace-fails-when-given-float32-arguments-on-0-6-1/7281 "2017-11-24T11:56:38Z")

</div>

julia\> function cwt(a, b) for i ∈ linspace(a, b, 4) println(i, " ", typeof(i)) end end cwt (generic function with 1 method) julia\> cwt(0f0, 3f0) 0.0 Float32 1.0 Float32 2.0 F…

---

## [Is there an HTML string type in Julia?](https://discourse.julialang.org/t/is-there-an-html-string-type-in-julia/7276)

<div class="topic-metadata">

**Author:** [@robblackwell](https://discourse.julialang.org/u/robblackwell)\
**Replies:** 1\
**Last updated:** [November 23, 2017, 5:34pm UTC](https://discourse.julialang.org/t/is-there-an-html-string-type-in-julia/7276 "2017-11-23T17:34:55Z")

</div>

When working in IJulia I find myself using this code: struct HtmlString s::String end Base.show(io::IO, ::MIME"text/html", s::HtmlString) = print(io, s.s) HtmlString("Result: \<b\>123.4\</b") I…

---

## [Why type instability?](https://discourse.julialang.org/t/why-type-instability/4013)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 24\
**Last updated:** [November 23, 2017, 1:36pm UTC](https://discourse.julialang.org/t/why-type-instability/4013 "2017-11-23T13:36:08Z")

</div>

We know that type instability is bad for performance. So why Julia allows type instability? That is, Julia could throw an error whenever a variable changes type.

---

## [Benchmarking / profiling cache use](https://discourse.julialang.org/t/benchmarking-profiling-cache-use/7260)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 3\
**Last updated:** [November 23, 2017, 12:23pm UTC](https://discourse.julialang.org/t/benchmarking-profiling-cache-use/7260 "2017-11-23T12:23:40Z")

</div>

Hi, I wanted to profile cache misses on some code of mine. I appear to be incapable of eyeballing the hardware prefetcher, and wanted to see whether some explicit prefetches improve my code. These are kinda accessible v…

---

## [Type constructor ambiguities](https://discourse.julialang.org/t/type-constructor-ambiguities/7264)

<div class="topic-metadata">

**Author:** [@DNF](https://discourse.julialang.org/u/DNF)\
**Replies:** 2\
**Last updated:** [November 23, 2017, 10:31am UTC](https://discourse.julialang.org/t/type-constructor-ambiguities/7264 "2017-11-23T10:31:34Z")

</div>

I am a bit mystified by the behaviour I am seeing when creating types that inherit from StaticArrays.FieldVector: julia\> using StaticArrays julia\> struct Dummy{T} \<: FieldVector{2, T} x::T y::T …

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

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