# General Usage

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

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

**Page:** 826

---

## [Consistent performance difference but identical LLVM IR](https://discourse.julialang.org/t/consistent-performance-difference-but-identical-llvm-ir/29620)

<div class="topic-metadata">

**Author:** [@milesf](https://discourse.julialang.org/u/milesf)\
**Replies:** 4\
**Last updated:** [October 8, 2019, 12:20am UTC](https://discourse.julialang.org/t/consistent-performance-difference-but-identical-llvm-ir/29620 "2019-10-08T00:20:35Z")

</div>

I am attempting to write a high-performance round-up function that treats Int64 and UInt64 identically. The compiled output is the same, but performance is always worse with UInt. It’s only a 10% difference, but it’s sur…

---

## [Seg fault when saving files with JLD2 in WSL](https://discourse.julialang.org/t/seg-fault-when-saving-files-with-jld2-in-wsl/13656)

<div class="topic-metadata">

**Author:** [@111](https://discourse.julialang.org/u/111)\
**Replies:** 7\
**Last updated:** [October 7, 2019, 10:55pm UTC](https://discourse.julialang.org/t/seg-fault-when-saving-files-with-jld2-in-wsl/13656 "2019-10-07T22:55:21Z")

</div>

The installation of JLD2 in WSL is passed successfully. However, the test code goes wrong: using JLD2, FileIO hello = "world" foo = :bar @save "example.jld2" hello foo The error message is: signal (11): Segmentation f…

---

## [Weird PackageCompiler problem with parallel builds](https://discourse.julialang.org/t/weird-packagecompiler-problem-with-parallel-builds/29505)

<div class="topic-metadata">

**Author:** [@dhazeghi](https://discourse.julialang.org/u/dhazeghi)\
**Replies:** 1\
**Last updated:** [October 7, 2019, 7:32pm UTC](https://discourse.julialang.org/t/weird-packagecompiler-problem-with-parallel-builds/29505 "2019-10-07T19:32:40Z")

</div>

Hello, we recently tried to update from PackageCompiler v0.6.0 to v0.6.4 and we’re hitting a weird problem. Because it takes 3-5 minutes to build a binary and we have half a dozen binaries to build, we fire off a bunch…

---

## [How to convert Cholesky {Float64,Array{Float64,2}} to Array{Float64,2} in julia](https://discourse.julialang.org/t/how-to-convert-cholesky-float64-array-float64-2-to-array-float64-2-in-julia/29536)

<div class="topic-metadata">

**Author:** [@shiva](https://discourse.julialang.org/u/shiva)\
**Replies:** 4\
**Last updated:** [October 7, 2019, 7:05pm UTC](https://discourse.julialang.org/t/how-to-convert-cholesky-float64-array-float64-2-to-array-float64-2-in-julia/29536 "2019-10-07T19:05:52Z")

</div>

Hello, I am using Julia 1.0.4 to do a cholesky decomposition I wrote the following code: using LinearAlgebra A=\[1 0 1; 0 2 0; 1 0 3\]; BB=cholesky(A); and the result is: BB=Cholesky{Float64,Array{Float64,2}}(\[1.0 0.…

---

## [Juno, toolbar is not shown correctly](https://discourse.julialang.org/t/juno-toolbar-is-not-shown-correctly/29538)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 8\
**Last updated:** [October 7, 2019, 6:37pm UTC](https://discourse.julialang.org/t/juno-toolbar-is-not-shown-correctly/29538 "2019-10-07T18:37:55Z")

</div>

I installed Juno according to the instruction. But not all of the tool bar buttons are shown as following. I have used VS code for several months, because of the bugs in Juno. I like some features of Juno but always …

---

## [Error with Pkg.add("Libdl")](https://discourse.julialang.org/t/error-with-pkg-add-libdl/29508)

<div class="topic-metadata">

**Author:** [@tommaso16](https://discourse.julialang.org/u/tommaso16)\
**Replies:** 2\
**Last updated:** [October 7, 2019, 4:33pm UTC](https://discourse.julialang.org/t/error-with-pkg-add-libdl/29508 "2019-10-07T16:33:54Z")

</div>

Hello, I am trying to run the command include(“setup.jl”) (referring to this code https://github.com/XiaojingGeorgeZhang/H-OBCA) but I get the error INFO: Precompiling module PyPlot. WARNING: could not import Base.push…

---

## [Groupreduce of DataFrame with empty group](https://discourse.julialang.org/t/groupreduce-of-dataframe-with-empty-group/29599)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 7\
**Last updated:** [October 7, 2019, 3:52pm UTC](https://discourse.julialang.org/t/groupreduce-of-dataframe-with-empty-group/29599 "2019-10-07T15:52:37Z")

</div>

I have a DataFrame df: df = DataFrame(a = repeat(\[1, 2, 3, 4\], outer=\[2\]), b = repeat(\[2, 1\], outer=\[4\]), c = 1:8); I want to apply the following operation: operator=(:a =\> …

---

## [Read lines from command and kill the process](https://discourse.julialang.org/t/read-lines-from-command-and-kill-the-process/29600)

<div class="topic-metadata">

**Author:** [@sdewaele](https://discourse.julialang.org/u/sdewaele)\
**Replies:** 0\
**Last updated:** [October 7, 2019, 3:15pm UTC](https://discourse.julialang.org/t/read-lines-from-command-and-kill-the-process/29600 "2019-10-07T15:15:58Z")

</div>

I would like to do the following: Start an external command Read lines from the command If the line contains a certain text, kill the external command Return once all lines are read Is there a simple way to achieve th…

---

## [OpenBLAS vs. "for loops" demo](https://discourse.julialang.org/t/openblas-vs-for-loops-demo/29581)

<div class="topic-metadata">

**Author:** [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Replies:** 6\
**Last updated:** [October 7, 2019, 2:07pm UTC](https://discourse.julialang.org/t/openblas-vs-for-loops-demo/29581 "2019-10-07T14:07:12Z")

</div>

I am preparing a presentation/demo for an upcoming meetup and want to showcase that “for loops” in Julia are fast. How fast? Fast enough to write simple code that compares to BLAS routines. So I decided to implement a “…

---

## [Code\_native opcode annotations](https://discourse.julialang.org/t/code-native-opcode-annotations/29562)

<div class="topic-metadata">

**Author:** [@milesf](https://discourse.julialang.org/u/milesf)\
**Replies:** 9\
**Last updated:** [October 7, 2019, 12:17pm UTC](https://discourse.julialang.org/t/code-native-opcode-annotations/29562 "2019-10-07T12:17:19Z")

</div>

For those of us not yet fluent in reading assembly, code\_native output could be enhanced with human-readable annotations of what the opcodes represent. This will save us from constantly searching through docs to find mea…

---

## [Test with title string](https://discourse.julialang.org/t/test-with-title-string/29566)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 6\
**Last updated:** [October 7, 2019, 10:20am UTC](https://discourse.julialang.org/t/test-with-title-string/29566 "2019-10-07T10:20:23Z")

</div>

Hi, I am doing some testing for a package and I would like to have a string attached to the test result. Right now, I have to use @testset with a begin keyword. Is there anything like the following? @test "Testing dum…

---

## [Compare julia sum to a cpp implementation - julia is extremely slow?!](https://discourse.julialang.org/t/compare-julia-sum-to-a-cpp-implementation-julia-is-extremely-slow/29398)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 35\
**Last updated:** [October 7, 2019, 9:18am UTC](https://discourse.julialang.org/t/compare-julia-sum-to-a-cpp-implementation-julia-is-extremely-slow/29398 "2019-10-07T09:18:29Z")

</div>

Hello, I am about to test the speed of a simple summation function of a 2D array in cpp and julia. However I see that julia code is becoming slower as the array increases while cpp code remains const in time. Could some…

---

## [Segfault while using @threads](https://discourse.julialang.org/t/segfault-while-using-threads/26705)

<div class="topic-metadata">

**Author:** [@mindbound](https://discourse.julialang.org/u/mindbound)\
**Replies:** 6\
**Last updated:** [October 7, 2019, 9:13am UTC](https://discourse.julialang.org/t/segfault-while-using-threads/26705 "2019-10-07T09:13:18Z")

</div>

With Julia v1.1.1 (official Arch Linux installation), I get a segmentation fault when running this example code: Threads.@threads for i = 1:10 println("i = $i on thread $(Threads.threadid())") end The exact message…

---

## [Extracting Lower Triangular Factor of Sparse Cholesky](https://discourse.julialang.org/t/extracting-lower-triangular-factor-of-sparse-cholesky/23095)

<div class="topic-metadata">

**Author:** [@suchitm](https://discourse.julialang.org/u/suchitm)\
**Replies:** 4\
**Last updated:** [October 7, 2019, 7:35am UTC](https://discourse.julialang.org/t/extracting-lower-triangular-factor-of-sparse-cholesky/23095 "2019-10-07T07:35:20Z")

</div>

This question pertains to issue #26147. I am having the same issues with the sparse cholesky factorization as the user who posted the last comment. The results for the lower triangular matrix from a sparse cholesky are n…

---

## [How to sum a vector in accumulated form to another vector?](https://discourse.julialang.org/t/how-to-sum-a-vector-in-accumulated-form-to-another-vector/29552)

<div class="topic-metadata">

**Author:** [@Halor](https://discourse.julialang.org/u/Halor)\
**Replies:** 8\
**Last updated:** [October 7, 2019, 6:57am UTC](https://discourse.julialang.org/t/how-to-sum-a-vector-in-accumulated-form-to-another-vector/29552 "2019-10-07T06:57:30Z")

</div>

Hi. I have been struggling trying to figure it out how to sum a vector. For example, I got those numers: a= Float64\[11\] 0.143816064 0.130130156 0.117746635 0.106541561 0.096402791 0.087228852 0.07892793 0.071416944 0.06…

---

## [Trouble creating a module from CxxWrap'ped code](https://discourse.julialang.org/t/trouble-creating-a-module-from-cxxwrapped-code/28770)

<div class="topic-metadata">

**Author:** [@atombear](https://discourse.julialang.org/u/atombear)\
**Replies:** 18\
**Last updated:** [October 7, 2019, 5:07am UTC](https://discourse.julialang.org/t/trouble-creating-a-module-from-cxxwrapped-code/28770 "2019-10-07T05:07:23Z")

</div>

I am totally baffled by this. I have been wrapping a c++ simulations package using cxxwrap learning plenty of c++, and generally getting everything to work. I prepared tests in the canonical way, and saw that I could r…

---

## [Code\_native diff](https://discourse.julialang.org/t/code-native-diff/29529)

<div class="topic-metadata">

**Author:** [@milesf](https://discourse.julialang.org/u/milesf)\
**Replies:** 3\
**Last updated:** [October 7, 2019, 1:22am UTC](https://discourse.julialang.org/t/code-native-diff/29529 "2019-10-07T01:22:29Z")

</div>

I’m often curious whether small changes to functions have any effect on the compiled output. This leads to a lot of cursory inspection of @code\_native output, where I’m just looking at the line count and last few lines. …

---

## [Why not use @generated?](https://discourse.julialang.org/t/why-not-use-generated/29531)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 16\
**Last updated:** [October 6, 2019, 8:36pm UTC](https://discourse.julialang.org/t/why-not-use-generated/29531 "2019-10-06T20:36:11Z")

</div>

It seems that using @generated is discouraged by the core devs and I would like to understand better when and why it is discouraged. I am aware of the excellent Keynote by @stevengj which already talks a lot about when (…

---

## [Cxx.jl LLVM error / unresolved external function](https://discourse.julialang.org/t/cxx-jl-llvm-error-unresolved-external-function/29550)

<div class="topic-metadata">

**Author:** [@tamasgal](https://discourse.julialang.org/u/tamasgal)\
**Replies:** 1\
**Last updated:** [October 6, 2019, 2:13pm UTC](https://discourse.julialang.org/t/cxx-jl-llvm-error-unresolved-external-function/29550 "2019-10-06T14:13:40Z")

</div>

Today I though I ruin my day by trying to interface our main DAQ framework (written in C++ and ROOT) in Julia and I think I am quite successful so far (haha). The best thing is, the software is closed source so I cannot …

---

## [Developing Julia Packages](https://discourse.julialang.org/t/developing-julia-packages/29541)

<div class="topic-metadata">

**Author:** [@Alec\_Loudenback](https://discourse.julialang.org/u/Alec_Loudenback)\
**Replies:** 5\
**Last updated:** [October 6, 2019, 1:41pm UTC](https://discourse.julialang.org/t/developing-julia-packages/29541 "2019-10-06T13:41:24Z")

</div>

@ChrisRackauckas made a YouTube tutorial on developing julia packages and some best practices:

---

## [Lazy readdir in Julia with libuv](https://discourse.julialang.org/t/lazy-readdir-in-julia-with-libuv/29522)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 2\
**Last updated:** [October 6, 2019, 9:45am UTC](https://discourse.julialang.org/t/lazy-readdir-in-julia-with-libuv/29522 "2019-10-06T09:45:19Z")

</div>

readdir relies on the libuv scandir function, meaning all the contents of a directory must be read to memory before we do anything. Sometimes it is useful to iterate over contents in a streaming way. Libuv allows this tr…

---

## [JuliaBinaryWrappers tracker and issue listing](https://discourse.julialang.org/t/juliabinarywrappers-tracker-and-issue-listing/29547)

<div class="topic-metadata">

**Author:** [@sambitdash](https://discourse.julialang.org/u/sambitdash)\
**Replies:** 2\
**Last updated:** [October 6, 2019, 8:48am UTC](https://discourse.julialang.org/t/juliabinarywrappers-tracker-and-issue-listing/29547 "2019-10-06T08:48:17Z")

</div>

Hi All, Is there a place to request for new binaries to be built for JuliaBinaryWrappers? For example, I want to request for Tesseract and Leptonica binaries to be included. But there is no easy way to do so as each bin…

---

## [Situations where mutable struct is more performant than immutable struct](https://discourse.julialang.org/t/situations-where-mutable-struct-is-more-performant-than-immutable-struct/29504)

<div class="topic-metadata">

**Author:** [@milesf](https://discourse.julialang.org/u/milesf)\
**Replies:** 6\
**Last updated:** [October 5, 2019, 8:44pm UTC](https://discourse.julialang.org/t/situations-where-mutable-struct-is-more-performant-than-immutable-struct/29504 "2019-10-05T20:44:08Z")

</div>

Wanted to highlight a situation where mutable structs offer better performance than immutable structs. If sorting an array of structs with many isbits fields, the immutable copy cost outweighs the mutable indirection co…

---

## [Escape the esc function](https://discourse.julialang.org/t/escape-the-esc-function/29524)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 1\
**Last updated:** [October 5, 2019, 5:16pm UTC](https://discourse.julialang.org/t/escape-the-esc-function/29524 "2019-10-05T17:16:50Z")

</div>

It is not uncommon that most of the expression returned by a macro needs to be escaped. For example using MacroTools const IGNORE = \[true\] macro foo(f) fdict = MacroTools.splitdef(f) fdict\[:body\] = quote …

---

## [Testing local functions](https://discourse.julialang.org/t/testing-local-functions/29521)

<div class="topic-metadata">

**Author:** [@MaxPauer](https://discourse.julialang.org/u/MaxPauer)\
**Replies:** 0\
**Last updated:** [October 5, 2019, 3:08pm UTC](https://discourse.julialang.org/t/testing-local-functions/29521 "2019-10-05T15:08:54Z")

</div>

I recently learned about using let-blocks for encapsulation. Is there any good way to test functions within let-blocks apart from making them global? function only\_global\_for\_testing end function actually\_needed\_in\_int…

---

## [Indicator matrix for categorical data in GLM.jl with DataFrames.jl](https://discourse.julialang.org/t/indicator-matrix-for-categorical-data-in-glm-jl-with-dataframes-jl/3448)

<div class="topic-metadata">

**Author:** [@dfdx](https://discourse.julialang.org/u/dfdx)\
**Replies:** 4\
**Last updated:** [October 5, 2019, 1:43pm UTC](https://discourse.julialang.org/t/indicator-matrix-for-categorical-data-in-glm-jl-with-dataframes-jl/3448 "2019-10-05T13:43:13Z")

</div>

I am working with a large data set and want to run a logit regression on monthly data. For this I create a DataFrame and use the GLM package in Julia. My code looke something like that: f=glm((Y ~ Age + Duration + Gend…

---

## [Can I choose display software?](https://discourse.julialang.org/t/can-i-choose-display-software/29510)

<div class="topic-metadata">

**Author:** [@Apoema](https://discourse.julialang.org/u/Apoema)\
**Replies:** 3\
**Last updated:** [October 5, 2019, 1:35pm UTC](https://discourse.julialang.org/t/can-i-choose-display-software/29510 "2019-10-05T13:35:38Z")

</div>

I am using Julia on Debian and plotting SVG images using Gadfly. The default software used to display the image is my web browser which really doesn’t seem as the best option to me. Can I configure Julia/Gadfly to use an…

---

## [Juno error](https://discourse.julialang.org/t/juno-error/29518)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 0\
**Last updated:** [October 5, 2019, 6:48am UTC](https://discourse.julialang.org/t/juno-error/29518 "2019-10-05T06:48:42Z")

</div>

When I search in Documentation in Juno. Got the following error. Julia version information, Julia Version 1.1.0 Commit 80516ca202 (2019-01-21 21:24 UTC) Platform Info: OS: macOS (x86\_64-apple-darwin14.5.0) CPU: …

---

## [How does one activate the environment of an added package?](https://discourse.julialang.org/t/how-does-one-activate-the-environment-of-an-added-package/29478)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 3\
**Last updated:** [October 5, 2019, 5:37am UTC](https://discourse.julialang.org/t/how-does-one-activate-the-environment-of-an-added-package/29478 "2019-10-05T05:37:52Z")

</div>

I start with the Julia folder wiped clean. So I do PetrKrysl@Spectre MINGW64 ~ $ rm -rf ~/.julia/ PetrKrysl@Spectre MINGW64 ~ $ julia \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.or…

---

## [Expr trees and genetic programming](https://discourse.julialang.org/t/expr-trees-and-genetic-programming/29488)

<div class="topic-metadata">

**Author:** [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Replies:** 8\
**Last updated:** [October 5, 2019, 2:54am UTC](https://discourse.julialang.org/t/expr-trees-and-genetic-programming/29488 "2019-10-05T02:54:33Z")

</div>

I’ve been experimenting with metaprogramming in Julia. I’d like to make a simple program to experiment around with a toy model for genetic programming. I’d like to be able to “splice” Expr trees but the fact that they ar…

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

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