# General Usage

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

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

**Page:** 1052

---

## [Ways of defining a function](https://discourse.julialang.org/t/ways-of-defining-a-function/3465)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 8\
**Last updated:** [May 2, 2017, 11:12am UTC](https://discourse.julialang.org/t/ways-of-defining-a-function/3465 "2017-05-02T11:12:43Z")

</div>

Most julia functions are defined like this: function f(x) # some code end However a few packages use the following style f(x) = begin # some code end Is there a semantic difference between the two or are they…

---

## [Shared library not found](https://discourse.julialang.org/t/shared-library-not-found/3476)

<div class="topic-metadata">

**Author:** [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Replies:** 1\
**Last updated:** [May 2, 2017, 10:28am UTC](https://discourse.julialang.org/t/shared-library-not-found/3476 "2017-05-02T10:28:43Z")

</div>

I’m working on writing a julia interface to SuperLU (https://github.com/dmbates/SuperLU.jl is outdated). So I download and install SuperLU, and check that the shared library is properly installed: ~: ls /usr/local/lib/l…

---

## [Ref semantics](https://discourse.julialang.org/t/ref-semantics/3467)

<div class="topic-metadata">

**Author:** [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Replies:** 0\
**Last updated:** [May 1, 2017, 8:00pm UTC](https://discourse.julialang.org/t/ref-semantics/3467 "2017-05-01T20:00:12Z")

</div>

I’ve just read the documentation on calling C and Fortran code, and I’m not entirely sure I fully understand what a Ref is, what it does and how it differs from Ptr. Here’s my best guess. I would appreciate if someone wi…

---

## [Juno for JuliaPro conflicts with boost on Windows](https://discourse.julialang.org/t/juno-for-juliapro-conflicts-with-boost-on-windows/3453)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 4\
**Last updated:** [May 1, 2017, 6:33pm UTC](https://discourse.julialang.org/t/juno-for-juliapro-conflicts-with-boost-on-windows/3453 "2017-05-01T18:33:54Z")

</div>

I’m running Juno for JuliaPro 0.5.1.1 on Windows 7 with boost C++ library installed. I’m getting this message when I run the first program from IDE, but the program seems to run fine: Add-Type : (0) : Warning as Error:…

---

## [Retrieve strides from \`jl\_array\_t\`](https://discourse.julialang.org/t/retrieve-strides-from-jl-array-t/3440)

<div class="topic-metadata">

**Author:** [@SylvainCorlay](https://discourse.julialang.org/u/SylvainCorlay)\
**Replies:** 6\
**Last updated:** [May 1, 2017, 2:11pm UTC](https://discourse.julialang.org/t/retrieve-strides-from-jl-array-t/3440 "2017-05-01T14:11:08Z")

</div>

Is there a means to retrieve the strides of a julia array from the C API? https://docs.julialang.org/en/stable/stdlib/arrays/#Base.strides The only property accessors available in julia.h apparently are JL\_DLLEXPORT v…

---

## [IJulia Syntax Highlighting](https://discourse.julialang.org/t/ijulia-syntax-highlighting/3455)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 0\
**Last updated:** [May 1, 2017, 10:44am UTC](https://discourse.julialang.org/t/ijulia-syntax-highlighting/3455 "2017-05-01T10:44:17Z")

</div>

It happens regularly that I open a notebook and syntax highlighting is broken. Next day it might work again - or not. Sometimes another notebooks started from the same server front page will work fine. I believe this is …

---

## [Massive \`readstring\` -\> Too many open files](https://discourse.julialang.org/t/massive-readstring-too-many-open-files/3426)

<div class="topic-metadata">

**Author:** [@ulysses](https://discourse.julialang.org/u/ulysses)\
**Replies:** 8\
**Last updated:** [May 1, 2017, 5:39am UTC](https://discourse.julialang.org/t/massive-readstring-too-many-open-files/3426 "2017-05-01T05:39:48Z")

</div>

My program processs large amount of files using readstring. Eventually it dies with Too many open files. I quess the reason is the way read function is implemented: it just do open but do not close, neither use do block.…

---

## [T \<: T question](https://discourse.julialang.org/t/t-t-question/3449)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 2\
**Last updated:** [May 1, 2017, 5:12am UTC](https://discourse.julialang.org/t/t-t-question/3449 "2017-05-01T05:12:17Z")

</div>

Does the example below from Types chapter of Julia manual depend on Real \<: Real being true? I’m assuming that author’s intention was to include the first definition of norm in more generic definition, which follows. S…

---

## [PyCall issue appearing with Julia 0.5.1 (0.4.7 worked fine)](https://discourse.julialang.org/t/pycall-issue-appearing-with-julia-0-5-1-0-4-7-worked-fine/3446)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 2\
**Last updated:** [May 1, 2017, 5:09am UTC](https://discourse.julialang.org/t/pycall-issue-appearing-with-julia-0-5-1-0-4-7-worked-fine/3446 "2017-05-01T05:09:31Z")

</div>

Hi all. I am using Windows 7 and the Python version that comes with Julia Pro. The code below runs fine for Julia 0.4.7 but with Julia 0.5.1 I get an error which is realted to the last pycall(pyDF\[“to\_excel”\], … The e…

---

## [LoadError: SystemError: opening file AirplaneArrival.csv: No such file or directory](https://discourse.julialang.org/t/loaderror-systemerror-opening-file-airplanearrival-csv-no-such-file-or-directory/3447)

<div class="topic-metadata">

**Author:** [@Wael\_Sboui](https://discourse.julialang.org/u/Wael_Sboui)\
**Replies:** 1\
**Last updated:** [April 30, 2017, 9:45pm UTC](https://discourse.julialang.org/t/loaderror-systemerror-opening-file-airplanearrival-csv-no-such-file-or-directory/3447 "2017-04-30T21:45:59Z")

</div>

---

## [More Pkg trouble: "unsatisfiable package requirements detected"](https://discourse.julialang.org/t/more-pkg-trouble-unsatisfiable-package-requirements-detected/2142)

<div class="topic-metadata">

**Author:** [@crbinz](https://discourse.julialang.org/u/crbinz)\
**Replies:** 19\
**Last updated:** [April 30, 2017, 2:55pm UTC](https://discourse.julialang.org/t/more-pkg-trouble-unsatisfiable-package-requirements-detected/2142 "2017-04-30T14:55:18Z")

</div>

This is with julia v0.5 on OS X: julia\> Pkg.update() INFO: Updating METADATA... INFO: Updating LoewnerJohnEllipsoids master... INFO: Updating RequestsCache master... INFO: Updating NASABreakup master... INFO: Updating K…

---

## [Slow down from parametric type](https://discourse.julialang.org/t/slow-down-from-parametric-type/3383)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 7\
**Last updated:** [April 29, 2017, 2:17pm UTC](https://discourse.julialang.org/t/slow-down-from-parametric-type/3383 "2017-04-29T14:17:05Z")

</div>

I have a World-like object, that is passed without modification to most of the functions in my codebase. It has four fields, which I’ll call air, fire, water, earth. Each of these is heavily parametric (typeof(world.air) …

---

## [\[BinDeps\] Is it possible to have a more verbose output about the build](https://discourse.julialang.org/t/bindeps-is-it-possible-to-have-a-more-verbose-output-about-the-build/3423)

<div class="topic-metadata">

**Author:** [@SylvainCorlay](https://discourse.julialang.org/u/SylvainCorlay)\
**Replies:** 5\
**Last updated:** [April 28, 2017, 10:08pm UTC](https://discourse.julialang.org/t/bindeps-is-it-possible-to-have-a-more-verbose-output-about-the-build/3423 "2017-04-28T22:08:05Z")

</div>

In the build of a native extension I am getting a laconic LoadError: None of the selected providers can install dependency tensors. on windows only. The build steps for that target invoke cmake, but I see none of the …

---

## [Type-stable zip to pairs](https://discourse.julialang.org/t/type-stable-zip-to-pairs/3390)

<div class="topic-metadata">

**Author:** [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Replies:** 4\
**Last updated:** [April 28, 2017, 6:41pm UTC](https://discourse.julialang.org/t/type-stable-zip-to-pairs/3390 "2017-04-28T18:41:49Z")

</div>

I have an interesting puzzle that I haven’t been able solve (without resorting to @generated functions). I’d like to write a function pairzip(x::Tuple, y::Tuple) such that pairzip((a, b), (c, d)) == (a=\>c, b=\>d) in a …

---

## [What is the correct name of supertype(DataType)?](https://discourse.julialang.org/t/what-is-the-correct-name-of-supertype-datatype/3420)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 4\
**Last updated:** [April 28, 2017, 6:02pm UTC](https://discourse.julialang.org/t/what-is-the-correct-name-of-supertype-datatype/3420 "2017-04-28T18:02:26Z")

</div>

REPL responds with Type{T} to supertype(DataType), but DataType \<: Type{T} is invalid. What is the correct name of supertype(DataType)?

---

## [Factorization of Integer Sparse Matrices Throws Error](https://discourse.julialang.org/t/factorization-of-integer-sparse-matrices-throws-error/3415)

<div class="topic-metadata">

**Author:** [@rbassett3](https://discourse.julialang.org/u/rbassett3)\
**Replies:** 2\
**Last updated:** [April 28, 2017, 3:46pm UTC](https://discourse.julialang.org/t/factorization-of-integer-sparse-matrices-throws-error/3415 "2017-04-28T15:46:44Z")

</div>

Hello fellow julia-users. I have been working with sparse matrices recently, and have come across a counter-intuitive method error when applying a QR factorization to a matrix with integer entries. The function qrfact w…

---

## [Rendering JavaScript in Juno/Atom PlotPane](https://discourse.julialang.org/t/rendering-javascript-in-juno-atom-plotpane/3376)

<div class="topic-metadata">

**Author:** [@randyzwitch](https://discourse.julialang.org/u/randyzwitch)\
**Replies:** 3\
**Last updated:** [April 28, 2017, 3:15pm UTC](https://discourse.julialang.org/t/rendering-javascript-in-juno-atom-plotpane/3376 "2017-04-28T15:15:46Z")

</div>

I’m trying to get Vega to plot in the Juno plotting pane. I can define the method signature correctly, in that calling a Vega.jl barplot() function will trigger the Media.render function, but if I substitute valid JavaSc…

---

## [\[Documentation\] Declared types, possible bug?](https://discourse.julialang.org/t/documentation-declared-types-possible-bug/3411)

<div class="topic-metadata">

**Author:** [@swissr](https://discourse.julialang.org/u/swissr)\
**Replies:** 1\
**Last updated:** [April 28, 2017, 1:00pm UTC](https://discourse.julialang.org/t/documentation-declared-types-possible-bug/3411 "2017-04-28T13:00:50Z")

</div>

\[Edit: moved to an issue according to the feedback from Kristoffer\] The chapter ‘## Declared Types’ starts with ‘The three kinds of types discussed in the previous three sections are actually all closely related’. Thi…

---

## [Odd behaviour of labels with plotlyjs in Plots.jl](https://discourse.julialang.org/t/odd-behaviour-of-labels-with-plotlyjs-in-plots-jl/3419)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 2\
**Last updated:** [April 28, 2017, 10:28am UTC](https://discourse.julialang.org/t/odd-behaviour-of-labels-with-plotlyjs-in-plots-jl/3419 "2017-04-28T10:28:31Z")

</div>

Hi all, I’m having a bit of trouble with labels when using plotlyjs() in Plots.jl. I’m running Julia v0.5 on Ubuntu 16.04, with Plots 0.10.3, and PlotlyJS 0.6.0. Working in the REPL: using Plots plotlyjs() plot(randn(1…

---

## [A good coroutines usage example (especially for v0.6)?](https://discourse.julialang.org/t/a-good-coroutines-usage-example-especially-for-v0-6/3329)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 9\
**Last updated:** [April 28, 2017, 4:15am UTC](https://discourse.julialang.org/t/a-good-coroutines-usage-example-especially-for-v0-6/3329 "2017-04-28T04:15:27Z")

</div>

I am quite new to the concept of coroutines. I have a situation in which I think it is appropriate to use them, and I’m sure I can figure out how to do that, but I’m not so sure I can figure out how to do that right. I…

---

## [Immutable vs Type: reassignment via arrays and performance](https://discourse.julialang.org/t/immutable-vs-type-reassignment-via-arrays-and-performance/3364)

<div class="topic-metadata">

**Author:** [@mcovalt](https://discourse.julialang.org/u/mcovalt)\
**Replies:** 11\
**Last updated:** [April 28, 2017, 12:51am UTC](https://discourse.julialang.org/t/immutable-vs-type-reassignment-via-arrays-and-performance/3364 "2017-04-28T00:51:48Z")

</div>

According to the docs, operating on immutable types can result in increased performance. On first thought, I assumed this was because the data contained inside immutable objects is known to be unchanging, but upon tinker…

---

## [Generating automatic constructors for parametric type](https://discourse.julialang.org/t/generating-automatic-constructors-for-parametric-type/2963)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [April 27, 2017, 11:46pm UTC](https://discourse.julialang.org/t/generating-automatic-constructors-for-parametric-type/2963 "2017-04-27T23:46:40Z")

</div>

MWE: for a parametric type definition with an inner constructor struct Foo{T \<: Real} x::T function Foo{T}(x) where T @assert x \> 0 new(x) end end I frequently end up writing boilerplate Fo…

---

## [JSON/CSS-like format in Julia?](https://discourse.julialang.org/t/json-css-like-format-in-julia/3372)

<div class="topic-metadata">

**Author:** [@TravisA9](https://discourse.julialang.org/u/TravisA9)\
**Replies:** 10\
**Last updated:** [April 27, 2017, 2:38pm UTC](https://discourse.julialang.org/t/json-css-like-format-in-julia/3372 "2017-04-27T14:38:14Z")

</div>

I remember running across a package in the not-too-distant past which stored and retrieved data in a format similar to JSON (but not JSON). After searching some time for it today I have been unable to find it. Does anyon…

---

## [Getting doc string from function in composite type?](https://discourse.julialang.org/t/getting-doc-string-from-function-in-composite-type/3401)

<div class="topic-metadata">

**Author:** [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Replies:** 3\
**Last updated:** [April 27, 2017, 12:13pm UTC](https://discourse.julialang.org/t/getting-doc-string-from-function-in-composite-type/3401 "2017-04-27T12:13:00Z")

</div>

What’s the trick for getting the docstring of the function stored in a composite type’s field? type MyType f::Function end julia\> s = MyType(sin) …

---

## [Convert type \`Any\` to \`Symbol\` to subset \`DataFrame\` columns](https://discourse.julialang.org/t/convert-type-any-to-symbol-to-subset-dataframe-columns/3389)

<div class="topic-metadata">

**Author:** [@sbohor3](https://discourse.julialang.org/u/sbohor3)\
**Replies:** 3\
**Last updated:** [April 26, 2017, 10:21pm UTC](https://discourse.julialang.org/t/convert-type-any-to-symbol-to-subset-dataframe-columns/3389 "2017-04-26T22:21:37Z")

</div>

I am trying to subset a dataframe’s (DF) columns using a list of column names extracted using DataFrames.Terms(model\_formula).terms which returns a type of Any object. I would like to convert this type Any to Symbol so I…

---

## [Pkg.update(): GitError](https://discourse.julialang.org/t/pkg-update-giterror/3368)

<div class="topic-metadata">

**Author:** [@jatotterdell](https://discourse.julialang.org/u/jatotterdell)\
**Replies:** 3\
**Last updated:** [April 26, 2017, 9:13pm UTC](https://discourse.julialang.org/t/pkg-update-giterror/3368 "2017-04-26T21:13:31Z")

</div>

I’m quite new to Julia, and after a fresh installation I’m running into the following error: julia\> Pkg.update() INFO: Initializing package repository /home/jatotterdell/.julia/v0.5 INFO: Cloning METADATA from https://g…

---

## [Function with "memory"](https://discourse.julialang.org/t/function-with-memory/3391)

<div class="topic-metadata">

**Author:** [@robertdj](https://discourse.julialang.org/u/robertdj)\
**Replies:** 5\
**Last updated:** [April 26, 2017, 7:39pm UTC](https://discourse.julialang.org/t/function-with-memory/3391 "2017-04-26T19:39:53Z")

</div>

I want to make a function with “memory”, that only modifies the second argument if the first satisfies certain conditions and otherwise returns the same second argument. Both arguments should be “scalar”/only one scalar …

---

## [UNICODE string from C++ to Julia and vice versa](https://discourse.julialang.org/t/unicode-string-from-c-to-julia-and-vice-versa/3272)

<div class="topic-metadata">

**Author:** [@Martin\_Florek](https://discourse.julialang.org/u/Martin_Florek)\
**Replies:** 20\
**Last updated:** [April 26, 2017, 8:03am UTC](https://discourse.julialang.org/t/unicode-string-from-c-to-julia-and-vice-versa/3272 "2017-04-26T08:03:14Z")

</div>

I’m using embedding Julia in C++ project. Now I need to get any unicode string to Julia, e.g… std::wstring test = L"šČô\_φ\_привет\_일보"; Tips & hints or a model example for solutions, please. Thanks.

---

## [Inheritance for Matrix Wrapper Type](https://discourse.julialang.org/t/inheritance-for-matrix-wrapper-type/3346)

<div class="topic-metadata">

**Author:** [@jebej](https://discourse.julialang.org/u/jebej)\
**Replies:** 4\
**Last updated:** [April 25, 2017, 6:47pm UTC](https://discourse.julialang.org/t/inheritance-for-matrix-wrapper-type/3346 "2017-04-25T18:47:25Z")

</div>

I want to define a matrix wrapper type in order to store more information than just the content of the matrix itself: immutable MatWrap{T\<:Number,S\<:AbstractMatrix} \<: AbstractMatrix{T} data::S otherstuff end I…

---

## [Help with Windows build scripts](https://discourse.julialang.org/t/help-with-windows-build-scripts/3374)

<div class="topic-metadata">

**Author:** [@nsmith](https://discourse.julialang.org/u/nsmith)\
**Replies:** 0\
**Last updated:** [April 25, 2017, 6:35pm UTC](https://discourse.julialang.org/t/help-with-windows-build-scripts/3374 "2017-04-25T18:35:41Z")

</div>

Hi Julia Community! I need some help adding support for Windows users in the build script of a package I maintain (Maxima.jl). Maxima ships an executable installer from their website but I have no idea how run this inst…

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

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