# General Usage

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

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

**Page:** 1042

---

## [Jupyterhub vs Juliabox](https://discourse.julialang.org/t/jupyterhub-vs-juliabox/4487)

<div class="topic-metadata">

**Author:** [@barche](https://discourse.julialang.org/u/barche)\
**Replies:** 0\
**Last updated:** [June 27, 2017, 10:52am UTC](https://discourse.julialang.org/t/jupyterhub-vs-juliabox/4487 "2017-06-27T10:52:27Z")

</div>

Hi all, Last week’s keynote by Fernando Pérez at JuliaCon inspired me to take a look at the options for running notebooks on a multi-user server of our own. It seems that besides Juliabox there is also Jupyterhub. What …

---

## [Issues with Julia in Juno IDE](https://discourse.julialang.org/t/issues-with-julia-in-juno-ide/4465)

<div class="topic-metadata">

**Author:** [@Mattri](https://discourse.julialang.org/u/Mattri)\
**Replies:** 3\
**Last updated:** [June 27, 2017, 9:26am UTC](https://discourse.julialang.org/t/issues-with-julia-in-juno-ide/4465 "2017-06-27T09:26:47Z")

</div>

Hello, I recently (last week) updated packages “uber-juno” and “julia-client” in Juno to the latest version. Core Julia ist still v 0.5. While in the REPL evreything is fine, in Juno I receive the following message when…

---

## [Wildly varying timings for round and round](https://discourse.julialang.org/t/wildly-varying-timings-for-round-and-round/4484)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 3\
**Last updated:** [June 27, 2017, 8:13am UTC](https://discourse.julialang.org/t/wildly-varying-timings-for-round-and-round/4484 "2017-06-27T08:13:47Z")

</div>

On Julia v0.6, I @time and @benchmark round(...) and its dot counterpart, round.(…)\`\`. The macro @time reports 0.6 ms for round and 29 ms for the dot version; the macro @benchmark shows that round.(...) is 3 orders of ma…

---

## [Confused about global variables](https://discourse.julialang.org/t/confused-about-global-variables/4441)

<div class="topic-metadata">

**Author:** [@kimran](https://discourse.julialang.org/u/kimran)\
**Replies:** 13\
**Last updated:** [June 27, 2017, 6:55am UTC](https://discourse.julialang.org/t/confused-about-global-variables/4441 "2017-06-27T06:55:11Z")

</div>

Consider the following code module T const a = true function c\_a(new\_a) global a a = new\_a end function p\_a() println(a) end end However, T.p\_a() does not seem to pick up the changed a after running T.c\_a(false) …

---

## [Polynomials](https://discourse.julialang.org/t/polynomials/4482)

<div class="topic-metadata">

**Author:** [@tastelessjolt](https://discourse.julialang.org/u/tastelessjolt)\
**Replies:** 1\
**Last updated:** [June 27, 2017, 5:40am UTC](https://discourse.julialang.org/t/polynomials/4482 "2017-06-27T05:40:38Z")

</div>

Is there a way of representing Polynomials in Julia?

---

## [Method invocation error on v0.6](https://discourse.julialang.org/t/method-invocation-error-on-v0-6/4476)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 6\
**Last updated:** [June 26, 2017, 10:12pm UTC](https://discourse.julialang.org/t/method-invocation-error-on-v0-6/4476 "2017-06-26T22:12:27Z")

</div>

I have some code that looks like this: route("/") do "hello" end Later on, the function passed into route is put in a variable to and the following code is run: if isa(to, Function) to() |\> to\_response end Works …

---

## [Jl\_ptr\_to\_array](https://discourse.julialang.org/t/jl-ptr-to-array/4436)

<div class="topic-metadata">

**Author:** [@tastelessjolt](https://discourse.julialang.org/u/tastelessjolt)\
**Replies:** 5\
**Last updated:** [June 26, 2017, 9:29pm UTC](https://discourse.julialang.org/t/jl-ptr-to-array/4436 "2017-06-26T21:29:35Z")

</div>

How should argument data to the function jl\_ptr\_to\_array be given? I know that in the case of Array{Float64,1} it’s just a pointer to double array. But suppose in the case of Array{Complex{Float64},1}, what should I pas…

---

## [Seamless Julia code debug](https://discourse.julialang.org/t/seamless-julia-code-debug/4379)

<div class="topic-metadata">

**Author:** [@dynamicsg](https://discourse.julialang.org/u/dynamicsg)\
**Replies:** 3\
**Last updated:** [June 26, 2017, 8:36pm UTC](https://discourse.julialang.org/t/seamless-julia-code-debug/4379 "2017-06-26T20:36:20Z")

</div>

Hello All I am trying to analyze Julia code, and I was interested to know if there is a seamless method to debug Julia development code. Using the gdb, I am able to add breakpoints and visualize the Julia “C” files, but…

---

## [How to get a clean stacktrace in v0.6](https://discourse.julialang.org/t/how-to-get-a-clean-stacktrace-in-v0-6/4474)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 8\
**Last updated:** [June 26, 2017, 7:39pm UTC](https://discourse.julialang.org/t/how-to-get-a-clean-stacktrace-in-v0-6/4474 "2017-06-26T19:39:49Z")

</div>

The stacktrace in 0.6 is nicely formatted in the REPL - but when I display it in the browser, it’s unreadable. Can I get a clean representation of the stacktrace? Stacktrace: \[1\] e\[1mmatch\_routese\[22me\[22me\[1m(e\[22me\[2…

---

## [Distributed generation of a DArray](https://discourse.julialang.org/t/distributed-generation-of-a-darray/4472)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 5\
**Last updated:** [June 26, 2017, 5:40pm UTC](https://discourse.julialang.org/t/distributed-generation-of-a-darray/4472 "2017-06-26T17:40:28Z")

</div>

I have generated arrays on separate processes, and cannot collect them into a single array on the master process because it cannot fit into memory. Is there a way to directly generate the DArray without having to put it …

---

## [Side effects of using a zero-based indexing package?](https://discourse.julialang.org/t/side-effects-of-using-a-zero-based-indexing-package/4451)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 9\
**Last updated:** [June 26, 2017, 5:19pm UTC](https://discourse.julialang.org/t/side-effects-of-using-a-zero-based-indexing-package/4451 "2017-06-26T17:19:49Z")

</div>

I saw @ChrisRackauckas starred a package on github recently about 2-based indexing // probably related to this ProgrammerHumor post: https://www.reddit.com/r/ProgrammerHumor/comments/6jea7z/array\_indexing\_round\_2/djdn…

---

## [Performance drop for explicit indexing in fused loops](https://discourse.julialang.org/t/performance-drop-for-explicit-indexing-in-fused-loops/4459)

<div class="topic-metadata">

**Author:** [@fjarri](https://discourse.julialang.org/u/fjarri)\
**Replies:** 10\
**Last updated:** [June 26, 2017, 2:25pm UTC](https://discourse.julialang.org/t/performance-drop-for-explicit-indexing-in-fused-loops/4459 "2017-06-26T14:25:52Z")

</div>

Consider the following code doing a simple computation: function test\_vectorized(a, a\_old) @. a\[:\] = a\_old\[:\] \* 2 end function test\_vectorized2(a, a\_old) @. a = a\_old \* 2 end function test\_devectorized(a, a\_…

---

## [Why do colored strings break contains() in v0.6?](https://discourse.julialang.org/t/why-do-colored-strings-break-contains-in-v0-6/4455)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 6\
**Last updated:** [June 26, 2017, 2:18pm UTC](https://discourse.julialang.org/t/why-do-colored-strings-break-contains-in-v0-6/4455 "2017-06-26T14:18:34Z")

</div>

As shown in the picture. contains doesn’t work on matching the INFO: JulzDummy... because one’s teal and the other’s grey. Why is that?

---

## [How to log to a db?](https://discourse.julialang.org/t/how-to-log-to-a-db/4463)

<div class="topic-metadata">

**Author:** [@kimran](https://discourse.julialang.org/u/kimran)\
**Replies:** 0\
**Last updated:** [June 26, 2017, 6:41am UTC](https://discourse.julialang.org/t/how-to-log-to-a-db/4463 "2017-06-26T06:41:39Z")

</div>

How could I redirect logging to a db, .e.g. MySQL? I see a few ways, but none provide the ready solution, in my understanding: Use Base.logging(io,…) to redirect info/warn/error to an IOStream, which would need to be…

---

## [Communication with a command line program](https://discourse.julialang.org/t/communication-with-a-command-line-program/4448)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 3\
**Last updated:** [June 26, 2017, 5:34am UTC](https://discourse.julialang.org/t/communication-with-a-command-line-program/4448 "2017-06-26T05:34:02Z")

</div>

Hi I’m trying to set-up communication with an interactive program. I’ll use bc for my example. I quickly found that this works: julia\> (p, process)=open(\`bc\`, "w", STDOUT) (Pipe(open =\> closed, 0 bytes waiting),Proce…

---

## [Broadcast promoting Array{Bool} to BitArray](https://discourse.julialang.org/t/broadcast-promoting-array-bool-to-bitarray/4445)

<div class="topic-metadata">

**Author:** [@angusmoore](https://discourse.julialang.org/u/angusmoore)\
**Replies:** 7\
**Last updated:** [June 26, 2017, 4:53am UTC](https://discourse.julialang.org/t/broadcast-promoting-array-bool-to-bitarray/4445 "2017-06-26T04:53:51Z")

</div>

I’ve just moved over to 0.6. I’m a bit confused about this change in behaviour with respect to bool arrays. In julia 0.5: julia\> foo = \[false,true\] 2-element Array{Bool,1}: false true julia\> !foo 2-element Arra…

---

## [Continguous memory allocation for numerous instances of compound types](https://discourse.julialang.org/t/continguous-memory-allocation-for-numerous-instances-of-compound-types/4450)

<div class="topic-metadata">

**Author:** [@rwgardner](https://discourse.julialang.org/u/rwgardner)\
**Replies:** 8\
**Last updated:** [June 26, 2017, 1:06am UTC](https://discourse.julialang.org/t/continguous-memory-allocation-for-numerous-instances-of-compound-types/4450 "2017-06-26T01:06:45Z")

</div>

I would like to allocate a large array of a particular type, such that all the data for the array is stored contiguously, i.e., the array stores no pointers. E.g., suppose I have type Foo a::Int64 b::Int64 c:…

---

## [Stack allocation when passing large isbits objects](https://discourse.julialang.org/t/stack-allocation-when-passing-large-isbits-objects/4452)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 0\
**Last updated:** [June 25, 2017, 9:25pm UTC](https://discourse.julialang.org/t/stack-allocation-when-passing-large-isbits-objects/4452 "2017-06-25T21:25:33Z")

</div>

When passing around a large isbits object without modification, does Julia push a copy onto the stack each time it’s passed as an argument? Eg. in this code using StaticArrays @noinline f(x) = g(x) @noinline g(x) = h(x…

---

## [Help understanding besselk deprecation warning](https://discourse.julialang.org/t/help-understanding-besselk-deprecation-warning/4449)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 2\
**Last updated:** [June 25, 2017, 5:08pm UTC](https://discourse.julialang.org/t/help-understanding-besselk-deprecation-warning/4449 "2017-06-25T17:08:33Z")

</div>

This is what I get in Julia v0.6: WARNING: besselk{T1 \<: Number}(x::Number, y::AbstractArray{T1}) is deprecated, use ($(Expr(:globalref, Compat, Symbol("@compat"))))(besselk.(x, y)) instead. Can you elaborate on this s…

---

## [Julia v0.6 - adding tuples in parallel for loop](https://discourse.julialang.org/t/julia-v0-6-adding-tuples-in-parallel-for-loop/4429)

<div class="topic-metadata">

**Author:** [@andreas25](https://discourse.julialang.org/u/andreas25)\
**Replies:** 6\
**Last updated:** [June 25, 2017, 2:29pm UTC](https://discourse.julialang.org/t/julia-v0-6-adding-tuples-in-parallel-for-loop/4429 "2017-06-25T14:29:46Z")

</div>

Hi, I have some problems adding tuples in a parallel for-loop since an update from v0.5 to v0.6. I define the addition of tuples in the following way … #defining a function that adds up two tuples a and b of arbitrary…

---

## [Accessing fields within a generated function](https://discourse.julialang.org/t/accessing-fields-within-a-generated-function/4422)

<div class="topic-metadata">

**Author:** [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Replies:** 6\
**Last updated:** [June 25, 2017, 2:58am UTC](https://discourse.julialang.org/t/accessing-fields-within-a-generated-function/4422 "2017-06-25T02:58:20Z")

</div>

Hi, I would like to have generated functions that work with – and can access properties of – fields of types while compiling. Specifically, I wrote a lot of “parameter container” types like “Covariance Matrix” and “Po…

---

## [Why not filt, filter as filter?](https://discourse.julialang.org/t/why-not-filt-filter-as-filter/4442)

<div class="topic-metadata">

**Author:** [@hpoit](https://discourse.julialang.org/u/hpoit)\
**Replies:** 5\
**Last updated:** [June 24, 2017, 6:26pm UTC](https://discourse.julialang.org/t/why-not-filt-filter-as-filter/4442 "2017-06-24T18:26:45Z")

</div>

julia\> methods(filter) # 8 methods for generic function "filter": filter(f, a::Array{T,1} where T) in Base at array.jl:1841 filter(f, Bs::BitArray) in Base at bitarray.jl:1911 filter(f, As::AbstractArray) in Base at arra…

---

## [Complex Number Arrays](https://discourse.julialang.org/t/complex-number-arrays/4393)

<div class="topic-metadata">

**Author:** [@tastelessjolt](https://discourse.julialang.org/u/tastelessjolt)\
**Replies:** 2\
**Last updated:** [June 23, 2017, 5:32pm UTC](https://discourse.julialang.org/t/complex-number-arrays/4393 "2017-06-23T17:32:14Z")

</div>

I can’t seem to find the struct for a complex number representation in Julia Embedding in C API. Thank you.

---

## [Pyplot/matplotlib crashes Julia both 0.5.2 and 0.6.0](https://discourse.julialang.org/t/pyplot-matplotlib-crashes-julia-both-0-5-2-and-0-6-0/4434)

<div class="topic-metadata">

**Author:** [@vepiteski](https://discourse.julialang.org/u/vepiteski)\
**Replies:** 2\
**Last updated:** [June 23, 2017, 10:10pm UTC](https://discourse.julialang.org/t/pyplot-matplotlib-crashes-julia-both-0-5-2-and-0-6-0/4434 "2017-06-23T22:10:12Z")

</div>

The error is This application failed to start because it could not find or load the Qt platform plugin “xcb” in “”. Available platform plugins are: minimal, offscreen, xcb. It used to work fine until yesterday. Any…

---

## [\`sortrows\` and \`sortcols\` on \`SubArrays\`](https://discourse.julialang.org/t/sortrows-and-sortcols-on-subarrays/4381)

<div class="topic-metadata">

**Author:** [@Hua-Zhou](https://discourse.julialang.org/u/Hua-Zhou)\
**Replies:** 3\
**Last updated:** [June 23, 2017, 5:31pm UTC](https://discourse.julialang.org/t/sortrows-and-sortcols-on-subarrays/4381 "2017-06-23T17:31:16Z")

</div>

Is there any reason the functions sortrows and sortcols don’t work on SubArrays? julia\> versioninfo() Julia Version 0.6.0 Commit 903644385b (2017-06-19 13:05 UTC) Platform Info: OS: macOS (x86\_64-apple-darwin13.4.0) …

---

## [PyPlot do not work on julia 0.6](https://discourse.julialang.org/t/pyplot-do-not-work-on-julia-0-6/4427)

<div class="topic-metadata">

**Author:** [@innerlee](https://discourse.julialang.org/u/innerlee)\
**Replies:** 2\
**Last updated:** [June 23, 2017, 2:11pm UTC](https://discourse.julialang.org/t/pyplot-do-not-work-on-julia-0-6/4427 "2017-06-23T14:11:28Z")

</div>

PyPlot used to work with previous RC versions. It errors with the release version. I tried deleting all files in ~/.julia/lib and ~/.julia/v0.6 and do a fresh start, just installing PyPlot and set ENV\["PYTHON"\]="". Howev…

---

## [ReverseDiff.jl with iterative solvers](https://discourse.julialang.org/t/reversediff-jl-with-iterative-solvers/4299)

<div class="topic-metadata">

**Author:** [@shubhamRanjan](https://discourse.julialang.org/u/shubhamRanjan)\
**Replies:** 14\
**Last updated:** [June 23, 2017, 12:42pm UTC](https://discourse.julialang.org/t/reversediff-jl-with-iterative-solvers/4299 "2017-06-23T12:42:10Z")

</div>

I am trying to find the derivative of a function (that has input as the converged values of Jacobi iterator), with respect to the elements of the matrices used in Jacobi iterations. For example, if f(x) is a function of x…

---

## [Type-annotate vs convert](https://discourse.julialang.org/t/type-annotate-vs-convert/4404)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 6\
**Last updated:** [June 23, 2017, 12:14pm UTC](https://discourse.julialang.org/t/type-annotate-vs-convert/4404 "2017-06-23T12:14:47Z")

</div>

Consider the issue of annotating types of objects taken from unknown sources. The following are two solutions to this problem: function test1(a::Vector{Any}) x = a\[1\]::Int 2\*x end and function test2(a::…

---

## [Adding JuMP downgrades some packages in v0.6](https://discourse.julialang.org/t/adding-jump-downgrades-some-packages-in-v0-6/4420)

<div class="topic-metadata">

**Author:** [@leejm516](https://discourse.julialang.org/u/leejm516)\
**Replies:** 1\
**Last updated:** [June 23, 2017, 6:04am UTC](https://discourse.julialang.org/t/adding-jump-downgrades-some-packages-in-v0-6/4420 "2017-06-23T06:04:07Z")

</div>

julia\> Pkg.add("JuMP") INFO: Downgrading DiffEqCallbacks: v0.2.0 =\> v0.1.1 INFO: Downgrading ForwardDiff: v0.5.0 =\> v0.4.2 INFO: Installing JuMP v0.17.1 INFO: Downgrading LineSearches: v2.2.0 =\> v0.1.5 INFO: Downgrading …

---

## [Appending to a JLD](https://discourse.julialang.org/t/appending-to-a-jld/4417)

<div class="topic-metadata">

**Author:** [@rcnlee](https://discourse.julialang.org/u/rcnlee)\
**Replies:** 4\
**Last updated:** [June 23, 2017, 4:42am UTC](https://discourse.julialang.org/t/appending-to-a-jld/4417 "2017-06-23T04:42:35Z")

</div>

Is there a good way to append variables to a JLD file? The readme talks about save() but that seems to only save a number of variables at once, not incrementally. Thanks!

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

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