# General Usage

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

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

**Page:** 776

---

## [Missing 7z.exe in Julia-1.3.0-rc3](https://discourse.julialang.org/t/missing-7z-exe-in-julia-1-3-0-rc3/29575)

<div class="topic-metadata">

**Author:** [@MikeErd](https://discourse.julialang.org/u/MikeErd)\
**Replies:** 6\
**Last updated:** [March 18, 2020, 12:53pm UTC](https://discourse.julialang.org/t/missing-7z-exe-in-julia-1-3-0-rc3/29575 "2020-03-18T12:53:08Z")

</div>

Compared to previous Julia versions it looks like, that 7z.exe file in %JULIA\_HOME%/bin is missing (right after a fresh installation). This issue has been detected when adding JLD2 package. add JLD2 Updating registry…

---

## [Optimisation design advice - metaprogramming/closures](https://discourse.julialang.org/t/optimisation-design-advice-metaprogramming-closures/35264)

<div class="topic-metadata">

**Author:** [@anon32405968](https://discourse.julialang.org/u/anon32405968)\
**Replies:** 6\
**Last updated:** [March 18, 2020, 11:57am UTC](https://discourse.julialang.org/t/optimisation-design-advice-metaprogramming-closures/35264 "2020-03-18T11:57:38Z")

</div>

Hello. We are trying to optimise parameters for functions that look something like: function cost\_func(time::Vector{Float64}, params::Vector{Float64}) cₐ, a, cᵦ, β = params return (some complicated combination o…

---

## [How to install package dependencies for unregistered package](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 20\
**Last updated:** [March 18, 2020, 11:01am UTC](https://discourse.julialang.org/t/how-to-install-package-dependencies-for-unregistered-package/36088 "2020-03-18T11:01:27Z")

</div>

I have created a few packages for numerical simulations, which are not (yet) registered anywhere. My current development workflow is to just clone the repository manually and to use a script to start the simulations (whi…

---

## [Creating one column from multiple DataFrames](https://discourse.julialang.org/t/creating-one-column-from-multiple-dataframes/36107)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 3\
**Last updated:** [March 18, 2020, 10:38am UTC](https://discourse.julialang.org/t/creating-one-column-from-multiple-dataframes/36107 "2020-03-18T10:38:17Z")

</div>

I have a data similar to the following in which one column is partly defined in one DataFrame and partly in a second using DataFrames, DataFramesMeta # Data situation: df1 = DataFrame(id1 = \[1, 2, 3, 4\], id2 = \[missing,…

---

## [Developed package "shadows" dependency package](https://discourse.julialang.org/t/developed-package-shadows-dependency-package/36017)

<div class="topic-metadata">

**Author:** [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Replies:** 8\
**Last updated:** [March 18, 2020, 7:34am UTC](https://discourse.julialang.org/t/developed-package-shadows-dependency-package/36017 "2020-03-18T07:34:03Z")

</div>

I’m not sure how to formulate this question/issue, I try to be as straightforward as possible. So I have two packages developed by myself (both are public, hosted on github). I started developing PackageA and at some po…

---

## [Writedlm - adding a blank line every n lines](https://discourse.julialang.org/t/writedlm-adding-a-blank-line-every-n-lines/36111)

<div class="topic-metadata">

**Author:** [@razvangheorghe](https://discourse.julialang.org/u/razvangheorghe)\
**Replies:** 3\
**Last updated:** [March 18, 2020, 7:21am UTC](https://discourse.julialang.org/t/writedlm-adding-a-blank-line-every-n-lines/36111 "2020-03-18T07:21:45Z")

</div>

Hi, I have three columns of numbers. x and y are coordinates and z is the value at x and y. I’m currently saving them to files like this: open(path, "w") do io writedlm(io, \[x y z\]) end I’m trying to splot as a pm…

---

## [Ccall fails on \*\*arrays of ComplexF64 (simple MWE)](https://discourse.julialang.org/t/ccall-fails-on-arrays-of-complexf64-simple-mwe/36127)

<div class="topic-metadata">

**Author:** [@xzackli](https://discourse.julialang.org/u/xzackli)\
**Replies:** 1\
**Last updated:** [March 18, 2020, 3:45am UTC](https://discourse.julialang.org/t/ccall-fails-on-arrays-of-complexf64-simple-mwe/36127 "2020-03-18T03:45:57Z")

</div>

I’m trying to modify 2D arrays using ccall, and this fails when the arrays contain complex double. The same code works when restricted to double. MWE Consider a C function which copies a 2D real array into a complex ar…

---

## [Unexpected dimension mismatch when using read!(io, BitArray)](https://discourse.julialang.org/t/unexpected-dimension-mismatch-when-using-read-io-bitarray/3036)

<div class="topic-metadata">

**Author:** [@sekunder](https://discourse.julialang.org/u/sekunder)\
**Replies:** 4\
**Last updated:** [March 17, 2020, 11:32pm UTC](https://discourse.julialang.org/t/unexpected-dimension-mismatch-when-using-read-io-bitarray/3036 "2020-03-17T23:32:10Z")

</div>

I am running into a strange DimensionMismatch error when using read! to fill a BitArray. The offending lines look like this: frames = BitArray(N\_bits\_per\_frame, N\_frames) read!(joinpath(root\_dir, bin\_file), frames) The…

---

## [On the garbage collection](https://discourse.julialang.org/t/on-the-garbage-collection/35695)

<div class="topic-metadata">

**Author:** [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Replies:** 35\
**Last updated:** [March 17, 2020, 8:43pm UTC](https://discourse.julialang.org/t/on-the-garbage-collection/35695 "2020-03-17T20:43:20Z")

</div>

Hi, I still feel some difficulty in understanding garbage collection. My understanding is that Julia has the mark-and-sweep garbage collector, which marks a set of GC-rooted objects and other objects traceable (or reach…

---

## [Segfault on DataFrames \`getindex\`](https://discourse.julialang.org/t/segfault-on-dataframes-getindex/20612)

<div class="topic-metadata">

**Author:** [@Rory-Finnegan](https://discourse.julialang.org/u/Rory-Finnegan)\
**Replies:** 24\
**Last updated:** [February 12, 2019, 9:13am UTC](https://discourse.julialang.org/t/segfault-on-dataframes-getindex/20612 "2019-02-12T09:13:30Z")

</div>

Hi folks, We’re getting a somewhat random segfault on a dataframes getindex operation inside a for-loop. I haven’t been able to extract a MWE from the proprietary code where this is occurring, but here is part of the se…

---

## [Change colors in Julia-Client](https://discourse.julialang.org/t/change-colors-in-julia-client/36103)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 1\
**Last updated:** [March 17, 2020, 3:59pm UTC](https://discourse.julialang.org/t/change-colors-in-julia-client/36103 "2020-03-17T15:59:01Z")

</div>

I do not know whether this is the proper place for this issue. I would like to: change the color of comments in Julia source (within terminal windows/panels in Atom). change the color of the top menu bar to something …

---

## [Why length(str) != sizeof(str)?](https://discourse.julialang.org/t/why-length-str-sizeof-str/36068)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 21\
**Last updated:** [March 17, 2020, 1:37pm UTC](https://discourse.julialang.org/t/why-length-str-sizeof-str/36068 "2020-03-17T13:37:27Z")

</div>

I used to use length() for string, but right now I noticed it’s not correct for big string, around 3000 characters. sizeof() give right result. Why is it? thank you in advance.

---

## [How to start tasks on multiple threads and control terminal output from central thread](https://discourse.julialang.org/t/how-to-start-tasks-on-multiple-threads-and-control-terminal-output-from-central-thread/36087)

<div class="topic-metadata">

**Author:** [@sloede](https://discourse.julialang.org/u/sloede)\
**Replies:** 5\
**Last updated:** [March 17, 2020, 1:29pm UTC](https://discourse.julialang.org/t/how-to-start-tasks-on-multiple-threads-and-control-terminal-output-from-central-thread/36087 "2020-03-17T13:29:40Z")

</div>

While I am not new to distributed computing, I have trouble wrapping my head around how to implement the following behavior in Julia. I have a testing tool that takes a bunch of tests (= directories with testing informa…

---

## [Great paper on performance and hardware](https://discourse.julialang.org/t/great-paper-on-performance-and-hardware/36093)

<div class="topic-metadata">

**Author:** [@jakobnissen](https://discourse.julialang.org/u/jakobnissen)\
**Replies:** 2\
**Last updated:** [March 17, 2020, 10:50am UTC](https://discourse.julialang.org/t/great-paper-on-performance-and-hardware/36093 "2020-03-17T10:50:41Z")

</div>

About 6 months back, a user on Slack posted a great paper on coding optimization. It was very long and went into detail on all relevant aspects of how RAM and CPUs work. Can anyone remember the name of it? Already answe…

---

## [What is the DataFramesMeta way to specify a column by its name in a variable?](https://discourse.julialang.org/t/what-is-the-dataframesmeta-way-to-specify-a-column-by-its-name-in-a-variable/35954)

<div class="topic-metadata">

**Author:** [@shg](https://discourse.julialang.org/u/shg)\
**Replies:** 6\
**Last updated:** [March 17, 2020, 10:20am UTC](https://discourse.julialang.org/t/what-is-the-dataframesmeta-way-to-specify-a-column-by-its-name-in-a-variable/35954 "2020-03-17T10:20:58Z")

</div>

What is the proper way to specify a column by a string variable containing the column name in a DataFramesMeta query? I tried Symbol(var) but got an error. julia\> df = DataFrame(num = 1:3) 3×1 DataFrame │ Row │ num │ …

---

## [Efficient way of comparing two matrices](https://discourse.julialang.org/t/efficient-way-of-comparing-two-matrices/36044)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 4\
**Last updated:** [March 17, 2020, 9:35am UTC](https://discourse.julialang.org/t/efficient-way-of-comparing-two-matrices/36044 "2020-03-17T09:35:45Z")

</div>

Hello, this question might seem very naive. But what is the best way of doing a logical comparison of two matrices. Consider the following MWE: function compare(N) for n=1:N X=rand(\[0,1\],4,4) Y=rand(…

---

## [I want to create my own module and just use it like other modules](https://discourse.julialang.org/t/i-want-to-create-my-own-module-and-just-use-it-like-other-modules/36043)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 4\
**Last updated:** [March 17, 2020, 8:59am UTC](https://discourse.julialang.org/t/i-want-to-create-my-own-module-and-just-use-it-like-other-modules/36043 "2020-03-17T08:59:37Z")

</div>

julia\> using MyExample ERROR: ArgumentError: Package MyExample not found in current path: - Run \`import Pkg; Pkg.add("MyExample")\` to install the MyExample package. Stacktrace: \[1\] require(::Module, ::Symbol) a…

---

## [A question about Atom/Julia](https://discourse.julialang.org/t/a-question-about-atom-julia/36080)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 3\
**Last updated:** [March 17, 2020, 8:41am UTC](https://discourse.julialang.org/t/a-question-about-atom-julia/36080 "2020-03-17T08:41:01Z")

</div>

Originally, my julia works .Because of my careless ,I have changed my system path then ,when I run a simple code, it slways shows running but it has no consequence .And there is a warning in the repl. I tried so man…

---

## [Mapreduce slower than sum](https://discourse.julialang.org/t/mapreduce-slower-than-sum/36046)

<div class="topic-metadata">

**Author:** [@CFBaptista](https://discourse.julialang.org/u/CFBaptista)\
**Replies:** 2\
**Last updated:** [March 17, 2020, 8:25am UTC](https://discourse.julialang.org/t/mapreduce-slower-than-sum/36046 "2020-03-17T08:25:05Z")

</div>

I am comparing three approaches for a point-wise multiplication of a vector field and a scalar field, followed by a summation over all elements of the resulting vector field. I would like to know why the mapreduce approa…

---

## [Automatically make all fields of an (immutable) struct concrete type](https://discourse.julialang.org/t/automatically-make-all-fields-of-an-immutable-struct-concrete-type/36081)

<div class="topic-metadata">

**Author:** [@lassepe](https://discourse.julialang.org/u/lassepe)\
**Replies:** 2\
**Last updated:** [March 17, 2020, 8:19am UTC](https://discourse.julialang.org/t/automatically-make-all-fields-of-an-immutable-struct-concrete-type/36081 "2020-03-17T08:19:35Z")

</div>

I often find myself introducing a bunch of type parameters to make working with the declared struct faster. For example, I would write struct Foo{TA, TB} a::TA b::TB end and the only purpose of TA and TB is to make s…

---

## [Call a macro within a macro](https://discourse.julialang.org/t/call-a-macro-within-a-macro/3708)

<div class="topic-metadata">

**Author:** [@matthieu](https://discourse.julialang.org/u/matthieu)\
**Replies:** 8\
**Last updated:** [March 17, 2020, 5:06am UTC](https://discourse.julialang.org/t/call-a-macro-within-a-macro/3708 "2020-03-17T05:06:46Z")

</div>

I am trying to define a macro that calls another macro. To take an example, suppose a package defines a macro @formula as follows: type Formula lhs::Union{Symbol, Expr, Void} rhs::Union{Symbol, Expr, Integer} e…

---

## [Is there a version of @sync that throws error when the task failed?](https://discourse.julialang.org/t/is-there-a-version-of-sync-that-throws-error-when-the-task-failed/36062)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 1\
**Last updated:** [March 17, 2020, 2:10am UTC](https://discourse.julialang.org/t/is-there-a-version-of-sync-that-throws-error-when-the-task-failed/36062 "2020-03-17T02:10:18Z")

</div>

By default, @sync will collect all the exceptions in its block and throw them after everything is done. However, I have a code looking like @sync begin @async for i in 1:1000 # task A end @async f…

---

## [How would I save a dictionary of dataframes that I can import to another file?](https://discourse.julialang.org/t/how-would-i-save-a-dictionary-of-dataframes-that-i-can-import-to-another-file/36042)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 4\
**Last updated:** [March 17, 2020, 2:05am UTC](https://discourse.julialang.org/t/how-would-i-save-a-dictionary-of-dataframes-that-i-can-import-to-another-file/36042 "2020-03-17T02:05:06Z")

</div>

Hi how are you, I have a dictionary where all the values are dataframes. I want to be able to save/export this dictionary of dataframes and import it in another file. Whats the best way to do this?

---

## [Error when using PyPlot and Gtk package](https://discourse.julialang.org/t/error-when-using-pyplot-and-gtk-package/34559)

<div class="topic-metadata">

**Author:** [@henry2004y](https://discourse.julialang.org/u/henry2004y)\
**Replies:** 5\
**Last updated:** [March 17, 2020, 12:14am UTC](https://discourse.julialang.org/t/error-when-using-pyplot-and-gtk-package/34559 "2020-03-17T00:14:15Z")

</div>

Hi, I am getting errors when using PyPlot and Gtk together: julia\> using PyPlot, Gtk ERROR: InitError: could not load library "/Users/hyzhou/.julia/artifacts/c6f53b0adfb48f611ad41b73461d9419117d3503/lib/libfontconfig.1…

---

## [VegaLite add line manually?](https://discourse.julialang.org/t/vegalite-add-line-manually/36033)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 9\
**Last updated:** [March 16, 2020, 10:40pm UTC](https://discourse.julialang.org/t/vegalite-add-line-manually/36033 "2020-03-16T22:40:11Z")

</div>

dfc\_single |\> @filter(\_.gender ∈ \["Male", "Female"\]) |\> @vlplot( :bar, width = 700, y={ "count()", axis={title="Gender fraction"}, stack=:normalize }, x="state", color = …

---

## [Arrays of CTypes Memory Layout](https://discourse.julialang.org/t/arrays-of-ctypes-memory-layout/35945)

<div class="topic-metadata">

**Author:** [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Replies:** 15\
**Last updated:** [March 16, 2020, 10:19pm UTC](https://discourse.julialang.org/t/arrays-of-ctypes-memory-layout/35945 "2020-03-16T22:19:26Z")

</div>

I’ve been using Julia 1.3.1 in a kind of hacky way to integrate it into C#. I have no troubles passing C# arrays of say, float’s to Julia and changing them in place. Which is fantastic, but when I try to return an array …

---

## [What is the current best practice for building a relocatable shared library?](https://discourse.julialang.org/t/what-is-the-current-best-practice-for-building-a-relocatable-shared-library/36063)

<div class="topic-metadata">

**Author:** [@rleegates](https://discourse.julialang.org/u/rleegates)\
**Replies:** 0\
**Last updated:** [March 16, 2020, 9:38pm UTC](https://discourse.julialang.org/t/what-is-the-current-best-practice-for-building-a-relocatable-shared-library/36063 "2020-03-16T21:38:56Z")

</div>

The Q&A concerning building shared libraries appear to be quite old and there has been lots of development work in the related PackageCompiler.jl recently. So what is the current best practice for building a relocatable …

---

## [Notate the original value form (not logged) in loglog plot](https://discourse.julialang.org/t/notate-the-original-value-form-not-logged-in-loglog-plot/36049)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 7\
**Last updated:** [March 16, 2020, 9:37pm UTC](https://discourse.julialang.org/t/notate-the-original-value-form-not-logged-in-loglog-plot/36049 "2020-03-16T21:37:31Z")

</div>

The x value vector x=\[5e-10, 5e-9, 5e-8, 5e-7, 5e-6\]. If plot(,xticks=x) then it’s marked after logged. Can I notate it by 5e\*\* scale correspondingly? Also, is it possible to tick y=collect(0:10:100) by its original form…

---

## [Are there package or function for space-time plot showing clone mass?](https://discourse.julialang.org/t/are-there-package-or-function-for-space-time-plot-showing-clone-mass/36056)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 0\
**Last updated:** [March 16, 2020, 7:16pm UTC](https://discourse.julialang.org/t/are-there-package-or-function-for-space-time-plot-showing-clone-mass/36056 "2020-03-16T19:16:31Z")

</div>

For example. I check violin plot but it seems violin cannot collide with other color regime horizontally(each color series are independent)?

---

## [Coerce type of elements in an empty concatenation](https://discourse.julialang.org/t/coerce-type-of-elements-in-an-empty-concatenation/36045)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 1\
**Last updated:** [March 16, 2020, 4:09pm UTC](https://discourse.julialang.org/t/coerce-type-of-elements-in-an-empty-concatenation/36045 "2020-03-16T16:09:27Z")

</div>

I have an array of vectors of a given type, that I want to concatenate into a single vector of the same type. vcat is normally good for this, but there is a problem if the array of vectors results to be empty: julia\> a …

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

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