# Latest

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

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

**Page:** 1916

---

## [Marking types as scalar for broadcasting, Ref vs. Tuple?](https://discourse.julialang.org/t/marking-types-as-scalar-for-broadcasting-ref-vs-tuple/29105)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 2\
**Last updated:** [September 24, 2019, 12:50pm UTC](https://discourse.julialang.org/t/marking-types-as-scalar-for-broadcasting-ref-vs-tuple/29105 "2019-09-24T12:50:49Z")

</div>

The typical method of marking a type as scalar for broadcasting seems to be Base.Broadcast.broadcastable(x::MyType) = Ref(x) I’ve experimented a bit with Base.Broadcast.broadcastable(x::MyType) = (x,) as an alternati…

---

## [Non-compact printing in logs in non-interactive sessions](https://discourse.julialang.org/t/non-compact-printing-in-logs-in-non-interactive-sessions/29104)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [September 24, 2019, 10:46am UTC](https://discourse.julialang.org/t/non-compact-printing-in-logs-in-non-interactive-sessions/29104 "2019-09-24T10:46:23Z")

</div>

In a long-running process I need to write out occasional numeric data. I found that it is printed compactly. MWE: tamas@tamas-vivobook ~/src/mu % julia -e 'x = collect(1.0:50.0); @info "logging" x' ┌ Info: logging │ x…

---

## [How to reshape() using an array instead of a tuple / Alt: How to convert an array into a tuple](https://discourse.julialang.org/t/how-to-reshape-using-an-array-instead-of-a-tuple-alt-how-to-convert-an-array-into-a-tuple/29101)

<div class="topic-metadata">

**Author:** [@danielc](https://discourse.julialang.org/u/danielc)\
**Replies:** 5\
**Last updated:** [September 24, 2019, 9:20am UTC](https://discourse.julialang.org/t/how-to-reshape-using-an-array-instead-of-a-tuple-alt-how-to-convert-an-array-into-a-tuple/29101 "2019-09-24T09:20:32Z")

</div>

Hello, I have something like this: data = \[ ... long array of numbers ... \] dims = \[1024,256,128\] # (for example) I want to reshape the data and ideally I would like to do this: reshape(data,dims) The problem I hav…

---

## [Paired symmetric matrix decomposition?](https://discourse.julialang.org/t/paired-symmetric-matrix-decomposition/29092)

<div class="topic-metadata">

**Author:** [@tim.holy](https://discourse.julialang.org/u/tim.holy)\
**Replies:** 1\
**Last updated:** [September 24, 2019, 7:42am UTC](https://discourse.julialang.org/t/paired-symmetric-matrix-decomposition/29092 "2019-09-24T07:42:36Z")

</div>

Do any of the linear algebra gurus here know the name of or a citation for the following paired matrix decomposition: given symmetric matrices A and B, and an arbitrary vector v, find a decomposition of the form A = W D…

---

## [In-place backslash operator for sparse matrices](https://discourse.julialang.org/t/in-place-backslash-operator-for-sparse-matrices/6091)

<div class="topic-metadata">

**Author:** [@tryingtosolve](https://discourse.julialang.org/u/tryingtosolve)\
**Replies:** 1\
**Last updated:** [September 26, 2017, 7:17pm UTC](https://discourse.julialang.org/t/in-place-backslash-operator-for-sparse-matrices/6091 "2017-09-26T19:17:56Z")

</div>

I have been doing A\\b where A is a sparse matrix. However, is there an in place version of \\? I have stumbled upon A\_ldiv\_B! but it seems to me (1) this function has been deprecated and (2) it didn’t work on sparse matr…

---

## [Basic question about different type annotations in function declarations](https://discourse.julialang.org/t/basic-question-about-different-type-annotations-in-function-declarations/29086)

<div class="topic-metadata">

**Author:** [@SEA](https://discourse.julialang.org/u/SEA)\
**Replies:** 5\
**Last updated:** [September 23, 2019, 9:25pm UTC](https://discourse.julialang.org/t/basic-question-about-different-type-annotations-in-function-declarations/29086 "2019-09-23T21:25:18Z")

</div>

I wanted to clarify my understanding of the following ways of defining a function. f(x) = … f(x::T) where {T} = … f(x::Any) = … Is it true that 1. and 2. are equivalent if there are no type restrictions in …

---

## [Cleaning up strings via piping...?](https://discourse.julialang.org/t/cleaning-up-strings-via-piping/29089)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 2\
**Last updated:** [September 23, 2019, 8:08pm UTC](https://discourse.julialang.org/t/cleaning-up-strings-via-piping/29089 "2019-09-23T20:08:40Z")

</div>

I’m hoping to get some tips for cleaning up strings (maybe with piping). For example, take the following vector: dirtydata = \["O' Malley's Irish Pub", "El Sueño", "123 & ABC & 100%", 1.23, missing, 12\] What I would lik…

---

## [Testing on ARM with Drone CI](https://discourse.julialang.org/t/testing-on-arm-with-drone-ci/25871)

<div class="topic-metadata">

**Author:** [@giordano](https://discourse.julialang.org/u/giordano)\
**Replies:** 2\
**Last updated:** [September 23, 2019, 7:43pm UTC](https://discourse.julialang.org/t/testing-on-arm-with-drone-ci/25871 "2019-09-23T19:43:59Z")

</div>

Drone CI is a free and open-source continuous integration platform and allows running tests for Julia packages on ARM architecture. You can install a local instance of Drone or use Drone Cloud at https://cloud.drone.io/ …

---

## [Raspberry PI - failed to map segment from shared object](https://discourse.julialang.org/t/raspberry-pi-failed-to-map-segment-from-shared-object/28888)

<div class="topic-metadata">

**Author:** [@jarl](https://discourse.julialang.org/u/jarl)\
**Replies:** 4\
**Last updated:** [September 23, 2019, 6:04pm UTC](https://discourse.julialang.org/t/raspberry-pi-failed-to-map-segment-from-shared-object/28888 "2019-09-23T18:04:34Z")

</div>

We have some problems using our package on a Raspebrry Pi. jarl@pirog:~/archive/julia-1.2.0/bin $ ./julia \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang.org (\_) | (\_) (\_) | …

---

## [What are those magic variables in lowered code?](https://discourse.julialang.org/t/what-are-those-magic-variables-in-lowered-code/29083)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 1\
**Last updated:** [September 23, 2019, 5:37pm UTC](https://discourse.julialang.org/t/what-are-those-magic-variables-in-lowered-code/29083 "2019-09-23T17:37:23Z")

</div>

I’m trying to understand the result of @code\_lowered macro. Consider this simple example: julia\> mutable struct Foo value end julia\> foo = Foo(1) Foo(1) julia\> @code\_lowered(foo.value = 2) CodeInfo(…

---

## [Allocations when using FunctionWrapper and StaticArrays](https://discourse.julialang.org/t/allocations-when-using-functionwrapper-and-staticarrays/29078)

<div class="topic-metadata">

**Author:** [@bender9000](https://discourse.julialang.org/u/bender9000)\
**Replies:** 0\
**Last updated:** [September 23, 2019, 3:24pm UTC](https://discourse.julialang.org/t/allocations-when-using-functionwrapper-and-staticarrays/29078 "2019-09-23T15:24:38Z")

</div>

I’ve simplified my unnecessarily complicated post to show a simple case where FunctionWrappers allocate whereas using a closure without function argument types doesn’t allocate. I’m not sure why this happens. Any help on…

---

## [Opaque pointers and ccall mem. management](https://discourse.julialang.org/t/opaque-pointers-and-ccall-mem-management/29081)

<div class="topic-metadata">

**Author:** [@lobingera](https://discourse.julialang.org/u/lobingera)\
**Replies:** 0\
**Last updated:** [September 23, 2019, 4:47pm UTC](https://discourse.julialang.org/t/opaque-pointers-and-ccall-mem-management/29081 "2019-09-23T16:47:03Z")

</div>

What is the recommended julia side of C-API opaque pointer? I’d like to have a julia type for it. z1 = ccall((lib, allocateNewO), Ptr{NewO},(Uint64, ), newNumber); with NewO without structure. Can julia be convince…

---

## [Function rand() or sample() for MCMC sampling and similar?](https://discourse.julialang.org/t/function-rand-or-sample-for-mcmc-sampling-and-similar/28985)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 19\
**Last updated:** [September 23, 2019, 3:39pm UTC](https://discourse.julialang.org/t/function-rand-or-sample-for-mcmc-sampling-and-similar/28985 "2019-09-23T15:39:33Z")

</div>

I was wondering whether to use rand() or StatsBase.sample() to name an MCMC sampling function? Some packages (e.g. AdvancedHMC.jl) use sample(), I currently use rand() (BAT.jl). There was a decision on rand() vs sample() …

---

## [Symplectic integrators](https://discourse.julialang.org/t/symplectic-integrators/29056)

<div class="topic-metadata">

**Author:** [@bojohnson02](https://discourse.julialang.org/u/bojohnson02)\
**Replies:** 2\
**Last updated:** [September 23, 2019, 2:25pm UTC](https://discourse.julialang.org/t/symplectic-integrators/29056 "2019-09-23T14:25:31Z")

</div>

In DifferentialEquations do the symplectic integrators require separable Hamiltonians? I’ve tried using a couple algorithms like Yoshida6 or KahanLi6 with a non-separable system and haven’t gotten good results when compa…

---

## [EUNBORNBRANCH error when adding private package](https://discourse.julialang.org/t/eunbornbranch-error-when-adding-private-package/28958)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 5\
**Last updated:** [September 23, 2019, 1:44pm UTC](https://discourse.julialang.org/t/eunbornbranch-error-when-adding-private-package/28958 "2019-09-23T13:44:45Z")

</div>

We’ve been using the package manager heavily ever since 1.0, with a dedicated private git server that contains bare git repos. Everything has always worked fine, but suddenly I find myself unable to add one of our packag…

---

## [Stheno.jl -- support for vector-valued functions](https://discourse.julialang.org/t/stheno-jl-support-for-vector-valued-functions/28832)

<div class="topic-metadata">

**Author:** [@emsal](https://discourse.julialang.org/u/emsal)\
**Replies:** 1\
**Last updated:** [September 23, 2019, 12:28pm UTC](https://discourse.julialang.org/t/stheno-jl-support-for-vector-valued-functions/28832 "2019-09-23T12:28:04Z")

</div>

I’m starting to do some work with Stheno.jl, a Gaussian processes library. The examples in the README.md and the linked model zoo seem to work primarily on 1D functions. I am new so I don’t exactly know how to infer thi…

---

## [Clean way to determine if a file open?](https://discourse.julialang.org/t/clean-way-to-determine-if-a-file-open/29063)

<div class="topic-metadata">

**Author:** [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Replies:** 8\
**Last updated:** [September 23, 2019, 11:13am UTC](https://discourse.julialang.org/t/clean-way-to-determine-if-a-file-open/29063 "2019-09-23T11:13:06Z")

</div>

Before running a program we want to determine if the file we want to write to is open? I am questioning if there is a cleaner way to interrogate if a file is open? # ===================================== # C…

---

## [Using a onehot vector together with other data](https://discourse.julialang.org/t/using-a-onehot-vector-together-with-other-data/29007)

<div class="topic-metadata">

**Author:** [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)\
**Replies:** 2\
**Last updated:** [September 23, 2019, 8:34am UTC](https://discourse.julialang.org/t/using-a-onehot-vector-together-with-other-data/29007 "2019-09-23T08:34:56Z")

</div>

Is it possible to use a Flux.onehot vector together with other data as input to a Layer?

---

## [Array{Float64}(undef, X) gives wrong results](https://discourse.julialang.org/t/array-float64-undef-x-gives-wrong-results/28991)

<div class="topic-metadata">

**Author:** [@JosephPollacco](https://discourse.julialang.org/u/JosephPollacco)\
**Replies:** 9\
**Last updated:** [September 23, 2019, 8:08am UTC](https://discourse.julialang.org/t/array-float64-undef-x-gives-wrong-results/28991 "2019-09-23T08:08:16Z")

</div>

I am writing a complex hydrological model in JUILIA. https://github.com/joseph-pollacco/HyCatch-1D/tree/master/JULIA Problem in file: In file WaterBalance.jl I was finding that when I run the model from the Julia REP…

---

## [Map over namedtuple keys and values: confusing error](https://discourse.julialang.org/t/map-over-namedtuple-keys-and-values-confusing-error/26866)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 10\
**Last updated:** [September 23, 2019, 8:07am UTC](https://discourse.julialang.org/t/map-over-namedtuple-keys-and-values-confusing-error/26866 "2019-09-23T08:07:45Z")

</div>

Hi! I want to map a function, which gets a Pair, over both keys and values of a namedtuple, and the most obvious way seems to be using, well, pairs: f(p) = (p.first, p.second) nt = (A=5, B=6) pairs(nt) |\> collect 2-ele…

---

## [When is it better to use non-concrete types in structs?](https://discourse.julialang.org/t/when-is-it-better-to-use-non-concrete-types-in-structs/29041)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 11\
**Last updated:** [September 23, 2019, 8:00am UTC](https://discourse.julialang.org/t/when-is-it-better-to-use-non-concrete-types-in-structs/29041 "2019-09-23T08:00:25Z")

</div>

I recently read the excellent post by @quinnj : I was surprised to learn that DataFrames.jl uses structs with AbstractArrays fields to cut down in compilation time without hurting runtime performance. This is quite a s…

---

## [Problem using Documenter.jl](https://discourse.julialang.org/t/problem-using-documenter-jl/29052)

<div class="topic-metadata">

**Author:** [@ARYADEEPTA\_DE](https://discourse.julialang.org/u/ARYADEEPTA_DE)\
**Replies:** 9\
**Last updated:** [September 23, 2019, 7:51am UTC](https://discourse.julialang.org/t/problem-using-documenter-jl/29052 "2019-09-23T07:51:18Z")

</div>

I am doing a project in julia, and was attempting to use doctest.jl for documentation. I was following the intstructions on github, and had everything working until running make.jl from the docs directory. Here is the co…

---

## [Online playground](https://discourse.julialang.org/t/online-playground/29024)

<div class="topic-metadata">

**Author:** [@vishr](https://discourse.julialang.org/u/vishr)\
**Replies:** 4\
**Last updated:** [September 23, 2019, 7:17am UTC](https://discourse.julialang.org/t/online-playground/29024 "2019-09-23T07:17:26Z")

</div>

Folks, I wanted to share https://code.labstack.com/julia , an online Julia programming playground. I hope you will find it useful. Thanks.

---

## [Strip out YAML blocks](https://discourse.julialang.org/t/strip-out-yaml-blocks/29059)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 4\
**Last updated:** [September 23, 2019, 7:10am UTC](https://discourse.julialang.org/t/strip-out-yaml-blocks/29059 "2019-09-23T07:10:51Z")

</div>

Is there an easy way to strip yaml blocks from markdown files, or more concretely - anything between and including the first and second occurence of --- and ---.

---

## [Reducing redundant typing when returning named tuples](https://discourse.julialang.org/t/reducing-redundant-typing-when-returning-named-tuples/29054)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 1\
**Last updated:** [September 23, 2019, 1:18am UTC](https://discourse.julialang.org/t/reducing-redundant-typing-when-returning-named-tuples/29054 "2019-09-23T01:18:40Z")

</div>

I think there was a post about this a while back but I’m not sure if it was before named tuples were in base or not and I also cannot find it. Say I create local variables a, b, and c inside a function. I want to return…

---

## [Zygote Performance](https://discourse.julialang.org/t/zygote-performance/29028)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 22\
**Last updated:** [September 23, 2019, 12:27am UTC](https://discourse.julialang.org/t/zygote-performance/29028 "2019-09-23T00:27:31Z")

</div>

At the moment I implement gradients for all my models, because I have not yet found that Julia’s AD packages come anywhere close to my fairly naive hand-optimised gradients. (The only exception is ForwardDiff on very sma…

---

## [DataFrames Error: Warning: \`T\` is deprecated, use \`nonmissingtype\` instead](https://discourse.julialang.org/t/dataframes-error-warning-t-is-deprecated-use-nonmissingtype-instead/29053)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 2\
**Last updated:** [September 23, 2019, 12:03am UTC](https://discourse.julialang.org/t/dataframes-error-warning-t-is-deprecated-use-nonmissingtype-instead/29053 "2019-09-23T00:03:55Z")

</div>

I’ve been getting this error a lot lately (I think since I updated my DataFrames package). Has anyone else run into this? ┌ Warning: \`T\` is deprecated, use \`nonmissingtype\` instead. │ caller = compacttype(::Type, ::In…

---

## [Question on using the GMT wrapper](https://discourse.julialang.org/t/question-on-using-the-gmt-wrapper/28968)

<div class="topic-metadata">

**Author:** [@natgeo-wong](https://discourse.julialang.org/u/natgeo-wong)\
**Replies:** 18\
**Last updated:** [September 22, 2019, 10:16pm UTC](https://discourse.julialang.org/t/question-on-using-the-gmt-wrapper/28968 "2019-09-22T22:16:02Z")

</div>

Hi all, I have a macOS, running Julia on Juno. I am trying to install the GMT wrapper into Julia, and it seems to work at a glance. However, when I run GMT, I get the following error: ERROR: error compiling finish\_PS…

---

## [PPL connection to MLJ.jl](https://discourse.julialang.org/t/ppl-connection-to-mlj-jl/28736)

<div class="topic-metadata">

**Author:** [@cscherrer](https://discourse.julialang.org/u/cscherrer)\
**Replies:** 12\
**Last updated:** [September 22, 2019, 9:53pm UTC](https://discourse.julialang.org/t/ppl-connection-to-mlj-jl/28736 "2019-09-22T21:53:11Z")

</div>

I’d like to get Soss.jl connected to MLJ.jl. I can imagine a few ways this might work, and thought I could get some input here on what could be most useful as first steps. I’ll start with a short overview, since Soss wo…

---

## [Syntax error of getindex in my code](https://discourse.julialang.org/t/syntax-error-of-getindex-in-my-code/29039)

<div class="topic-metadata">

**Author:** [@Fuad\_Sami](https://discourse.julialang.org/u/Fuad_Sami)\
**Replies:** 11\
**Last updated:** [September 22, 2019, 6:14pm UTC](https://discourse.julialang.org/t/syntax-error-of-getindex-in-my-code/29039 "2019-09-22T18:14:50Z")

</div>

this is the error : LoadError(“main.jl”, 5, ErrorException(“syntax: invalid iteration specification”)) function makeAnagram(a::String,b::String) lettercounts = zeros(Int,27) for i in a a1 = a\[i\] …

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

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