# General Usage

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

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

**Page:** 894

---

## [Convert a DecisionTree model into a TensorFlow model](https://discourse.julialang.org/t/convert-a-decisiontree-model-into-a-tensorflow-model/20783)

<div class="topic-metadata">

**Author:** [@kimran](https://discourse.julialang.org/u/kimran)\
**Replies:** 2\
**Last updated:** [February 14, 2019, 9:51am UTC](https://discourse.julialang.org/t/convert-a-decisiontree-model-into-a-tensorflow-model/20783 "2019-02-14T09:51:07Z")

</div>

Hello Everyone :slight\_smile: Does anybody have an idea how one could convert a model coded in DecisionTree.jl into a TensorFlow model The reason I would want that is e.g. because Firebase can host TensorFlow Lite mode…

---

## [HTTP.jl in docker](https://discourse.julialang.org/t/http-jl-in-docker/20764)

<div class="topic-metadata">

**Author:** [@anj](https://discourse.julialang.org/u/anj)\
**Replies:** 3\
**Last updated:** [February 14, 2019, 8:57am UTC](https://discourse.julialang.org/t/http-jl-in-docker/20764 "2019-02-14T08:57:18Z")

</div>

\[SOLVED\] here I am trying to create a simple HTTP server running in docker and seem to be failing. Here is the simplest app: test\_http.jl using HTTP HTTP.listen() do req::HTTP.Request req.target == "/" && return HT…

---

## [Writing efficient code in monadic style](https://discourse.julialang.org/t/writing-efficient-code-in-monadic-style/20756)

<div class="topic-metadata">

**Author:** [@jonathan-laurent](https://discourse.julialang.org/u/jonathan-laurent)\
**Replies:** 1\
**Last updated:** [February 14, 2019, 7:36am UTC](https://discourse.julialang.org/t/writing-efficient-code-in-monadic-style/20756 "2019-02-14T07:36:54Z")

</div>

Hi everyone, I have been trying to write some Julia code in monadic style while keeping it as efficient as possible. I am running in a problem that can be illustrated by the following minimal example: # Simple implemen…

---

## [Chain function calls based on array](https://discourse.julialang.org/t/chain-function-calls-based-on-array/20775)

<div class="topic-metadata">

**Author:** [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Replies:** 1\
**Last updated:** [February 14, 2019, 6:44am UTC](https://discourse.julialang.org/t/chain-function-calls-based-on-array/20775 "2019-02-14T06:44:03Z")

</div>

I am trying to figure out a way to, given: addtest(a, b) = a+ b test = \[1, 2, 3, 4\] y = 10 … translate: for a in test y += addtest(a, y) end into: y = addtest(test\[1\], y) y = addtest(test\[2\], y) etc.. The reaso…

---

## [Test: absolute tolerance for vectors](https://discourse.julialang.org/t/test-absolute-tolerance-for-vectors/20776)

<div class="topic-metadata">

**Author:** [@mopg](https://discourse.julialang.org/u/mopg)\
**Replies:** 1\
**Last updated:** [February 14, 2019, 6:01am UTC](https://discourse.julialang.org/t/test-absolute-tolerance-for-vectors/20776 "2019-02-14T06:01:01Z")

</div>

Does anyone know how tolerances are computed for vectors in the Base.Test environment? I’m seeing some behavior that I can’t fully explain, see below. using Test a = rand(10) \* 1e-4 @test a ≈ zeros(size(a)) atol=1e-4 …

---

## [Reduce allocations for shaped views](https://discourse.julialang.org/t/reduce-allocations-for-shaped-views/20757)

<div class="topic-metadata">

**Author:** [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Replies:** 9\
**Last updated:** [February 13, 2019, 11:57pm UTC](https://discourse.julialang.org/t/reduce-allocations-for-shaped-views/20757 "2019-02-13T23:57:00Z")

</div>

tl;dr Reduce the allocation for foo(u,...): Inside the function, given an array u of size m\*1, get the first n=d\*d\*p elements of u where n\<m is guaranteed, and reshape it as an array f of d-by-d matrices (access as f\[j\],…

---

## [How to debug remote worker not connecting?](https://discourse.julialang.org/t/how-to-debug-remote-worker-not-connecting/20762)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 1\
**Last updated:** [February 13, 2019, 9:20pm UTC](https://discourse.julialang.org/t/how-to-debug-remote-worker-not-connecting/20762 "2019-02-13T21:20:27Z")

</div>

I’m using ClusterManagers.jl to create an ElasticManager to connect some workers on a cluster. This is working between some nodes on the cluster (manager and workers both on login nodes) but not between others (manager o…

---

## [Project level precompile caching?](https://discourse.julialang.org/t/project-level-precompile-caching/20733)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 1\
**Last updated:** [February 13, 2019, 8:29am UTC](https://discourse.julialang.org/t/project-level-precompile-caching/20733 "2019-02-13T08:29:56Z")

</div>

Every time I activate . a project it seems that a bunch of packages have to recompile. If I have multiple pull requests outstanding and a few branches of my own packages this can add up to a lot of time when switching …

---

## [Non-temporal memory IO](https://discourse.julialang.org/t/non-temporal-memory-io/20605)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 7\
**Last updated:** [February 13, 2019, 7:40am UTC](https://discourse.julialang.org/t/non-temporal-memory-io/20605 "2019-02-13T07:40:10Z")

</div>

I have just recently learned about non-temporal memory reading and writing (reading this), and I’m trying to experiment with it. I already have a basic merge-sort algorithm implemented using SIMD.jl. How could I replace …

---

## [Mmap and memory alignment](https://discourse.julialang.org/t/mmap-and-memory-alignment/20665)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 13\
**Last updated:** [February 13, 2019, 6:50am UTC](https://discourse.julialang.org/t/mmap-and-memory-alignment/20665 "2019-02-13T06:50:29Z")

</div>

I have binary files (IAEA phase space files) which contain large contiguous lists of particles. And I want to mmap these files. Here is a simplified variant of my issue: A particle consists of 5 bytes, where the first b…

---

## [How to capture stdout and stderr in \<1.1?](https://discourse.julialang.org/t/how-to-capture-stdout-and-stderr-in-1-1/20712)

<div class="topic-metadata">

**Author:** [@ianshmean](https://discourse.julialang.org/u/ianshmean)\
**Replies:** 1\
**Last updated:** [February 13, 2019, 4:04am UTC](https://discourse.julialang.org/t/how-to-capture-stdout-and-stderr-in-1-1/20712 "2019-02-13T04:04:25Z")

</div>

The following works in 1.1 but fails in earlier versions. What would be the right/best way to capture both stdout and stderr in \<1.1? stdout\_buf = IOBuffer() stderr\_buf = IOBuffer() run(pipeline(ignorestatus(cmd), stdo…

---

## [Small \<: AbstractDict implementation](https://discourse.julialang.org/t/small-abstractdict-implementation/20659)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 9\
**Last updated:** [February 13, 2019, 12:02am UTC](https://discourse.julialang.org/t/small-abstractdict-implementation/20659 "2019-02-13T00:02:15Z")

</div>

Is there a package implementing a mutable \<: AbstractDict optimized for a small number of elements? In my application, I would insert 1 element with get!(() -\> new\_record(), dict, key) in about 70–90% of cases, occasi…

---

## [Precompile weirdness with my first package](https://discourse.julialang.org/t/precompile-weirdness-with-my-first-package/20664)

<div class="topic-metadata">

**Author:** [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Replies:** 4\
**Last updated:** [February 12, 2019, 10:52pm UTC](https://discourse.julialang.org/t/precompile-weirdness-with-my-first-package/20664 "2019-02-12T22:52:38Z")

</div>

I’ve built an energy system model using JuMP and am preparing to open-source it, so as a first step I converted it into a package (named “Supergrid” for now). This is my first package so I may have messed something up, b…

---

## [Garbage collection is not working in this case on linux](https://discourse.julialang.org/t/garbage-collection-is-not-working-in-this-case-on-linux/8798)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 7\
**Last updated:** [February 12, 2019, 10:37pm UTC](https://discourse.julialang.org/t/garbage-collection-is-not-working-in-this-case-on-linux/8798 "2019-02-12T22:37:35Z")

</div>

I have a minimal working example here: # This file is saved as ts.jl struct NoTBModel norbits::Int64 positions::Dict{Vector{Int64},Vector{Matrix{Float64}}} end function NoTBModel(norbits::Int64) return NoT…

---

## [JuliaDB - split one column into n columns](https://discourse.julialang.org/t/juliadb-split-one-column-into-n-columns/20718)

<div class="topic-metadata">

**Author:** [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Replies:** 1\
**Last updated:** [February 12, 2019, 10:17pm UTC](https://discourse.julialang.org/t/juliadb-split-one-column-into-n-columns/20718 "2019-02-12T22:17:31Z")

</div>

Hi, had a question about splitting a single column into multiple new columns. Let’s say I have a table with a column like this: Table with 8434 rows, 2 columns: STATION WND ─────────────────────────────── "72473…

---

## [REPL is broken in Atom + Juno + Julia 1.1.0 new install](https://discourse.julialang.org/t/repl-is-broken-in-atom-juno-julia-1-1-0-new-install/20724)

<div class="topic-metadata">

**Author:** [@adannenberg](https://discourse.julialang.org/u/adannenberg)\
**Replies:** 0\
**Last updated:** [February 12, 2019, 9:32pm UTC](https://discourse.julialang.org/t/repl-is-broken-in-atom-juno-julia-1-1-0-new-install/20724 "2019-02-12T21:32:16Z")

</div>

I believe this was reported on a Development thread several months ago, but since then v1.1.0 has been promoted to a stable release and the issue on the Development thread seems to have gone dormant. The following is co…

---

## [Pushing the limits of recursive inlining with tuples](https://discourse.julialang.org/t/pushing-the-limits-of-recursive-inlining-with-tuples/20662)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 3\
**Last updated:** [February 12, 2019, 8:32pm UTC](https://discourse.julialang.org/t/pushing-the-limits-of-recursive-inlining-with-tuples/20662 "2019-02-12T20:32:23Z")

</div>

I am trying to understand the limits of what the compiler can do when functions are defined with a lot of compile-time information, like tuples of fixed length, or also static arrays. In this example, we have a selectio…

---

## [How to use Unicode characters in regex named groups?](https://discourse.julialang.org/t/how-to-use-unicode-characters-in-regex-named-groups/20178)

<div class="topic-metadata">

**Author:** [@D\_A](https://discourse.julialang.org/u/D_A)\
**Replies:** 3\
**Last updated:** [February 12, 2019, 8:26pm UTC](https://discourse.julialang.org/t/how-to-use-unicode-characters-in-regex-named-groups/20178 "2019-02-12T20:26:04Z")

</div>

Hello, First, I have to say I am a new user of this language and I try to know if it is suited for my needs and style. I would like to know how I can use Unicode regex named groups, because it seems it results in an er…

---

## [JuliaDB Benchmarks](https://discourse.julialang.org/t/juliadb-benchmarks/20710)

<div class="topic-metadata">

**Author:** [@joshday](https://discourse.julialang.org/u/joshday)\
**Replies:** 4\
**Last updated:** [February 12, 2019, 8:11pm UTC](https://discourse.julialang.org/t/juliadb-benchmarks/20710 "2019-02-12T20:11:55Z")

</div>

I’ve started gathering some reproducible benchmarks at GitHub - JuliaData/JuliaDB\_Benchmarks: Reproducible benchmarks for JuliaDB (huge shout out to https://github.com/oxinabox/DataDeps.jl for simplifying the reproducibl…

---

## [Concatenate and then unconcatenate](https://discourse.julialang.org/t/concatenate-and-then-unconcatenate/20538)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 10\
**Last updated:** [February 12, 2019, 8:01pm UTC](https://discourse.julialang.org/t/concatenate-and-then-unconcatenate/20538 "2019-02-12T20:01:27Z")

</div>

Is there some nice solution for vertically concatenating arrays into one matrix, and then “unconcatenate” a similar matrix to equally sized arrays as we started with? Something like this: small\_matrices = \[rand(1,2), r…

---

## [X not defined error, even though it is?](https://discourse.julialang.org/t/x-not-defined-error-even-though-it-is/20714)

<div class="topic-metadata">

**Author:** [@fusion809](https://discourse.julialang.org/u/fusion809)\
**Replies:** 5\
**Last updated:** [February 12, 2019, 6:33pm UTC](https://discourse.julialang.org/t/x-not-defined-error-even-though-it-is/20714 "2019-02-12T18:33:12Z")

</div>

Hi, I have this code: using Pkg; n = 1.0; function yfc(t) # x in here is actually t from before cos(1/3 \* t^3 + n\*t) end; const t0 = 0; const tf = 1000; const N = 10000000; const dt = 1000 / N; t = t0:dt:tf;…

---

## [Pkg version for OpenCL](https://discourse.julialang.org/t/pkg-version-for-opencl/20711)

<div class="topic-metadata">

**Author:** [@marsupialsoup](https://discourse.julialang.org/u/marsupialsoup)\
**Replies:** 1\
**Last updated:** [February 12, 2019, 4:26pm UTC](https://discourse.julialang.org/t/pkg-version-for-opencl/20711 "2019-02-12T16:26:29Z")

</div>

Hello, there is a version of OpenCL which is compatible with Julia version \> 0.7.0 (i.e. 1.0.0, and 1.1.0). Where is the version that the package manager install specified? Or would anyone be able to give a brief explan…

---

## [CPU cycles and syscalls](https://discourse.julialang.org/t/cpu-cycles-and-syscalls/20702)

<div class="topic-metadata">

**Author:** [@varleg](https://discourse.julialang.org/u/varleg)\
**Replies:** 4\
**Last updated:** [February 12, 2019, 4:19pm UTC](https://discourse.julialang.org/t/cpu-cycles-and-syscalls/20702 "2019-02-12T16:19:54Z")

</div>

Hello. I am doing a project on Julias performance compared to assembly, C and FPGA rpogramming. The thing I have noticed thus far is: Julia uses 300,000,000 cycles and 130.7 msec to calculate 2+2 C uses 290,000 cycles…

---

## [Puzzling performance when multiplying real and complex matrices](https://discourse.julialang.org/t/puzzling-performance-when-multiplying-real-and-complex-matrices/20689)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 3\
**Last updated:** [February 12, 2019, 3:12pm UTC](https://discourse.julialang.org/t/puzzling-performance-when-multiplying-real-and-complex-matrices/20689 "2019-02-12T15:12:39Z")

</div>

Perhaps the following puzzle will ring a bell for someone? Multiply mul!(H, B, Gamma): (eltype(H), eltype(B), eltype(Gamma)) = (Complex{Float64}, Complex{Float64}, Complex{Float64}) It takes 13.091117 second…

---

## [SerialPorts](https://discourse.julialang.org/t/serialports/18914)

<div class="topic-metadata">

**Author:** [@abuAnat](https://discourse.julialang.org/u/abuAnat)\
**Replies:** 6\
**Last updated:** [February 12, 2019, 2:53pm UTC](https://discourse.julialang.org/t/serialports/18914 "2019-02-12T14:53:59Z")

</div>

SerialPorts.jl doesn’t work with Julia version 1+. I need to control a laser device through a serial port. Any suggestions?

---

## [Integer-Arrays to CuArrays](https://discourse.julialang.org/t/integer-arrays-to-cuarrays/20703)

<div class="topic-metadata">

**Author:** [@DavidBerghaus](https://discourse.julialang.org/u/DavidBerghaus)\
**Replies:** 0\
**Last updated:** [February 12, 2019, 2:15pm UTC](https://discourse.julialang.org/t/integer-arrays-to-cuarrays/20703 "2019-02-12T14:15:11Z")

</div>

Is there a way to cast an Array{Int64} to CuArray{Int64}? CuArrays seems to be always transforming integers to floats: julia\> cu(\[0,1\]) 2-element CuArray{Float32,1}: 0.0 1.0 A workaround (which also proves that CuAr…

---

## [Send a function to worker processes](https://discourse.julialang.org/t/send-a-function-to-worker-processes/20696)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 2\
**Last updated:** [February 12, 2019, 1:57pm UTC](https://discourse.julialang.org/t/send-a-function-to-worker-processes/20696 "2019-02-12T13:57:51Z")

</div>

Is there an easy way to send a function that is already defined to all worker processes? E.g.: julia\> f(x) = x + 1 julia\> @everywhere f = $f

---

## [Way to programmatically clear last println() statement in Jupyter cell?](https://discourse.julialang.org/t/way-to-programmatically-clear-last-println-statement-in-jupyter-cell/3582)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 2\
**Last updated:** [February 12, 2019, 11:16am UTC](https://discourse.julialang.org/t/way-to-programmatically-clear-last-println-statement-in-jupyter-cell/3582 "2019-02-12T11:16:26Z")

</div>

Is there a way to remove the output of a Jupyter cell (equivalent of what gets done when you run the cell for the first time)? This would allow you to use println(...) and the like inside @manipulate clauses Otherwise …

---

## [Implementing a function from an interface, multiple dispatch](https://discourse.julialang.org/t/implementing-a-function-from-an-interface-multiple-dispatch/20694)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 3\
**Last updated:** [February 12, 2019, 8:14am UTC](https://discourse.julialang.org/t/implementing-a-function-from-an-interface-multiple-dispatch/20694 "2019-02-12T08:14:03Z")

</div>

I am reading the source of CSVFiles.jl and I see it implements the TableTraits interface, which in Julia, is the defacto way of describing table data. I see functions like function TableTraits.getiterator(file::CSVFile)…

---

## [Simplest way to define an efficient \`==\` on a new type](https://discourse.julialang.org/t/simplest-way-to-define-an-efficient-on-a-new-type/20679)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 4\
**Last updated:** [February 11, 2019, 7:29pm UTC](https://discourse.julialang.org/t/simplest-way-to-define-an-efficient-on-a-new-type/20679 "2019-02-11T19:29:24Z")

</div>

Because of the issues with the default definition of ==, I often find myself having to define == to be extra safe. It would be nice if writing the function were really simple, I’d like to do typeof(t1) == typeof(t2) ||…

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

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