# General Usage

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

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

**Page:** 842

---

## [How to speed up a generic function evaluating multiple array calculations](https://discourse.julialang.org/t/how-to-speed-up-a-generic-function-evaluating-multiple-array-calculations/27419)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 3\
**Last updated:** [August 13, 2019, 10:48am UTC](https://discourse.julialang.org/t/how-to-speed-up-a-generic-function-evaluating-multiple-array-calculations/27419 "2019-08-13T10:48:09Z")

</div>

This is maybe more of a software design question than performance, or perhaps more adequate to Domains-Optimization category. I also don’t know if any available packages like JuMP or Flux could solve this for me already …

---

## [Moving Base.skipmissing to Base.Iterators](https://discourse.julialang.org/t/moving-base-skipmissing-to-base-iterators/27493)

<div class="topic-metadata">

**Author:** [@pnalysz](https://discourse.julialang.org/u/pnalysz)\
**Replies:** 0\
**Last updated:** [August 13, 2019, 9:43am UTC](https://discourse.julialang.org/t/moving-base-skipmissing-to-base-iterators/27493 "2019-08-13T09:43:57Z")

</div>

As the title says… Is there any reason not do it?

---

## [How (or whether) to force correct handling of different return types?](https://discourse.julialang.org/t/how-or-whether-to-force-correct-handling-of-different-return-types/27482)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 2\
**Last updated:** [August 13, 2019, 6:26am UTC](https://discourse.julialang.org/t/how-or-whether-to-force-correct-handling-of-different-return-types/27482 "2019-08-13T06:26:16Z")

</div>

I have a stylistic question. From statically compiled languages I am used to having to define what a function’s return values can be. In Julia, I don’t have to. Let’s take circle line intersection as an example. The resu…

---

## [Select SubdataFrame in groupDataFrame by symbol](https://discourse.julialang.org/t/select-subdataframe-in-groupdataframe-by-symbol/27463)

<div class="topic-metadata">

**Author:** [@ErwanPiR](https://discourse.julialang.org/u/ErwanPiR)\
**Replies:** 0\
**Last updated:** [August 12, 2019, 3:43pm UTC](https://discourse.julialang.org/t/select-subdataframe-in-groupdataframe-by-symbol/27463 "2019-08-12T15:43:47Z")

</div>

Hi, I haven’t found the way to select a specific SubDataFrame in a Grouped DataFrame. Let’s say you have the following dataframe df = DataFrame(A = rand(5), B = \["type1", "type2", "type1", "Type3", "type2"\]) that you…

---

## [Deepcopying struct with array fields](https://discourse.julialang.org/t/deepcopying-struct-with-array-fields/27430)

<div class="topic-metadata">

**Author:** [@DocDave](https://discourse.julialang.org/u/DocDave)\
**Replies:** 14\
**Last updated:** [August 12, 2019, 3:16pm UTC](https://discourse.julialang.org/t/deepcopying-struct-with-array-fields/27430 "2019-08-12T15:16:53Z")

</div>

I have a struct containing fields, some of which are multidimensional Arrays, however I want to be able to copy (both deep and shallow) between instances of this type. Comments on an answer from SO indicate that this can…

---

## [How to make a groupedbar plot with several stacked bars](https://discourse.julialang.org/t/how-to-make-a-groupedbar-plot-with-several-stacked-bars/27306)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 4\
**Last updated:** [August 12, 2019, 3:10pm UTC](https://discourse.julialang.org/t/how-to-make-a-groupedbar-plot-with-several-stacked-bars/27306 "2019-08-12T15:10:35Z")

</div>

It’s really hard to explain in words what I would like to do, so here is a picture: The black lines represent “levels” - each level has a stacked bar in it. I know how this was done in Matlab, I just need help transl…

---

## [3,000+ files and 1.4GB build directory with PackageCompiler. What am I doing wrong?](https://discourse.julialang.org/t/3-000-files-and-1-4gb-build-directory-with-packagecompiler-what-am-i-doing-wrong/27414)

<div class="topic-metadata">

**Author:** [@Lachlan\_Smith](https://discourse.julialang.org/u/Lachlan_Smith)\
**Replies:** 5\
**Last updated:** [August 12, 2019, 2:02pm UTC](https://discourse.julialang.org/t/3-000-files-and-1-4gb-build-directory-with-packagecompiler-what-am-i-doing-wrong/27414 "2019-08-12T14:02:54Z")

</div>

\[basically copy/pasted from my post on reddit which can be found here\] A few screenshots to illustrate what I’m dealing with: Imgur: The magic of the Internet As the title says, I’m a bit lost here. I took the example…

---

## [Correct usage of build\_sysimg](https://discourse.julialang.org/t/correct-usage-of-build-sysimg/27457)

<div class="topic-metadata">

**Author:** [@fverdugo](https://discourse.julialang.org/u/fverdugo)\
**Replies:** 2\
**Last updated:** [August 12, 2019, 1:34pm UTC](https://discourse.julialang.org/t/correct-usage-of-build-sysimg/27457 "2019-08-12T13:34:59Z")

</div>

I am unable to build a system image using the build\_sysimg command. I get different types of errors. Assume that I want to build a system with the following user definitions: # file userimg.jl function bar() println(…

---

## [Need to include one file multiple times, how to avoid warning](https://discourse.julialang.org/t/need-to-include-one-file-multiple-times-how-to-avoid-warning/27439)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 14\
**Last updated:** [August 12, 2019, 1:08pm UTC](https://discourse.julialang.org/t/need-to-include-one-file-multiple-times-how-to-avoid-warning/27439 "2019-08-12T13:08:32Z")

</div>

I get some warnings when I include one public file in several other files in a same package. It is straightforward to include the public file which defines some common functions. The code is as follows. # ./src/test\_red…

---

## [Thread- and process-id in log messages?](https://discourse.julialang.org/t/thread-and-process-id-in-log-messages/27303)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 3\
**Last updated:** [August 12, 2019, 12:13pm UTC](https://discourse.julialang.org/t/thread-and-process-id-in-log-messages/27303 "2019-08-12T12:13:04Z")

</div>

It would be very useful to have a mechanism that automatically adds thread- and process-id to log messages. Can this currently be implemented using a custom logger, or would this require changes to Julia’s logging system…

---

## [Ho can I append a value into initialised array without first empty row?](https://discourse.julialang.org/t/ho-can-i-append-a-value-into-initialised-array-without-first-empty-row/27443)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 2\
**Last updated:** [August 12, 2019, 10:39am UTC](https://discourse.julialang.org/t/ho-can-i-append-a-value-into-initialised-array-without-first-empty-row/27443 "2019-08-12T10:39:35Z")

</div>

Hi, I am trying to append some values into an initialized array. But first elements of this array is not the first appended value. I did like follows: #initialized an array a = Array{Float64,1} #append into a a = \[a;5;…

---

## [Unpacking CartesianIndex](https://discourse.julialang.org/t/unpacking-cartesianindex/27374)

<div class="topic-metadata">

**Author:** [@Charlie\_He](https://discourse.julialang.org/u/Charlie_He)\
**Replies:** 7\
**Last updated:** [August 12, 2019, 9:43am UTC](https://discourse.julialang.org/t/unpacking-cartesianindex/27374 "2019-08-12T09:43:30Z")

</div>

for (i, j) in CartesianIndices(a) println(i, j) end produces an error: ERROR: iteration is deliberately unsupported for CartesianIndex. Use \`I\` rather than \`I...\`, or use \`Tuple(I)...\` This is an unreasonable desi…

---

## [Invalid quoted expression when assigning tuple to multiple variables](https://discourse.julialang.org/t/invalid-quoted-expression-when-assigning-tuple-to-multiple-variables/27404)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 2\
**Last updated:** [August 12, 2019, 7:06am UTC](https://discourse.julialang.org/t/invalid-quoted-expression-when-assigning-tuple-to-multiple-variables/27404 "2019-08-12T07:06:11Z")

</div>

This is valid code: julia\> x,y = 1,2 (1, 2) julia\> x 1 julia\> y 2 But, the quoted expression isn’t correct and cannot be evaluated… julia\> :(x,y = 1,2) |\> dump Expr head: Symbol tuple args: Array{Any}((3,)) …

---

## [Accessing windows credentials (or chrome credentials)](https://discourse.julialang.org/t/accessing-windows-credentials-or-chrome-credentials/27381)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 3\
**Last updated:** [August 12, 2019, 5:23am UTC](https://discourse.julialang.org/t/accessing-windows-credentials-or-chrome-credentials/27381 "2019-08-12T05:23:30Z")

</div>

Is there an easy way to “access a stored password” in a Julia script/package? Say I have five people using the same package/script which uses individual credentials for a website (say AWS). How can I make this work smoo…

---

## [Using Julia to Build an Email Client](https://discourse.julialang.org/t/using-julia-to-build-an-email-client/27146)

<div class="topic-metadata">

**Author:** [@NomNomChompsky](https://discourse.julialang.org/u/NomNomChompsky)\
**Replies:** 8\
**Last updated:** [August 12, 2019, 4:49am UTC](https://discourse.julialang.org/t/using-julia-to-build-an-email-client/27146 "2019-08-12T04:49:07Z")

</div>

I’ve finished translating a few old projects from uni into Julia, among a few other languages, and am wanting to try my hand at something a little more ambitious in my learning endeavors. Would Julia be well-suited for …

---

## [Get error string contents](https://discourse.julialang.org/t/get-error-string-contents/27432)

<div class="topic-metadata">

**Author:** [@milesf](https://discourse.julialang.org/u/milesf)\
**Replies:** 2\
**Last updated:** [August 12, 2019, 12:42am UTC](https://discourse.julialang.org/t/get-error-string-contents/27432 "2019-08-12T00:42:34Z")

</div>

How do you access to the error string payload in addition to the error type? For example: d = Dict() e = try a = parse(Float64, d\["a"\]) catch error error end For convenience in REPL, e is set to the error, which i…

---

## [Access the element at a specific position of a matrix in Julia](https://discourse.julialang.org/t/access-the-element-at-a-specific-position-of-a-matrix-in-julia/27394)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 4\
**Last updated:** [August 11, 2019, 4:20pm UTC](https://discourse.julialang.org/t/access-the-element-at-a-specific-position-of-a-matrix-in-julia/27394 "2019-08-11T16:20:01Z")

</div>

Hi, I know how to access the element at a specific position of a matrix. For example, m = \[1 2 3; 4 5 6\] # m is a 2 by 3 matrix m\[1,2\] # m\[1,2\] would return the element at position (1,2), which is numbe…

---

## [Function wrapper for custom functions](https://discourse.julialang.org/t/function-wrapper-for-custom-functions/27409)

<div class="topic-metadata">

**Author:** [@mrVeng](https://discourse.julialang.org/u/mrVeng)\
**Replies:** 5\
**Last updated:** [August 11, 2019, 2:19pm UTC](https://discourse.julialang.org/t/function-wrapper-for-custom-functions/27409 "2019-08-11T14:19:10Z")

</div>

Hi everyone, I have 2 functions defined that are used for resampling a vector of reals: using Distributions using BenchmarkTools function resampling\_multinomial(weights::AbstractVector{T}, particlesN::Int) where {T\<:R…

---

## [Wrapper functions guidlines](https://discourse.julialang.org/t/wrapper-functions-guidlines/27387)

<div class="topic-metadata">

**Author:** [@Amin\_Yahyaabadi](https://discourse.julialang.org/u/Amin_Yahyaabadi)\
**Replies:** 7\
**Last updated:** [August 11, 2019, 11:11am UTC](https://discourse.julialang.org/t/wrapper-functions-guidlines/27387 "2019-08-11T11:11:45Z")

</div>

As part of one of my JuliaMatlab packages, MatLang, I want to write wrapper functions that simulate Matlab like APIs. What are some guidelines for writing efficient wrappers? Is using chained if-else efficient defi…

---

## [Gtk ComBox problem](https://discourse.julialang.org/t/gtk-combox-problem/27365)

<div class="topic-metadata">

**Author:** [@Kelvyn88](https://discourse.julialang.org/u/Kelvyn88)\
**Replies:** 3\
**Last updated:** [August 11, 2019, 12:23am UTC](https://discourse.julialang.org/t/gtk-combox-problem/27365 "2019-08-11T00:23:36Z")

</div>

Hi everybody. I´m working with Gtk. I want to push! a GtkComboBox with a signal\_connect function (:changed). The problem is that, when I use “set\_gtk\_property(cb, :active, 0)” as a example, the Julia session closes. If …

---

## [Interpolating symbol in @eval expression](https://discourse.julialang.org/t/interpolating-symbol-in-eval-expression/27396)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 3\
**Last updated:** [August 10, 2019, 4:39pm UTC](https://discourse.julialang.org/t/interpolating-symbol-in-eval-expression/27396 "2019-08-10T16:39:42Z")

</div>

In this example, I’m trying to define functions for accessing data frame columns. However, the interpolation within the getindex call ended up with a type rather than the original symbol… Why is that? What can I do to …

---

## [How to run benchmark CI on every commit?](https://discourse.julialang.org/t/how-to-run-benchmark-ci-on-every-commit/27034)

<div class="topic-metadata">

**Author:** [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Replies:** 13\
**Last updated:** [August 10, 2019, 8:54am UTC](https://discourse.julialang.org/t/how-to-run-benchmark-ci-on-every-commit/27034 "2019-08-10T08:54:28Z")

</div>

I’m working on a package, that I want to benchmark at every commit, because I want to see how the performance evolves over time. A short note on this idea I assume that it’s not the best workflow, would be better to run…

---

## [How to suppress output position information of info macro when I use global\_logger()](https://discourse.julialang.org/t/how-to-suppress-output-position-information-of-info-macro-when-i-use-global-logger/27372)

<div class="topic-metadata">

**Author:** [@AtsushiSakai](https://discourse.julialang.org/u/AtsushiSakai)\
**Replies:** 2\
**Last updated:** [August 10, 2019, 6:45am UTC](https://discourse.julialang.org/t/how-to-suppress-output-position-information-of-info-macro-when-i-use-global-logger/27372 "2019-08-10T06:45:39Z")

</div>

I have a question about Logging module in Julia 1.1. When I use Logging module with default configurations, the warn macro and error macro shows output position information (ex. @ Main REPL\[3\]:1), but the info macro do…

---

## [Segfault with SIMD.jl and BenchmarkTools.jl](https://discourse.julialang.org/t/segfault-with-simd-jl-and-benchmarktools-jl/27352)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 6\
**Last updated:** [August 10, 2019, 1:59am UTC](https://discourse.julialang.org/t/segfault-with-simd-jl-and-benchmarktools-jl/27352 "2019-08-10T01:59:08Z")

</div>

Hi, I try to learn how to use SIMD.jl and the following snippet produces a segmentation fault when I use @btime. using BenchmarkTools using SIMD const SBS=8 function microaxpy\_simd!(ys::Vector{T}, a::T, xs::Vector{T…

---

## [Segfault in C library depending on import order](https://discourse.julialang.org/t/segfault-in-c-library-depending-on-import-order/27362)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 0\
**Last updated:** [August 9, 2019, 9:24pm UTC](https://discourse.julialang.org/t/segfault-in-c-library-depending-on-import-order/27362 "2019-08-09T21:24:39Z")

</div>

Hi! I encountered a very strange issue, when there is sometimes a segfault when calling an external 3rd party library, depending on import order. This works fine (needs PyCall.jl, matplotlib, FINUFFT.jl installed): usi…

---

## [Hand rolled filter faster than filter function for dataframe?](https://discourse.julialang.org/t/hand-rolled-filter-faster-than-filter-function-for-dataframe/27358)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 2\
**Last updated:** [August 9, 2019, 8:22pm UTC](https://discourse.julialang.org/t/hand-rolled-filter-faster-than-filter-function-for-dataframe/27358 "2019-08-09T20:22:43Z")

</div>

From the MWE: 0.019227 seconds (313 allocations: 3.065 MiB) 0.037725 seconds (599.53 k allocations: 15.439 MiB, 8.73% gc time) Faster and much, much fewer allocations. This result is better than what I see in the actu…

---

## [Conditional function definition](https://discourse.julialang.org/t/conditional-function-definition/27348)

<div class="topic-metadata">

**Author:** [@antoine-levitt](https://discourse.julialang.org/u/antoine-levitt)\
**Replies:** 2\
**Last updated:** [August 9, 2019, 7:07pm UTC](https://discourse.julialang.org/t/conditional-function-definition/27348 "2019-08-09T19:07:42Z")

</div>

What is going on here? function g1(a) if a == 0 f(x) = 2 else f(x) = 3 end println(f(1)) end function g2(a) f = x -\> 1 if a == 0 f(x) = 2 else f(x) = 3 en…

---

## [Works in Julia 1.1.0 but not in 1.1.1. Where to download older; 1.1.0 to confirm?](https://discourse.julialang.org/t/works-in-julia-1-1-0-but-not-in-1-1-1-where-to-download-older-1-1-0-to-confirm/27337)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 2\
**Last updated:** [August 9, 2019, 3:34pm UTC](https://discourse.julialang.org/t/works-in-julia-1-1-0-but-not-in-1-1-1-where-to-download-older-1-1-0-to-confirm/27337 "2019-08-09T15:34:45Z")

</div>

We’re looking into an issue, he says 1.1.0(rc2) worked. And 1.1.1 has failed for me (locally too): https://github.com/JuliaCN/Py2Jl.jl/issues/5#issuecomment-519653780 Does anyone have 1.1.0 non-rc to check for us, or k…

---

## [Extending builtin functions like ifelse()](https://discourse.julialang.org/t/extending-builtin-functions-like-ifelse/27319)

<div class="topic-metadata">

**Author:** [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Replies:** 4\
**Last updated:** [August 9, 2019, 10:40am UTC](https://discourse.julialang.org/t/extending-builtin-functions-like-ifelse/27319 "2019-08-09T10:40:27Z")

</div>

Apparently, it’s currently impossible to extend builtin functions. Is there an effort to change this? Or is there a way around the restriction already? The issue came up in a feature request for NumberIntervals.jl.

---

## [Simple tutorial for PackageCompiler sysimage build?](https://discourse.julialang.org/t/simple-tutorial-for-packagecompiler-sysimage-build/27349)

<div class="topic-metadata">

**Author:** [@LaurentPlagne](https://discourse.julialang.org/u/LaurentPlagne)\
**Replies:** 0\
**Last updated:** [August 9, 2019, 10:25am UTC](https://discourse.julialang.org/t/simple-tutorial-for-packagecompiler-sysimage-build/27349 "2019-08-09T10:25:20Z")

</div>

Hi I cannot make Julia produce AVX2 instructions (ymm registers) on my machine. I use to build the sysimage before PackageCompiler arrival but now it seems that the documentation is a bit broken for this feature. I am…

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

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