# General Usage

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

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

**Page:** 990

---

## [Unrolled.jl – problems with "where" keyword](https://discourse.julialang.org/t/unrolled-jl-problems-with-where-keyword/9715)

<div class="topic-metadata">

**Author:** [@lhupe](https://discourse.julialang.org/u/lhupe)\
**Replies:** 4\
**Last updated:** [March 17, 2018, 8:23pm UTC](https://discourse.julialang.org/t/unrolled-jl-problems-with-where-keyword/9715 "2018-03-17T20:23:45Z")

</div>

I have a function that takes an SVector of some type, i.e. function foo(vec::SVector{2,T}) where T for x in vec #do something with x end end and want to use Unrolled.jl on it. However, when I add the @u…

---

## [How to handle error statuses and exit codes in Julia while invoking external commands?](https://discourse.julialang.org/t/how-to-handle-error-statuses-and-exit-codes-in-julia-while-invoking-external-commands/9768)

<div class="topic-metadata">

**Author:** [@rahulkp220](https://discourse.julialang.org/u/rahulkp220)\
**Replies:** 2\
**Last updated:** [March 17, 2018, 6:32pm UTC](https://discourse.julialang.org/t/how-to-handle-error-statuses-and-exit-codes-in-julia-while-invoking-external-commands/9768 "2018-03-17T18:32:55Z")

</div>

Hi, I am trying to run an external command from Julia using the run() function, but I am stuck on how to handle error codes and exit codes of any particular command. Previous Julia version had a readall() function, whic…

---

## [Difference between \`write\` and \`print\`](https://discourse.julialang.org/t/difference-between-write-and-print/6943)

<div class="topic-metadata">

**Author:** [@tparker](https://discourse.julialang.org/u/tparker)\
**Replies:** 10\
**Last updated:** [March 17, 2018, 6:05pm UTC](https://discourse.julialang.org/t/difference-between-write-and-print/6943 "2018-03-17T18:05:17Z")

</div>

The documentation entries for write and print seem very similar. There are a few minor differences (write allows file names as well as I/O streams and returns the number of bytes written, while print calls show if the ar…

---

## [Type piracy?](https://discourse.julialang.org/t/type-piracy/9713)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 10\
**Last updated:** [March 17, 2018, 5:14pm UTC](https://discourse.julialang.org/t/type-piracy/9713 "2018-03-17T17:14:36Z")

</div>

I have the following function that takes a tuple and converts it to an unsigned integer: function f(::Type{UInt16}, x::NTuple{2, UInt8}) x1 = 0x0001 \* x\[1\] x2 = 0x0100 \* x\[2\] x1 + x2 end What would be the r…

---

## [Cannot install any package on JuliaPro 0.6.2.2](https://discourse.julialang.org/t/cannot-install-any-package-on-juliapro-0-6-2-2/9769)

<div class="topic-metadata">

**Author:** [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Replies:** 2\
**Last updated:** [March 17, 2018, 2:57pm UTC](https://discourse.julialang.org/t/cannot-install-any-package-on-juliapro-0-6-2-2/9769 "2018-03-17T14:57:08Z")

</div>

Hello everyone, I need some help. I’m on windows 8 and I just installed JuliaPro 0.6.2.2 I cannot install any package. For now I only tried with YAML, Plots and Cubature and none of them work. They all give the same …

---

## [Seemingly edge case of not being able to \`include\` while inside an \`if\` condition inside a loop.](https://discourse.julialang.org/t/seemingly-edge-case-of-not-being-able-to-include-while-inside-an-if-condition-inside-a-loop/9444)

<div class="topic-metadata">

**Author:** [@jayvn](https://discourse.julialang.org/u/jayvn)\
**Replies:** 8\
**Last updated:** [March 17, 2018, 4:52am UTC](https://discourse.julialang.org/t/seemingly-edge-case-of-not-being-able-to-include-while-inside-an-if-condition-inside-a-loop/9444 "2018-03-17T04:52:34Z")

</div>

So if I run this to re-include a file when it changes: fname = "/full/path/to/changingfile.jl" t1 = 0 while(true) if t1 != mtime(fname) println(isfile(fname)) include(abspath(fname)) t1 = mtime(fname) e…

---

## [Eliminating allocations with functions in struct](https://discourse.julialang.org/t/eliminating-allocations-with-functions-in-struct/9764)

<div class="topic-metadata">

**Author:** [@jebej](https://discourse.julialang.org/u/jebej)\
**Replies:** 1\
**Last updated:** [March 17, 2018, 4:29am UTC](https://discourse.julialang.org/t/eliminating-allocations-with-functions-in-struct/9764 "2018-03-17T04:29:51Z")

</div>

Hello all, I thought that the following would not result in dynamic dispatch, but I am still seeing allocation: module DispTests struct ParamFun{N,F} fₙ::F pₙ::NTuple{N,Vector{Float64}} end ParamFun{N}(f,p) w…

---

## [Dot syntax and reduction](https://discourse.julialang.org/t/dot-syntax-and-reduction/2091)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 6\
**Last updated:** [March 16, 2018, 11:19pm UTC](https://discourse.julialang.org/t/dot-syntax-and-reduction/2091 "2018-03-16T23:19:57Z")

</div>

If I do: all(x .== 0) where x is a huge vector (for example), will this instantiate the intermediate array of Booleans (x .== 0)?

---

## [Why full(Hermitian{Sparse}) is not Hermitian?](https://discourse.julialang.org/t/why-full-hermitian-sparse-is-not-hermitian/9756)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 7\
**Last updated:** [March 16, 2018, 10:03pm UTC](https://discourse.julialang.org/t/why-full-hermitian-sparse-is-not-hermitian/9756 "2018-03-16T22:03:30Z")

</div>

The following snippet: M = Hermitian(speye(10)) full(M) does not return an Hermitian matrix. Is there a reason for this?

---

## [Error with julia-client after Atom update](https://discourse.julialang.org/t/error-with-julia-client-after-atom-update/9760)

<div class="topic-metadata">

**Author:** [@cstook](https://discourse.julialang.org/u/cstook)\
**Replies:** 4\
**Last updated:** [March 16, 2018, 8:40pm UTC](https://discourse.julialang.org/t/error-with-julia-client-after-atom-update/9760 "2018-03-16T20:40:44Z")

</div>

After an updating Atom to version 1.25.0 I receive the following error every time I open Atom. “Some installed packages could not be loaded because they contain native modules that were compiled for an earlier version o…

---

## [Analogue package for SOLVER in excel? Other solution?](https://discourse.julialang.org/t/analogue-package-for-solver-in-excel-other-solution/9633)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 13\
**Last updated:** [March 16, 2018, 1:13pm UTC](https://discourse.julialang.org/t/analogue-package-for-solver-in-excel-other-solution/9633 "2018-03-16T13:13:28Z")

</div>

What is the analogue package for SOLVER in excel? I have a function with 3 parameters a, b, c and a data vector DATA, the output is a scalar, I need to find a combiner a, b, c to make the result \> minimum ? Is analogu…

---

## [Writing an array too large to store in memory](https://discourse.julialang.org/t/writing-an-array-too-large-to-store-in-memory/9752)

<div class="topic-metadata">

**Author:** [@dsweber2](https://discourse.julialang.org/u/dsweber2)\
**Replies:** 2\
**Last updated:** [March 16, 2018, 12:53pm UTC](https://discourse.julialang.org/t/writing-an-array-too-large-to-store-in-memory/9752 "2018-03-16T12:53:30Z")

</div>

I am transforming a dataset, and the process of transforming it both takes a long time and takes up a large amount of memory. I really only need a single row of the matrix in memory at any given time, so is there some ef…

---

## [ZMQ - correct usage ](https://discourse.julialang.org/t/zmq-correct-usage/9734)

<div class="topic-metadata">

**Author:** [@msomers](https://discourse.julialang.org/u/msomers)\
**Replies:** 1\
**Last updated:** [March 15, 2018, 2:35pm UTC](https://discourse.julialang.org/t/zmq-correct-usage/9734 "2018-03-15T14:35:51Z")

</div>

trying to get a simple ZMQ communication going connecting to a simple python echo server import zmq # ZeroMQ Context context = zmq.Context() # Define the socket using the "Context" sock = context.socket(zmq.REP) sock.…

---

## [Using sizehint! on a Dict that I would like to declare const](https://discourse.julialang.org/t/using-sizehint-on-a-dict-that-i-would-like-to-declare-const/9728)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 2\
**Last updated:** [March 15, 2018, 5:53am UTC](https://discourse.julialang.org/t/using-sizehint-on-a-dict-that-i-would-like-to-declare-const/9728 "2018-03-15T05:53:52Z")

</div>

My understanding of how sizehint! works is that it needs to be called over a Dict before you populate the Dict with key/value pairs, if you want to see any performance benefit. Is this correct? If so, then it would sugg…

---

## [svdvals is alarmingly slow](https://discourse.julialang.org/t/svdvals-is-alarmingly-slow/9259)

<div class="topic-metadata">

**Author:** [@tobydriscoll](https://discourse.julialang.org/u/tobydriscoll)\
**Replies:** 31\
**Last updated:** [March 15, 2018, 1:04am UTC](https://discourse.julialang.org/t/svdvals-is-alarmingly-slow/9259 "2018-03-15T01:04:03Z")

</div>

Straightforward use of svdvals on a freshly restarted Julia session: using BenchmarkTools B=randn(100,100); @btime svdvals($B); versioninfo() Here’s the result. 10.423 ms (11 allocations: 138.20 KiB) Julia Version …

---

## [Get an image from a matrix of signed integers](https://discourse.julialang.org/t/get-an-image-from-a-matrix-of-signed-integers/9701)

<div class="topic-metadata">

**Author:** [@giordano](https://discourse.julialang.org/u/giordano)\
**Replies:** 11\
**Last updated:** [March 14, 2018, 3:50pm UTC](https://discourse.julialang.org/t/get-an-image-from-a-matrix-of-signed-integers/9701 "2018-03-14T15:50:32Z")

</div>

What’s the best way to get a PNG image out of a matrix of signed integers, with Images.jl? I converted the signed integers to Fixed in the range \[-1, 1) (e.g., Int64 to Fixed{Int64, 63}), but when I try to create a PNG …

---

## [Complement](https://discourse.julialang.org/t/complement/9710)

<div class="topic-metadata">

**Author:** [@Samudra](https://discourse.julialang.org/u/Samudra)\
**Replies:** 1\
**Last updated:** [March 14, 2018, 8:34am UTC](https://discourse.julialang.org/t/complement/9710 "2018-03-14T08:34:39Z")

</div>

Hi, Seems like ‘Complement’ is no longer available for Julia 0.6, Does anyone have an idea what I could use instead?

---

## [How does Julia go from array comprehension to collect(::Generator)?](https://discourse.julialang.org/t/how-does-julia-go-from-array-comprehension-to-collect-generator/9705)

<div class="topic-metadata">

**Author:** [@jandehaan](https://discourse.julialang.org/u/jandehaan)\
**Replies:** 2\
**Last updated:** [March 14, 2018, 1:51am UTC](https://discourse.julialang.org/t/how-does-julia-go-from-array-comprehension-to-collect-generator/9705 "2018-03-14T01:51:37Z")

</div>

I have the following julia\> Base.collect(::Base.Generator{MyCollection}) = print("success") julia\> \[x for x in MyCollection(\[1,2\])\] success I can’t figure out how Julia goes from parsing the comprehension \[x for x in M…

---

## [Installing Julia 0.4](https://discourse.julialang.org/t/installing-julia-0-4/9680)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 16\
**Last updated:** [March 14, 2018, 1:18am UTC](https://discourse.julialang.org/t/installing-julia-0-4/9680 "2018-03-14T01:18:29Z")

</div>

I need to debug some legacy Julia package developed for Julia 0.4. What is the best way to install Julia 0.4 on macOS 10.13 (High Sierra, the most recent macOS)? I tried several methods, but none of them worked. I ch…

---

## [Spider/Radar charts](https://discourse.julialang.org/t/spider-radar-charts/9700)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 1\
**Last updated:** [March 13, 2018, 9:25pm UTC](https://discourse.julialang.org/t/spider-radar-charts/9700 "2018-03-13T21:25:06Z")

</div>

Anyone knows what’s the best way to create spider charts in Julia?

---

## [\[ANN\] New benchmark comparison](https://discourse.julialang.org/t/ann-new-benchmark-comparison/9689)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 5\
**Last updated:** [March 13, 2018, 6:53pm UTC](https://discourse.julialang.org/t/ann-new-benchmark-comparison/9689 "2018-03-13T18:53:43Z")

</div>

There is a benchmark posted here of which I just became aware today. I will investigate a bit more, but if anyone has had a look already, I would appreciate any comments or insights.

---

## [Reinterpret examples for converting Julia multi-dimensional arrays and StaticArrays](https://discourse.julialang.org/t/reinterpret-examples-for-converting-julia-multi-dimensional-arrays-and-staticarrays/9682)

<div class="topic-metadata">

**Author:** [@zygmuntszpak](https://discourse.julialang.org/u/zygmuntszpak)\
**Replies:** 1\
**Last updated:** [March 13, 2018, 1:13pm UTC](https://discourse.julialang.org/t/reinterpret-examples-for-converting-julia-multi-dimensional-arrays-and-staticarrays/9682 "2018-03-13T13:13:16Z")

</div>

I’m having trouble discerning how to convert between different representations of array structures using reinterpret. I’ve figured some things out, which I have posted below in case anyone else will find the examples us…

---

## [Interdependent files in module](https://discourse.julialang.org/t/interdependent-files-in-module/9675)

<div class="topic-metadata">

**Author:** [@Robert\_Honig](https://discourse.julialang.org/u/Robert_Honig)\
**Replies:** 3\
**Last updated:** [March 13, 2018, 7:04am UTC](https://discourse.julialang.org/t/interdependent-files-in-module/9675 "2018-03-13T07:04:37Z")

</div>

Say I have the following module definition: module Foo include("bar.jl") include("baz.jl") include("qux.jl") end bar.jl uses a function provided by qux.jl. What is the julian way to handle this sort of intermodular dep…

---

## [Error loading Atom.jl](https://discourse.julialang.org/t/error-loading-atom-jl/5652)

<div class="topic-metadata">

**Author:** [@Rudiney](https://discourse.julialang.org/u/Rudiney)\
**Replies:** 5\
**Last updated:** [March 12, 2018, 8:37pm UTC](https://discourse.julialang.org/t/error-loading-atom-jl/5652 "2018-03-12T20:37:50Z")

</div>

Hello! When a type using Atom a have this message: julia\> using Atom INFO: Precompiling module Atom. ERROR: LoadError: HttpParser not properly installed. Please run Pkg.build(“HttpParser”) Stacktrace: \[1\] error(::…

---

## [UTF8 to Ascii and Reverse](https://discourse.julialang.org/t/utf8-to-ascii-and-reverse/9650)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 5\
**Last updated:** [March 12, 2018, 7:40pm UTC](https://discourse.julialang.org/t/utf8-to-ascii-and-reverse/9650 "2018-03-12T19:40:27Z")

</div>

I could program this, but I am wondering if this is already in j: an encoder/decoder of UTF8 to ASCII. Something like julia\> x= "\\u00a5" "¥" julia\> encodeutf8toascii(x) "\\\\00a5" julia\> encodeascii2utf8(ans) "¥" PS: …

---

## [Poor time performance on Dict?](https://discourse.julialang.org/t/poor-time-performance-on-dict/9656)

<div class="topic-metadata">

**Author:** [@phrmoy](https://discourse.julialang.org/u/phrmoy)\
**Replies:** 26\
**Last updated:** [March 12, 2018, 3:35pm UTC](https://discourse.julialang.org/t/poor-time-performance-on-dict/9656 "2018-03-12T15:35:42Z")

</div>

So I conducted a very simple run-time test for both Array and Dict. And here are the results of the very simple test: Now, it was clear to me before the test that the allocated Array was going to be much faster. But t…

---

## [Making type stable code](https://discourse.julialang.org/t/making-type-stable-code/9610)

<div class="topic-metadata">

**Author:** [@davidavdav](https://discourse.julialang.org/u/davidavdav)\
**Replies:** 6\
**Last updated:** [March 12, 2018, 8:10am UTC](https://discourse.julialang.org/t/making-type-stable-code/9610 "2018-03-12T08:10:18Z")

</div>

Hello, I am struggling with making NamedArrays more type stable. I need to implement getindex() for the same range of slices that AbstractArray can handle. For the backing array that NamedArrays wraps, this is easy. …

---

## [Skewness/kurtosis](https://discourse.julialang.org/t/skewness-kurtosis/9652)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 4\
**Last updated:** [March 12, 2018, 5:22am UTC](https://discourse.julialang.org/t/skewness-kurtosis/9652 "2018-03-12T05:22:38Z")

</div>

Hi there. What am I missing? Skewness and kurtosis are different… julia\> using OnlineStats, StatsBase julia\> w = randn(10000); julia\> ws = Series(Mean(), Variance(), Moments()); julia\> mean(w), var(w), skewness(w), …

---

## [Way to know if someone's using package in terminal?](https://discourse.julialang.org/t/way-to-know-if-someones-using-package-in-terminal/9649)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 2\
**Last updated:** [March 11, 2018, 10:26pm UTC](https://discourse.julialang.org/t/way-to-know-if-someones-using-package-in-terminal/9649 "2018-03-11T22:26:26Z")

</div>

Is there a way to check within a package (as its developer) whether the user is using: JuliaPro Jupyter REPL etc. // basically just need to know if the person can render html, css, and js (i.e. not using the REPL)

---

## [Performance degradation of \`fill\` in latest Julia 0.7 Dev?](https://discourse.julialang.org/t/performance-degradation-of-fill-in-latest-julia-0-7-dev/9648)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 2\
**Last updated:** [March 11, 2018, 9:16pm UTC](https://discourse.julialang.org/t/performance-degradation-of-fill-in-latest-julia-0-7-dev/9648 "2018-03-11T21:16:25Z")

</div>

I’m not sure if this has already been observed by someone, but I searched and didn’t find anything. The performance of fill is very slow in 0.7 in comparison to 0.6.2 or an explicit loop. The following results are from 0…

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

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