# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1832

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

**Page:** 1833

---

## [Adding documentation string in metaprogramming function definition eval loop](https://discourse.julialang.org/t/adding-documentation-string-in-metaprogramming-function-definition-eval-loop/34156)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 3\
**Last updated:** [February 4, 2020, 10:50am UTC](https://discourse.julialang.org/t/adding-documentation-string-in-metaprogramming-function-definition-eval-loop/34156 "2020-02-04T10:50:20Z")

</div>

I have this nice codeblock: for (dim, Dim) in (("time", :Time), ("zonal", :Lon)) @eval begin # """ # $(dim)average(a::DimensionalArray, i=end) # Return the $(dim)-averaged \`a\` (average ac…

---

## [How to optimaly comprssing and save long strings ( 10^6 char and more)](https://discourse.julialang.org/t/how-to-optimaly-comprssing-and-save-long-strings-10-6-char-and-more/34133)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 4\
**Last updated:** [February 4, 2020, 10:40am UTC](https://discourse.julialang.org/t/how-to-optimaly-comprssing-and-save-long-strings-10-6-char-and-more/34133 "2020-02-04T10:40:06Z")

</div>

how to optimaly comprssing and save long strings ( 10^6 char and more) HDF5 I cant do “compress” another oprtions ? Formats? Paul

---

## [Code introspection recommendations/advice](https://discourse.julialang.org/t/code-introspection-recommendations-advice/34118)

<div class="topic-metadata">

**Author:** [@BrucePBon](https://discourse.julialang.org/u/BrucePBon)\
**Replies:** 2\
**Last updated:** [February 4, 2020, 10:19am UTC](https://discourse.julialang.org/t/code-introspection-recommendations-advice/34118 "2020-02-04T10:19:42Z")

</div>

After some testing I obtained that calling the C FFTW library directly from julia is much faster (x5 faster) than using the FFTW julia package. Now I want to understand where this difference might be coming from, therefo…

---

## [TextUserInterfaces.jl: The road so far](https://discourse.julialang.org/t/textuserinterfaces-jl-the-road-so-far/34098)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 3\
**Last updated:** [February 4, 2020, 10:07am UTC](https://discourse.julialang.org/t/textuserinterfaces-jl-the-road-so-far/34098 "2020-02-04T10:07:59Z")

</div>

Hi! As some of you know, I am (trying) to develop an interface between Julia and NCurses in the package TextUserInterfaces.jl. Today, I think I hit a major milestone! I have rewritten everything so that we can work wit…

---

## [Best practice way to check if method is defined for given arguments](https://discourse.julialang.org/t/best-practice-way-to-check-if-method-is-defined-for-given-arguments/34152)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 2\
**Last updated:** [February 4, 2020, 9:49am UTC](https://discourse.julialang.org/t/best-practice-way-to-check-if-method-is-defined-for-given-arguments/34152 "2020-02-04T09:49:28Z")

</div>

What’s the clean, best-practice way to check if a method is defined for a given set of arguments, from within package code? I want to check if certain required methods/traits are implemented for given arguments/types bef…

---

## [Pkg operations without updating registry](https://discourse.julialang.org/t/pkg-operations-without-updating-registry/34151)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 3\
**Last updated:** [February 4, 2020, 9:47am UTC](https://discourse.julialang.org/t/pkg-operations-without-updating-registry/34151 "2020-02-04T09:47:48Z")

</div>

Is it possibly to run Pkg operations like add and instantiate without updating the registry? Since my registry is on NFS, updating it is slow, and having it update every few minutes when doing a lot of package operations…

---

## [How to plot next to each other and in rows small matrices as images (greyscale)](https://discourse.julialang.org/t/how-to-plot-next-to-each-other-and-in-rows-small-matrices-as-images-greyscale/34149)

<div class="topic-metadata">

**Author:** [@Ujku\_KU](https://discourse.julialang.org/u/Ujku_KU)\
**Replies:** 4\
**Last updated:** [February 4, 2020, 8:21am UTC](https://discourse.julialang.org/t/how-to-plot-next-to-each-other-and-in-rows-small-matrices-as-images-greyscale/34149 "2020-02-04T08:21:49Z")

</div>

Hi guys, my question is: how to plot next to each other and in rows small matrices as images (greyscale)? Thank you very much in advance for your support. Cheers. Ergnoor

---

## [\[ANN\] IntelVectorMath.jl (revived VML.jl)](https://discourse.julialang.org/t/ann-intelvectormath-jl-revived-vml-jl/33249)

<div class="topic-metadata">

**Author:** [@Crown421](https://discourse.julialang.org/u/Crown421)\
**Replies:** 7\
**Last updated:** [February 4, 2020, 1:30am UTC](https://discourse.julialang.org/t/ann-intelvectormath-jl-revived-vml-jl/33249 "2020-02-04T01:30:20Z")

</div>

Dear all, I am excited to be able to announce the revived VML.jl as IntelVectorMath.jl This package provides easy access to the vectorized versions of common math function from the Intel Vector Math Library, which i…

---

## [Translating code from VBA to Julia](https://discourse.julialang.org/t/translating-code-from-vba-to-julia/6622)

<div class="topic-metadata">

**Author:** [@micro](https://discourse.julialang.org/u/micro)\
**Replies:** 1\
**Last updated:** [February 4, 2020, 12:52am UTC](https://discourse.julialang.org/t/translating-code-from-vba-to-julia/6622 "2020-02-04T00:52:06Z")

</div>

Please let me know your email if you are interested. We can discuss further there. The complexity of the sample VBA code is very low - reading csv input files / performing some basic arithmetic calculation / writing out…

---

## [Workspace in Julia](https://discourse.julialang.org/t/workspace-in-julia/34122)

<div class="topic-metadata">

**Author:** [@shiroghost](https://discourse.julialang.org/u/shiroghost)\
**Replies:** 16\
**Last updated:** [February 3, 2020, 11:13pm UTC](https://discourse.julialang.org/t/workspace-in-julia/34122 "2020-02-03T23:13:51Z")

</div>

Hi all, New to Julia, but with experience in HPC. I am looking for a canonical way to have module variables that can be shared between the different functions of the module without having to pass these variables as argu…

---

## [Try Julia in the Documentation](https://discourse.julialang.org/t/try-julia-in-the-documentation/34111)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 1\
**Last updated:** [February 3, 2020, 10:21pm UTC](https://discourse.julialang.org/t/try-julia-in-the-documentation/34111 "2020-02-03T22:21:05Z")

</div>

Recently I stumbled over the c sharp docs and I like the way that I just could try c sharp in the browser. Since Julia has a repl I thought this would be a nice feature for the Julia documentation.

---

## [Random numbers and DArrays](https://discourse.julialang.org/t/random-numbers-and-darrays/34129)

<div class="topic-metadata">

**Author:** [@squirrel](https://discourse.julialang.org/u/squirrel)\
**Replies:** 1\
**Last updated:** [February 3, 2020, 9:30pm UTC](https://discourse.julialang.org/t/random-numbers-and-darrays/34129 "2020-02-03T21:30:21Z")

</div>

This function doesn’t behave as expected. When I pass it a DArray, it goes to the correct part of the loop and prints “Some sort of integer… max 127” as I expect it to, but then the map alters the DArray v in ways I don’…

---

## [How using push on typed dictionary](https://discourse.julialang.org/t/how-using-push-on-typed-dictionary/33827)

<div class="topic-metadata">

**Author:** [@Darione](https://discourse.julialang.org/u/Darione)\
**Replies:** 8\
**Last updated:** [February 3, 2020, 8:39pm UTC](https://discourse.julialang.org/t/how-using-push-on-typed-dictionary/33827 "2020-02-03T20:39:39Z")

</div>

Hello everybody, i was playing with dictionary … i can’t understand why the last my statement is not correct in this case: println("1° dictionary") myDictionary1 = Dict() push!(myDictionary1,"alpha"=\>\[10,20\]) # ok this…

---

## [Using DifferentialEquations.jl to solve routine optimal control problems](https://discourse.julialang.org/t/using-differentialequations-jl-to-solve-routine-optimal-control-problems/34096)

<div class="topic-metadata">

**Author:** [@Albert\_Zevelev](https://discourse.julialang.org/u/Albert_Zevelev)\
**Replies:** 7\
**Last updated:** [February 3, 2020, 8:38pm UTC](https://discourse.julialang.org/t/using-differentialequations-jl-to-solve-routine-optimal-control-problems/34096 "2020-02-03T20:38:18Z")

</div>

I’m using DifferentialEquations.jl to solve a standard consumption-savings problem. I wanna see if there is a way to solve these issues before I submit feature-requests. using DifferentialEquations, BoundaryValueDiffEq…

---

## [How to create SharedArrays on other workers](https://discourse.julialang.org/t/how-to-create-sharedarrays-on-other-workers/33619)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 9\
**Last updated:** [February 3, 2020, 5:48pm UTC](https://discourse.julialang.org/t/how-to-create-sharedarrays-on-other-workers/33619 "2020-02-03T17:48:05Z")

</div>

I am trying to create a SharedArray on a different worker in julia 1.3.0. Consider the following code snippet: using Distributed addprocs(1) using SharedArrays f = @spawnat 2 SharedVector{Float64}(10) fetch(f) If I …

---

## [Vim + ALE: has anyone gotten LanguageServer or StaticLint to work?](https://discourse.julialang.org/t/vim-ale-has-anyone-gotten-languageserver-or-staticlint-to-work/34123)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 1\
**Last updated:** [February 3, 2020, 4:53pm UTC](https://discourse.julialang.org/t/vim-ale-has-anyone-gotten-languageserver-or-staticlint-to-work/34123 "2020-02-03T16:53:38Z")

</div>

I’m using (regular) vim with ALE for linting and LSP support. However, LanguageServer.jl doesn’t seem to work: using the default ALE scripts, vim will instantiate a Julia proces with LanguageServer that then takes 100% C…

---

## [Calculating a standardization function from scratch](https://discourse.julialang.org/t/calculating-a-standardization-function-from-scratch/34117)

<div class="topic-metadata">

**Author:** [@PyDataBlog](https://discourse.julialang.org/u/PyDataBlog)\
**Replies:** 6\
**Last updated:** [February 3, 2020, 4:18pm UTC](https://discourse.julialang.org/t/calculating-a-standardization-function-from-scratch/34117 "2020-02-03T16:18:47Z")

</div>

Hi, I am trying to create a standardization function from scratch to scale features: Here’s my current implementation: # Standardize training features function scale\_features(X) μ = mean(X, dims=1) σ = std(X, d…

---

## [How to generate a random unitary matrix perfectly in Julia](https://discourse.julialang.org/t/how-to-generate-a-random-unitary-matrix-perfectly-in-julia/34102)

<div class="topic-metadata">

**Author:** [@JunjieWu](https://discourse.julialang.org/u/JunjieWu)\
**Replies:** 10\
**Last updated:** [February 3, 2020, 4:18pm UTC](https://discourse.julialang.org/t/how-to-generate-a-random-unitary-matrix-perfectly-in-julia/34102 "2020-02-03T16:18:00Z")

</div>

Dear friends, I am trying to implement a function that generates a random unitary matrix. However, I found that I met a precision issue. Is any idea how to solve this problem? using LinearAlgebra function RandomUnitar…

---

## [How to minimize a function of single integer variable?](https://discourse.julialang.org/t/how-to-minimize-a-function-of-single-integer-variable/34115)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 2\
**Last updated:** [February 3, 2020, 4:08pm UTC](https://discourse.julialang.org/t/how-to-minimize-a-function-of-single-integer-variable/34115 "2020-02-03T16:08:22Z")

</div>

Let’s suppose I have a function f(m): \\mathbb{N}\\rightarrow\\mathbb{R}. What method should I use to minimize it? The function is supposed to be smooth if we continue it from \\mathbb{N} to \[1,+\\infty). Also, it’s contin…

---

## [Functions of Functions Performance in a Loop](https://discourse.julialang.org/t/functions-of-functions-performance-in-a-loop/34116)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 2\
**Last updated:** [February 3, 2020, 3:45pm UTC](https://discourse.julialang.org/t/functions-of-functions-performance-in-a-loop/34116 "2020-02-03T15:45:42Z")

</div>

For the following two loops, in which a function of a function is called in one, and the computation is more explicit in the other, there is a significant amount of memory allocation in the former. It also takes a perf…

---

## [Operation across the matching dimension of an array with a vector](https://discourse.julialang.org/t/operation-across-the-matching-dimension-of-an-array-with-a-vector/34120)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 3\
**Last updated:** [February 3, 2020, 3:44pm UTC](https://discourse.julialang.org/t/operation-across-the-matching-dimension-of-an-array-with-a-vector/34120 "2020-02-03T15:44:15Z")

</div>

Hi there, I am trying to apply a bivariate function f across an arbitrary dimensional array A and a vector B. I want to apply this function across the dimension of A that matches length with B. For example if A is 3-dim…

---

## [Taking the array indexing interface seriously](https://discourse.julialang.org/t/taking-the-array-indexing-interface-seriously/32035)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 31\
**Last updated:** [February 3, 2020, 3:16pm UTC](https://discourse.julialang.org/t/taking-the-array-indexing-interface-seriously/32035 "2020-02-03T15:16:13Z")

</div>

I’m doing some work standardizing array interfaces for the spatial data ecosystem in HDF5, ArchGDAL and in GeoData. It’s not uncommon for widely use packages to have non-standard indexing inputs and outputs. HDF5.jl cu…

---

## [State of PackageCompiler](https://discourse.julialang.org/t/state-of-packagecompiler/33945)

<div class="topic-metadata">

**Author:** [@cshen](https://discourse.julialang.org/u/cshen)\
**Replies:** 3\
**Last updated:** [February 3, 2020, 2:12pm UTC](https://discourse.julialang.org/t/state-of-packagecompiler/33945 "2020-02-03T14:12:48Z")

</div>

Hello, I have been tinkering around the PackageCompiler module. I’ve been trying to build various system images with my most used packages to speed up the workflow (so far no success). I must admit that i am really co…

---

## [Help to avoid a type-instability](https://discourse.julialang.org/t/help-to-avoid-a-type-instability/34097)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 13\
**Last updated:** [February 3, 2020, 2:01pm UTC](https://discourse.julialang.org/t/help-to-avoid-a-type-instability/34097 "2020-02-03T14:01:42Z")

</div>

Hi! I need to construct a struct that has a vector with elements of another structure as in this code: mutable struct A{T} value::T end mutable struct B v::Vector{A} end get\_data(a::A{T}) where T = a.value ge…

---

## [Initializing a grid with coordinates on the GPU](https://discourse.julialang.org/t/initializing-a-grid-with-coordinates-on-the-gpu/34107)

<div class="topic-metadata">

**Author:** [@stabbles](https://discourse.julialang.org/u/stabbles)\
**Replies:** 1\
**Last updated:** [February 3, 2020, 12:50pm UTC](https://discourse.julialang.org/t/initializing-a-grid-with-coordinates-on-the-gpu/34107 "2020-02-03T12:50:21Z")

</div>

I’m trying to build a tensor A of size 3 x ℓ x m x n where A\[:, i, j, k\] is a 3D coordinate at (i, j, k) in a uniform grid for \[0, 1\]^3. On the CPU this code looks like this: function mesh(n) r = range(0.0f0, 1.0f0, …

---

## [Calling a Method object](https://discourse.julialang.org/t/calling-a-method-object/34112)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 1\
**Last updated:** [February 3, 2020, 12:14pm UTC](https://discourse.julialang.org/t/calling-a-method-object/34112 "2020-02-03T12:14:23Z")

</div>

Is there any way to do this? julia\> m = @which sin(1) sin(x::Real) in Base.Math at special/trig.jl:53 julia\> m(20) ERROR: MethodError: objects of type Method are not callable Stacktrace: \[1\] top-level scope at REPL\[5\]…

---

## [Operator algebra design](https://discourse.julialang.org/t/operator-algebra-design/34104)

<div class="topic-metadata">

**Author:** [@Sleort](https://discourse.julialang.org/u/Sleort)\
**Replies:** 4\
**Last updated:** [February 3, 2020, 11:47am UTC](https://discourse.julialang.org/t/operator-algebra-design/34104 "2020-02-03T11:47:42Z")

</div>

Although I can easily construct an operator algebra in Julia using closures, I wonder if this is the best/most “Julian” way of doing it. As an example, take the following code import Base: +, -, \*, / abstract type Abst…

---

## [Blockdiag for dense matrices](https://discourse.julialang.org/t/blockdiag-for-dense-matrices/33941)

<div class="topic-metadata">

**Author:** [@olof3](https://discourse.julialang.org/u/olof3)\
**Replies:** 10\
**Last updated:** [February 3, 2020, 9:51am UTC](https://discourse.julialang.org/t/blockdiag-for-dense-matrices/33941 "2020-02-03T09:51:42Z")

</div>

Quite often I want to form dense block diagonal matrices from a few dense matrices. Is there an easy way to do this? There is blockdiag for sparse matrices: help?\> blockdiag search: blockdiag blockdiag(A...) Conca…

---

## [Variabile scope into the for? panic](https://discourse.julialang.org/t/variabile-scope-into-the-for-panic/33971)

<div class="topic-metadata">

**Author:** [@Darione](https://discourse.julialang.org/u/Darione)\
**Replies:** 15\
**Last updated:** [February 3, 2020, 8:08am UTC](https://discourse.julialang.org/t/variabile-scope-into-the-for-panic/33971 "2020-02-03T08:08:19Z")

</div>

I am trying Julia since 3 weeks, so i am totally beginner. Here i was trying to get argument passed to my script, running into the command line: folder\_path = “” println(“Set parameters …”) for i in 1:length(ARGS) x…

---

## [Dict can't find a key it already said is there?](https://discourse.julialang.org/t/dict-cant-find-a-key-it-already-said-is-there/34088)

<div class="topic-metadata">

**Author:** [@rmz](https://discourse.julialang.org/u/rmz)\
**Replies:** 6\
**Last updated:** [February 3, 2020, 7:33am UTC](https://discourse.julialang.org/t/dict-cant-find-a-key-it-already-said-is-there/34088 "2020-02-03T07:33:34Z")

</div>

I’m confused I have this piece of code (see below, the important part is the the push! … line), it will push a value to a set located in a dict at a key (called “coord”) that we have already verified exists in the dict …

[Previous page](https://discourse.julialang.org/latest.md?page=1831)

[Next page](https://discourse.julialang.org/latest.md?page=1833)
