# General Usage

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

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

**Page:** 817

---

## [Using Transducers.jl instead of stateful functions for stream processing](https://discourse.julialang.org/t/using-transducers-jl-instead-of-stateful-functions-for-stream-processing/30553)

<div class="topic-metadata">

**Author:** [@sairus7](https://discourse.julialang.org/u/sairus7)\
**Replies:** 8\
**Last updated:** [November 7, 2019, 9:31am UTC](https://discourse.julialang.org/t/using-transducers-jl-instead-of-stateful-functions-for-stream-processing/30553 "2019-11-07T09:31:05Z")

</div>

Looks like a nice solution for processing buffered streams of signals in chunks and pass its results to next processing steps in a sequense or tree. But can you please explain, how should stateful functions code change…

---

## [Check if a type implements an interface in Julia](https://discourse.julialang.org/t/check-if-a-type-implements-an-interface-in-julia/30818)

<div class="topic-metadata">

**Author:** [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Replies:** 1\
**Last updated:** [November 7, 2019, 8:03am UTC](https://discourse.julialang.org/t/check-if-a-type-implements-an-interface-in-julia/30818 "2019-11-07T08:03:00Z")

</div>

I’ used title from a SO question ~3 years old here. Is there a better approach in Julia 1.0+ how to test or dispatch to types that e.g support indexing or iteration, without using methodswith()?

---

## [How to clear or close pyplot figure?](https://discourse.julialang.org/t/how-to-clear-or-close-pyplot-figure/30767)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 4\
**Last updated:** [November 7, 2019, 7:00am UTC](https://discourse.julialang.org/t/how-to-clear-or-close-pyplot-figure/30767 "2019-11-07T07:00:48Z")

</div>

How to clear or close pyplot figure? Paul

---

## [Unable to make 3d quiver plot](https://discourse.julialang.org/t/unable-to-make-3d-quiver-plot/30811)

<div class="topic-metadata">

**Author:** [@alacritas](https://discourse.julialang.org/u/alacritas)\
**Replies:** 1\
**Last updated:** [November 7, 2019, 1:05am UTC](https://discourse.julialang.org/t/unable-to-make-3d-quiver-plot/30811 "2019-11-07T01:05:23Z")

</div>

I have 3 dimensional data, but it looks like the only available package to do this is PyPlot, but this available example is not working with my environment (Julia 1.2.0), and returns an error saying Unkown projection '3d…

---

## [Help with recursive type for automatic differentiation (Taylor Numbers) as in a Haskell example](https://discourse.julialang.org/t/help-with-recursive-type-for-automatic-differentiation-taylor-numbers-as-in-a-haskell-example/30804)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 11\
**Last updated:** [November 7, 2019, 1:06am UTC](https://discourse.julialang.org/t/help-with-recursive-type-for-automatic-differentiation-taylor-numbers-as-in-a-haskell-example/30804 "2019-11-07T01:06:28Z")

</div>

Hello, I am about to try out to implement Taylor numbers for automatic differentiation (just as a simple example for myself). Y have found a very neat version written in Haskell here: Automatic Differentiation: Dual numb…

---

## [Similar performance using DataFrames or DataFramesMeta?](https://discourse.julialang.org/t/similar-performance-using-dataframes-or-dataframesmeta/30813)

<div class="topic-metadata">

**Author:** [@bashonubuntu](https://discourse.julialang.org/u/bashonubuntu)\
**Replies:** 0\
**Last updated:** [November 7, 2019, 1:04am UTC](https://discourse.julialang.org/t/similar-performance-using-dataframes-or-dataframesmeta/30813 "2019-11-07T01:04:31Z")

</div>

In my experience, DataFrames and DataFramesMeta have performed quite similarly in typical use-cases like selecting a subset of a dataframe based on a condition, selecting a column from a dataframe etc. Have other users f…

---

## [Does Julia have an index symbol ! like Haskell?](https://discourse.julialang.org/t/does-julia-have-an-index-symbol-like-haskell/30787)

<div class="topic-metadata">

**Author:** [@AlexanderChen](https://discourse.julialang.org/u/AlexanderChen)\
**Replies:** 17\
**Last updated:** [November 7, 2019, 12:12am UTC](https://discourse.julialang.org/t/does-julia-have-an-index-symbol-like-haskell/30787 "2019-11-07T00:12:17Z")

</div>

Hi, In Haskell you have the !! symbol which is used as follows: a = \[1,2,3\] a !! 2 Output: 3 (haskell is 0-based) I find this quite handy but i can only find a regular index method in Julia: a\[3\] = 3 Does Julia ha…

---

## [Can DataFrames.jl handle multi-dimensional arrays](https://discourse.julialang.org/t/can-dataframes-jl-handle-multi-dimensional-arrays/30727)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 6\
**Last updated:** [November 6, 2019, 8:56pm UTC](https://discourse.julialang.org/t/can-dataframes-jl-handle-multi-dimensional-arrays/30727 "2019-11-06T20:56:58Z")

</div>

I was wondering if DataFrames.jl can handle multi-dimensional arrays, meaning an array with 3 or more dimensions. I can run using DataFrames DataFrame(rand(3,4) and that works fine. But if I try: DataFrame(rand(3,4,…

---

## [How do I plot?](https://discourse.julialang.org/t/how-do-i-plot/30783)

<div class="topic-metadata">

**Author:** [@Emir\_Sahin](https://discourse.julialang.org/u/Emir_Sahin)\
**Replies:** 3\
**Last updated:** [November 6, 2019, 5:45pm UTC](https://discourse.julialang.org/t/how-do-i-plot/30783 "2019-11-06T17:45:32Z")

</div>

xfirst=rand(-5:5) for n=1:100 a=rand(-0.1:0.1) xnew=xfirst+(xfirst\*a) if mainfonk(xnew)\>mainfonk(xfirst) xfirst=xnew println(mainfonk(xfirst)) end end Hi. I am working hill climbing in julia. I am trying…

---

## [Get intuition on how to improve matmul code](https://discourse.julialang.org/t/get-intuition-on-how-to-improve-matmul-code/30799)

<div class="topic-metadata">

**Author:** [@davidbp](https://discourse.julialang.org/u/davidbp)\
**Replies:** 14\
**Last updated:** [November 6, 2019, 5:31pm UTC](https://discourse.julialang.org/t/get-intuition-on-how-to-improve-matmul-code/30799 "2019-11-06T17:31:02Z")

</div>

Hello, After playing a little bit with the most naive matmul blocked version I have found on the internet I was wondering what could I do to improve the performance. function matmul\_blocked\_1!(A, B, C) bs = 10 …

---

## [How to keep a reference for C structure to avoid GC?](https://discourse.julialang.org/t/how-to-keep-a-reference-for-c-structure-to-avoid-gc/9310)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 25\
**Last updated:** [November 6, 2019, 5:14pm UTC](https://discourse.julialang.org/t/how-to-keep-a-reference-for-c-structure-to-avoid-gc/9310 "2019-11-06T17:14:16Z")

</div>

I need to pass a struct that may contain an array of its own type to a C library. To achieve that, I use the pointer function to obtain an address and encode that in an UInt64 field (as expected by the C library). I’ve…

---

## [Julia and GoogleMaps](https://discourse.julialang.org/t/julia-and-googlemaps/29693)

<div class="topic-metadata">

**Author:** [@Dervis](https://discourse.julialang.org/u/Dervis)\
**Replies:** 11\
**Last updated:** [November 6, 2019, 4:47pm UTC](https://discourse.julialang.org/t/julia-and-googlemaps/29693 "2019-11-06T16:47:22Z")

</div>

Dear all, I 'd like to plot my GPS points (LLA) on Googlemaps with Julia and also would like to plot a route between two GPS points on GoogleMaps again via julia. I did a little bit of research on the forums but couldn’…

---

## [How do I turn this into arrays?](https://discourse.julialang.org/t/how-do-i-turn-this-into-arrays/30784)

<div class="topic-metadata">

**Author:** [@AlexanderChen](https://discourse.julialang.org/u/AlexanderChen)\
**Replies:** 2\
**Last updated:** [November 6, 2019, 9:43am UTC](https://discourse.julialang.org/t/how-do-i-turn-this-into-arrays/30784 "2019-11-06T09:43:51Z")

</div>

Hi, This code works but the output is 1 single array: \[ 10 - i - j for i in collect(0:9), j in collect(0:9) if 10- i - j \> 0\] output: \[10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 9, 8, 7, 6, 5, 4, 3, 2, 1, 8, 7, 6, 5, 4, 3, 2, 1,…

---

## [Doto macro?](https://discourse.julialang.org/t/doto-macro/30766)

<div class="topic-metadata">

**Author:** [@Orbots](https://discourse.julialang.org/u/Orbots)\
**Replies:** 5\
**Last updated:** [November 6, 2019, 1:24am UTC](https://discourse.julialang.org/t/doto-macro/30766 "2019-11-06T01:24:23Z")

</div>

Is there something like clojure’s doto macro readily available? doto - clojure.core | ClojureDocs - Community-Powered Clojure Documentation and Examples. “Evaluates x then calls all of the methods and functions with t…

---

## [Best julian way to populate empty dataframes?](https://discourse.julialang.org/t/best-julian-way-to-populate-empty-dataframes/30768)

<div class="topic-metadata">

**Author:** [@bashonubuntu](https://discourse.julialang.org/u/bashonubuntu)\
**Replies:** 2\
**Last updated:** [November 6, 2019, 12:50am UTC](https://discourse.julialang.org/t/best-julian-way-to-populate-empty-dataframes/30768 "2019-11-06T00:50:24Z")

</div>

Hello, Often times in what I code, I need to populate an empty dataframe based on some pre-existing dataframe which is called inside a function. For example, function populate\_meta\_data(data::R) where {R\<:DataFrame} …

---

## [Backpropagate compat bounds](https://discourse.julialang.org/t/backpropagate-compat-bounds/30737)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 10\
**Last updated:** [November 5, 2019, 11:53pm UTC](https://discourse.julialang.org/t/backpropagate-compat-bounds/30737 "2019-11-05T23:53:19Z")

</div>

As has been pointed out by @fredrikekre in Please be mindful of version bounds and semantic versioning when tagging your packages - #20 by fredrikekre, compat entries do not backpropagate to older versions of a package. …

---

## [Zygote foreigncall expression error](https://discourse.julialang.org/t/zygote-foreigncall-expression-error/30739)

<div class="topic-metadata">

**Author:** [@LudiWin](https://discourse.julialang.org/u/LudiWin)\
**Replies:** 3\
**Last updated:** [November 5, 2019, 9:00pm UTC](https://discourse.julialang.org/t/zygote-foreigncall-expression-error/30739 "2019-11-05T21:00:35Z")

</div>

Hi, to get into Julia I started implementing different machine learning algorithms. Last night i implemented a GP just to see how that would work. Here’s the code so far: using LinearAlgebra, Random, Distributions us…

---

## [How to start with 3D scater plots?](https://discourse.julialang.org/t/how-to-start-with-3d-scater-plots/30730)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 3\
**Last updated:** [November 5, 2019, 8:47pm UTC](https://discourse.julialang.org/t/how-to-start-with-3d-scater-plots/30730 "2019-11-05T20:47:07Z")

</div>

I am starting with 3D plots, How to start with 3D scater plots? Paul

---

## [Atom Juno won't open Julia if directory path contains spaces](https://discourse.julialang.org/t/atom-juno-wont-open-julia-if-directory-path-contains-spaces/8659)

<div class="topic-metadata">

**Author:** [@clinton](https://discourse.julialang.org/u/clinton)\
**Replies:** 2\
**Last updated:** [January 29, 2018, 8:48pm UTC](https://discourse.julialang.org/t/atom-juno-wont-open-julia-if-directory-path-contains-spaces/8659 "2018-01-29T20:48:48Z")

</div>

I tried to switch to using the atom-integrated REPL in the latest Juno patch. However, it doesn’t seem to work with a space in the Julia directory path (this is on Windows). The full path is: C:\\Users\\Clinton Name\\AppDa…

---

## [Running a function in parallel](https://discourse.julialang.org/t/running-a-function-in-parallel/30756)

<div class="topic-metadata">

**Author:** [@Patrik\_Waldmann](https://discourse.julialang.org/u/Patrik_Waldmann)\
**Replies:** 2\
**Last updated:** [November 5, 2019, 6:14pm UTC](https://discourse.julialang.org/t/running-a-function-in-parallel/30756 "2019-11-05T18:14:59Z")

</div>

I need help getting a function to run in parallel. I want to distribute both data and packages to all workers, see the following example (which doesn’t work): #Simulated data (n observations, p variables, tr truevariabl…

---

## [Assignments, Copies and Deepcop](https://discourse.julialang.org/t/assignments-copies-and-deepcop/30723)

<div class="topic-metadata">

**Author:** [@natgeo-wong](https://discourse.julialang.org/u/natgeo-wong)\
**Replies:** 14\
**Last updated:** [November 5, 2019, 5:07pm UTC](https://discourse.julialang.org/t/assignments-copies-and-deepcop/30723 "2019-11-05T17:07:15Z")

</div>

This is a question regarding the use of “=” signs in Julia. I can do the following for-loop in MATLAB for ii = 1 : dt ηp1 = shallowwave1D(ηn,ηm1,r); ηm1 = ηn; ηn = ηp1; end Can the same be done in Julia? Or …

---

## [Error using JuliaPro behind corporate firewall](https://discourse.julialang.org/t/error-using-juliapro-behind-corporate-firewall/22653)

<div class="topic-metadata">

**Author:** [@nukebro](https://discourse.julialang.org/u/nukebro)\
**Replies:** 4\
**Last updated:** [November 5, 2019, 3:46pm UTC](https://discourse.julialang.org/t/error-using-juliapro-behind-corporate-firewall/22653 "2019-11-05T15:46:59Z")

</div>

I recently downloaded JuliaPro and started to use the REPL through atom, but I can’t import any packages. When I try to add anything, I get the following error, (v1.0) pkg\> add JuMP Resolving package versions... ERROR…

---

## [Implement a convenient interface to keep some parameter fix for optimization](https://discourse.julialang.org/t/implement-a-convenient-interface-to-keep-some-parameter-fix-for-optimization/30745)

<div class="topic-metadata">

**Author:** [@scheidan](https://discourse.julialang.org/u/scheidan)\
**Replies:** 2\
**Last updated:** [November 5, 2019, 1:07pm UTC](https://discourse.julialang.org/t/implement-a-convenient-interface-to-keep-some-parameter-fix-for-optimization/30745 "2019-11-05T13:07:38Z")

</div>

Hi all, First I have to apologize because I could not write this questions as concise as I’d like to. My goal is to implement an interface for optimisation/inference where the user can keep certain parameters fix (i.e.…

---

## [Expectations met](https://discourse.julialang.org/t/expectations-met/30741)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 0\
**Last updated:** [November 5, 2019, 10:56am UTC](https://discourse.julialang.org/t/expectations-met/30741 "2019-11-05T10:56:27Z")

</div>

I added packages A , B and C and it just worked! :heart:

---

## [Typed equality comparison](https://discourse.julialang.org/t/typed-equality-comparison/30736)

<div class="topic-metadata">

**Author:** [@phg](https://discourse.julialang.org/u/phg)\
**Replies:** 1\
**Last updated:** [November 5, 2019, 10:18am UTC](https://discourse.julialang.org/t/typed-equality-comparison/30736 "2019-11-05T10:18:36Z")

</div>

Is there any existing function (in Base or standard libraries) to do essentially the following: ≅(x::T, y::T) where {T} = x == y ≅(x, y) = false ?

---

## [\`getproperty\` with other types than \`Symbol\`](https://discourse.julialang.org/t/getproperty-with-other-types-than-symbol/30729)

<div class="topic-metadata">

**Author:** [@phg](https://discourse.julialang.org/u/phg)\
**Replies:** 3\
**Last updated:** [November 5, 2019, 9:51am UTC](https://discourse.julialang.org/t/getproperty-with-other-types-than-symbol/30729 "2019-11-05T09:51:26Z")

</div>

I noticed that one can overload getproperty with String, not only Symbol (PyCall does this): julia\> struct Foo end julia\> import Base: getproperty julia\> getproperty(::Foo, x::Symbol) = x getproperty (generic function…

---

## [Version of a new package (\["master"\] has no known version)](https://discourse.julialang.org/t/version-of-a-new-package-master-has-no-known-version/30731)

<div class="topic-metadata">

**Author:** [@misha\_mikhasenko](https://discourse.julialang.org/u/misha_mikhasenko)\
**Replies:** 2\
**Last updated:** [November 5, 2019, 9:22am UTC](https://discourse.julialang.org/t/version-of-a-new-package-master-has-no-known-version/30731 "2019-11-05T09:22:31Z")

</div>

I have two packages under development, the second, X3872.jl, depends on the first ThreeBodyDecay.jl. While there is no specific requirement for the version of the first package, the Pkg system cannot resolve the depe…

---

## [Suppress Plot Window when output to animation](https://discourse.julialang.org/t/suppress-plot-window-when-output-to-animation/30724)

<div class="topic-metadata">

**Author:** [@natgeo-wong](https://discourse.julialang.org/u/natgeo-wong)\
**Replies:** 3\
**Last updated:** [November 5, 2019, 7:16am UTC](https://discourse.julialang.org/t/suppress-plot-window-when-output-to-animation/30724 "2019-11-05T07:16:54Z")

</div>

Hi! I’m creating an animation of several dozen to a hundred or so frames. However, for each frame I want to push to the animation there is a popup window that flashes open and then closes. Is there a way to get rid of…

---

## [Same types have different hash](https://discourse.julialang.org/t/same-types-have-different-hash/30725)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 1\
**Last updated:** [November 5, 2019, 6:41am UTC](https://discourse.julialang.org/t/same-types-have-different-hash/30725 "2019-11-05T06:41:50Z")

</div>

EDIT: Also posted as Bug report at https://github.com/JuliaLang/julia/issues/33766 Just stumbled over inconsistent == and hash for Tuple types: while Tuple{Array} == (Tuple{Array{T}} where T) we have hash(Tuple{Array…

---

## [Is it possible to improve the readdir function](https://discourse.julialang.org/t/is-it-possible-to-improve-the-readdir-function/30624)

<div class="topic-metadata">

**Author:** [@Yan](https://discourse.julialang.org/u/Yan)\
**Replies:** 3\
**Last updated:** [November 5, 2019, 4:13am UTC](https://discourse.julialang.org/t/is-it-possible-to-improve-the-readdir-function/30624 "2019-11-05T04:13:57Z")

</div>

To improve the following syntax: filter(x → occursin(r"(?i).jpg|.png", x), readdir()) into readdir(.jpg|.png)

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

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