# General Usage

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

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

**Page:** 1051

---

## [UndefRefError: access to undefined reference](https://discourse.julialang.org/t/undefreferror-access-to-undefined-reference/3526)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 8\
**Last updated:** [May 9, 2017, 11:05am UTC](https://discourse.julialang.org/t/undefreferror-access-to-undefined-reference/3526 "2017-05-09T11:05:48Z")

</div>

I appreciate if someone can comment on the following behavior. Please consider the code below for an estimator type: type SimpleKriging{T\<:Real} \<: AbstractEstimator # input fields X::AbstractMatrix{T} z::Abstract…

---

## [Poor typing of tuple generators](https://discourse.julialang.org/t/poor-typing-of-tuple-generators/2880)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 7\
**Last updated:** [May 8, 2017, 9:58pm UTC](https://discourse.julialang.org/t/poor-typing-of-tuple-generators/2880 "2017-05-08T21:58:29Z")

</div>

I’m used to writing tuple comprehensions using tuple((blah(x) for x in tup)...), but I just found out that it’s not type-stable: add2(tup) = tuple((x+2 for x in tup)...) @code\_warntype add2((1,2.0,3)) # ::Tuple{Var…

---

## [(Ab)use of IOContext for fine-grained output control](https://discourse.julialang.org/t/ab-use-of-iocontext-for-fine-grained-output-control/3509)

<div class="topic-metadata">

**Author:** [@fengyang.wang](https://discourse.julialang.org/u/fengyang.wang)\
**Replies:** 2\
**Last updated:** [May 8, 2017, 6:18pm UTC](https://discourse.julialang.org/t/ab-use-of-iocontext-for-fine-grained-output-control/3509 "2017-05-08T18:18:26Z")

</div>

Is it considered a reasonable use of IOContext to define a large number of settings that control output in a fine manner? I’m considering settings such as :serialcomma =\> true, decimalpoint =\> ".", and similar, and wonde…

---

## [Speed of writing vs. reading elements in an array](https://discourse.julialang.org/t/speed-of-writing-vs-reading-elements-in-an-array/3596)

<div class="topic-metadata">

**Author:** [@mcovalt](https://discourse.julialang.org/u/mcovalt)\
**Replies:** 4\
**Last updated:** [May 8, 2017, 3:36pm UTC](https://discourse.julialang.org/t/speed-of-writing-vs-reading-elements-in-an-array/3596 "2017-05-08T15:36:28Z")

</div>

I’m writing a performance critical module. While using @inbounds, I can read elements (getindex) about 50x faster than I can write elements (setindex!) in two arrays of identical type and size. Both arrays are accessed a…

---

## [Is there a Julian way to combine types generically or a design pattern that achieves the goal?](https://discourse.julialang.org/t/is-there-a-julian-way-to-combine-types-generically-or-a-design-pattern-that-achieves-the-goal/983)

<div class="topic-metadata">

**Author:** [@philip](https://discourse.julialang.org/u/philip)\
**Replies:** 16\
**Last updated:** [May 8, 2017, 2:50pm UTC](https://discourse.julialang.org/t/is-there-a-julian-way-to-combine-types-generically-or-a-design-pattern-that-achieves-the-goal/983 "2017-05-08T14:50:54Z")

</div>

The general idea is that I often have types that are composed of smaller “pieces” of the types. Not subtypes in the sense of a type tree, rather partial-types in the sense of records with only a fraction of the next type…

---

## [Custom widget in IJulia / Interact.jl?](https://discourse.julialang.org/t/custom-widget-in-ijulia-interact-jl/3578)

<div class="topic-metadata">

**Author:** [@izaid](https://discourse.julialang.org/u/izaid)\
**Replies:** 1\
**Last updated:** [May 7, 2017, 11:17pm UTC](https://discourse.julialang.org/t/custom-widget-in-ijulia-interact-jl/3578 "2017-05-07T23:17:05Z")

</div>

I’m just wondering if it is possible to define a custom widget in IJulia. In Python, this is possible with ipywidgets and, specifically, the widget cookiecutter template – see https://github.com/jupyter-widgets/widget-co…

---

## [Multithreading in Julia](https://discourse.julialang.org/t/multithreading-in-julia/3579)

<div class="topic-metadata">

**Author:** [@Divyansh\_Srivastava](https://discourse.julialang.org/u/Divyansh_Srivastava)\
**Replies:** 2\
**Last updated:** [May 7, 2017, 5:13pm UTC](https://discourse.julialang.org/t/multithreading-in-julia/3579 "2017-05-07T17:13:28Z")

</div>

a = Threads.Atomic{Int}(0); b = zeros(10) Threads.@threads for i = 1:10 a += i b\[i\] = Threads.threadid() end a When running this code with multiple threads , the value of variable “a” at the end of every itera…

---

## [How to throw an error on value overflow?](https://discourse.julialang.org/t/how-to-throw-an-error-on-value-overflow/3408)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 2\
**Last updated:** [May 7, 2017, 9:38pm UTC](https://discourse.julialang.org/t/how-to-throw-an-error-on-value-overflow/3408 "2017-05-07T21:38:54Z")

</div>

For example, in Int64: 10^21 returns 3875820019684212736 How do you turn off rollover and just throw an error instead?

---

## [Best tool for printing tables in Jupyter notebook?](https://discourse.julialang.org/t/best-tool-for-printing-tables-in-jupyter-notebook/3548)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 12\
**Last updated:** [May 7, 2017, 9:19pm UTC](https://discourse.julialang.org/t/best-tool-for-printing-tables-in-jupyter-notebook/3548 "2017-05-07T21:19:06Z")

</div>

Lets say I had something like: var | expected\_value | actual\_value -----|----------------|-------------- a | 5 | 5 s | 8 | 8 d | 13 | 14 f | 21 …

---

## [Iterator over variable number of arguments](https://discourse.julialang.org/t/iterator-over-variable-number-of-arguments/3558)

<div class="topic-metadata">

**Author:** [@mforets](https://discourse.julialang.org/u/mforets)\
**Replies:** 6\
**Last updated:** [May 7, 2017, 4:49pm UTC](https://discourse.julialang.org/t/iterator-over-variable-number-of-arguments/3558 "2017-05-07T16:49:45Z")

</div>

Suppose you want to define an iterator over the vertices of the n-dimensional unit hypercube. In two dimensions, this is: julia\> using Iterators julia\> collect(Iterators.product(\[-1, 1\], \[-1, 1\])) 4-element Array{Tuple…

---

## [Are any of these bugs?](https://discourse.julialang.org/t/are-any-of-these-bugs/3569)

<div class="topic-metadata">

**Author:** [@loisel](https://discourse.julialang.org/u/loisel)\
**Replies:** 2\
**Last updated:** [May 7, 2017, 3:05pm UTC](https://discourse.julialang.org/t/are-any-of-these-bugs/3569 "2017-05-07T15:05:40Z")

</div>

julia\> immutable Z \<: Unsigned foo end julia\> Z(12) Error showing value of type Z: ERROR: MethodError: no method matching leading\_zeros(::Z) Closest candidates are: leading\_zeros{T\<:Union{Int128,Int16,Int32,Int64,…

---

## [Using \`info\` inside a function that is executed in parallel](https://discourse.julialang.org/t/using-info-inside-a-function-that-is-executed-in-parallel/3571)

<div class="topic-metadata">

**Author:** [@musm](https://discourse.julialang.org/u/musm)\
**Replies:** 4\
**Last updated:** [May 7, 2017, 2:19am UTC](https://discourse.julialang.org/t/using-info-inside-a-function-that-is-executed-in-parallel/3571 "2017-05-07T02:19:14Z")

</div>

INFO seems to get printed multiple times on the same line julia\> @everywhere function test(i) info("HI $i") end julia\> pmap(test,1:10); INFO: INFO: INFO: INFO: HI 3 HI 4 HI 2 HI 1 INFO: INFO: HI 5 INFO: …

---

## [Pipe vs TCPSocket on Windows](https://discourse.julialang.org/t/pipe-vs-tcpsocket-on-windows/3552)

<div class="topic-metadata">

**Author:** [@nsmith](https://discourse.julialang.org/u/nsmith)\
**Replies:** 2\
**Last updated:** [May 6, 2017, 4:48pm UTC](https://discourse.julialang.org/t/pipe-vs-tcpsocket-on-windows/3552 "2017-05-06T16:48:54Z")

</div>

I recently moved Maxima.jl over to Pipe based communication from TCPSocket based communication and started getting Unicode errors. The communication layer sends messages back and forth between Julia and Maxima. Oddly, th…

---

## [Profile.print() not working 0.5.1 win7](https://discourse.julialang.org/t/profile-print-not-working-0-5-1-win7/3554)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 0\
**Last updated:** [May 6, 2017, 8:00am UTC](https://discourse.julialang.org/t/profile-print-not-working-0-5-1-win7/3554 "2017-05-06T08:00:00Z")

</div>

Hi all I am getting the below error when using Profile.print() on a package of mine which is not public. Profile.retrieve() throws the same error. This code produces the error: Profile.clear() Profile.init() Pro…

---

## [What's the status on #15276 in v0.6?](https://discourse.julialang.org/t/whats-the-status-on-15276-in-v0-6/3513)

<div class="topic-metadata">

**Author:** [@rleegates](https://discourse.julialang.org/u/rleegates)\
**Replies:** 1\
**Last updated:** [May 5, 2017, 10:19pm UTC](https://discourse.julialang.org/t/whats-the-status-on-15276-in-v0-6/3513 "2017-05-05T22:19:47Z")

</div>

As the title states, what is the status on typing captured variables in closures, i.e. issue #15276, on v0.6?

---

## [Regex w/ String Interpolation](https://discourse.julialang.org/t/regex-w-string-interpolation/3545)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 1\
**Last updated:** [May 5, 2017, 9:13pm UTC](https://discourse.julialang.org/t/regex-w-string-interpolation/3545 "2017-05-05T21:13:53Z")

</div>

I want to do something along the lines of: a = "focus" ismatch(r"$(a)\\s\*:\\s\*true", "# focus: true") But this doesnt work // probably similar to issue #1797 What is the correct way to do this? eval( parse( "ismatch(r…

---

## [Interaction between broadcasting and custom indexing](https://discourse.julialang.org/t/interaction-between-broadcasting-and-custom-indexing/3506)

<div class="topic-metadata">

**Author:** [@gasagna](https://discourse.julialang.org/u/gasagna)\
**Replies:** 1\
**Last updated:** [May 4, 2017, 10:01pm UTC](https://discourse.julialang.org/t/interaction-between-broadcasting-and-custom-indexing/3506 "2017-05-04T22:01:38Z")

</div>

Hi, I have some weird interaction between broadcasting and custom indices for a type. This is a minimal example. Say I have this type, which holds data in a matrix format struct Foo \<: AbstractMatrix{Float64} data…

---

## [Building Julia 0.6 executable in a docker container](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464)

<div class="topic-metadata">

**Author:** [@cmeister747](https://discourse.julialang.org/u/cmeister747)\
**Replies:** 8\
**Last updated:** [May 4, 2017, 7:11pm UTC](https://discourse.julialang.org/t/building-julia-0-6-executable-in-a-docker-container/3464 "2017-05-04T19:11:39Z")

</div>

Has anyone tried to build the Julia 0.6 executable from the source code? I’m trying to do so in a Docker container and running make (or sudo make) produces \>100 errors. Any advice would be very appreciated!

---

## [Julia- Warning Method definition is overwritten](https://discourse.julialang.org/t/julia-warning-method-definition-is-overwritten/3514)

<div class="topic-metadata">

**Author:** [@Saran](https://discourse.julialang.org/u/Saran)\
**Replies:** 2\
**Last updated:** [May 4, 2017, 1:10pm UTC](https://discourse.julialang.org/t/julia-warning-method-definition-is-overwritten/3514 "2017-05-04T13:10:27Z")

</div>

I the following warnings when i execute the code written below WARNING: Method definition (::Type{Main.Vector2D})(Real, Real) in module Main at /…/juliaIntro.jl:13 overwritten at /…/juliaIntro.jl:13. WARNING: Method…

---

## [Issues with installing Atom package](https://discourse.julialang.org/t/issues-with-installing-atom-package/3481)

<div class="topic-metadata">

**Author:** [@Fanderson1130](https://discourse.julialang.org/u/Fanderson1130)\
**Replies:** 2\
**Last updated:** [May 3, 2017, 11:53pm UTC](https://discourse.julialang.org/t/issues-with-installing-atom-package/3481 "2017-05-03T23:53:44Z")

</div>

Hi Julia Users, This is my first post and I’m afraid it won’t be very interesting and is basically selfish, however, I’m following the instructions I received from the Atom dashboard and really want to run Julia in Atom/…

---

## [How do I figure out where things went wrong in this parallel code?](https://discourse.julialang.org/t/how-do-i-figure-out-where-things-went-wrong-in-this-parallel-code/3462)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 3\
**Last updated:** [May 3, 2017, 3:06pm UTC](https://discourse.julialang.org/t/how-do-i-figure-out-where-things-went-wrong-in-this-parallel-code/3462 "2017-05-03T15:06:30Z")

</div>

I have the following code (simplified) that I run in a julia -p 4 REPL: println("computing betweenness centrality - method1") rbc1 = @spawn betweenness\_centrality(g, ...) println("computing betweenness centrality - met…

---

## [Making a UInt64 bit-masking function generic](https://discourse.julialang.org/t/making-a-uint64-bit-masking-function-generic/3477)

<div class="topic-metadata">

**Author:** [@Ward9250](https://discourse.julialang.org/u/Ward9250)\
**Replies:** 8\
**Last updated:** [May 3, 2017, 2:24pm UTC](https://discourse.julialang.org/t/making-a-uint64-bit-masking-function-generic/3477 "2017-05-03T14:24:11Z")

</div>

I’ve got a function that currently accepts a 64 bit integer, and masks it with some other 64 bit integer e.g. x & 0x3333333333333333 In such code, the hex is written in full, literally. But if I want to generalise this…

---

## [Poor performance of the cis() function](https://discourse.julialang.org/t/poor-performance-of-the-cis-function/3402)

<div class="topic-metadata">

**Author:** [@111](https://discourse.julialang.org/u/111)\
**Replies:** 13\
**Last updated:** [May 3, 2017, 2:06pm UTC](https://discourse.julialang.org/t/poor-performance-of-the-cis-function/3402 "2017-05-03T14:06:34Z")

</div>

I wrote a program with Julia, but the performance is disappointing. The program is constructed with some functions, and global variables are prevented, arrays are well preallocated before used, the fft operation is acce…

---

## [Tryparse() how to "convert" nullables to normal type](https://discourse.julialang.org/t/tryparse-how-to-convert-nullables-to-normal-type/3490)

<div class="topic-metadata">

**Author:** [@strickek](https://discourse.julialang.org/u/strickek)\
**Replies:** 3\
**Last updated:** [May 3, 2017, 12:55pm UTC](https://discourse.julialang.org/t/tryparse-how-to-convert-nullables-to-normal-type/3490 "2017-05-03T12:55:20Z")

</div>

I want to test if a string is in a date format and parse it. Becaus try … catch need a lot of time I use tryparse(). But I need a normal date, no nullable date. At the moment I do It like this: datenullable = tryparse…

---

## [Terminal Capabilities Packages in Julia?](https://discourse.julialang.org/t/terminal-capabilities-packages-in-julia/3470)

<div class="topic-metadata">

**Author:** [@xiaohk](https://discourse.julialang.org/u/xiaohk)\
**Replies:** 1\
**Last updated:** [May 3, 2017, 12:33pm UTC](https://discourse.julialang.org/t/terminal-capabilities-packages-in-julia/3470 "2017-05-03T12:33:42Z")

</div>

Hello, I am wondering if there are Julia packages help building command line interface, such as blessing in Python?

---

## [Horrendous start-up time. julia or plots or both?](https://discourse.julialang.org/t/horrendous-start-up-time-julia-or-plots-or-both/3489)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 1\
**Last updated:** [May 3, 2017, 4:46am UTC](https://discourse.julialang.org/t/horrendous-start-up-time-julia-or-plots-or-both/3489 "2017-05-03T04:46:09Z")

</div>

using Plots x=1:100 y=\[i\*i for i in x\] plot(x,y) gui() real 0m22.690s user 0m20.084s sys 0m1.456s There’s about 1.5s in there for me to close the plot window. This is clearly broken behavior. Can somebody suggest…

---

## [Help with closures and remotecall\_fetch](https://discourse.julialang.org/t/help-with-closures-and-remotecall-fetch/3421)

<div class="topic-metadata">

**Author:** [@EthanAnderes](https://discourse.julialang.org/u/EthanAnderes)\
**Replies:** 2\
**Last updated:** [May 2, 2017, 6:54pm UTC](https://discourse.julialang.org/t/help-with-closures-and-remotecall-fetch/3421 "2017-05-02T18:54:19Z")

</div>

I’m trying to figure out how to use closures with parallel processing. Basically I want to define a closure on each worker which holds a large number of parameters as internal states that are pre-computed on the master n…

---

## [Splat inside an array comprehension](https://discourse.julialang.org/t/splat-inside-an-array-comprehension/3473)

<div class="topic-metadata">

**Author:** [@westleyargentum](https://discourse.julialang.org/u/westleyargentum)\
**Replies:** 3\
**Last updated:** [May 2, 2017, 5:04pm UTC](https://discourse.julialang.org/t/splat-inside-an-array-comprehension/3473 "2017-05-02T17:04:19Z")

</div>

Hey all, embarrassed to say I’ve been a couple releases behind, but I’m starting to write more julia again and loving 0.5 Something I lost track of, however, is array comprehensions that are automatically flattened. Sup…

---

## [SharedArrays lacking a lot of functions](https://discourse.julialang.org/t/sharedarrays-lacking-a-lot-of-functions/3472)

<div class="topic-metadata">

**Author:** [@musm](https://discourse.julialang.org/u/musm)\
**Replies:** 5\
**Last updated:** [May 2, 2017, 4:41pm UTC](https://discourse.julialang.org/t/sharedarrays-lacking-a-lot-of-functions/3472 "2017-05-02T16:41:07Z")

</div>

I was using SharedArray’s recently and tried something as simple as maximum on a SharedArray yet this and many other basic function for working with arrays are lacking with shared arrays.

---

## [Userimg.jl with enum return WARNING: using Base.e in module Main conflicts with an existing identifier](https://discourse.julialang.org/t/userimg-jl-with-enum-return-warning-using-base-e-in-module-main-conflicts-with-an-existing-identifier/3474)

<div class="topic-metadata">

**Author:** [@Martin\_Florek](https://discourse.julialang.org/u/Martin_Florek)\
**Replies:** 1\
**Last updated:** [May 2, 2017, 8:26am UTC](https://discourse.julialang.org/t/userimg-jl-with-enum-return-warning-using-base-e-in-module-main-conflicts-with-an-existing-identifier/3474 "2017-05-02T08:26:13Z")

</div>

I have compiled system image building and now when I open the DLL I get warrning. WARNING: using Base.e in module Main conflicts with an existing identifier I think it’s something in my userimg.jl. What can it do? Th…

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

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