# General Usage

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

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

**Page:** 899

---

## [Interpolating INTO a square grid FROM nonsquare or nonuniform positions](https://discourse.julialang.org/t/interpolating-into-a-square-grid-from-nonsquare-or-nonuniform-positions/20095)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 0\
**Last updated:** [January 25, 2019, 3:52pm UTC](https://discourse.julialang.org/t/interpolating-into-a-square-grid-from-nonsquare-or-nonuniform-positions/20095 "2019-01-25T15:52:41Z")

</div>

Hello, I have a Vector Ψ that is defined on the two dimensional plane and has values at some specific positions, contained in a vector P as e.g. 2-tuples or SVector{2}. For example: P 40492-element Array{SArray{Tuple{2…

---

## [Relais quantique](https://discourse.julialang.org/t/relais-quantique/19858)

<div class="topic-metadata">

**Author:** [@marouane](https://discourse.julialang.org/u/marouane)\
**Replies:** 14\
**Last updated:** [January 25, 2019, 3:50pm UTC](https://discourse.julialang.org/t/relais-quantique/19858 "2019-01-25T15:50:11Z")

</div>

Hi Julia Community, these past couple of months i’ve been trying to run a code with some packages a i have started with the functions or the packages in order to call them in the main code, the packages are: utility, di…

---

## [Taking a derivative of nested object using lens from Setfield.jl](https://discourse.julialang.org/t/taking-a-derivative-of-nested-object-using-lens-from-setfield-jl/20078)

<div class="topic-metadata">

**Author:** [@tkf](https://discourse.julialang.org/u/tkf)\
**Replies:** 0\
**Last updated:** [January 25, 2019, 10:28am UTC](https://discourse.julialang.org/t/taking-a-derivative-of-nested-object-using-lens-from-setfield-jl/20078 "2019-01-25T10:28:51Z")

</div>

This is my response to @ChrisRackauckas’s comment: in New Package PseudoArcLengthContinuation. I don’t want to hijack the package announcement topic of @rveltz’s awesome package PseudoArcLengthContinuation.jl. So I’m…

---

## [How to create a vector of variable length in julia?](https://discourse.julialang.org/t/how-to-create-a-vector-of-variable-length-in-julia/20060)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 7\
**Last updated:** [January 25, 2019, 7:44am UTC](https://discourse.julialang.org/t/how-to-create-a-vector-of-variable-length-in-julia/20060 "2019-01-25T07:44:05Z")

</div>

I’d like to create a vector and then add value to it one by one. The thing is, I do not know how many values I’d like to add in total until the process is done. Is this doable using julia vector? Or do I need another dat…

---

## [Translating a C type with Julia embedded to a Julia type of the same layout](https://discourse.julialang.org/t/translating-a-c-type-with-julia-embedded-to-a-julia-type-of-the-same-layout/20065)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 4\
**Last updated:** [January 25, 2019, 12:34am UTC](https://discourse.julialang.org/t/translating-a-c-type-with-julia-embedded-to-a-julia-type-of-the-same-layout/20065 "2019-01-25T00:34:30Z")

</div>

Hi, I am trying to figure out the Julia equivalents of the types in this Julia embedded struct https://github.com/JuliaLang/julia/blob/master/src/julia.h#L1615. Is there any mapping list (couldn’t find in the docs) of w…

---

## [Wrote a macro to make ccall look a little more like Julia. Need an opinion on the return type placement](https://discourse.julialang.org/t/wrote-a-macro-to-make-ccall-look-a-little-more-like-julia-need-an-opinion-on-the-return-type-placement/19373)

<div class="topic-metadata">

**Author:** [@ninjaaron](https://discourse.julialang.org/u/ninjaaron)\
**Replies:** 32\
**Last updated:** [January 24, 2019, 9:48pm UTC](https://discourse.julialang.org/t/wrote-a-macro-to-make-ccall-look-a-little-more-like-julia-need-an-opinion-on-the-return-type-placement/19373 "2019-01-24T21:48:21Z")

</div>

I wrote this macro that lets you put the types of the C arguments in the places where you’d put type annotations in a Julia function definition. Initially, I had the return type at the end of the function, as you would h…

---

## [The advantage of using a length-1-vector instead of an int/float variable (if any)?](https://discourse.julialang.org/t/the-advantage-of-using-a-length-1-vector-instead-of-an-int-float-variable-if-any/20035)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 8\
**Last updated:** [January 24, 2019, 8:17pm UTC](https://discourse.julialang.org/t/the-advantage-of-using-a-length-1-vector-instead-of-an-int-float-variable-if-any/20035 "2019-01-24T20:17:06Z")

</div>

t = Vector{Float}(1) # t is a Float-vector of length 1, i.e., it's a one-element vector initMessage(t, msg) = doPrint && (t\[1\] = time(); print(msg)) # a simple function to check the progress of #running the code. Logic:…

---

## [Custom indexing for a named array](https://discourse.julialang.org/t/custom-indexing-for-a-named-array/20014)

<div class="topic-metadata">

**Author:** [@yurivish](https://discourse.julialang.org/u/yurivish)\
**Replies:** 9\
**Last updated:** [January 24, 2019, 7:38pm UTC](https://discourse.julialang.org/t/custom-indexing-for-a-named-array/20014 "2019-01-24T19:38:14Z")

</div>

I am playing around with a custom named array and trying to figure out how to make it play nicely with custom indices, such as those in @mbauman’s fantastic InvertedIndices package. Here’s a toy example, simple as I cou…

---

## [Package for approximate small quantiles](https://discourse.julialang.org/t/package-for-approximate-small-quantiles/20046)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 1\
**Last updated:** [January 24, 2019, 6:30pm UTC](https://discourse.julialang.org/t/package-for-approximate-small-quantiles/20046 "2019-01-24T18:30:33Z")

</div>

Anybody knows about a package that might be used for fast estimation of approximated quantiles? I’m looking for an efficient method that might be used with very large datasets, without having to store all the values (I c…

---

## [How does the fadjlist field of simplegraphs in LightGraphs package work?](https://discourse.julialang.org/t/how-does-the-fadjlist-field-of-simplegraphs-in-lightgraphs-package-work/19972)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 10\
**Last updated:** [January 24, 2019, 5:05pm UTC](https://discourse.julialang.org/t/how-does-the-fadjlist-field-of-simplegraphs-in-lightgraphs-package-work/19972 "2019-01-24T17:05:34Z")

</div>

I think this is really strange. ;( \_/ |\\\_\_'\_|\_|\_|\\\_\_'\_| | Official http://julialang.org/ release |\_\_/ | x86\_64-pc-linux-gnu julia\> using LightGraphs julia\> g=LightGraphs.Grid(\[2,2\]) {4, 4} undire…

---

## [DiffEqFlux: neural\_ode stops prematurely](https://discourse.julialang.org/t/diffeqflux-neural-ode-stops-prematurely/19995)

<div class="topic-metadata">

**Author:** [@fastwave](https://discourse.julialang.org/u/fastwave)\
**Replies:** 4\
**Last updated:** [January 24, 2019, 3:56pm UTC](https://discourse.julialang.org/t/diffeqflux-neural-ode-stops-prematurely/19995 "2019-01-24T15:56:45Z")

</div>

I am trying to replicate the example in the README of DiffEqFlux https://github.com/JuliaDiffEq/DiffEqFlux.jl. Calling the neural\_ode generated function makes Julia exit before training could begin. The code is using …

---

## [Feedforward NN using StaticArrays with no allocation](https://discourse.julialang.org/t/feedforward-nn-using-staticarrays-with-no-allocation/20036)

<div class="topic-metadata">

**Author:** [@bender9000](https://discourse.julialang.org/u/bender9000)\
**Replies:** 5\
**Last updated:** [January 24, 2019, 3:02pm UTC](https://discourse.julialang.org/t/feedforward-nn-using-staticarrays-with-no-allocation/20036 "2019-01-24T15:02:20Z")

</div>

I am writing a performance sensitive application that cannot have any allocations which also runs inference using a multi layered perceptron. The dimensions of each layers output in Neural Network are fairly small and be…

---

## [What is rand(distrSamp, n) for distrSamp being a probability distribution sampler?](https://discourse.julialang.org/t/what-is-rand-distrsamp-n-for-distrsamp-being-a-probability-distribution-sampler/20027)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 0\
**Last updated:** [January 24, 2019, 10:04am UTC](https://discourse.julialang.org/t/what-is-rand-distrsamp-n-for-distrsamp-being-a-probability-distribution-sampler/20027 "2019-01-24T10:04:57Z")

</div>

In the Distribution package, suppose distrSamp is of type probability distribution sampler. What exactly does the functionrand(distrSamp,n) do ? What’s the returned value of this function? Or is it because of method disp…

---

## [Going beyond a single core execution with FluxML (no CUDA)](https://discourse.julialang.org/t/going-beyond-a-single-core-execution-with-fluxml-no-cuda/20026)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 3\
**Last updated:** [January 24, 2019, 10:21am UTC](https://discourse.julialang.org/t/going-beyond-a-single-core-execution-with-fluxml-no-cuda/20026 "2019-01-24T10:21:50Z")

</div>

I tried a few examples from FluxML model-zoo and only one core is getting fully utilized on my 4 core Intel CPU with integrated GPU. Is there any cure for that, other than buying Nvidia GPU? Optimally, I would like to h…

---

## [Typestability in matrix multiplication, intended behaviour or bug?](https://discourse.julialang.org/t/typestability-in-matrix-multiplication-intended-behaviour-or-bug/19969)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 10\
**Last updated:** [January 24, 2019, 9:12am UTC](https://discourse.julialang.org/t/typestability-in-matrix-multiplication-intended-behaviour-or-bug/19969 "2019-01-24T09:12:23Z")

</div>

The first one seems intended behaviour, is the second one a bug? julia\> rand(3, 3) \* \[1.0, missing, missing\] 3-element Array{Union{Missing, Float64},1}: missing missing missing julia\> rand(3, 3) \* \[1.0f0, missing, m…

---

## [UndefVarError: Using \`TypeVar\` both in argument type and return type](https://discourse.julialang.org/t/undefvarerror-using-typevar-both-in-argument-type-and-return-type/20015)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 2\
**Last updated:** [January 24, 2019, 4:54am UTC](https://discourse.julialang.org/t/undefvarerror-using-typevar-both-in-argument-type-and-return-type/20015 "2019-01-24T04:54:05Z")

</div>

I have three methods julia\> f(::T) where {T \<: Int} = 2 f (generic function with 1 method) julia\> f(::T)::T where {T \<: Float64} = 2.0 ERROR: UndefVarError: T not defined Stacktrace: \[1\] top-level scope at none:0 jul…

---

## [Precompilation problem setting const Ref{Ptr} in a Module](https://discourse.julialang.org/t/precompilation-problem-setting-const-ref-ptr-in-a-module/19988)

<div class="topic-metadata">

**Author:** [@PhilipV](https://discourse.julialang.org/u/PhilipV)\
**Replies:** 1\
**Last updated:** [January 24, 2019, 1:30am UTC](https://discourse.julialang.org/t/precompilation-problem-setting-const-ref-ptr-in-a-module/19988 "2019-01-24T01:30:06Z")

</div>

Hi everyone, I’m working on a PR to extend MPI.jl, which is a Julia package ccalling into a C/Fortran library. I need to store inside my module a constant Ref{Ptr{Cvoid}}. Since the precompiler actually clears the valu…

---

## [Segfault compiling code using PyCall](https://discourse.julialang.org/t/segfault-compiling-code-using-pycall/20010)

<div class="topic-metadata">

**Author:** [@dhazeghi](https://discourse.julialang.org/u/dhazeghi)\
**Replies:** 1\
**Last updated:** [January 24, 2019, 12:44am UTC](https://discourse.julialang.org/t/segfault-compiling-code-using-pycall/20010 "2019-01-24T00:44:47Z")

</div>

Hi folks, I’m trying to get a compiled binary out of Julia 1.1 for a program that makes use of PyCall, but Julia is segfaulting during the compilation. Any recommendations how I might go about debugging this? Are ther…

---

## [Large Julia RSS usage even after calling gc()](https://discourse.julialang.org/t/large-julia-rss-usage-even-after-calling-gc/19499)

<div class="topic-metadata">

**Author:** [@dhazeghi](https://discourse.julialang.org/u/dhazeghi)\
**Replies:** 1\
**Last updated:** [January 24, 2019, 12:09am UTC](https://discourse.julialang.org/t/large-julia-rss-usage-even-after-calling-gc/19499 "2019-01-24T00:09:06Z")

</div>

Hi folks, I have a program running under Julia 0.6/Ubuntu Linux that allocates a fair amount of memory during its runtime (~13GB or so, according to @time - mostly arrays, a few SharedArrays as well). After it finishes…

---

## [Latex font not showing in pyplot](https://discourse.julialang.org/t/latex-font-not-showing-in-pyplot/19996)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 4\
**Last updated:** [January 23, 2019, 11:00pm UTC](https://discourse.julialang.org/t/latex-font-not-showing-in-pyplot/19996 "2019-01-23T23:00:07Z")

</div>

Dear all, I’m trying to use pyplot to build some plots for my presentations, but fail to make it understand that latex text must use standard latex fonts. If you run the following code to generate the plot, look at the …

---

## [Could Transducers help here?](https://discourse.julialang.org/t/could-transducers-help-here/19986)

<div class="topic-metadata">

**Author:** [@ffevotte](https://discourse.julialang.org/u/ffevotte)\
**Replies:** 4\
**Last updated:** [January 23, 2019, 9:02pm UTC](https://discourse.julialang.org/t/could-transducers-help-here/19986 "2019-01-23T21:02:00Z")

</div>

I’m trying to get a finer understanding of where Transducers.jl can help, especially by comparison to explicit loops and iterators. Here is a small example (freely adapted from advent of code, day 6, part2). A version …

---

## [A convenient script to plot benchmarks and make comparisons](https://discourse.julialang.org/t/a-convenient-script-to-plot-benchmarks-and-make-comparisons/20004)

<div class="topic-metadata">

**Author:** [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Replies:** 0\
**Last updated:** [January 23, 2019, 8:38pm UTC](https://discourse.julialang.org/t/a-convenient-script-to-plot-benchmarks-and-make-comparisons/20004 "2019-01-23T20:38:49Z")

</div>

The benchmark plotting presented at the official site looks so cool, and I want to make it conveniently, so I made this: using Benchmarkplotting using Gadfly using Statistics cases = \[ :range100 =\> 1:100, :ra…

---

## [Refactoring searching through a time-series](https://discourse.julialang.org/t/refactoring-searching-through-a-time-series/19530)

<div class="topic-metadata">

**Author:** [@Seanny123](https://discourse.julialang.org/u/Seanny123)\
**Replies:** 10\
**Last updated:** [January 23, 2019, 6:49pm UTC](https://discourse.julialang.org/t/refactoring-searching-through-a-time-series/19530 "2019-01-23T18:49:51Z")

</div>

I’ve written a short script to search a time-series for a specific sub-sequence. I’m having trouble refactoring the code. I’ve linked to question on Code Review StackExchange if someone wants to do a complete review. How…

---

## [ANN: Anyone need my 2.7x faster factorial (or gamma) function?](https://discourse.julialang.org/t/ann-anyone-need-my-2-7x-faster-factorial-or-gamma-function/19926)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 22\
**Last updated:** [January 23, 2019, 6:23pm UTC](https://discourse.julialang.org/t/ann-anyone-need-my-2-7x-faster-factorial-or-gamma-function/19926 "2019-01-23T18:23:16Z")

</div>

I was looking into faster code generation (not factorial specifically, but started with that function). It took a lot longer than it seemed it would at first. Anyway the Julia PR was closed, but I have more recent code,…

---

## ['export' dictionary keys as variables](https://discourse.julialang.org/t/export-dictionary-keys-as-variables/19968)

<div class="topic-metadata">

**Author:** [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Replies:** 6\
**Last updated:** [January 23, 2019, 5:16pm UTC](https://discourse.julialang.org/t/export-dictionary-keys-as-variables/19968 "2019-01-23T17:16:55Z")

</div>

Given a dictionary, how to create variables that point to the keys’ value. This is easy to do manually: dict = Dict(:a =\> "newton", :b =\> "einstein", :c =\> "hawking") a = dict\[:a\] a # =\> "newton" b = dict\[:b\] b # =\> …

---

## [Are the Julia binaries GPL-free?](https://discourse.julialang.org/t/are-the-julia-binaries-gpl-free/19993)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 7\
**Last updated:** [January 23, 2019, 4:59pm UTC](https://discourse.julialang.org/t/are-the-julia-binaries-gpl-free/19993 "2019-01-23T16:59:15Z")

</div>

It’s unclear to me if Julia \[1.1\] is compiled with USE\_GPL\_LIBS (the docs only say it’s possible to compile without): https://github.com/JuliaLang/julia/search?q=USE\_GPL\_LIBS&unscoped\_q=USE\_GPL\_LIBS It seems SuiteSpars…

---

## [Polylib Package](https://discourse.julialang.org/t/polylib-package/19994)

<div class="topic-metadata">

**Author:** [@marouane](https://discourse.julialang.org/u/marouane)\
**Replies:** 0\
**Last updated:** [January 23, 2019, 4:57pm UTC](https://discourse.julialang.org/t/polylib-package/19994 "2019-01-23T16:57:50Z")

</div>

hi, i am cureently working with Julia 0.7 and i want to download the Polylib Package and it doesnt want to and this is what the terminal shows me: ERROR: The following package names could not be resolved: PolyLib (not…

---

## [Error running model-zoo example cifar10.jl of the Flux package](https://discourse.julialang.org/t/error-running-model-zoo-example-cifar10-jl-of-the-flux-package/19991)

<div class="topic-metadata">

**Author:** [@arnaudmgh](https://discourse.julialang.org/u/arnaudmgh)\
**Replies:** 3\
**Last updated:** [January 23, 2019, 4:34pm UTC](https://discourse.julialang.org/t/error-running-model-zoo-example-cifar10-jl-of-the-flux-package/19991 "2019-01-23T16:34:51Z")

</div>

I tried with \]instantiate first, and without, same result. Seems to be a problem with conversion to Float32 of Forward.Diff.Dual. Not sure how to go about it, any help would be appreciated. julia\> include("cifar10.jl") …

---

## [Problems regarding test and module imports](https://discourse.julialang.org/t/problems-regarding-test-and-module-imports/19943)

<div class="topic-metadata">

**Author:** [@srb](https://discourse.julialang.org/u/srb)\
**Replies:** 6\
**Last updated:** [January 23, 2019, 3:27pm UTC](https://discourse.julialang.org/t/problems-regarding-test-and-module-imports/19943 "2019-01-23T15:27:32Z")

</div>

Hello, I’m having some trouble structuring my project so that i can easily run tests. Right now I have the following structure: Project/ src/ MyStruct.jl test/ MyStruct-test.jl runtests…

---

## [Documenter.jl: deploying skipped tags](https://discourse.julialang.org/t/documenter-jl-deploying-skipped-tags/19965)

<div class="topic-metadata">

**Author:** [@lostella](https://discourse.julialang.org/u/lostella)\
**Replies:** 4\
**Last updated:** [January 23, 2019, 2:24pm UTC](https://discourse.julialang.org/t/documenter-jl-deploying-skipped-tags/19965 "2019-01-23T14:24:37Z")

</div>

What is the best way of deploying documentation for tags that were (for some reason) skipped? I tagged some versions of a package when, probably, something either in Travis or in the docs folder was misconfigured. As a …

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

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