# General Usage

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

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

**Page:** 974

---

## [Help to create a macro do avoid integer overflow](https://discourse.julialang.org/t/help-to-create-a-macro-do-avoid-integer-overflow/11354)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 14\
**Last updated:** [June 2, 2018, 5:43pm UTC](https://discourse.julialang.org/t/help-to-create-a-macro-do-avoid-integer-overflow/11354 "2018-06-02T17:43:16Z")

</div>

Hi guys! I need help to create a macro to do the following: On every integer operation, check if overflow will happen. If it does, then promote the arguments to integer representations with higher number of bits. I d…

---

## [0.7.0-alpha not running on Win10](https://discourse.julialang.org/t/0-7-0-alpha-not-running-on-win10/11366)

<div class="topic-metadata">

**Author:** [@MLackner](https://discourse.julialang.org/u/MLackner)\
**Replies:** 1\
**Last updated:** [June 2, 2018, 3:46pm UTC](https://discourse.julialang.org/t/0-7-0-alpha-not-running-on-win10/11366 "2018-06-02T15:46:07Z")

</div>

Hi! I’m not able to run version 0.7.0-alpha on Windows 10. When I try running the julia.exe a terminal window pops up and closes immediately. On some runs I managed to glimpse something saying “homedir” or “builddir mov…

---

## ["Nullable" fields: Current recommendation?](https://discourse.julialang.org/t/nullable-fields-current-recommendation/11258)

<div class="topic-metadata">

**Author:** [@mlhetland](https://discourse.julialang.org/u/mlhetland)\
**Replies:** 17\
**Last updated:** [June 2, 2018, 11:34am UTC](https://discourse.julialang.org/t/nullable-fields-current-recommendation/11258 "2018-06-02T11:34:11Z")

</div>

In the style guide for 0.6, one is advised to use Nullable{T} rather than Union{Void, T} for fields. In 0.7, Nullable{T} is deprecated, and one is advised to use Union{T, Nothing} or Union{Some{T}, Nothing} instead, wher…

---

## [Display of multibyte characters in Julia 0.7.0-alpha](https://discourse.julialang.org/t/display-of-multibyte-characters-in-julia-0-7-0-alpha/11360)

<div class="topic-metadata">

**Author:** [@bkamins](https://discourse.julialang.org/u/bkamins)\
**Replies:** 2\
**Last updated:** [June 2, 2018, 9:34am UTC](https://discourse.julialang.org/t/display-of-multibyte-characters-in-julia-0-7-0-alpha/11360 "2018-06-02T09:34:51Z")

</div>

On Windows 10 under Julia 0.7.0-alpha I have the following problem with displaying of multibyte characters: \_ \_ \_ \_(\_)\_ | A fresh approach to technical computing (\_) | (\_) (\_) | Do…

---

## [Improving serialization time](https://discourse.julialang.org/t/improving-serialization-time/11318)

<div class="topic-metadata">

**Author:** [@jinliangwei](https://discourse.julialang.org/u/jinliangwei)\
**Replies:** 7\
**Last updated:** [June 2, 2018, 4:27am UTC](https://discourse.julialang.org/t/improving-serialization-time/11318 "2018-06-02T04:27:58Z")

</div>

I have a object which is essentially a = \[\[(Int64(10), Int32(2)) for i = 1:500\] for i = 1:102661\]. Serializing it takes 1.9 seconds. This has become a major bottleneck in my program because it has to be down repeatedly. …

---

## [Obtaining a function's output type](https://discourse.julialang.org/t/obtaining-a-functions-output-type/11313)

<div class="topic-metadata">

**Author:** [@jebej](https://discourse.julialang.org/u/jebej)\
**Replies:** 8\
**Last updated:** [June 1, 2018, 9:59pm UTC](https://discourse.julialang.org/t/obtaining-a-functions-output-type/11313 "2018-06-01T21:59:14Z")

</div>

Given a function and some argument types, it should be possible to know the return type without actually running the executing the method. How can I do that? Is there something like a functiontype(f,argtypes)? My goal i…

---

## [Some more observations on working with Pkg(3)](https://discourse.julialang.org/t/some-more-observations-on-working-with-pkg-3/11234)

<div class="topic-metadata">

**Author:** [@goedman](https://discourse.julialang.org/u/goedman)\
**Replies:** 38\
**Last updated:** [June 1, 2018, 9:13pm UTC](https://discourse.julialang.org/t/some-more-observations-on-working-with-pkg-3/11234 "2018-06-01T21:13:08Z")

</div>

Encouraged by this thread ( Switching to Pkg3 ) I also ventured into Pkg(3) land for a redo of Stan.jl for Julia 0.7/1.0 ( StanJulia ) and similarly for a previously registered project PtFEM.jl ( PtFEM ). Both Github or…

---

## [Is there no hope of fixing a \< b & c \< d before v1.0?](https://discourse.julialang.org/t/is-there-no-hope-of-fixing-a-b-c-d-before-v1-0/5763)

<div class="topic-metadata">

**Author:** [@NickNack](https://discourse.julialang.org/u/NickNack)\
**Replies:** 18\
**Last updated:** [June 1, 2018, 8:14pm UTC](https://discourse.julialang.org/t/is-there-no-hope-of-fixing-a-b-c-d-before-v1-0/5763 "2018-06-01T20:14:22Z")

</div>

I’ve considered myself a Julian for about 6 months now. I have enough experience to know that a \< b & c \< d is parsed as a \< (b & c) \< d and not as most would probably expect. And yet this bug (see comment below) bit me …

---

## [Warning: \`using A: B\` will only be allowed for single bindings](https://discourse.julialang.org/t/warning-using-a-b-will-only-be-allowed-for-single-bindings/11345)

<div class="topic-metadata">

**Author:** [@goedman](https://discourse.julialang.org/u/goedman)\
**Replies:** 0\
**Last updated:** [June 1, 2018, 5:26pm UTC](https://discourse.julialang.org/t/warning-using-a-b-will-only-be-allowed-for-single-bindings/11345 "2018-06-01T17:26:54Z")

</div>

On Julia 0.7-alpha I get this warning: Warning: using A: B will only be allowed for single bindings, not modules. Use using A.B instead import CmdStan: CmdStan, CMDSTAN\_HOME, Diagnose, Optimize, Sample, Stanmodel, Vari…

---

## [Error building julia; bug in latest gcc (9.0.0 experimental), or in Julia's gc code?](https://discourse.julialang.org/t/error-building-julia-bug-in-latest-gcc-9-0-0-experimental-or-in-julias-gc-code/11253)

<div class="topic-metadata">

**Author:** [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Replies:** 9\
**Last updated:** [June 1, 2018, 3:41pm UTC](https://discourse.julialang.org/t/error-building-julia-bug-in-latest-gcc-9-0-0-experimental-or-in-julias-gc-code/11253 "2018-06-01T15:41:51Z")

</div>

Hi, I’ve been getting the following error when trying to build Julia (v0.6.2 / v0.6.3 / master): In file included from /home/chris/Documents/prog/julia-reg/src/codegen.cpp:105: /home/chris/Documents/prog/julia-reg/src/…

---

## [Embedding Julia in C -- error regarding jl\_array\_ptr\_1d\_push](https://discourse.julialang.org/t/embedding-julia-in-c-error-regarding-jl-array-ptr-1d-push/11315)

<div class="topic-metadata">

**Author:** [@jinliangwei](https://discourse.julialang.org/u/jinliangwei)\
**Replies:** 1\
**Last updated:** [June 1, 2018, 3:18pm UTC](https://discourse.julialang.org/t/embedding-julia-in-c-error-regarding-jl-array-ptr-1d-push/11315 "2018-06-01T15:18:26Z")

</div>

\#include \<julia.h\> int main(int argc, char\* argv\[\]) { jl\_init(); jl\_value\_t\* array\_type\_jl = nullptr; jl\_value\_t\* array\_jl = nullptr; jl\_value\_t\* value\_jl = nullptr; JL\_GC\_PUSH3(&array\_type\_jl, &array\_jl, &val…

---

## [Functions for median of ordinal data](https://discourse.julialang.org/t/functions-for-median-of-ordinal-data/10964)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 8\
**Last updated:** [June 1, 2018, 3:02pm UTC](https://discourse.julialang.org/t/functions-for-median-of-ordinal-data/10964 "2018-06-01T15:02:52Z")

</div>

If you have an array of Date() objects and you want to find the middle one, what do you do? If you have an odd number of objects, just take the middle one If you have an even number, you would normally do the mean of t…

---

## [API design help: potentially modifying argument](https://discourse.julialang.org/t/api-design-help-potentially-modifying-argument/11334)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 1\
**Last updated:** [June 1, 2018, 12:41pm UTC](https://discourse.julialang.org/t/api-design-help-potentially-modifying-argument/11334 "2018-06-01T12:41:29Z")

</div>

I would like to get comments on a certain point of API design for a package I am pondering over. Specifically, for an MWE, I have a generic function exposed by the API, the user defines custom types and how to “update” t…

---

## [Pkg3: How to get the precompilation warnings again?](https://discourse.julialang.org/t/pkg3-how-to-get-the-precompilation-warnings-again/11329)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 1\
**Last updated:** [June 1, 2018, 10:07am UTC](https://discourse.julialang.org/t/pkg3-how-to-get-the-precompilation-warnings-again/11329 "2018-06-01T10:07:12Z")

</div>

With 0.7 alpha, I installed the package CSV and got a lot of warnings when precompiling. Now I would like to report these warnings, but I cannot reproduce them. If I do \] rm CSV add CSV precompile It is not getting pr…

---

## [Pkg.update() error on mac osX: GitError](https://discourse.julialang.org/t/pkg-update-error-on-mac-osx-giterror/11324)

<div class="topic-metadata">

**Author:** [@iArchimedes](https://discourse.julialang.org/u/iArchimedes)\
**Replies:** 0\
**Last updated:** [June 1, 2018, 6:32am UTC](https://discourse.julialang.org/t/pkg-update-error-on-mac-osx-giterror/11324 "2018-06-01T06:32:25Z")

</div>

Couldn’t update julia on mac os X. I am using julia on a ubuntu as well. No issue there. The error message is pasted below: julia\> Pkg.update() INFO: Updating METADATA… ERROR: GitError(Code:ENOTFOUND, Class:Repository…

---

## [Speedup of \`\\\` solver bottleneck](https://discourse.julialang.org/t/speedup-of-solver-bottleneck/11279)

<div class="topic-metadata">

**Author:** [@stst](https://discourse.julialang.org/u/stst)\
**Replies:** 8\
**Last updated:** [June 1, 2018, 3:33am UTC](https://discourse.julialang.org/t/speedup-of-solver-bottleneck/11279 "2018-06-01T03:33:19Z")

</div>

Below is my implementation of the block principal pivoting algorithm for solving a non-negative linear least squares problem. This function is the bottleneck in my code (running on v0.6.2), which calls this in an inner l…

---

## [Using a type in a generated module](https://discourse.julialang.org/t/using-a-type-in-a-generated-module/11306)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 1\
**Last updated:** [June 1, 2018, 12:33am UTC](https://discourse.julialang.org/t/using-a-type-in-a-generated-module/11306 "2018-06-01T00:33:35Z")

</div>

Hi, I am looking for a way to generate a module using a type which is not imported in the generated module, meaning i need the full path to the type. How can i get this done? Here is an example: module DF is\_module…

---

## [World age error when parsing function from String](https://discourse.julialang.org/t/world-age-error-when-parsing-function-from-string/11277)

<div class="topic-metadata">

**Author:** [@jocklawrie](https://discourse.julialang.org/u/jocklawrie)\
**Replies:** 4\
**Last updated:** [May 31, 2018, 11:10pm UTC](https://discourse.julialang.org/t/world-age-error-when-parsing-function-from-string/11277 "2018-05-31T23:10:11Z")

</div>

Hi all, I am using DataFrames and wanting to specify intra-row constraints in YAML, which can then be parsed and applied to each row of the data. As an example, the following code works: d = DataFrame( id = UInt.(…

---

## [\`@threads\` with \`@simd\` performance regression on \`0.7.0-alpha\`](https://discourse.julialang.org/t/threads-with-simd-performance-regression-on-0-7-0-alpha/11297)

<div class="topic-metadata">

**Author:** [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Replies:** 1\
**Last updated:** [May 31, 2018, 10:55pm UTC](https://discourse.julialang.org/t/threads-with-simd-performance-regression-on-0-7-0-alpha/11297 "2018-05-31T22:55:33Z")

</div>

Hello, I encountered this in one of my applications. All these tests are with 1 thread. Here is a MWE: function filla!(a) for i2 in 1:size(a,2) @simd for i1 in 1:size(a,1) @inbo…

---

## [Calculation of formal solution of dynamical systems](https://discourse.julialang.org/t/calculation-of-formal-solution-of-dynamical-systems/11046)

<div class="topic-metadata">

**Author:** [@gmouts](https://discourse.julialang.org/u/gmouts)\
**Replies:** 25\
**Last updated:** [May 31, 2018, 10:54pm UTC](https://discourse.julialang.org/t/calculation-of-formal-solution-of-dynamical-systems/11046 "2018-05-31T22:54:41Z")

</div>

I want to calculate the formal solution of a discreet dynamical system (obviously not the whole infinite series, but let’s say all terms up to order N). For simplicity let’s get the example of f(z) = z + z^2 + z^3. I wa…

---

## [How do you get LaTeX representation from PGFPlots in Plots.jl?](https://discourse.julialang.org/t/how-do-you-get-latex-representation-from-pgfplots-in-plots-jl/11312)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 1\
**Last updated:** [May 31, 2018, 10:16pm UTC](https://discourse.julialang.org/t/how-do-you-get-latex-representation-from-pgfplots-in-plots-jl/11312 "2018-05-31T22:16:35Z")

</div>

Is there a way to monkey around with a plot using Plots.jl and then get the LaTeX code that would produce it? // using the PGFPlots backend

---

## [Inbounds still gives me a bounds error](https://discourse.julialang.org/t/inbounds-still-gives-me-a-bounds-error/11281)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 14\
**Last updated:** [May 31, 2018, 10:05pm UTC](https://discourse.julialang.org/t/inbounds-still-gives-me-a-bounds-error/11281 "2018-05-31T22:05:19Z")

</div>

Why does this code: T = \[1,2,3\] @inbounds x = T\[4\] gives me an error: ERROR: LoadError: BoundsError: attempt to access 3-element Array{Int64,1} at index \[4\] Stacktrace: \[1\] getindex(::Array{Int64,1}, ::Int64) at ./a…

---

## [Installation JuliaPro-0.6.2.2](https://discourse.julialang.org/t/installation-juliapro-0-6-2-2/11310)

<div class="topic-metadata">

**Author:** [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Replies:** 0\
**Last updated:** [May 31, 2018, 9:24pm UTC](https://discourse.julialang.org/t/installation-juliapro-0-6-2-2/11310 "2018-05-31T21:24:22Z")

</div>

Downloaded the newest version JuliaPro and tried to install. It failed due to a permission denial: chobbes@sms0061:~/Downloads/JuliaPro$ ./JuliaPro-0.6.2.2\_build-314.sh /home/chobbes/julia JuliaPro installation has star…

---

## [Help with a Macro](https://discourse.julialang.org/t/help-with-a-macro/11300)

<div class="topic-metadata">

**Author:** [@TsurHerman](https://discourse.julialang.org/u/TsurHerman)\
**Replies:** 2\
**Last updated:** [May 31, 2018, 9:02pm UTC](https://discourse.julialang.org/t/help-with-a-macro/11300 "2018-05-31T21:02:49Z")

</div>

Help! I need to transform function definitions from their normal form FFF(a::Int64,b::Int64) = a+b) function FFF(a::A,b::B) a+b a-b end to const FFF = MultiFunc(:FFF,:Main) @generated ContextCall{:FFF,:Main,…

---

## [Problems after switch to Pkg3](https://discourse.julialang.org/t/problems-after-switch-to-pkg3/11144)

<div class="topic-metadata">

**Author:** [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Replies:** 20\
**Last updated:** [May 31, 2018, 3:29pm UTC](https://discourse.julialang.org/t/problems-after-switch-to-pkg3/11144 "2018-05-31T15:29:52Z")

</div>

I’ve been running into a strange problem ever since the switch on master to Pkg3 building one of my packages (which works fine still on v0.6.2, and older versions of v0.7). For some reason, a Char is being passed to the…

---

## [Deploying julia packages once in the cloud (google dataflow) (pipeline)](https://discourse.julialang.org/t/deploying-julia-packages-once-in-the-cloud-google-dataflow-pipeline/11286)

<div class="topic-metadata">

**Author:** [@guillempuig1](https://discourse.julialang.org/u/guillempuig1)\
**Replies:** 6\
**Last updated:** [May 31, 2018, 1:58pm UTC](https://discourse.julialang.org/t/deploying-julia-packages-once-in-the-cloud-google-dataflow-pipeline/11286 "2018-05-31T13:58:03Z")

</div>

Hi everyone! I’m trying to run my julia model in google dataflow. The issue is that I have to install Julia(\>=v0.5.2) by an script of python (language supported in GCP) via subprocess statements because I need that the …

---

## [Sums of a ragged array](https://discourse.julialang.org/t/sums-of-a-ragged-array/11246)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 2\
**Last updated:** [May 31, 2018, 1:06pm UTC](https://discourse.julialang.org/t/sums-of-a-ragged-array/11246 "2018-05-31T13:06:23Z")

</div>

I have a ragged array in the form of a vector of values, vals, and a corresponding vector of indices, ind. Both of these vectors are of length n. The elements of ind are in the range 1:k. I want to increment a k-vecto…

---

## [Performance Issue with Gtk.jl](https://discourse.julialang.org/t/performance-issue-with-gtk-jl/6171)

<div class="topic-metadata">

**Author:** [@tobias.knopp](https://discourse.julialang.org/u/tobias.knopp)\
**Replies:** 7\
**Last updated:** [May 31, 2018, 8:45am UTC](https://discourse.julialang.org/t/performance-issue-with-gtk-jl/6171 "2018-05-31T08:45:12Z")

</div>

Hi, I have a performance issue that may be linked to Gtk.jl. My application needs 30 sec to start up the first time and profiling tells me that most of the time is spend in inference. The app is a little larger so that …

---

## [Why does \[1; 2; 3\] creates an Array of dimension 1 instead of 3x1 Array of dimnesion 2](https://discourse.julialang.org/t/why-does-1-2-3-creates-an-array-of-dimension-1-instead-of-3x1-array-of-dimnesion-2/11233)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 7\
**Last updated:** [May 31, 2018, 8:40am UTC](https://discourse.julialang.org/t/why-does-1-2-3-creates-an-array-of-dimension-1-instead-of-3x1-array-of-dimnesion-2/11233 "2018-05-31T08:40:32Z")

</div>

Hello, following the docs , is a separator while space is a horizontal concatination and ; is vertical one. Now, to have a consistant behavior, why not do it the following: julia\> \[1, 2, 3\] 3-element Array{Int64,1}: 1 …

---

## [Getproperty, decorations, inheritance in 0.7](https://discourse.julialang.org/t/getproperty-decorations-inheritance-in-0-7/11237)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 17\
**Last updated:** [May 31, 2018, 7:58am UTC](https://discourse.julialang.org/t/getproperty-decorations-inheritance-in-0-7/11237 "2018-05-31T07:58:33Z")

</div>

I wanted to ask whether there is a sensible way of decorating functions. That is, if I have a function f(x)=false, then I can clearly define g(x)=(x==42?f(x):true), and hence have decorated f. However, I want to do this…

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

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