# General Usage

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

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

**Page:** 986

---

## [dynamic Vararg count](https://discourse.julialang.org/t/dynamic-vararg-count/10144)

<div class="topic-metadata">

**Author:** [@atteson](https://discourse.julialang.org/u/atteson)\
**Replies:** 10\
**Last updated:** [April 4, 2018, 5:47pm UTC](https://discourse.julialang.org/t/dynamic-vararg-count/10144 "2018-04-04T17:47:10Z")

</div>

The following code fails to compile (if n is not defined in Main that is). Is there a way to do something like this? function f(n::Int); g(x::Vararg{Float64,n}) = sum(x); end

---

## [Can one override method ambiguity?](https://discourse.julialang.org/t/can-one-override-method-ambiguity/10140)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [April 4, 2018, 4:02pm UTC](https://discourse.julialang.org/t/can-one-override-method-ambiguity/10140 "2018-04-04T16:02:50Z")

</div>

I have an API for which the user defines methods for a function, to dispatch on user-defined types. However, when the second argument is nothing, I want this method to return nothing without the user defining a method f…

---

## [Inverse of a symmetric matrix is not symmetric?](https://discourse.julialang.org/t/inverse-of-a-symmetric-matrix-is-not-symmetric/10132)

<div class="topic-metadata">

**Author:** [@realdavid](https://discourse.julialang.org/u/realdavid)\
**Replies:** 16\
**Last updated:** [April 4, 2018, 2:16pm UTC](https://discourse.julialang.org/t/inverse-of-a-symmetric-matrix-is-not-symmetric/10132 "2018-04-04T14:16:32Z")

</div>

I am new to Julia and I am using Julia Version 0.6.2 and I am wondering the possible reason for the following. mat = zeros(6, 6) for i = 1 : 6 for j = 1 : 6 mat\[i, j\] = exp(-(i - j)^2) end end issymmetri…

---

## [Problems with CodecZlib](https://discourse.julialang.org/t/problems-with-codeczlib/10124)

<div class="topic-metadata">

**Author:** [@jacobcvt12](https://discourse.julialang.org/u/jacobcvt12)\
**Replies:** 7\
**Last updated:** [April 4, 2018, 1:44pm UTC](https://discourse.julialang.org/t/problems-with-codeczlib/10124 "2018-04-04T13:44:38Z")

</div>

I’m unable to build CodecZlib (required for DataFrames). I get the error below. Any ideas on what I need to do to fix this problem? julia\> Pkg.build("CodecZlib") INFO: Building CodecZlib Info: Downloading https://github…

---

## [Behavior of == when isless or \< is defined](https://discourse.julialang.org/t/behavior-of-when-isless-or-is-defined/10114)

<div class="topic-metadata">

**Author:** [@sambitdash](https://discourse.julialang.org/u/sambitdash)\
**Replies:** 22\
**Last updated:** [April 4, 2018, 11:19am UTC](https://discourse.julialang.org/t/behavior-of-when-isless-or-is-defined/10114 "2018-04-04T11:19:57Z")

</div>

Hi All, I will like to understand the behavior of == of an immutable type when \< is defined. When strict ordering exists in a system, == is not mandated. For example: ==(a, b) = !(a \< b) && !(b \< a) Is it how Julia …

---

## [How to speed up the Interpolation](https://discourse.julialang.org/t/how-to-speed-up-the-interpolation/10147)

<div class="topic-metadata">

**Author:** [@Wonki\_Lee](https://discourse.julialang.org/u/Wonki_Lee)\
**Replies:** 7\
**Last updated:** [April 4, 2018, 10:31am UTC](https://discourse.julialang.org/t/how-to-speed-up-the-interpolation/10147 "2018-04-04T10:31:01Z")

</div>

Hi all ~. Currently, I want to make a function that returns numerical integration through interpolation. But my array is large(~10^7) which takes extreme amounts of allocations & memory. Here’s my code. unit\_q = colle…

---

## [Wrapper for GDBM](https://discourse.julialang.org/t/wrapper-for-gdbm/10152)

<div class="topic-metadata">

**Author:** [@BenLauwens](https://discourse.julialang.org/u/BenLauwens)\
**Replies:** 0\
**Last updated:** [April 4, 2018, 9:07am UTC](https://discourse.julialang.org/t/wrapper-for-gdbm/10152 "2018-04-04T09:07:45Z")

</div>

Hi I have made a thin wrapper for the gdbm library: GDBM.jl. The interface for associative collections is partially implemented. If there is some interest, documentation, testing and automatic installation of the depen…

---

## [sessionInfo() in Julia](https://discourse.julialang.org/t/sessioninfo-in-julia/10151)

<div class="topic-metadata">

**Author:** [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Replies:** 1\
**Last updated:** [April 4, 2018, 8:29am UTC](https://discourse.julialang.org/t/sessioninfo-in-julia/10151 "2018-04-04T08:29:45Z")

</div>

A good practice for reproducible research and code is to report the session information. I believe there should be a better and more complete solution especially relying on Revise.jl and hopefully is something implemente…

---

## [How should I implement parallel maximum likelihood?](https://discourse.julialang.org/t/how-should-i-implement-parallel-maximum-likelihood/10113)

<div class="topic-metadata">

**Author:** [@aaowens](https://discourse.julialang.org/u/aaowens)\
**Replies:** 7\
**Last updated:** [April 4, 2018, 2:48am UTC](https://discourse.julialang.org/t/how-should-i-implement-parallel-maximum-likelihood/10113 "2018-04-04T02:48:52Z")

</div>

In my maximum likelihood problem, I have a fixed collection of data and I want to evaluate a complicated likelihood function on it for different parameter values until I find the best one. The simplest solution I’ve foun…

---

## [Nullables (Deprecated?)](https://discourse.julialang.org/t/nullables-deprecated/10089)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 11\
**Last updated:** [April 4, 2018, 1:57am UTC](https://discourse.julialang.org/t/nullables-deprecated/10089 "2018-04-04T01:57:31Z")

</div>

I am reading systematically from start to end through the current 0.6.2 manual. section 14.4 is about Nullable objects. Has a decision been made about the fate of Nullable? is it replaced by Missing? (If so, maybe ad…

---

## [Boltzmann Factor in a loop](https://discourse.julialang.org/t/boltzmann-factor-in-a-loop/10086)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 38\
**Last updated:** [April 3, 2018, 9:30pm UTC](https://discourse.julialang.org/t/boltzmann-factor-in-a-loop/10086 "2018-04-03T21:30:22Z")

</div>

I was looking at the performance of a Monte Carlo method with @cortner and he observed there was some unanticipated behavior in the computation of the Boltzmann factor, e^{-\\beta V(x)}, within the loop. The following is…

---

## [JuMP Does Not Precompile](https://discourse.julialang.org/t/jump-does-not-precompile/10141)

<div class="topic-metadata">

**Author:** [@shoshievass](https://discourse.julialang.org/u/shoshievass)\
**Replies:** 7\
**Last updated:** [April 3, 2018, 7:02pm UTC](https://discourse.julialang.org/t/jump-does-not-precompile/10141 "2018-04-03T19:02:33Z")

</div>

I downloaded Baron (and Pkg.add(“BARON”)) and did a Pkg.update() this morning and since doing that, I’m unable to use JuMP. Does anyone know what might be going on? Julia Version: Version 0.6.2 (2017-12-13 18:08 UTC) W…

---

## [Broadcast operations with ranges](https://discourse.julialang.org/t/broadcast-operations-with-ranges/10139)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 7\
**Last updated:** [April 3, 2018, 6:42pm UTC](https://discourse.julialang.org/t/broadcast-operations-with-ranges/10139 "2018-04-03T18:42:04Z")

</div>

Say I want to use a sliding window of width = N, such that in the first iteration I would write it as the range 1:N, and the start and stop values of the range would move j units after the j-th iteration. My first try wo…

---

## [How can I speed up calling python function?](https://discourse.julialang.org/t/how-can-i-speed-up-calling-python-function/10135)

<div class="topic-metadata">

**Author:** [@jbrea](https://discourse.julialang.org/u/jbrea)\
**Replies:** 2\
**Last updated:** [April 3, 2018, 2:48pm UTC](https://discourse.julialang.org/t/how-can-i-speed-up-calling-python-function/10135 "2018-04-03T14:48:43Z")

</div>

I would like to use the openai gym in julia. Thanks to PyCall this is very easy. The only downside is that my naive approach seems to be pretty slow. To demonstrate this, I use a minimal example with numpy. I observe qu…

---

## [QML FileDialog](https://discourse.julialang.org/t/qml-filedialog/10125)

<div class="topic-metadata">

**Author:** [@Jordan\_Cluts](https://discourse.julialang.org/u/Jordan_Cluts)\
**Replies:** 4\
**Last updated:** [April 3, 2018, 2:04pm UTC](https://discourse.julialang.org/t/qml-filedialog/10125 "2018-04-03T14:04:21Z")

</div>

I am a user coming from Matlab and I missed the Matlab functionality of uigetfile. When I’m prototyping functions that process data it’s handy to have a simple function that opens a selection dialog and returns the filen…

---

## [Shouldn't isempty(nothing) return true?](https://discourse.julialang.org/t/shouldnt-isempty-nothing-return-true/9296)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 21\
**Last updated:** [April 3, 2018, 1:30pm UTC](https://discourse.julialang.org/t/shouldnt-isempty-nothing-return-true/9296 "2018-04-03T13:30:48Z")

</div>

As subject says, instead of isempty(nothing) ERROR: MethodError: no method matching start(::Void)

---

## [Kernel error in jupyter](https://discourse.julialang.org/t/kernel-error-in-jupyter/10123)

<div class="topic-metadata">

**Author:** [@ameliajo](https://discourse.julialang.org/u/ameliajo)\
**Replies:** 2\
**Last updated:** [April 3, 2018, 12:41pm UTC](https://discourse.julialang.org/t/kernel-error-in-jupyter/10123 "2018-04-03T12:41:25Z")

</div>

When trying to open a notebook in jupyter, it gives me the following kernel error. (Note, I am running Julia 0.6.2). FileNotFoundError: \[Errno 2\] No such file or directory: ‘/private/var/folders/ch/3nf50c254qj98r9h\_r6wh…

---

## [Adding methods to a function wrapper dynamically](https://discourse.julialang.org/t/adding-methods-to-a-function-wrapper-dynamically/10111)

<div class="topic-metadata">

**Author:** [@anon67531922](https://discourse.julialang.org/u/anon67531922)\
**Replies:** 2\
**Last updated:** [April 3, 2018, 8:52am UTC](https://discourse.julialang.org/t/adding-methods-to-a-function-wrapper-dynamically/10111 "2018-04-03T08:52:11Z")

</div>

Good morning from Manila! :wave::coffee: I have a function wrapper: julia\> struct fwrap f::Function end julia\> fw = fwrap(() -\> nothing) fwrap(#11) I can now implement multiple methods for my f, e.g. julia\> fw.f(…

---

## [SimpleTraits error in Julia 0.6](https://discourse.julialang.org/t/simpletraits-error-in-julia-0-6/10109)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 3\
**Last updated:** [April 3, 2018, 8:31am UTC](https://discourse.julialang.org/t/simpletraits-error-in-julia-0-6/10109 "2018-04-03T08:31:39Z")

</div>

Is SimpleTraits still supported in 0.6? This simple code from the test suite fails. Note that it works fine on Julia 0.7. julia\> using SimpleTraits julia\> @traitdef Tr1{X} julia\> @traitimpl Tr1{Integer} julia\> cons…

---

## [How do you inherit Interface?](https://discourse.julialang.org/t/how-do-you-inherit-interface/10097)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 8\
**Last updated:** [April 2, 2018, 1:57pm UTC](https://discourse.julialang.org/t/how-do-you-inherit-interface/10097 "2018-04-02T13:57:17Z")

</div>

How do you inherit interfaces in Julia? There is some required functions for certain types, like subtypes of AbstractArray, etc. Will it be possible to inherit those required functions that is not actually different fro…

---

## [Curious regression](https://discourse.julialang.org/t/curious-regression/10108)

<div class="topic-metadata">

**Author:** [@stabbles](https://discourse.julialang.org/u/stabbles)\
**Replies:** 0\
**Last updated:** [April 1, 2018, 10:31pm UTC](https://discourse.julialang.org/t/curious-regression/10108 "2018-04-01T22:31:46Z")

</div>

A while ago I found a curious performance regression in a very simple change to the sparse mat-vec product. Today I tried the same on Julia 0.7 and the results were exactly the opposite\*: \> bench() # Julia 0.6.2 (Trial(…

---

## [Using locks in pmap](https://discourse.julialang.org/t/using-locks-in-pmap/10087)

<div class="topic-metadata">

**Author:** [@squaregoldfish](https://discourse.julialang.org/u/squaregoldfish)\
**Replies:** 2\
**Last updated:** [April 1, 2018, 9:24pm UTC](https://discourse.julialang.org/t/using-locks-in-pmap/10087 "2018-04-01T21:24:04Z")

</div>

I have an @everywhere function that I’m running in pmap, which works well except for the occasional glitch. I have a theory that said glitch is related to an I/O issue when multiple processes try to read/write files at t…

---

## [Removing \`2 allocations: 64 bytes\`](https://discourse.julialang.org/t/removing-2-allocations-64-bytes/10095)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 2\
**Last updated:** [April 1, 2018, 6:34am UTC](https://discourse.julialang.org/t/removing-2-allocations-64-bytes/10095 "2018-04-01T06:34:36Z")

</div>

I am trying to make a super-fast QR decomposition with 0 allocations if possible. At this point https://github.com/mohamed82008/InplaceQR.jl is at 2 allocations: 64 bytes and within a factor of 8 of LAPACK’s multi-thread…

---

## [Extracting Q from qrfact allocation-free](https://discourse.julialang.org/t/extracting-q-from-qrfact-allocation-free/10083)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 8\
**Last updated:** [April 1, 2018, 2:32am UTC](https://discourse.julialang.org/t/extracting-q-from-qrfact-allocation-free/10083 "2018-04-01T02:32:54Z")

</div>

I am trying to extract the Q matrix from a QR decomposition without allocating. The following hack doesn’t work: julia\> using LinearAlgebra julia\> A = rand(3,2); julia\> qrf = qrfact(A); julia\> qrf.Q \* Matrix{Float64}…

---

## [Way to view struct objects and memory impact?](https://discourse.julialang.org/t/way-to-view-struct-objects-and-memory-impact/10082)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 3\
**Last updated:** [March 31, 2018, 2:33pm UTC](https://discourse.julialang.org/t/way-to-view-struct-objects-and-memory-impact/10082 "2018-03-31T14:33:02Z")

</div>

I’m trying to find objects that might be lingering around after they’re useful. Is there a tool that helps you find these memory hogs?

---

## [Simulate Tuple{Vararg{T1,N},T2} where{T1, N, T2}](https://discourse.julialang.org/t/simulate-tuple-vararg-t1-n-t2-where-t1-n-t2/10061)

<div class="topic-metadata">

**Author:** [@cnliao](https://discourse.julialang.org/u/cnliao)\
**Replies:** 3\
**Last updated:** [March 31, 2018, 7:41am UTC](https://discourse.julialang.org/t/simulate-tuple-vararg-t1-n-t2-where-t1-n-t2/10061 "2018-03-31T07:41:20Z")

</div>

It seems that Vararg is not supported except at last place, but I want its behavior. What I am trying to do is to preallocate a vector of views into an Array, so that each view can be reused instead of having to be recr…

---

## [Wrong output from det(Array{Complex})](https://discourse.julialang.org/t/wrong-output-from-det-array-complex/10022)

<div class="topic-metadata">

**Author:** [@pedrohnv](https://discourse.julialang.org/u/pedrohnv)\
**Replies:** 11\
**Last updated:** [March 31, 2018, 2:54am UTC](https://discourse.julialang.org/t/wrong-output-from-det-array-complex/10022 "2018-03-31T02:54:14Z")

</div>

I have a complex matrix A = Array{Complex32}(\[20-50im -10+20im -10+30im; -10.0+20.0im 26.0-52.0im -16.0+32.0im; -10.0+30.0im -16.0+32.0im 26.0-62.0im\]) Its determinant is 0, but when I call det(A) #out=-116.25 - 5.00i…

---

## [Tips for updating code for 0.7](https://discourse.julialang.org/t/tips-for-updating-code-for-0-7/9427)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 16\
**Last updated:** [March 30, 2018, 6:13pm UTC](https://discourse.julialang.org/t/tips-for-updating-code-for-0-7/9427 "2018-03-30T18:13:23Z")

</div>

I’ve recently been updating a lot of code to 0.7 and have found the process significantly more painful than the 0.5 to 0.6 transition. Of course, it is always much more difficult to get coding working on 2 different ver…

---

## [ContinousTransformations.jl help](https://discourse.julialang.org/t/continoustransformations-jl-help/10062)

<div class="topic-metadata">

**Author:** [@gabrielgellner](https://discourse.julialang.org/u/gabrielgellner)\
**Replies:** 8\
**Last updated:** [March 30, 2018, 5:09pm UTC](https://discourse.julialang.org/t/continoustransformations-jl-help/10062 "2018-03-30T17:09:09Z")

</div>

So I am trying out the awesome DynamicHMC.jl package and as such need to wrap my head around using ContinousTransformations.jl to make sure my priors are handled correctly. My current issue is how to combine transformat…

---

## [Emacs users should know about julia-max-block-lookback](https://discourse.julialang.org/t/emacs-users-should-know-about-julia-max-block-lookback/10068)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 3\
**Last updated:** [March 30, 2018, 3:41pm UTC](https://discourse.julialang.org/t/emacs-users-should-know-about-julia-max-block-lookback/10068 "2018-03-30T15:41:31Z")

</div>

yeah- don’t use 5000. that’s too small a number. 10000 is better. mystery of why my indentation was failing in the middle of a file solved. in emacs’ julia mode (defcustom julia-max-block-lookback 5000 "When indent…

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

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