# General Usage

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

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

**Page:** 947

---

## [Member order alignment packing in structs](https://discourse.julialang.org/t/member-order-alignment-packing-in-structs/14232)

<div class="topic-metadata">

**Author:** [@nordlow](https://discourse.julialang.org/u/nordlow)\
**Replies:** 2\
**Last updated:** [August 29, 2018, 12:15pm UTC](https://discourse.julialang.org/t/member-order-alignment-packing-in-structs/14232 "2018-08-29T12:15:25Z")

</div>

Do I have to care about in which order to put data members of a struct in order to get optimal memory alignment packing or does Julia optimize the order automatically? AFAICT it doesn’t because struct BIB z::UInt8 …

---

## [Best practice to deal with \`missing\` in packages](https://discourse.julialang.org/t/best-practice-to-deal-with-missing-in-packages/14236)

<div class="topic-metadata">

**Author:** [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Replies:** 1\
**Last updated:** [August 29, 2018, 11:18am UTC](https://discourse.julialang.org/t/best-practice-to-deal-with-missing-in-packages/14236 "2018-08-29T11:18:07Z")

</div>

A major part of the 0.7 transition is that now any (most) packages can have users passing in Arrays with missing in it, and we need to be able to deal with that somehow. Some functions in packages are calls to dependenc…

---

## [Warnings switch to oneunit](https://discourse.julialang.org/t/warnings-switch-to-oneunit/14230)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 3\
**Last updated:** [August 29, 2018, 11:12am UTC](https://discourse.julialang.org/t/warnings-switch-to-oneunit/14230 "2018-08-29T11:12:06Z")

</div>

I am continuously getting these warnings in my code: LB = Array{candidateKeypoint,1}(0) H̄ = Array{Any}(3,3) for extremum in LA′ α1Star = 0.0 α2Star = 0.0 α3Star = 0.0 σ = 0.0 x = 0.0 y = 0.0 …

---

## [Select multiple fields from a NamedTuple and create new NamedTuple](https://discourse.julialang.org/t/select-multiple-fields-from-a-namedtuple-and-create-new-namedtuple/14231)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 7\
**Last updated:** [August 29, 2018, 10:39am UTC](https://discourse.julialang.org/t/select-multiple-fields-from-a-namedtuple-and-create-new-namedtuple/14231 "2018-08-29T10:39:44Z")

</div>

Hello, I wonder how I can take several fields of an NamedTuple and generate a new NamedTuple from them. I mean, the generator way is clear A = (a = 1, b = 2, c = 3) args = (:a, :b) B = NamedTuple{args}(getfield(A, i) f…

---

## [Polymorphic Type Instance Memory Overhead](https://discourse.julialang.org/t/polymorphic-type-instance-memory-overhead/14211)

<div class="topic-metadata">

**Author:** [@nordlow](https://discourse.julialang.org/u/nordlow)\
**Replies:** 4\
**Last updated:** [August 29, 2018, 9:39am UTC](https://discourse.julialang.org/t/polymorphic-type-instance-memory-overhead/14211 "2018-08-29T09:39:56Z")

</div>

How do I measure the memory overhead of an instance of a polymorphic type in Julia? I am particularly interested in union types sub-types of Any Further, does Julia have some memory-usage optimization tricks for the…

---

## [Workflow for deploying Pkg3 package on a computing cluster](https://discourse.julialang.org/t/workflow-for-deploying-pkg3-package-on-a-computing-cluster/14196)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 1\
**Last updated:** [August 29, 2018, 9:18am UTC](https://discourse.julialang.org/t/workflow-for-deploying-pkg3-package-on-a-computing-cluster/14196 "2018-08-29T09:18:15Z")

</div>

Let’s say I want to develop a private package PrivPack, transfer it to a computing cluster, then run a bunch of scripts which use this package. I would like to clarify the steps in this scheme. When I \] generate PrivPac…

---

## [More pressure on garbage collector](https://discourse.julialang.org/t/more-pressure-on-garbage-collector/6493)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 10\
**Last updated:** [August 29, 2018, 8:42am UTC](https://discourse.julialang.org/t/more-pressure-on-garbage-collector/6493 "2018-08-29T08:42:27Z")

</div>

Hello, is it possible to manually increase pressure on Garbage Collector? I have several workers whose job is to download large files from S3, load them, and preprocess such that the master worker does not need to deal …

---

## [Dispatch question with TrackedArray in Flux](https://discourse.julialang.org/t/dispatch-question-with-trackedarray-in-flux/14229)

<div class="topic-metadata">

**Author:** [@Tomas\_Pevny](https://discourse.julialang.org/u/Tomas_Pevny)\
**Replies:** 0\
**Last updated:** [August 29, 2018, 8:16am UTC](https://discourse.julialang.org/t/dispatch-question-with-trackedarray-in-flux/14229 "2018-08-29T08:16:54Z")

</div>

Hi, I have a following problem. I need to define a function, say f(a, b), where a and b are matrices. For this function, I want to define a gradient for Flux, therefore if one of those arguments are of type TrackedArray,…

---

## [Straw poll for emacs / org-mode workflow](https://discourse.julialang.org/t/straw-poll-for-emacs-org-mode-workflow/10369)

<div class="topic-metadata">

**Author:** [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Replies:** 24\
**Last updated:** [August 29, 2018, 8:10am UTC](https://discourse.julialang.org/t/straw-poll-for-emacs-org-mode-workflow/10369 "2018-08-29T08:10:42Z")

</div>

Over the past few months I’ve been getting deeper into emacs, mostly by using org-mode for all my todo list management, keeping track of papers I am reading, and general note taking. It’s been pretty great. Currently I …

---

## [How am I supposed to create and distribute packages in Julia 0.7/1.0 ?](https://discourse.julialang.org/t/how-am-i-supposed-to-create-and-distribute-packages-in-julia-0-7-1-0/14135)

<div class="topic-metadata">

**Author:** [@Erik\_Engheim](https://discourse.julialang.org/u/Erik_Engheim)\
**Replies:** 3\
**Last updated:** [August 29, 2018, 8:09am UTC](https://discourse.julialang.org/t/how-am-i-supposed-to-create-and-distribute-packages-in-julia-0-7-1-0/14135 "2018-08-29T08:09:11Z")

</div>

I am quite confused about the package situation in Julia at the moment. I’ve worked with the previous package manager and followed to guides for how to make a package and distribute it. Like how you register it, make sur…

---

## [Unexpected "="](https://discourse.julialang.org/t/unexpected/14225)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 8\
**Last updated:** [August 29, 2018, 6:27am UTC](https://discourse.julialang.org/t/unexpected/14225 "2018-08-29T06:27:52Z")

</div>

This segment of Julia code filters keypoints in an image by an interpolation of the fields in the extremum from a difference of gaussian scale space. mutable struct discrete\_extremum o s m n intensit…

---

## [Error in Distributions.quantile when broadcasting in Julia 1.0](https://discourse.julialang.org/t/error-in-distributions-quantile-when-broadcasting-in-julia-1-0/14182)

<div class="topic-metadata">

**Author:** [@cherichy](https://discourse.julialang.org/u/cherichy)\
**Replies:** 2\
**Last updated:** [August 29, 2018, 12:47am UTC](https://discourse.julialang.org/t/error-in-distributions-quantile-when-broadcasting-in-julia-1-0/14182 "2018-08-29T00:47:19Z")

</div>

I found this broadcast error when using Distributions.quantile. And I found that it was called on the type of Noraml, which is the first parameter. So I check the help ?quantile, and found that there are three usages of …

---

## [Lovely PlotThemes](https://discourse.julialang.org/t/lovely-plotthemes/14217)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 1\
**Last updated:** [August 28, 2018, 10:20pm UTC](https://discourse.julialang.org/t/lovely-plotthemes/14217 "2018-08-28T22:20:47Z")

</div>

Plots is just terrific work with GR, PyPlot backends. PlotlyJS looks really nice, but is lagging in 0.7/1.0 updates for the moment. PlotThemes makes a bunch of visuals incredibly easy to implement. I have one question…

---

## [Yield(), tasks and interrupting OpenGL code](https://discourse.julialang.org/t/yield-tasks-and-interrupting-opengl-code/14085)

<div class="topic-metadata">

**Author:** [@davidm](https://discourse.julialang.org/u/davidm)\
**Replies:** 6\
**Last updated:** [August 28, 2018, 9:45pm UTC](https://discourse.julialang.org/t/yield-tasks-and-interrupting-opengl-code/14085 "2018-08-28T21:45:17Z")

</div>

I’ve been trying to work with OpenGL (ModernGL.jl) within the REPL but using a scheduled task to keep rendering continuously to allow interactivity with schedule(Task(renderLoop)). I experienced some crashes (difficult …

---

## [\`k\` smallest eigenvalues of symmetric positive definite matrix](https://discourse.julialang.org/t/k-smallest-eigenvalues-of-symmetric-positive-definite-matrix/14209)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 4\
**Last updated:** [August 28, 2018, 9:18pm UTC](https://discourse.julialang.org/t/k-smallest-eigenvalues-of-symmetric-positive-definite-matrix/14209 "2018-08-28T21:18:12Z")

</div>

I need to compute the k smallest eigenvalues of a symmetric positive definite real matrix, and their corresponding eigenvectors. Can I use a Julia package for this, or is there something under LinearAlgebra that helps? L…

---

## [How to do chunk matrix/vector multiplication with @threads](https://discourse.julialang.org/t/how-to-do-chunk-matrix-vector-multiplication-with-threads/14173)

<div class="topic-metadata">

**Author:** [@biona001](https://discourse.julialang.org/u/biona001)\
**Replies:** 1\
**Last updated:** [August 28, 2018, 8:56pm UTC](https://discourse.julialang.org/t/how-to-do-chunk-matrix-vector-multiplication-with-threads/14173 "2018-08-28T20:56:46Z")

</div>

I implemented c = Ab using multithreading naively by computing row-wise dot products. I did so on BitArrays because it is the closest thing to the actual data structure in my problem. However, when I tried to switch the…

---

## [Unnecessary materialize in broadcast?](https://discourse.julialang.org/t/unnecessary-materialize-in-broadcast/14141)

<div class="topic-metadata">

**Author:** [@mfalt](https://discourse.julialang.org/u/mfalt)\
**Replies:** 9\
**Last updated:** [August 28, 2018, 8:16pm UTC](https://discourse.julialang.org/t/unnecessary-materialize-in-broadcast/14141 "2018-08-28T20:16:55Z")

</div>

I am wondering if julia will ever automatically fuse broadcast calls. Take the following example: Example: f1(x,y,z) = x .= (x .- y)/z f2(x,y,z) = x .= (x .- y)/.z x = randn(1000); y = randn(1000); z = 2.0 julia\> @cod…

---

## [\`maximum!\` allocates](https://discourse.julialang.org/t/maximum-allocates/14191)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 4\
**Last updated:** [August 28, 2018, 4:13pm UTC](https://discourse.julialang.org/t/maximum-allocates/14191 "2018-08-28T16:13:50Z")

</div>

I get allocations, but I don’t understand why since it is writing the results in a preallocated array. X = rand(10,3,4); x= rand(1,3,4); @btime maximum!($x,$X) # 452.492 ns (6 allocations: 240 bytes)

---

## [Binning Large Collections of Timestamps](https://discourse.julialang.org/t/binning-large-collections-of-timestamps/13581)

<div class="topic-metadata">

**Author:** [@RobertR](https://discourse.julialang.org/u/RobertR)\
**Replies:** 6\
**Last updated:** [August 28, 2018, 3:19pm UTC](https://discourse.julialang.org/t/binning-large-collections-of-timestamps/13581 "2018-08-28T15:19:42Z")

</div>

Hey, I have a large amount of timestamps (in the form of an array of Float64 seconds), and I need to bin them (into ‘counts’, so something like \[1, 10, 40, 122\] binned to 60 seconds would give counts of \[3, 0, 1\] with t…

---

## [How to export multiple dataframe to multiple excel worksheets (in a loop)?](https://discourse.julialang.org/t/how-to-export-multiple-dataframe-to-multiple-excel-worksheets-in-a-loop/12126)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 9\
**Last updated:** [August 28, 2018, 2:03pm UTC](https://discourse.julialang.org/t/how-to-export-multiple-dataframe-to-multiple-excel-worksheets-in-a-loop/12126 "2018-08-28T14:03:54Z")

</div>

I’m trying to export the results of my optimization problem to excel. I have tested the function below that works very well but I have to pass all the data frames once a time. XLSX.writetable("report.xlsx", REPORT\_A=( D…

---

## [Void not defined (version problem?)](https://discourse.julialang.org/t/void-not-defined-version-problem/14183)

<div class="topic-metadata">

**Author:** [@Jeroen\_Mebis](https://discourse.julialang.org/u/Jeroen_Mebis)\
**Replies:** 2\
**Last updated:** [August 28, 2018, 12:30pm UTC](https://discourse.julialang.org/t/void-not-defined-version-problem/14183 "2018-08-28T12:30:17Z")

</div>

Hi A friend has written some code in a previous Julia version. I want to run it in version 1.0 but I’m getting some errors like this one: if jbdy\["installationDate"\] isa Void date\_instal = NaN end but I get this…

---

## [Weird scoping issue](https://discourse.julialang.org/t/weird-scoping-issue/14162)

<div class="topic-metadata">

**Author:** [@Nosferican](https://discourse.julialang.org/u/Nosferican)\
**Replies:** 5\
**Last updated:** [August 28, 2018, 12:09pm UTC](https://discourse.julialang.org/t/weird-scoping-issue/14162 "2018-08-28T12:09:52Z")

</div>

using Julia v"1.0.0", julia\> count = 0 0 or julia\> count count (generic function with 6 methods) julia\> count = 0 ERROR: cannot assign variable Base.count from module Main Why is it that the function is not exported…

---

## [Cleanup of ~/.julia?](https://discourse.julialang.org/t/cleanup-of-julia/14176)

<div class="topic-metadata">

**Author:** [@johann.spies](https://discourse.julialang.org/u/johann.spies)\
**Replies:** 5\
**Last updated:** [August 28, 2018, 9:56am UTC](https://discourse.julialang.org/t/cleanup-of-julia/14176 "2018-08-28T09:56:10Z")

</div>

On my computer ~/.julia takes up a lot of space and I think that might not be necessary: --- /home/js/.julia --------------------------------------------------------------------------------------------------------------…

---

## [Function occursin() needs a method that accepts Union{String, Missing}](https://discourse.julialang.org/t/function-occursin-needs-a-method-that-accepts-union-string-missing/14095)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 12\
**Last updated:** [August 28, 2018, 10:56am UTC](https://discourse.julialang.org/t/function-occursin-needs-a-method-that-accepts-union-string-missing/14095 "2018-08-28T10:56:20Z")

</div>

I have a dataframe in which I need to filter on political party. But, because the data sometimes comes from noisy sources, garbage characters may be appended to a typical party name. So :Party .== “Democrat” (or any o…

---

## [How can I know the uuid of a registered package?](https://discourse.julialang.org/t/how-can-i-know-the-uuid-of-a-registered-package/14081)

<div class="topic-metadata">

**Author:** [@Diego\_Javier\_Zea](https://discourse.julialang.org/u/Diego_Javier_Zea)\
**Replies:** 7\
**Last updated:** [August 28, 2018, 5:03am UTC](https://discourse.julialang.org/t/how-can-i-know-the-uuid-of-a-registered-package/14081 "2018-08-28T05:03:51Z")

</div>

I wanted to know the uuid for of a registered package for using Requires.jl in Julia 0.7. I found the uuid looking into the Package.toml file of the package in GitHub - JuliaRegistries/General: The official registry of …

---

## [Any sorting function in Julia that is as fast as Matlab's maxk?](https://discourse.julialang.org/t/any-sorting-function-in-julia-that-is-as-fast-as-matlabs-maxk/14105)

<div class="topic-metadata">

**Author:** [@complexfilter](https://discourse.julialang.org/u/complexfilter)\
**Replies:** 7\
**Last updated:** [August 28, 2018, 4:35am UTC](https://discourse.julialang.org/t/any-sorting-function-in-julia-that-is-as-fast-as-matlabs-maxk/14105 "2018-08-28T04:35:06Z")

</div>

I found that maxk in Matlab is way faster(4.7 times in Matlab 2018a) than the maxk in Julia. QQ=randn(1000,1); tic; for i=1:10000 \[~,ind\]=maxk(QQ,10); end toc; and tic(); for i=1:10000 ind1=partialsortperm(Q, 1:10, re…

---

## [What is Julia's im2col?](https://discourse.julialang.org/t/what-is-julias-im2col/14066)

<div class="topic-metadata">

**Author:** [@complexfilter](https://discourse.julialang.org/u/complexfilter)\
**Replies:** 9\
**Last updated:** [August 28, 2018, 3:38am UTC](https://discourse.julialang.org/t/what-is-julias-im2col/14066 "2018-08-28T03:38:16Z")

</div>

I wish to fastly convert the image blocks to columns. Such a function is called im2col in Matlab. I was wondering if there is any off-the-shelf function in Julia that does the some job.

---

## [Right way to transform keyword arguments](https://discourse.julialang.org/t/right-way-to-transform-keyword-arguments/14057)

<div class="topic-metadata">

**Author:** [@denizyuret](https://discourse.julialang.org/u/denizyuret)\
**Replies:** 4\
**Last updated:** [August 27, 2018, 8:46pm UTC](https://discourse.julialang.org/t/right-way-to-transform-keyword-arguments/14057 "2018-08-27T20:46:25Z")

</div>

If f(xf...;of...) is going to call g(xg...; og...) after applying some transformations xf-\>xg and of-\>og, what is the most efficient way to do this? of happens to be a pairs iterator of NamedTuples, so direct map on it …

---

## [Combine using M: a, b; import M](https://discourse.julialang.org/t/combine-using-m-a-b-import-m/14030)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 5\
**Last updated:** [August 27, 2018, 8:26pm UTC](https://discourse.julialang.org/t/combine-using-m-a-b-import-m/14030 "2018-08-27T20:26:57Z")

</div>

Now that using M: a, b does not import M per se, I found that I have to add an import explicitly when I am being very tidy with namespaces in packages (just using what I use frequently, qualify the rest). Is it possib…

---

## [Best way of building a heavily nested Dict](https://discourse.julialang.org/t/best-way-of-building-a-heavily-nested-dict/14139)

<div class="topic-metadata">

**Author:** [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Replies:** 4\
**Last updated:** [August 27, 2018, 7:49pm UTC](https://discourse.julialang.org/t/best-way-of-building-a-heavily-nested-dict/14139 "2018-08-27T19:49:00Z")

</div>

I want to create a nested Dict from a list of data. I think it’s clear from this non-working example what I want to do: # make dummy data n = 1000 r = \[rand(string.('A':'Z'), n, 5) rand(n,1)\] # build a nested Dict nest…

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

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