# General Usage

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

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

**Page:** 961

---

## [Precision issue: (A.+R.-A.-R) do not vanish ?!](https://discourse.julialang.org/t/precision-issue-a-r-a-r-do-not-vanish/12615)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 33\
**Last updated:** [July 29, 2018, 1:39pm UTC](https://discourse.julialang.org/t/precision-issue-a-r-a-r-do-not-vanish/12615 "2018-07-29T13:39:50Z")

</div>

N = 1023 A = rand(1000:20000,(N,N)); R = rand(ComplexF64,N,N); println(sum(abs.(A.+R.-A.-R))) println(sum(abs.(R.+A.-R.-A))) On my machine it gives 4.53665288446814e-7 5.0590642786119133e-11 What is happening?

---

## [Performance of length(::String)](https://discourse.julialang.org/t/performance-of-length-string/12672)

<div class="topic-metadata">

**Author:** [@Diego\_Javier\_Zea](https://discourse.julialang.org/u/Diego_Javier_Zea)\
**Replies:** 24\
**Last updated:** [July 28, 2018, 9:49pm UTC](https://discourse.julialang.org/t/performance-of-length-string/12672 "2018-07-28T21:49:09Z")

</div>

Hi! I’ve noticed that length(::String) isn’t a cheap operation in Julia, since it requires to iterate the string. In fact, it’s more expensive than Python len(str), even for unicode strings. Also, length(::String) is sl…

---

## [Error bars in 3D](https://discourse.julialang.org/t/error-bars-in-3d/12711)

<div class="topic-metadata">

**Author:** [@rcnlee](https://discourse.julialang.org/u/rcnlee)\
**Replies:** 0\
**Last updated:** [July 28, 2018, 7:51pm UTC](https://discourse.julialang.org/t/error-bars-in-3d/12711 "2018-07-28T19:51:25Z")

</div>

Is it possible to have error bars in 3D plots using Plots.jl? e.g., for a scatter3d plot. I see :xerror and :yerror but no :zerror in args.jl Thanks!

---

## [Arrays more advanced indexing](https://discourse.julialang.org/t/arrays-more-advanced-indexing/12696)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 1\
**Last updated:** [July 28, 2018, 10:48am UTC](https://discourse.julialang.org/t/arrays-more-advanced-indexing/12696 "2018-07-28T10:48:47Z")

</div>

Hi, I am going through the JuliaImages documentation for advanced image indexing here. I guess I am doing something wrong. But the result for: julia\> imgov = colorview(RGB, paddedviews(0, img, imgrot, zeroarray)...) …

---

## [Does inter-pixel distance change after downsampling?](https://discourse.julialang.org/t/does-inter-pixel-distance-change-after-downsampling/12594)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 7\
**Last updated:** [July 28, 2018, 7:38am UTC](https://discourse.julialang.org/t/does-inter-pixel-distance-change-after-downsampling/12594 "2018-07-28T07:38:40Z")

</div>

Hi guys! I have a question. It’s not related to Julia but general image processing. So I am trying to implement SIFT in Julia. My question is regarding inter-pixel distance. I think after downsampling the number of pix…

---

## [Coordinate transforms doubt](https://discourse.julialang.org/t/coordinate-transforms-doubt/12695)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 0\
**Last updated:** [July 28, 2018, 7:02am UTC](https://discourse.julialang.org/t/coordinate-transforms-doubt/12695 "2018-07-28T07:02:52Z")

</div>

Hi! So I am reading up on Coordinate Transforms and I stumbled upon this post on Stackoverflow. At the bottom the author(Dan Getz) says that “transform takes the standard coordinates of the points in the volume (1:3 x …

---

## [Installing LightGraph on Julia 0.7 master fails](https://discourse.julialang.org/t/installing-lightgraph-on-julia-0-7-master-fails/12671)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 17\
**Last updated:** [July 27, 2018, 8:34pm UTC](https://discourse.julialang.org/t/installing-lightgraph-on-julia-0-7-master-fails/12671 "2018-07-27T20:34:05Z")

</div>

Installing LightGraph on Julia 0.7 fails. I created a ticket (Precompiling LightGraph fails on Julia 0.7 · Issue #942 · sbromberger/LightGraphs.jl · GitHub), but it was immediately closed with the remark this would be a …

---

## [Parse String to DataType](https://discourse.julialang.org/t/parse-string-to-datatype/7118)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 19\
**Last updated:** [July 27, 2018, 5:17pm UTC](https://discourse.julialang.org/t/parse-string-to-datatype/7118 "2018-07-27T17:17:06Z")

</div>

I can do julia\> s = "Complex{Float64}" "Complex{Float64}" julia\> x = eval(parse(s)) Complex{Float64} julia\> typeof(x) DataType Is there a neater way than using eval to interpret the string as a datatype? Why is there…

---

## [Assignment in function arguments](https://discourse.julialang.org/t/assignment-in-function-arguments/12665)

<div class="topic-metadata">

**Author:** [@mlhetland](https://discourse.julialang.org/u/mlhetland)\
**Replies:** 7\
**Last updated:** [July 26, 2018, 11:26pm UTC](https://discourse.julialang.org/t/assignment-in-function-arguments/12665 "2018-07-26T23:26:38Z")

</div>

One of the references I found for this were in an old discussion about keyword arguments, where it seems the conclusion was that they prevented the possibility of assigments in function arguments. That makes sense for as…

---

## [Documenting when the closure "bug" (#15276) binds, and how to avoid it for introductory users](https://discourse.julialang.org/t/documenting-when-the-closure-bug-15276-binds-and-how-to-avoid-it-for-introductory-users/12642)

<div class="topic-metadata">

**Author:** [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Replies:** 44\
**Last updated:** [July 26, 2018, 7:45pm UTC](https://discourse.julialang.org/t/documenting-when-the-closure-bug-15276-binds-and-how-to-avoid-it-for-introductory-users/12642 "2018-07-26T19:45:39Z")

</div>

Plenty of discussion has occured about approaches to solving performance of captured variables in closures · Issue #15276 · JuliaLang/julia · GitHub and examples of it rearing its ugly head, but I haven’t seen a succinct…

---

## [Frequently failure with adding packages](https://discourse.julialang.org/t/frequently-failure-with-adding-packages/3214)

<div class="topic-metadata">

**Author:** [@sclereid](https://discourse.julialang.org/u/sclereid)\
**Replies:** 3\
**Last updated:** [July 26, 2018, 2:36pm UTC](https://discourse.julialang.org/t/frequently-failure-with-adding-packages/3214 "2018-07-26T14:36:22Z")

</div>

For example, when I want to add the IJulia package on my Mac OS julia 0.5 version, it says: julia\> using IJulia INFO: Precompiling module IJulia. ERROR: LoadError: ZMQ not properly installed. Please run Pkg.build("ZMQ")…

---

## [Most minimal way to get breadth-first indices?](https://discourse.julialang.org/t/most-minimal-way-to-get-breadth-first-indices/12661)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 4\
**Last updated:** [July 26, 2018, 9:45am UTC](https://discourse.julialang.org/t/most-minimal-way-to-get-breadth-first-indices/12661 "2018-07-26T09:45:46Z")

</div>

Let’s say you have N integers from 1:N (i.e. N = 15) cur\_vector = \[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 \] What is the most minimal way to turn this into the breadth-first search indices from recursive bis…

---

## [Tensorboard doesn't find numpy](https://discourse.julialang.org/t/tensorboard-doesnt-find-numpy/12652)

<div class="topic-metadata">

**Author:** [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Replies:** 2\
**Last updated:** [July 25, 2018, 2:10pm UTC](https://discourse.julialang.org/t/tensorboard-doesnt-find-numpy/12652 "2018-07-25T14:10:25Z")

</div>

I want to do some small projects with TensorFlow and it works fine, but can not make Tensorboard work. I’m also kinda new to Linux, so I’m not sure that everything I do is correct. To start up Tensorboard easier I made …

---

## [Issues with PyCall and parallelization using HTTP.jl-built web service](https://discourse.julialang.org/t/issues-with-pycall-and-parallelization-using-http-jl-built-web-service/12659)

<div class="topic-metadata">

**Author:** [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Replies:** 1\
**Last updated:** [July 26, 2018, 12:12am UTC](https://discourse.julialang.org/t/issues-with-pycall-and-parallelization-using-http-jl-built-web-service/12659 "2018-07-26T00:12:18Z")

</div>

Hi all, in 0.7 beta, I am trying to create a web service using HTTP.jl that can utilize a periodically-updating tree (built with NearestNeighbors.jl). We need to use sklearn from python to generate vectors with which to…

---

## [Large performance regression of vectorized functions on master](https://discourse.julialang.org/t/large-performance-regression-of-vectorized-functions-on-master/12657)

<div class="topic-metadata">

**Author:** [@giordano](https://discourse.julialang.org/u/giordano)\
**Replies:** 4\
**Last updated:** [July 25, 2018, 9:15pm UTC](https://discourse.julialang.org/t/large-performance-regression-of-vectorized-functions-on-master/12657 "2018-07-25T21:15:02Z")

</div>

While upgrading this package to Julia 0.7, I noticed a quite large performance regression in vectorized operations. This is the script I used for benchmarking: n = 12500 Ch = rand(n) Sh = rand(n) C2 = rand(n) S2 = ran…

---

## [Using someone else's project with Pkg3](https://discourse.julialang.org/t/using-someone-elses-project-with-pkg3/12640)

<div class="topic-metadata">

**Author:** [@giordano](https://discourse.julialang.org/u/giordano)\
**Replies:** 3\
**Last updated:** [July 25, 2018, 9:08pm UTC](https://discourse.julialang.org/t/using-someone-elses-project-with-pkg3/12640 "2018-07-25T21:08:10Z")

</div>

In Julia 0.7, if I clone the repository of an unregistered package to ~/.julia/dev is still necessary to manually add this directory to LOAD\_PATH in order to use someone else’s project as outlined here?

---

## [Passing keyword arguments through a thin wrapper without explicitly writing them out](https://discourse.julialang.org/t/passing-keyword-arguments-through-a-thin-wrapper-without-explicitly-writing-them-out/8173)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 4\
**Last updated:** [July 25, 2018, 6:58pm UTC](https://discourse.julialang.org/t/passing-keyword-arguments-through-a-thin-wrapper-without-explicitly-writing-them-out/8173 "2018-07-25T18:58:15Z")

</div>

I wonder if there is a way to pass on keyword arguments through a thin wrapper without having to explicitly type the keyword arguments, something like the following Python code. Splatting doesn’t seem to work, nor does p…

---

## [Avoiding memory allocation for vector operations](https://discourse.julialang.org/t/avoiding-memory-allocation-for-vector-operations/12447)

<div class="topic-metadata">

**Author:** [@jdrugo](https://discourse.julialang.org/u/jdrugo)\
**Replies:** 11\
**Last updated:** [July 25, 2018, 3:26pm UTC](https://discourse.julialang.org/t/avoiding-memory-allocation-for-vector-operations/12447 "2018-07-25T15:26:18Z")

</div>

Hi everyone, I expected this to be a trivial optimization, but am struggling with writing vectorized code that doesn’t allocation memory. Consider the following code: function gram\_schmidt1!{T \<: Real}(U::Matrix{T}) …

---

## [Julia merge png](https://discourse.julialang.org/t/julia-merge-png/12645)

<div class="topic-metadata">

**Author:** [@Romero\_Azzalini](https://discourse.julialang.org/u/Romero_Azzalini)\
**Replies:** 2\
**Last updated:** [July 25, 2018, 3:23pm UTC](https://discourse.julialang.org/t/julia-merge-png/12645 "2018-07-25T15:23:48Z")

</div>

Hi, I want to merge 3 pictures (.png) into one, like a subplot, with 2 pictures in the upper and one in the center of the bottom row. How would I do that? Best, Hannes

---

## [Calculate inertial parameters from a mesh](https://discourse.julialang.org/t/calculate-inertial-parameters-from-a-mesh/12633)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 16\
**Last updated:** [July 25, 2018, 1:02pm UTC](https://discourse.julialang.org/t/calculate-inertial-parameters-from-a-mesh/12633 "2018-07-25T13:02:43Z")

</div>

There is some package that can be used to calculate inertial parameters (centers of masses, moments of inertial, etc.) from a triangular mesh? E.g. implementation of \[1\] or similar. I’ve been looking at the packages in h…

---

## [Expressions separated by semicolon](https://discourse.julialang.org/t/expressions-separated-by-semicolon/12638)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 8\
**Last updated:** [July 25, 2018, 12:27pm UTC](https://discourse.julialang.org/t/expressions-separated-by-semicolon/12638 "2018-07-25T12:27:09Z")

</div>

This happens in a tuple of expressions, when there is a semicolon that separates them: julia\> ex = :(a=1; b=2, c=3) :(($(Expr(:parameters, :(b=2), :(c=3))), a = 1)) julia\> dump(ex) Expr head: Symbol tuple args: Arr…

---

## [Way to get commit SHAs of all packages (Julia 0.7)?](https://discourse.julialang.org/t/way-to-get-commit-shas-of-all-packages-julia-0-7/12646)

<div class="topic-metadata">

**Author:** [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Replies:** 1\
**Last updated:** [July 25, 2018, 6:13am UTC](https://discourse.julialang.org/t/way-to-get-commit-shas-of-all-packages-julia-0-7/12646 "2018-07-25T06:13:42Z")

</div>

In Julia 0.7, is there a way to get the SHAs for the versions in use in a project of all the packages in the project? In other words, when you do \] status the output includes some hashes, which are basically UUIDs for th…

---

## [Name of the running.jl or notebook()](https://discourse.julialang.org/t/name-of-the-running-jl-or-notebook/12635)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 3\
**Last updated:** [July 25, 2018, 2:36am UTC](https://discourse.julialang.org/t/name-of-the-running-jl-or-notebook/12635 "2018-07-25T02:36:07Z")

</div>

Hi, I’m facing something that apparently does not seem very simple to solve. The fact is that I’m producing some code that can either go on a notebook() in IJupyter, or be pasted on an ASCII text file (with .jl extensio…

---

## [Ccall with return vector\<double\>](https://discourse.julialang.org/t/ccall-with-return-vector-double/12631)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 2\
**Last updated:** [July 24, 2018, 1:44pm UTC](https://discourse.julialang.org/t/ccall-with-return-vector-double/12631 "2018-07-24T13:44:09Z")

</div>

Hello, I have a function in a shared library (self-written) where I have a vector\<double\> as a return type. Now, how would I organize the ccall in order to get a \`Array{Float64} in Julia. I cannot figure it out on my ow…

---

## [Docstring for overwritten function](https://discourse.julialang.org/t/docstring-for-overwritten-function/10777)

<div class="topic-metadata">

**Author:** [@Sam](https://discourse.julialang.org/u/Sam)\
**Replies:** 4\
**Last updated:** [July 24, 2018, 1:25pm UTC](https://discourse.julialang.org/t/docstring-for-overwritten-function/10777 "2018-07-24T13:25:46Z")

</div>

Hi, I am writing a Module where I am overwriting the function sample from StatsBase.jl. To be able to overwrite the function sample I import the function in the file Modulename.jl # import sample import StatsBase: sa…

---

## [JLD on Multithreading](https://discourse.julialang.org/t/jld-on-multithreading/12632)

<div class="topic-metadata">

**Author:** [@DavidBerghaus](https://discourse.julialang.org/u/DavidBerghaus)\
**Replies:** 2\
**Last updated:** [July 24, 2018, 11:55am UTC](https://discourse.julialang.org/t/jld-on-multithreading/12632 "2018-07-24T11:55:11Z")

</div>

I am calculating matrix entries through multithreading and now would like to save the matrix to a file because it gets too big for my RAM. I read that the package JLD is most common for saving Julia variables. But when…

---

## [Import vs using (v0.7)](https://discourse.julialang.org/t/import-vs-using-v0-7/11753)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 5\
**Last updated:** [July 24, 2018, 8:43am UTC](https://discourse.julialang.org/t/import-vs-using-v0-7/11753 "2018-07-24T08:43:05Z")

</div>

I was reading the Pkg documentation for Julia v0.7 and I noticed that the examples use import. I was wondering if this represents idiomatic Julia and if import is recommended over using. Having clear what using and impo…

---

## [Deserializing "Untrusted" Data](https://discourse.julialang.org/t/deserializing-untrusted-data/12621)

<div class="topic-metadata">

**Author:** [@travigd](https://discourse.julialang.org/u/travigd)\
**Replies:** 1\
**Last updated:** [July 24, 2018, 4:16am UTC](https://discourse.julialang.org/t/deserializing-untrusted-data/12621 "2018-07-24T04:16:14Z")

</div>

How “safe” is deserializing data (à la deserialize) from an untrusted source? I’m okay with the process crashing if the data isn’t valid, but not okay with arbitrary code execution. For context, I’m trying to run studen…

---

## [Closed topic](https://discourse.julialang.org/t/closed-topic/12620)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 0\
**Last updated:** [July 23, 2018, 11:15pm UTC](https://discourse.julialang.org/t/closed-topic/12620 "2018-07-23T23:15:40Z")

</div>

Solved! problem! No need for answer

---

## [Notebook help using question mark is broken in Julia 0.6.4](https://discourse.julialang.org/t/notebook-help-using-question-mark-is-broken-in-julia-0-6-4/12571)

<div class="topic-metadata">

**Author:** [@ronubi](https://discourse.julialang.org/u/ronubi)\
**Replies:** 5\
**Last updated:** [July 23, 2018, 10:07pm UTC](https://discourse.julialang.org/t/notebook-help-using-question-mark-is-broken-in-julia-0-6-4/12571 "2018-07-23T22:07:56Z")

</div>

In a Jupyter notebook running the Julia 0.6.4 kernel, typing a leading question mark(?) followed by anything results in similar problems for me, on Mac and Linux: ?+ UndefVarError: result not defined Stacktrace: \[1\] …

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

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