# General Usage

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

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

**Page:** 1055

---

## [Help with a simple BinDeps file](https://discourse.julialang.org/t/help-with-a-simple-bindeps-file/3123)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 4\
**Last updated:** [April 12, 2017, 11:34am UTC](https://discourse.julialang.org/t/help-with-a-simple-bindeps-file/3123 "2017-04-12T11:34:57Z")

</div>

I need to read the date metadata from a bunch of videos. I think I want to use mediainfo for this task. I therefore want to add it to my package build.jl file using BinDeps. I managed to create this build.jl file, but it…

---

## [Can a Pkg.checkout be REQUIRED?](https://discourse.julialang.org/t/can-a-pkg-checkout-be-required/3165)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 4\
**Last updated:** [April 12, 2017, 9:09am UTC](https://discourse.julialang.org/t/can-a-pkg-checkout-be-required/3165 "2017-04-12T09:09:46Z")

</div>

I have a package, ArbFloats, that depends upon the presence of Nemo. The current release version of Nemo does not work with v0.6xx. The current checkout version does. How do I get that built first?

---

## [Pmap cannot write into SharedArray](https://discourse.julialang.org/t/pmap-cannot-write-into-sharedarray/3177)

<div class="topic-metadata">

**Author:** [@Arrigo\_Benedetti](https://discourse.julialang.org/u/Arrigo_Benedetti)\
**Replies:** 1\
**Last updated:** [April 12, 2017, 4:18am UTC](https://discourse.julialang.org/t/pmap-cannot-write-into-sharedarray/3177 "2017-04-12T04:18:13Z")

</div>

Consider the following code: nw = nworkers() @show nw N=20 @eval @everywhere N = $N spw = ceil(Int, N / nw) @show spw @everywhere yr = SharedArray(Float64, N) @everywhere yr = 1:N @everywhere sigma = SharedArray(Flo…

---

## [BinDeps for an executable](https://discourse.julialang.org/t/bindeps-for-an-executable/3161)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 5\
**Last updated:** [April 11, 2017, 9:04pm UTC](https://discourse.julialang.org/t/bindeps-for-an-executable/3161 "2017-04-11T21:04:55Z")

</div>

I need to include an executable in my package (in my case it’s exiftool). I managed to get BinDeps.jl to download it and extract it to a src folder in my deps folder. But it’s riddled with problems (doesn’t work in Windo…

---

## [Best practices for type dispatch?](https://discourse.julialang.org/t/best-practices-for-type-dispatch/3174)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 3\
**Last updated:** [April 11, 2017, 6:28pm UTC](https://discourse.julialang.org/t/best-practices-for-type-dispatch/3174 "2017-04-11T18:28:25Z")

</div>

Say I want to create a function that has two methods, each dispatching on a specific (sub)type: abstract type AbstractFooBar end struct Foo \<: AbstractFooBar end struct Bar \<: AbstractFooBar end There are (at least) t…

---

## [Generate text for testing](https://discourse.julialang.org/t/generate-text-for-testing/3167)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 6\
**Last updated:** [April 11, 2017, 5:29pm UTC](https://discourse.julialang.org/t/generate-text-for-testing/3167 "2017-04-11T17:29:30Z")

</div>

Any good-enough way to generate text for testing purposes? I’m building a GUI and I want to generate some crazy text to see if it can handle it. Should include new lines, tabs, commas, symbols, unicode, etc…

---

## [Pkg.test() for cloned package](https://discourse.julialang.org/t/pkg-test-for-cloned-package/3164)

<div class="topic-metadata">

**Author:** [@BenjaminBorn](https://discourse.julialang.org/u/BenjaminBorn)\
**Replies:** 6\
**Last updated:** [April 11, 2017, 2:55pm UTC](https://discourse.julialang.org/t/pkg-test-for-cloned-package/3164 "2017-04-11T14:55:19Z")

</div>

My Julia installation includes a registered package X and, in order to make changes to X, I also cloned Master of the package to a folder outside the Julia installation (i.e. Dropbox) and branched from there. Until now,…

---

## [Error trying to build system image on Windows](https://discourse.julialang.org/t/error-trying-to-build-system-image-on-windows/2745)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 6\
**Last updated:** [April 11, 2017, 2:54pm UTC](https://discourse.julialang.org/t/error-trying-to-build-system-image-on-windows/2745 "2017-04-11T14:54:12Z")

</div>

I’m trying to build a Julia system image on Windows 10. (following http://docs.julialang.org/en/stable/devdocs/sysimg/#building-the-julia-system-image) First I installed gcc: Pkg.add("WinRPM") using WinRPM WinRPM.inst…

---

## [DataTypes as function arguments](https://discourse.julialang.org/t/datatypes-as-function-arguments/3163)

<div class="topic-metadata">

**Author:** [@traktofon](https://discourse.julialang.org/u/traktofon)\
**Replies:** 1\
**Last updated:** [April 11, 2017, 2:46pm UTC](https://discourse.julialang.org/t/datatypes-as-function-arguments/3163 "2017-04-11T14:46:22Z")

</div>

Let’s say I want to define a function tmap which applies a given function to several arguments, where – this is the tricky part – the arguments are DataTypes. My first try was the “obvious” tmap1(f, xs...) = map(f, xs) …

---

## [Multiple Dispatch on input file type?](https://discourse.julialang.org/t/multiple-dispatch-on-input-file-type/3159)

<div class="topic-metadata">

**Author:** [@Crghilardi](https://discourse.julialang.org/u/Crghilardi)\
**Replies:** 0\
**Last updated:** [April 11, 2017, 3:25am UTC](https://discourse.julialang.org/t/multiple-dispatch-on-input-file-type/3159 "2017-04-11T03:25:22Z")

</div>

Hi, I am looking to write some code that starts with loading some data from a file database. I know it will be either an access database or SQLite database. Since the general mechanism is the same with only the connecti…

---

## [Embedding: jl\_new\_array signature seems incorrect in documentation](https://discourse.julialang.org/t/embedding-jl-new-array-signature-seems-incorrect-in-documentation/3149)

<div class="topic-metadata">

**Author:** [@SylvainCorlay](https://discourse.julialang.org/u/SylvainCorlay)\
**Replies:** 2\
**Last updated:** [April 10, 2017, 10:43pm UTC](https://discourse.julialang.org/t/embedding-jl-new-array-signature-seems-incorrect-in-documentation/3149 "2017-04-10T22:43:57Z")

</div>

Up until v0.3, the signature of jl\_new\_array was jl\_array\_t \*jl\_new\_array(jl\_value\_t \*atype, jl\_tuple\_t \*dims) And as off v0.4, the signature has changed to jl\_array\_t \*jl\_new\_array(jl\_value\_t \*atype, jl\_value\_t \*dims…

---

## [Error on Precompilation](https://discourse.julialang.org/t/error-on-precompilation/3144)

<div class="topic-metadata">

**Author:** [@Tyde](https://discourse.julialang.org/u/Tyde)\
**Replies:** 1\
**Last updated:** [April 10, 2017, 1:58pm UTC](https://discourse.julialang.org/t/error-on-precompilation/3144 "2017-04-10T13:58:44Z")

</div>

Hi, I just reinstalled julia, but now got the same error on precompilation of different Packages. For example when I try to use Plots, the following error shows: ERROR: LoadError: LoadError: error compiling convert: er…

---

## [Nlopt, stogo, on windows, doesnt work](https://discourse.julialang.org/t/nlopt-stogo-on-windows-doesnt-work/3080)

<div class="topic-metadata">

**Author:** [@flomenbom](https://discourse.julialang.org/u/flomenbom)\
**Replies:** 8\
**Last updated:** [April 10, 2017, 10:08am UTC](https://discourse.julialang.org/t/nlopt-stogo-on-windows-doesnt-work/3080 "2017-04-10T10:08:03Z")

</div>

The nlopt algorithms, on windows GD\_STOGO & GD\_STOGO\_RAND do not work The website about nlopt said "StoGO is written in C++, which means that it is only included when you compile the C++ algorithms enabled, in which …

---

## [Formatted printing of arrays](https://discourse.julialang.org/t/formatted-printing-of-arrays/3121)

<div class="topic-metadata">

**Author:** [@asubedi](https://discourse.julialang.org/u/asubedi)\
**Replies:** 5\
**Last updated:** [April 10, 2017, 7:56am UTC](https://discourse.julialang.org/t/formatted-printing-of-arrays/3121 "2017-04-10T07:56:39Z")

</div>

I want to print the elements of an array of floating point numbers in the same format. In Python/Numpy, I do: np.set\_printoptions(formatter={‘float’: ‘{: 10.6f}’.format, ‘complexfloat’: ‘{: 10.6f}’.format}) and the sim…

---

## [On Windows, how to use classes in C++ DLL library from Julia?](https://discourse.julialang.org/t/on-windows-how-to-use-classes-in-c-dll-library-from-julia/3031)

<div class="topic-metadata">

**Author:** [@Zhong\_Pan](https://discourse.julialang.org/u/Zhong_Pan)\
**Replies:** 10\
**Last updated:** [April 9, 2017, 5:13am UTC](https://discourse.julialang.org/t/on-windows-how-to-use-classes-in-c-dll-library-from-julia/3031 "2017-04-09T05:13:22Z")

</div>

I do work on Windows as it’s the standard platform for our company. A simulation software vendor provided a C++ DLL library that was built with Visual Studio. I cannot access the source code, nor can the vendor custom-bu…

---

## [PkgDev.publish gives SystemError](https://discourse.julialang.org/t/pkgdev-publish-gives-systemerror/3115)

<div class="topic-metadata">

**Author:** [@leiteiro](https://discourse.julialang.org/u/leiteiro)\
**Replies:** 0\
**Last updated:** [April 8, 2017, 10:05am UTC](https://discourse.julialang.org/t/pkgdev-publish-gives-systemerror/3115 "2017-04-08T10:05:35Z")

</div>

PkgDev.publish("FooBar") gives on Windows10 the SystemError: opening file C:\\Users\\Home\\AppData\\Local\\JuliaPro-0.5.1.1\\pkgs-0.5.1.1\\v0.5\\METADATA\\LineSearches/versions/2.0.0/sha1: No such file or directory in publish…

---

## [FYI: Julia for Linux on 'Bash for Windows'](https://discourse.julialang.org/t/fyi-julia-for-linux-on-bash-for-windows/3096)

<div class="topic-metadata">

**Author:** [@m-j-w](https://discourse.julialang.org/u/m-j-w)\
**Replies:** 2\
**Last updated:** [April 7, 2017, 7:00pm UTC](https://discourse.julialang.org/t/fyi-julia-for-linux-on-bash-for-windows/3096 "2017-04-07T19:00:01Z")

</div>

Since Windows 10 1703 (Creators Update, available since April 6th 2017 or so) ,the Windows-Subsystem-Linux (WSL) provides the opportunity to use a fully featured Linux environment natively on Windows. Although in princi…

---

## [Functions and callable methods](https://discourse.julialang.org/t/functions-and-callable-methods/2983)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [April 7, 2017, 5:08pm UTC](https://discourse.julialang.org/t/functions-and-callable-methods/2983 "2017-04-07T17:08:47Z")

</div>

I am confused about how to organize my code for objects which behave like functions. Some functions do different things when called with arguments which are \<: Function, eg Plots.plot will plot the function, but will not…

---

## [Non-default Constructor](https://discourse.julialang.org/t/non-default-constructor/3094)

<div class="topic-metadata">

**Author:** [@Snir\_Gazit](https://discourse.julialang.org/u/Snir_Gazit)\
**Replies:** 9\
**Last updated:** [April 6, 2017, 10:45pm UTC](https://discourse.julialang.org/t/non-default-constructor/3094 "2017-04-06T22:45:40Z")

</div>

I am having trouble with defining a non-default constructor. See code snippet below, type AType a::Float64 end type BType b::Float64 Btype(a\_type::AType)=new(a\_var.a) end a\_var=AType(5.0) b\_var=BType(a\_va…

---

## [How do I wrap class with public member variables using CxxWrap.jl?](https://discourse.julialang.org/t/how-do-i-wrap-class-with-public-member-variables-using-cxxwrap-jl/3093)

<div class="topic-metadata">

**Author:** [@Zhong\_Pan](https://discourse.julialang.org/u/Zhong_Pan)\
**Replies:** 2\
**Last updated:** [April 6, 2017, 10:31pm UTC](https://discourse.julialang.org/t/how-do-i-wrap-class-with-public-member-variables-using-cxxwrap-jl/3093 "2017-04-06T22:31:35Z")

</div>

Thanks to barche and others I was able to start making good progress using CxxWrap.jl. I do still have one blocking question: how can I wrap a class which has public member variables whose values are supposed to be chan…

---

## [UDP Multicast with Julia](https://discourse.julialang.org/t/udp-multicast-with-julia/3045)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 3\
**Last updated:** [April 6, 2017, 9:13pm UTC](https://discourse.julialang.org/t/udp-multicast-with-julia/3045 "2017-04-06T21:13:13Z")

</div>

Hello, I am using the following function to read UDP messages with Julia: # background loop for receiving UDP messages, terminated with \<ctrl\> + \<c\> function receiveData(server\_ip) global terminate udpsock = UDPSocke…

---

## [Annotate return type for anonymous function & lambdas](https://discourse.julialang.org/t/annotate-return-type-for-anonymous-function-lambdas/3087)

<div class="topic-metadata">

**Author:** [@FANG\_Colin](https://discourse.julialang.org/u/FANG_Colin)\
**Replies:** 2\
**Last updated:** [April 6, 2017, 7:17pm UTC](https://discourse.julialang.org/t/annotate-return-type-for-anonymous-function-lambdas/3087 "2017-04-06T19:17:27Z")

</div>

Is it possible to add return types for anonymous function & lambdas? The followings don’t work function ()::Int 1 end ()::Int -\> 1

---

## [Specify hash function used by \`hash()\`?](https://discourse.julialang.org/t/specify-hash-function-used-by-hash/3091)

<div class="topic-metadata">

**Author:** [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Replies:** 1\
**Last updated:** [April 6, 2017, 4:58pm UTC](https://discourse.julialang.org/t/specify-hash-function-used-by-hash/3091 "2017-04-06T16:58:19Z")

</div>

I’m new to the idea of hash functions, so please forgive me if this is a naive question, but I’m wondering if there’s a way to specify the hash function and seed used with hash(). I made a julia implementation of a tool …

---

## [BoundsError when NullableArray a field](https://discourse.julialang.org/t/boundserror-when-nullablearray-a-field/3084)

<div class="topic-metadata">

**Author:** [@merl-dev](https://discourse.julialang.org/u/merl-dev)\
**Replies:** 2\
**Last updated:** [April 6, 2017, 3:52pm UTC](https://discourse.julialang.org/t/boundserror-when-nullablearray-a-field/3084 "2017-04-06T15:52:07Z")

</div>

(Posted originally as NullableArrays issue #190, likely should have started here on discourse before filing an issue…) Not sure if I missed something about iteration interfaces or NullableArrays, but consider the follow…

---

## [WARNING: deprecated syntax "\_ as an rvalue"](https://discourse.julialang.org/t/warning-deprecated-syntax---as-an-rvalue/3090)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 1\
**Last updated:** [April 6, 2017, 2:40pm UTC](https://discourse.julialang.org/t/warning-deprecated-syntax---as-an-rvalue/3090 "2017-04-06T14:40:57Z")

</div>

I am trying Julia v0.6 and this warning is new. It doesn’t have a line number attached to it, so I don’t know where I have to look in the source. I know that the identifier \_ will be used to discard values in the future…

---

## [Dispatch on singleton type inside a tuple](https://discourse.julialang.org/t/dispatch-on-singleton-type-inside-a-tuple/3058)

<div class="topic-metadata">

**Author:** [@traktofon](https://discourse.julialang.org/u/traktofon)\
**Replies:** 8\
**Last updated:** [April 6, 2017, 1:39pm UTC](https://discourse.julialang.org/t/dispatch-on-singleton-type-inside-a-tuple/3058 "2017-04-06T13:39:58Z")

</div>

Hello, in order to dispatch on a datatype known at runtime, we can use singleton types: func1(::Type{T},n) where T = Array{T}(n) which seems to give a type-stable result: julia\> @code\_warntype func1(Int32,10) Variab…

---

## [Within function error - in atom](https://discourse.julialang.org/t/within-function-error-in-atom/3089)

<div class="topic-metadata">

**Author:** [@davidzentlermunro](https://discourse.julialang.org/u/davidzentlermunro)\
**Replies:** 0\
**Last updated:** [April 6, 2017, 12:22pm UTC](https://discourse.julialang.org/t/within-function-error-in-atom/3089 "2017-04-06T12:22:03Z")

</div>

I’m getting the error shown below. The code is long and involved so I’m not sure it’s helpful to share at this point, but the error seems to occur when I am evaluating code that sits within a function, called elsewhere. …

---

## [How to make fields in type object undefined](https://discourse.julialang.org/t/how-to-make-fields-in-type-object-undefined/3082)

<div class="topic-metadata">

**Author:** [@mazzanti](https://discourse.julialang.org/u/mazzanti)\
**Replies:** 3\
**Last updated:** [April 6, 2017, 10:54am UTC](https://discourse.julialang.org/t/how-to-make-fields-in-type-object-undefined/3082 "2017-04-06T10:54:44Z")

</div>

Hi folks, in many of my julia codes I define my own type variables, in such a way that nothing is by default initialized, expecting the user will initialize the fields he needs. For instance type fooo x :: Int …

---

## [Generate independent LLVM code from Julia](https://discourse.julialang.org/t/generate-independent-llvm-code-from-julia/3065)

<div class="topic-metadata">

**Author:** [@Karan\_Aggarwal](https://discourse.julialang.org/u/Karan_Aggarwal)\
**Replies:** 0\
**Last updated:** [April 5, 2017, 2:04pm UTC](https://discourse.julialang.org/t/generate-independent-llvm-code-from-julia/3065 "2017-04-05T14:04:32Z")

</div>

How to generate exact LLVM code for julia, so that I can run it independently . It should not contain jl\_true …

---

## [Variables in \`@code\_warntype\` output not shown in Body](https://discourse.julialang.org/t/variables-in-code-warntype-output-not-shown-in-body/3074)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 3\
**Last updated:** [April 5, 2017, 8:07pm UTC](https://discourse.julialang.org/t/variables-in-code-warntype-output-not-shown-in-body/3074 "2017-04-05T20:07:27Z")

</div>

I am trying to eliminate type instability in my function. When I perform @code\_warntype to the function, some of the variables in the Variables: section of the output have names like #temp#@\_130, T@\_131, and A\_1@\_166, a…

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

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