# General Usage

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

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

**Page:** 694

---

## [How to filter out Dict based on the value of subdict](https://discourse.julialang.org/t/how-to-filter-out-dict-based-on-the-value-of-subdict/47914)

<div class="topic-metadata">

**Author:** [@sogrbilja](https://discourse.julialang.org/u/sogrbilja)\
**Replies:** 1\
**Last updated:** [October 7, 2020, 7:35am UTC](https://discourse.julialang.org/t/how-to-filter-out-dict-based-on-the-value-of-subdict/47914 "2020-10-07T07:35:16Z")

</div>

I have a Dict: UNITS = Dict(\[ "BUHLER2" =\> Dict(\["cap" =\> 2000, "mincap" =\> 60, "dcap" =\> 49660, "util\_cost1" =\> 2, "maxprodr" =\> 49660\]), "BUHLER1" =\> Dict(\["cap" =\> 1500, "mincap" =\> 60, "dcap" =\> 37245, "u…

---

## [Gadfly label coloring](https://discourse.julialang.org/t/gadfly-label-coloring/37374)

<div class="topic-metadata">

**Author:** [@monty](https://discourse.julialang.org/u/monty)\
**Replies:** 2\
**Last updated:** [October 7, 2020, 4:46am UTC](https://discourse.julialang.org/t/gadfly-label-coloring/37374 "2020-10-07T04:46:21Z")

</div>

How to color the labels with the color of the dots? Gadfly.plot(\[1 2 "a";3 4 "b"; 3 2 "c"\], x=Gadfly.Col.value(1), y=Gadfly.Col.value(2), label=Gadfly.Col.value(3), color=Gadfly.Col.value(3), Gadfly.Geom.point, Gadfly.G…

---

## [Implementation of SNPE](https://discourse.julialang.org/t/implementation-of-snpe/47879)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 4\
**Last updated:** [October 6, 2020, 7:29pm UTC](https://discourse.julialang.org/t/implementation-of-snpe/47879 "2020-10-06T19:29:34Z")

</div>

Hi, Does anyone have a code for SNPE in Julia? see delfi for a python version. Thank you, Best.

---

## [Is Juno debugging in Atom broken for Julia 1.5.2?](https://discourse.julialang.org/t/is-juno-debugging-in-atom-broken-for-julia-1-5-2/47865)

<div class="topic-metadata">

**Author:** [@adrpo](https://discourse.julialang.org/u/adrpo)\
**Replies:** 5\
**Last updated:** [October 6, 2020, 6:57pm UTC](https://discourse.julialang.org/t/is-juno-debugging-in-atom-broken-for-julia-1-5-2/47865 "2020-10-06T18:57:25Z")

</div>

Hi all, I cannot seem to get any debugging to work using latest Atom and Juno client 0.12.6. I always get an: ERROR: UndefVarError: ModuleWhereTheFunction I run Juno.@run on. Seems to be a bug somewhere in logging.jl w…

---

## [Julia assertion failure](https://discourse.julialang.org/t/julia-assertion-failure/46725)

<div class="topic-metadata">

**Author:** [@jacob-roth](https://discourse.julialang.org/u/jacob-roth)\
**Replies:** 3\
**Last updated:** [October 6, 2020, 5:17pm UTC](https://discourse.julialang.org/t/julia-assertion-failure/46725 "2020-10-06T17:17:27Z")

</div>

I just downloaded julia 1.4.2 and tried to run but received the following error message. What did I do wrong?? (base) myuser:~ $ exec '/private/var/folders/10/y7z26t512kbbfrsj12fx3wkr0000gn/T/AppTranslocation/361AA1DE-3…

---

## [Intel oneAPI](https://discourse.julialang.org/t/intel-oneapi/47858)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 3\
**Last updated:** [October 6, 2020, 4:27pm UTC](https://discourse.julialang.org/t/intel-oneapi/47858 "2020-10-06T16:27:48Z")

</div>

We should be aware of this - and I am sure many people are. It has been around for a bit of time now. I am not advocating yet another C-based language… But we should be aware of the newly named oneMKL and the level Ze…

---

## [Putting xaxis ticks and labels on top (not bottom)](https://discourse.julialang.org/t/putting-xaxis-ticks-and-labels-on-top-not-bottom/47854)

<div class="topic-metadata">

**Author:** [@mit.edelman](https://discourse.julialang.org/u/mit.edelman)\
**Replies:** 2\
**Last updated:** [October 6, 2020, 3:01pm UTC](https://discourse.julialang.org/t/putting-xaxis-ticks-and-labels-on-top-not-bottom/47854 "2020-10-06T15:01:49Z")

</div>

In a plot, the xticks and the xlabel go at the bottom. Can I directly put it on top rather than the bottom by somehow using guide\_position somehow? or what does guide\_position do?

---

## [What can I do in case Gram matrix is not positive definite?](https://discourse.julialang.org/t/what-can-i-do-in-case-gram-matrix-is-not-positive-definite/47835)

<div class="topic-metadata">

**Author:** [@Sijun](https://discourse.julialang.org/u/Sijun)\
**Replies:** 4\
**Last updated:** [October 6, 2020, 1:27pm UTC](https://discourse.julialang.org/t/what-can-i-do-in-case-gram-matrix-is-not-positive-definite/47835 "2020-10-06T13:27:49Z")

</div>

Dear Julians, I have constructed a Gram matrix from Gaussian kernel function and tried to get some samples from the Gaussian process with zero mean and the Gram matrix as its covariance. However, MvNormal throws “Not p…

---

## [FAQ: using Plots, plot on a map?](https://discourse.julialang.org/t/faq-using-plots-plot-on-a-map/47853)

<div class="topic-metadata">

**Author:** [@ZhouZhuofei](https://discourse.julialang.org/u/ZhouZhuofei)\
**Replies:** 2\
**Last updated:** [October 6, 2020, 12:57pm UTC](https://discourse.julialang.org/t/faq-using-plots-plot-on-a-map/47853 "2020-10-06T12:57:20Z")

</div>

When I have plotted some pictures in the jupyter notebook with Plots, however, when I want to draw a map, I need to use some other packages like PlotlyJS, emmm. But there will be conflict WARNING: both PlotlyJS and Plot…

---

## [Need help with resolving method ambiguities](https://discourse.julialang.org/t/need-help-with-resolving-method-ambiguities/47779)

<div class="topic-metadata">

**Author:** [@tisztamo](https://discourse.julialang.org/u/tisztamo)\
**Replies:** 8\
**Last updated:** [October 6, 2020, 11:39am UTC](https://discourse.julialang.org/t/need-help-with-resolving-method-ambiguities/47779 "2020-10-06T11:39:51Z")

</div>

Just started to experiment with implementing a proxy type, but I failed very early: module Proxies export AbstractProxy, Proxy abstract type AbstractProxy end struct Proxy{TInner} \<: AbstractProxy inner::TInner …

---

## [These stack traces are out of control](https://discourse.julialang.org/t/these-stack-traces-are-out-of-control/47162)

<div class="topic-metadata">

**Author:** [@Samuel\_Ainsworth](https://discourse.julialang.org/u/Samuel_Ainsworth)\
**Replies:** 14\
**Last updated:** [October 6, 2020, 11:19am UTC](https://discourse.julialang.org/t/these-stack-traces-are-out-of-control/47162 "2020-10-06T11:19:02Z")

</div>

I just got a stack trace that has exceeded the scroll back on the VSCode terminal: \[15\] \_\_solve(::ODEProblem{Array{Float64,1},Tuple{Float64,Float64},true,DiffEqBase.NullParameters,DiffEqBase.ODEFunction{true,DiffEqSens…

---

## [Store abstract types in a container](https://discourse.julialang.org/t/store-abstract-types-in-a-container/47764)

<div class="topic-metadata">

**Author:** [@isentropic](https://discourse.julialang.org/u/isentropic)\
**Replies:** 7\
**Last updated:** [October 6, 2020, 5:00am UTC](https://discourse.julialang.org/t/store-abstract-types-in-a-container/47764 "2020-10-06T05:00:36Z")

</div>

What is the best way to store abstract types in an array let’s say: I have array world geometry. Each world component is essentially an object. Each array element could be A or B type, but both A\<:C, B\<:C. So I need a A…

---

## [Modify global variable in a function](https://discourse.julialang.org/t/modify-global-variable-in-a-function/47831)

<div class="topic-metadata">

**Author:** [@Jea](https://discourse.julialang.org/u/Jea)\
**Replies:** 1\
**Last updated:** [October 6, 2020, 3:52am UTC](https://discourse.julialang.org/t/modify-global-variable-in-a-function/47831 "2020-10-06T03:52:46Z")

</div>

I want to rename a variable in a function for later use with its new value. What I was thinking was this: myVar = "" function renameVar() myVar = "Hello" end renameVar() println(myVar) #What I wanted is for it …

---

## [Pre-Allocate Array Custom Struct with Zeroed Values](https://discourse.julialang.org/t/pre-allocate-array-custom-struct-with-zeroed-values/47823)

<div class="topic-metadata">

**Author:** [@RodBiren](https://discourse.julialang.org/u/RodBiren)\
**Replies:** 6\
**Last updated:** [October 6, 2020, 2:25am UTC](https://discourse.julialang.org/t/pre-allocate-array-custom-struct-with-zeroed-values/47823 "2020-10-06T02:25:38Z")

</div>

I am trying to figure out how to pre-allocate an array with a custom struct with zeroed values. I figured out how to allocate using undef, but I am uncertain how I can do that while setting the values other than a loop. …

---

## [Concatenating vectors of different length into a dataframe or table](https://discourse.julialang.org/t/concatenating-vectors-of-different-length-into-a-dataframe-or-table/47760)

<div class="topic-metadata">

**Author:** [@horizon](https://discourse.julialang.org/u/horizon)\
**Replies:** 9\
**Last updated:** [October 6, 2020, 1:32am UTC](https://discourse.julialang.org/t/concatenating-vectors-of-different-length-into-a-dataframe-or-table/47760 "2020-10-06T01:32:40Z")

</div>

Hi, I am trying to concatenate vectors of different length (can we merge vectors of different lengths?) into a dataframe or table but nothing seems to work. I will share my code. g = loadtable("all\_files" ; spacedelim…

---

## [How best to write this macro?](https://discourse.julialang.org/t/how-best-to-write-this-macro/47817)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 8\
**Last updated:** [October 6, 2020, 12:27am UTC](https://discourse.julialang.org/t/how-best-to-write-this-macro/47817 "2020-10-06T00:27:48Z")

</div>

I’m learning about meta programming and as practice, I tried to define a macro that would batch define and initialize arrays of a certain type. I got some of the way, but it’s clunky. What would be a better way of writ…

---

## [Logdet of a cholesky! factorized matrix trows a \`DomainError\`](https://discourse.julialang.org/t/logdet-of-a-cholesky-factorized-matrix-trows-a-domainerror/47592)

<div class="topic-metadata">

**Author:** [@Maximilian](https://discourse.julialang.org/u/Maximilian)\
**Replies:** 3\
**Last updated:** [October 5, 2020, 8:39pm UTC](https://discourse.julialang.org/t/logdet-of-a-cholesky-factorized-matrix-trows-a-domainerror/47592 "2020-10-05T20:39:17Z")

</div>

The following code trows a DomainError after cholesky!() was called: mat = \[2.4 2.05 2.05 2.4\] logdet(mat) logdet(cholesky(mat)) cholesky!(mat) logdet(mat) Why is this the case?

---

## [Memoization performance](https://discourse.julialang.org/t/memoization-performance/26361)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 6\
**Last updated:** [October 5, 2020, 8:16pm UTC](https://discourse.julialang.org/t/memoization-performance/26361 "2020-10-05T20:16:12Z")

</div>

Consider the classic fibonacci example: fib = n -\> n \< 3 ? 1 : fib(n-1) + fib(n-2) I have benchmarked several memoization implementations. The result is somewhat surprising. In theory, they work almost the same way. …

---

## [Problem with sign(pi)](https://discourse.julialang.org/t/problem-with-sign-pi/47801)

<div class="topic-metadata">

**Author:** [@aml](https://discourse.julialang.org/u/aml)\
**Replies:** 8\
**Last updated:** [October 5, 2020, 7:32pm UTC](https://discourse.julialang.org/t/problem-with-sign-pi/47801 "2020-10-05T19:32:30Z")

</div>

The following behavior seems strange: sign(pi) ERROR: InexactError: Bool(-1) Stacktrace: \[1\] Bool at .\\float.jl:73 \[inlined\] \[2\] convert at .\\number.jl:7 \[inlined\] \[3\] oftype(::Bool, ::Int64) at .\\essentials.jl:367 …

---

## [Using Julia Logging with Multiple Julia Scripts](https://discourse.julialang.org/t/using-julia-logging-with-multiple-julia-scripts/47796)

<div class="topic-metadata">

**Author:** [@bmalham](https://discourse.julialang.org/u/bmalham)\
**Replies:** 1\
**Last updated:** [October 5, 2020, 4:34pm UTC](https://discourse.julialang.org/t/using-julia-logging-with-multiple-julia-scripts/47796 "2020-10-05T16:34:06Z")

</div>

Hello, I currently have a situation where I have one Julia script that calls other Julia functions via the “run” command, and I am trying to find a way to use Julia logging (provided by the ‘Logging’ package) throughout…

---

## [Independent LU factorization of small matrices not faster with threads](https://discourse.julialang.org/t/independent-lu-factorization-of-small-matrices-not-faster-with-threads/47694)

<div class="topic-metadata">

**Author:** [@hcarlsso](https://discourse.julialang.org/u/hcarlsso)\
**Replies:** 10\
**Last updated:** [October 5, 2020, 4:06pm UTC](https://discourse.julialang.org/t/independent-lu-factorization-of-small-matrices-not-faster-with-threads/47694 "2020-10-05T16:06:14Z")

</div>

My problem is that I want to solve many small linear systems of size 3x3, and to do it in parallel, using LU factorization. using LinearAlgebra using TimerOutputs using Random reset\_timer!() function f\_lu(N) Rando…

---

## [Help with convert error from Array{Float64, 2} to Float64](https://discourse.julialang.org/t/help-with-convert-error-from-array-float64-2-to-float64/47792)

<div class="topic-metadata">

**Author:** [@jayanth\_jayasimha](https://discourse.julialang.org/u/jayanth_jayasimha)\
**Replies:** 1\
**Last updated:** [October 5, 2020, 2:59pm UTC](https://discourse.julialang.org/t/help-with-convert-error-from-array-float64-2-to-float64/47792 "2020-10-05T14:59:17Z")

</div>

Hi How do you clear this error please do help me at the earliest. gmsh.initialize(ARGS) gmsh.option.setNumber(“General.Terminal”, 1) gmsh.model.add(“Jayanth model”) using LinearAlgebra gmsh.initialize(ARGS) gmsh.o…

---

## [3D Matrix vs Array of 2D Matrices using Comprehensions](https://discourse.julialang.org/t/3d-matrix-vs-array-of-2d-matrices-using-comprehensions/47688)

<div class="topic-metadata">

**Author:** [@jleman](https://discourse.julialang.org/u/jleman)\
**Replies:** 5\
**Last updated:** [October 5, 2020, 2:24pm UTC](https://discourse.julialang.org/t/3d-matrix-vs-array-of-2d-matrices-using-comprehensions/47688 "2020-10-05T14:24:30Z")

</div>

I am trying to populate a large, dense 3D matrix (3000 x 18 x 1000). I tried iterating over all positions of the 3D matrix (testing various row/column iteration orders) - see Attempt 1. I also tried array comprehension…

---

## [JSON3 - How write(serialize) the specified number of significant digits?](https://discourse.julialang.org/t/json3-how-write-serialize-the-specified-number-of-significant-digits/47633)

<div class="topic-metadata">

**Author:** [@Martin\_Florek](https://discourse.julialang.org/u/Martin_Florek)\
**Replies:** 3\
**Last updated:** [October 2, 2020, 8:17pm UTC](https://discourse.julialang.org/t/json3-how-write-serialize-the-specified-number-of-significant-digits/47633 "2020-10-02T20:17:00Z")

</div>

Hi all, I would like write short form number of digits. e.g as round(x; sigdigits=10) I parse vector of float with help JSON3 to json string and vice versa. Default Float64 is NumberType JSON3.StructType(::Type{\<:Floa…

---

## [Reconstruct() in Parameters.jl with parameters interdependency](https://discourse.julialang.org/t/reconstruct-in-parameters-jl-with-parameters-interdependency/47753)

<div class="topic-metadata">

**Author:** [@Caio\_Machado](https://discourse.julialang.org/u/Caio_Machado)\
**Replies:** 4\
**Last updated:** [October 5, 2020, 9:24am UTC](https://discourse.julialang.org/t/reconstruct-in-parameters-jl-with-parameters-interdependency/47753 "2020-10-05T09:24:48Z")

</div>

Hi all, I find Parameters.jl and its function reconstruct() a very convenient way to handle models that need to be computed under many set of parameters. The feature that one can define a default value for a parameter t…

---

## [Plots export to svg with text converted to shape](https://discourse.julialang.org/t/plots-export-to-svg-with-text-converted-to-shape/47420)

<div class="topic-metadata">

**Author:** [@jlang](https://discourse.julialang.org/u/jlang)\
**Replies:** 1\
**Last updated:** [October 5, 2020, 8:36am UTC](https://discourse.julialang.org/t/plots-export-to-svg-with-text-converted-to-shape/47420 "2020-10-05T08:36:28Z")

</div>

I have two julia versions: one julia 1.0 with Plots 0.28.4 and one julia 1.5.1 with Plots 1.6.4. They both use the GR backend. Basically I don’t change anything. Take this little script: import Plots using Plots plot(e…

---

## [Searchsortedfirst \`by\` argument not working?](https://discourse.julialang.org/t/searchsortedfirst-by-argument-not-working/47769)

<div class="topic-metadata">

**Author:** [@Donut\_Meepo](https://discourse.julialang.org/u/Donut_Meepo)\
**Replies:** 2\
**Last updated:** [October 5, 2020, 7:41am UTC](https://discourse.julialang.org/t/searchsortedfirst-by-argument-not-working/47769 "2020-10-05T07:41:23Z")

</div>

Hi, Could anyone help me figure out why the by transformation was not applied? Thank you!

---

## [Stacktraces print backwards](https://discourse.julialang.org/t/stacktraces-print-backwards/47722)

<div class="topic-metadata">

**Author:** [@Ginter](https://discourse.julialang.org/u/Ginter)\
**Replies:** 9\
**Last updated:** [October 5, 2020, 6:39am UTC](https://discourse.julialang.org/t/stacktraces-print-backwards/47722 "2020-10-05T06:39:53Z")

</div>

When an error occurs, stacktraces are get printed in the same order as the stack unwinds. This is the opposite of Python’s behavior and makes it so I always need to scroll up to see what caused the error. Is there a way …

---

## [Fastest way to simulate the birthday paradox](https://discourse.julialang.org/t/fastest-way-to-simulate-the-birthday-paradox/47756)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 2\
**Last updated:** [October 5, 2020, 3:58am UTC](https://discourse.julialang.org/t/fastest-way-to-simulate-the-birthday-paradox/47756 "2020-10-05T03:58:46Z")

</div>

Trying to write a script for a video to explain some Julia programming concepts. Was trying to use the birthday “paradox” as example. It states that in a room of 23 ppl, there is a 50% chance that at least one pair of pe…

---

## [Inconsistent typing making adding arrays and adding a vector to the end of an array difficult](https://discourse.julialang.org/t/inconsistent-typing-making-adding-arrays-and-adding-a-vector-to-the-end-of-an-array-difficult/47662)

<div class="topic-metadata">

**Author:** [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Replies:** 27\
**Last updated:** [October 4, 2020, 1:48pm UTC](https://discourse.julialang.org/t/inconsistent-typing-making-adding-arrays-and-adding-a-vector-to-the-end-of-an-array-difficult/47662 "2020-10-04T13:48:49Z")

</div>

I’m surprised that I actually found something scientific-computing related that is easier for me to do in JavaScript than it is in Julia. I’ve written functions that use the 4/5th order Runge-Kutta-Fehlberg method to sol…

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

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