# General Usage

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

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

**Page:** 927

---

## [UndefVarError: .\* not defined](https://discourse.julialang.org/t/undefvarerror-not-defined/16517)

<div class="topic-metadata">

**Author:** [@Yunde](https://discourse.julialang.org/u/Yunde)\
**Replies:** 17\
**Last updated:** [October 20, 2018, 10:38pm UTC](https://discourse.julialang.org/t/undefvarerror-not-defined/16517 "2018-10-20T22:38:12Z")

</div>

I checked many of the topics related to “UndefVarError” already but did not find the answer to my problem. Here is the example code: macro IxConfig(expr::Expr) if (expr.head == Symbol("struct")) ps = \[\]; …

---

## [Experimenting and developing unregistered packages](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563)

<div class="topic-metadata">

**Author:** [@lostella](https://discourse.julialang.org/u/lostella)\
**Replies:** 8\
**Last updated:** [October 20, 2018, 7:43pm UTC](https://discourse.julialang.org/t/experimenting-and-developing-unregistered-packages/16563 "2018-10-20T19:43:48Z")

</div>

Hi all, I’m trying to use the following workflow to collaboratively experiment with and develop a package. The setup is as follows: I have a project directory with Project.toml and a script script.jl that runs an experi…

---

## [Is something like reversed Dict? findall(x -\> x=="house", cc) is to slow:/](https://discourse.julialang.org/t/is-something-like-reversed-dict-findall-x-x-house-cc-is-to-slow/16443)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 25\
**Last updated:** [October 20, 2018, 7:42pm UTC](https://discourse.julialang.org/t/is-something-like-reversed-dict-findall-x-x-house-cc-is-to-slow/16443 "2018-10-20T19:42:05Z")

</div>

Dict can find one val by key \> julia\> D=Dict("a"=\>1,"b"=\>1,"c"=\>2) \> Dict{String,Int64} with 3 entries: \> "c" =\> 2 \> "b" =\> 1 \> "a" =\> 1 \> \> julia\> get(D,"a",false) \> 1 I need something fast in oposite side: som…

---

## [Custom array for 3D-Matrix operations 4x4](https://discourse.julialang.org/t/custom-array-for-3d-matrix-operations-4x4/16568)

<div class="topic-metadata">

**Author:** [@Ralf\_Dietrich](https://discourse.julialang.org/u/Ralf_Dietrich)\
**Replies:** 8\
**Last updated:** [October 20, 2018, 3:50pm UTC](https://discourse.julialang.org/t/custom-array-for-3d-matrix-operations-4x4/16568 "2018-10-20T15:50:09Z")

</div>

I need a structure like that, as a custom array 4x4 for 3D-calculations: Matrix3D = zeros(Float64, 4, 4) I tried to define it like that, but i stuck: struct Matrix3D \<: Abstract??? ??? end to use it: myMatrix3D = …

---

## [Function change](https://discourse.julialang.org/t/function-change/16553)

<div class="topic-metadata">

**Author:** [@lannisite110](https://discourse.julialang.org/u/lannisite110)\
**Replies:** 2\
**Last updated:** [October 20, 2018, 1:29pm UTC](https://discourse.julialang.org/t/function-change/16553 "2018-10-20T13:29:29Z")

</div>

this is the function. x is a 4 dim arrays. y is 2 dim arrays. i want to push data with size of batchsize to data arrays. however the error says that cget isn’t defined. so do you know the function names that cget chan…

---

## [The function change for compiler](https://discourse.julialang.org/t/the-function-change-for-compiler/16564)

<div class="topic-metadata">

**Author:** [@lannisite110](https://discourse.julialang.org/u/lannisite110)\
**Replies:** 1\
**Last updated:** [October 20, 2018, 12:07pm UTC](https://discourse.julialang.org/t/the-function-change-for-compiler/16564 "2018-10-20T12:07:14Z")

</div>

I want to use compile function to initialize vgg\_model with parameter extracted from vgg-verydeep-16.mat using Knet file = matread("vgg-verydeep-16.mat") global vgg = compile(:vgg\_model; weights=file) ERROR: LoadError:…

---

## [A usage about multi-dimension arrays](https://discourse.julialang.org/t/a-usage-about-multi-dimension-arrays/16548)

<div class="topic-metadata">

**Author:** [@lannisite110](https://discourse.julialang.org/u/lannisite110)\
**Replies:** 6\
**Last updated:** [October 20, 2018, 11:55am UTC](https://discourse.julialang.org/t/a-usage-about-multi-dimension-arrays/16548 "2018-10-20T11:55:02Z")

</div>

i try to find that how to using multi-dimension arrays minus a constant in julia1.0 documents, but i fail. so can you help me? thanks

---

## [What is the best way to concat an array of tensors](https://discourse.julialang.org/t/what-is-the-best-way-to-concat-an-array-of-tensors/16560)

<div class="topic-metadata">

**Author:** [@Xiucheng\_Li](https://discourse.julialang.org/u/Xiucheng_Li)\
**Replies:** 4\
**Last updated:** [October 20, 2018, 11:47am UTC](https://discourse.julialang.org/t/what-is-the-best-way-to-concat-an-array-of-tensors/16560 "2018-10-20T11:47:36Z")

</div>

Assuming I have an array of tensors, I would like to concat them along their fourth dimension such as xs = \[rand(28, 28, 1, 1) for \_ in 1:60000\] cat(xs..., dims=4) |\> size It will take up to 40GB memory and will not s…

---

## [Dispatch on content from file](https://discourse.julialang.org/t/dispatch-on-content-from-file/16541)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 6\
**Last updated:** [October 20, 2018, 8:04am UTC](https://discourse.julialang.org/t/dispatch-on-content-from-file/16541 "2018-10-20T08:04:01Z")

</div>

This is a really open-ended question but I hope to get some wisdom from those that found a solution that you’re content with. I need to process data in very distinct and different ways dependent on the content of some d…

---

## [Group of variables to named tuple: built-in solution?](https://discourse.julialang.org/t/group-of-variables-to-named-tuple-built-in-solution/16531)

<div class="topic-metadata">

**Author:** [@jtackm](https://discourse.julialang.org/u/jtackm)\
**Replies:** 7\
**Last updated:** [October 19, 2018, 10:59pm UTC](https://discourse.julialang.org/t/group-of-variables-to-named-tuple-built-in-solution/16531 "2018-10-19T22:59:29Z")

</div>

I regularly have the use case that I would like to convert a group of variable references to a named tuple with the reference names as keys and the referenced values as vals (usually to improve self-documentation of code…

---

## [Provide output message during build (0.7/1.x)](https://discourse.julialang.org/t/provide-output-message-during-build-0-7-1-x/16497)

<div class="topic-metadata">

**Author:** [@jjstickel](https://discourse.julialang.org/u/jjstickel)\
**Replies:** 2\
**Last updated:** [October 19, 2018, 10:21pm UTC](https://discourse.julialang.org/t/provide-output-message-during-build-0-7-1-x/16497 "2018-10-19T22:21:41Z")

</div>

I’m trying to provide a warning/information message during the build of a package (via build.jl). The problem is that the output goes to build.log rather than the REPL, unless there is an error. How can I force output to…

---

## [Base.next?](https://discourse.julialang.org/t/base-next/16534)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 5\
**Last updated:** [October 19, 2018, 9:21pm UTC](https://discourse.julialang.org/t/base-next/16534 "2018-10-19T21:21:58Z")

</div>

My code was written with Base.next and now it is not working with 1.0 Where can I learn the latest iterator interface and what I need to change. Thanks

---

## [Pkg.test does not recognize package dependencies](https://discourse.julialang.org/t/pkg-test-does-not-recognize-package-dependencies/16545)

<div class="topic-metadata">

**Author:** [@danielc](https://discourse.julialang.org/u/danielc)\
**Replies:** 3\
**Last updated:** [October 19, 2018, 9:01pm UTC](https://discourse.julialang.org/t/pkg-test-does-not-recognize-package-dependencies/16545 "2018-10-19T21:01:34Z")

</div>

Hello, I am writing a Julia package. I already have a few releases, so I got the basics working. I just added another function and I added the new dependency on Statistics, like so: (Planets) pkg\> resolve Resolving pa…

---

## [Make function arguments positional or keyword](https://discourse.julialang.org/t/make-function-arguments-positional-or-keyword/2984)

<div class="topic-metadata">

**Author:** [@sbohor3](https://discourse.julialang.org/u/sbohor3)\
**Replies:** 33\
**Last updated:** [October 19, 2018, 8:23pm UTC](https://discourse.julialang.org/t/make-function-arguments-positional-or-keyword/2984 "2018-10-19T20:23:57Z")

</div>

How do I create a function that can take either positional or keyword arguments? Right now, I have a function that takes keyword arguments. But, I would to revise it to take either positional or keyword arguments. Thanks…

---

## [Datetimes and SQLite.jl encoding](https://discourse.julialang.org/t/datetimes-and-sqlite-jl-encoding/16412)

<div class="topic-metadata">

**Author:** [@mosiman](https://discourse.julialang.org/u/mosiman)\
**Replies:** 4\
**Last updated:** [October 19, 2018, 12:12pm UTC](https://discourse.julialang.org/t/datetimes-and-sqlite-jl-encoding/16412 "2018-10-19T12:12:24Z")

</div>

Hey all, hopefully this is the right place to post this question since I have no idea if its a lack of my own knowledge, or SQLite.jl, SQLite, or encodings in general. I did some work a while ago in Julia, and used the …

---

## [Where is the FFT?](https://discourse.julialang.org/t/where-is-the-fft/16512)

<div class="topic-metadata">

**Author:** [@abcsds](https://discourse.julialang.org/u/abcsds)\
**Replies:** 5\
**Last updated:** [October 19, 2018, 11:05am UTC](https://discourse.julialang.org/t/where-is-the-fft/16512 "2018-10-19T11:05:51Z")

</div>

Hi, this might seem silly, but I can’t seem to find the FFT, neither on the documentation, nor on the Base library. When searching through the help system I get this: help?\> fft search: Cptrdiff\_t findfirst fieldoffset …

---

## [Iterating over an Enum](https://discourse.julialang.org/t/iterating-over-an-enum/16502)

<div class="topic-metadata">

**Author:** [@grahamstark](https://discourse.julialang.org/u/grahamstark)\
**Replies:** 2\
**Last updated:** [October 19, 2018, 9:39am UTC](https://discourse.julialang.org/t/iterating-over-an-enum/16502 "2018-10-19T09:39:33Z")

</div>

Hi, quick question that I can’t see an answer to in the docs: how can I iterate over the members of an Enum? So, I have: @enum DistanceFunctionType chi\_square d\_and\_s\_type\_a d\_and\_s\_type\_b and I want to write someth…

---

## [Calling a C function which return a pointer to struct](https://discourse.julialang.org/t/calling-a-c-function-which-return-a-pointer-to-struct/16409)

<div class="topic-metadata">

**Author:** [@Hongliang\_Yang](https://discourse.julialang.org/u/Hongliang_Yang)\
**Replies:** 3\
**Last updated:** [October 19, 2018, 9:27am UTC](https://discourse.julialang.org/t/calling-a-c-function-which-return-a-pointer-to-struct/16409 "2018-10-19T09:27:21Z")

</div>

Hi Julia users, I want to call a C function which return a pointer to struct, such as typedef struct { int n\_atoms; int \*mapping\_to\_primitive; double transformation\_matrix\[3\]\[3\]; double origin\_shift\[3\]; int (…

---

## [Precompilation issue with any module that wraps Plots](https://discourse.julialang.org/t/precompilation-issue-with-any-module-that-wraps-plots/16514)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 4\
**Last updated:** [October 19, 2018, 7:53am UTC](https://discourse.julialang.org/t/precompilation-issue-with-any-module-that-wraps-plots/16514 "2018-10-19T07:53:45Z")

</div>

Hi all, I’m on Julia Version 0.7.0 (2018-08-08 06:46 UTC), with Plots v0.19.3 and GR v0.34.1, both of which installed and pre-compiled without a problem and can produce and save plots with plot and savefig without any i…

---

## [Parallel computing, invalid checksum in cache file](https://discourse.julialang.org/t/parallel-computing-invalid-checksum-in-cache-file/16373)

<div class="topic-metadata">

**Author:** [@adamslc](https://discourse.julialang.org/u/adamslc)\
**Replies:** 4\
**Last updated:** [October 19, 2018, 2:55am UTC](https://discourse.julialang.org/t/parallel-computing-invalid-checksum-in-cache-file/16373 "2018-10-19T02:55:45Z")

</div>

I’m trying to do some simulations in Julia using a large cluster, but when I try to load packages, I get ArgumentError: invalid checksum in cache file /home/.../. Here is how I am loading my packages: using Distributed …

---

## [Is it possible to \`reinterpret\` a \`UInt64\` as \`Array{UInt16,1}\`](https://discourse.julialang.org/t/is-it-possible-to-reinterpret-a-uint64-as-array-uint16-1/16516)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 1\
**Last updated:** [October 19, 2018, 2:34am UTC](https://discourse.julialang.org/t/is-it-possible-to-reinterpret-a-uint64-as-array-uint16-1/16516 "2018-10-19T02:34:34Z")

</div>

One can do reinterpret(UInt64, rand(UInt16,4)) to convert an array of UInt64 into a UInt64 but if there a function to do a reverse of that? I tried reinterpret(Array{UInt16,1}, rand(UInt64)) and it doesn’t work. I ca…

---

## [Julia Multithreading (Threads.@threads) and Travis CI](https://discourse.julialang.org/t/julia-multithreading-threads-threads-and-travis-ci/16468)

<div class="topic-metadata">

**Author:** [@juthohaegeman](https://discourse.julialang.org/u/juthohaegeman)\
**Replies:** 2\
**Last updated:** [October 18, 2018, 8:17pm UTC](https://discourse.julialang.org/t/julia-multithreading-threads-threads-and-travis-ci/16468 "2018-10-18T20:17:10Z")

</div>

Hi all, in a number of packages I started experimenting with code that exploits Julia’s multithreading facilities, i.e. mainly the Threads.@threads macro. I am a bit confused as to how to enable automatic testing of my …

---

## [package installation issue: julia 1.0.1 (pro)](https://discourse.julialang.org/t/package-installation-issue-julia-1-0-1-pro/16362)

<div class="topic-metadata">

**Author:** [@Neurovium](https://discourse.julialang.org/u/Neurovium)\
**Replies:** 2\
**Last updated:** [October 18, 2018, 7:22pm UTC](https://discourse.julialang.org/t/package-installation-issue-julia-1-0-1-pro/16362 "2018-10-18T19:22:21Z")

</div>

Hi all, I have used StatPlots and Query (from Queryverse) for plotting data from dataframes (DataFrame) in julia 1 and 0.7. Now, I have installed Julia pro (linux) and when I try to add these (unregistered) packages, I …

---

## [Importing default functions](https://discourse.julialang.org/t/importing-default-functions/16494)

<div class="topic-metadata">

**Author:** [@VitalyRomanov](https://discourse.julialang.org/u/VitalyRomanov)\
**Replies:** 2\
**Last updated:** [October 18, 2018, 3:44pm UTC](https://discourse.julialang.org/t/importing-default-functions/16494 "2018-10-18T15:44:51Z")

</div>

I have a fresh official installation of Julia 1.0.1 on OS X. Whenever I run Julia, no default functions are available julia\> Pkg ERROR: UndefVarError: Pkg not defined julia\> import Pkg julia\> Pkg Pkg julia\> mean E…

---

## [Issues with In Place Transformations and Scope](https://discourse.julialang.org/t/issues-with-in-place-transformations-and-scope/16478)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 3\
**Last updated:** [October 18, 2018, 3:13pm UTC](https://discourse.julialang.org/t/issues-with-in-place-transformations-and-scope/16478 "2018-10-18T15:13:12Z")

</div>

The following is a simplified and related version of the issue I raised here: function f!(x\_work, x) n = length(x); for (j,k) in zip(1:n,n:-1:1) x\_work\[j\] = sin(x\[k\]); end x\_work, x end function…

---

## [Head and Tail](https://discourse.julialang.org/t/head-and-tail/16479)

<div class="topic-metadata">

**Author:** [@jandehaan](https://discourse.julialang.org/u/jandehaan)\
**Replies:** 7\
**Last updated:** [October 18, 2018, 2:33pm UTC](https://discourse.julialang.org/t/head-and-tail/16479 "2018-10-18T14:33:15Z")

</div>

Is there a function in Julia that returns two items: the first (head) element of an iterator/collection and the remainder (tail?) of that same iterator/collection?

---

## [Possible issue with JuliaCIBot](https://discourse.julialang.org/t/possible-issue-with-juliacibot/16304)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 0\
**Last updated:** [October 14, 2018, 10:55am UTC](https://discourse.julialang.org/t/possible-issue-with-juliacibot/16304 "2018-10-14T10:55:02Z")

</div>

SECOND EDIT: Yup, fixing the bug in my package (somehow?!?) fixed the issue I was encountering with JuliaCIBot. Obviously my understanding of the logs produced by JuliaCIBot could use some improvement. If a moderator wan…

---

## [Learning Julia or c++ from python and R backgrounds](https://discourse.julialang.org/t/learning-julia-or-c-from-python-and-r-backgrounds/16446)

<div class="topic-metadata">

**Author:** [@aminevsaziz](https://discourse.julialang.org/u/aminevsaziz)\
**Replies:** 20\
**Last updated:** [October 18, 2018, 9:00am UTC](https://discourse.julialang.org/t/learning-julia-or-c-from-python-and-r-backgrounds/16446 "2018-10-18T09:00:20Z")

</div>

I’m fairly new to data science…first I start using R like 2 years ago then recenlty like 5 months ago I start migrating to Python and I did that pretty fast. Then recenlty i stumble into Julia in PyCon video. Since then…

---

## [How to construct a Date array?](https://discourse.julialang.org/t/how-to-construct-a-date-array/16485)

<div class="topic-metadata">

**Author:** [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Replies:** 2\
**Last updated:** [October 18, 2018, 4:33am UTC](https://discourse.julialang.org/t/how-to-construct-a-date-array/16485 "2018-10-18T04:33:15Z")

</div>

under Julia 0.6, I could do: dr = Dates.Date(2001) : Dates.Date(2010) I didn’t use this script under Julia 0.7, so didn’t get deprecate messages. Now under 1.0.1, this statement gets an error: ERROR: MethodError: Can…

---

## [Pkg projects: Is it possible to subsititute packages in a project?](https://discourse.julialang.org/t/pkg-projects-is-it-possible-to-subsititute-packages-in-a-project/16460)

<div class="topic-metadata">

**Author:** [@galenlynch](https://discourse.julialang.org/u/galenlynch)\
**Replies:** 11\
**Last updated:** [October 17, 2018, 10:11pm UTC](https://discourse.julialang.org/t/pkg-projects-is-it-possible-to-subsititute-packages-in-a-project/16460 "2018-10-17T22:11:46Z")

</div>

I am trying to deploy my code on a bunch of other machines using a project. My code depends on a pull request that I’ve made against DSP.jl, but has not been merged. I would like all code that depends on DSP.jl to instea…

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

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