# General Usage

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

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

**Page:** 985

---

## [Problems calling Fortran in Windows](https://discourse.julialang.org/t/problems-calling-fortran-in-windows/10271)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 3\
**Last updated:** [April 11, 2018, 12:59pm UTC](https://discourse.julialang.org/t/problems-calling-fortran-in-windows/10271 "2018-04-11T12:59:24Z")

</div>

Hi guys, We are trying to call a Fortan function (IGRF) from Windows. The fortan code is: https://www.ngdc.noaa.gov/IAGA/vmod/igrf12.f (Actually many things are removed, we only need the igrf12syn function) We are com…

---

## [Understanding how broadcasting works with Dict](https://discourse.julialang.org/t/understanding-how-broadcasting-works-with-dict/10272)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 2\
**Last updated:** [April 11, 2018, 5:26am UTC](https://discourse.julialang.org/t/understanding-how-broadcasting-works-with-dict/10272 "2018-04-11T05:26:29Z")

</div>

I’m trying to work out what happens under the hood in the following broadcasting situation: d = Dict{Int,String}(1=\>"a") get.(d, \[1,2\], "nothing here") The output is as I expected, ie \["a", "nothing here"\]. But what I …

---

## [Pkg.add proxy authentication required, but no callback provided](https://discourse.julialang.org/t/pkg-add-proxy-authentication-required-but-no-callback-provided/10244)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 3\
**Last updated:** [April 10, 2018, 11:43pm UTC](https://discourse.julialang.org/t/pkg-add-proxy-authentication-required-but-no-callback-provided/10244 "2018-04-10T23:43:50Z")

</div>

Help! I am stuck in a maze of twisty packages. I am behind a corporate firewall, though I can set the variable http\_proxy and run a git clone from the bash command prompt. In the Julia REPL I get this failure: ulia\> …

---

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

<div class="topic-metadata">

**Author:** [@hawttubbz](https://discourse.julialang.org/u/hawttubbz)\
**Replies:** 1\
**Last updated:** [April 10, 2018, 10:31pm UTC](https://discourse.julialang.org/t/pkg-update/10267 "2018-04-10T22:31:16Z")

</div>

When I try and update my package on my work computer using Pkg.update() in the julia terminal I get the error below. Note, I am using a work computer (windows) and have been using a proxy. Second I have plenty of memory …

---

## [Initializing a number matrix](https://discourse.julialang.org/t/initializing-a-number-matrix/10248)

<div class="topic-metadata">

**Author:** [@jebej](https://discourse.julialang.org/u/jebej)\
**Replies:** 19\
**Last updated:** [April 10, 2018, 7:51pm UTC](https://discourse.julialang.org/t/initializing-a-number-matrix/10248 "2018-04-10T19:51:52Z")

</div>

I was wondering if there was a faster way of initializing a number matrix without needing to traverse the matrix twice as in the following code (where the first zeros command needs to go over the whole matrix to zero it …

---

## [Colors and markers in grouped plot](https://discourse.julialang.org/t/colors-and-markers-in-grouped-plot/10264)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 0\
**Last updated:** [April 10, 2018, 6:02pm UTC](https://discourse.julialang.org/t/colors-and-markers-in-grouped-plot/10264 "2018-04-10T18:02:13Z")

</div>

I really appreciate the grouped plot from StatPlots.jl, in particular since this PR (adjusting group legend lables nicely) has been merged. However, typically I want to group and plot data according to, let’s say, two c…

---

## [Strange behavior for subtraction AST?](https://discourse.julialang.org/t/strange-behavior-for-subtraction-ast/10258)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 1\
**Last updated:** [April 10, 2018, 1:31pm UTC](https://discourse.julialang.org/t/strange-behavior-for-subtraction-ast/10258 "2018-04-10T13:31:35Z")

</div>

Hi, I was wondering why the Julia AST automatically splits subtraction into multiple operations: julia\> :(x-y-z) :((x - y) - z) julia\> dump(ans) Expr head: Symbol call args: Array{Any}((3,)) 1: Symbol - 2: …

---

## [Concatenation on matrix-like types on 0.7](https://discourse.julialang.org/t/concatenation-on-matrix-like-types-on-0-7/10251)

<div class="topic-metadata">

**Author:** [@abelsiqueira](https://discourse.julialang.org/u/abelsiqueira)\
**Replies:** 2\
**Last updated:** [April 10, 2018, 11:29am UTC](https://discourse.julialang.org/t/concatenation-on-matrix-like-types-on-0-7/10251 "2018-04-10T11:29:26Z")

</div>

I think this commit broke LinearOperators here. Essentially, making \[A B; C\] calls something different on 0.7, and doesn’t work with the default hcat and vcat. A workaround would be to define hvcat for LinearOperators, …

---

## [Instantiate the type from a few strings](https://discourse.julialang.org/t/instantiate-the-type-from-a-few-strings/10260)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 4\
**Last updated:** [April 10, 2018, 10:24am UTC](https://discourse.julialang.org/t/instantiate-the-type-from-a-few-strings/10260 "2018-04-10T10:24:02Z")

</div>

I have a Dict{String, \<values\>} and I want to instantiate a type depending on the keys of that dict: x = Dict("a" =\> 2, "b" =\> 0.0) struct AnB a::Int b::Float64 end y = fun(x) # returns AnB(2, 0.0) I’m going to …

---

## [How to run lowered AST?](https://discourse.julialang.org/t/how-to-run-lowered-ast/10231)

<div class="topic-metadata">

**Author:** [@Per](https://discourse.julialang.org/u/Per)\
**Replies:** 10\
**Last updated:** [April 10, 2018, 10:22am UTC](https://discourse.julialang.org/t/how-to-run-lowered-ast/10231 "2018-04-10T10:22:27Z")

</div>

Is there an “official” way to run the CodeInfo objects that one gets from code\_typed? I’d like to be able to do some transformations on code based the types of intermediate results, and then run the transformed code. (I…

---

## [Lost type information in nested tuples?](https://discourse.julialang.org/t/lost-type-information-in-nested-tuples/10253)

<div class="topic-metadata">

**Author:** [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Replies:** 1\
**Last updated:** [April 10, 2018, 1:41am UTC](https://discourse.julialang.org/t/lost-type-information-in-nested-tuples/10253 "2018-04-10T01:41:37Z")

</div>

Zips of several items result in iterator states which are nested tuples. I have a line in my code\_warntype which looks like this: s@\_7::Tuple{Int64,Tuple{Int64,Tuple{Int64,Tuple{Int64,Tuple}}}} = (Base.Iterators.tuple)(…

---

## [Type Issues and Memory Mangement](https://discourse.julialang.org/t/type-issues-and-memory-mangement/10237)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 15\
**Last updated:** [April 10, 2018, 1:07am UTC](https://discourse.julialang.org/t/type-issues-and-memory-mangement/10237 "2018-04-10T01:07:08Z")

</div>

For the following code: function run0(x, V, n) for i=1:n V(x); end end function vA(x,A) v = 0.5 \* A \* x^2; return v end v1 = x-\> vA(x,2); x0 = rand(); @time run0(x0, v1, 10) @time run0(x0, v…

---

## [Test-oriented development, Julia, and me](https://discourse.julialang.org/t/test-oriented-development-julia-and-me/10245)

<div class="topic-metadata">

**Author:** [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Replies:** 7\
**Last updated:** [April 9, 2018, 7:10pm UTC](https://discourse.julialang.org/t/test-oriented-development-julia-and-me/10245 "2018-04-09T19:10:07Z")

</div>

Like many users of Julia, I’m an engineer who mostly uses it to write one-off scripts and do ad-hoc calculations. But I’ve also started to try to wrap up some of my more commonly-used functionality into packages for re…

---

## [How to create fixed-length tuple without heap allocation](https://discourse.julialang.org/t/how-to-create-fixed-length-tuple-without-heap-allocation/10250)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 2\
**Last updated:** [April 9, 2018, 6:05pm UTC](https://discourse.julialang.org/t/how-to-create-fixed-length-tuple-without-heap-allocation/10250 "2018-04-09T18:05:45Z")

</div>

The following program allocates memory (according to the @time macro) proportionally to n, which suggests that each invocation of tuple creates something on the heap. Note that the program is written so that the length …

---

## [Help on optimization](https://discourse.julialang.org/t/help-on-optimization/10238)

<div class="topic-metadata">

**Author:** [@Lian\_Yunlong](https://discourse.julialang.org/u/Lian_Yunlong)\
**Replies:** 11\
**Last updated:** [April 9, 2018, 2:39pm UTC](https://discourse.julialang.org/t/help-on-optimization/10238 "2018-04-09T14:39:49Z")

</div>

Hello everyone, I need some help on optimization of a function, which looks like this # re-edit SpMatrixListUnion = Union{Vector{SparseMatrixCSC{Float64,Int64}},Vector{SparseMatrixCSC{Complex128,Int64}}} function avg\_…

---

## [Correct way to declare global constant in modules](https://discourse.julialang.org/t/correct-way-to-declare-global-constant-in-modules/10234)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 15\
**Last updated:** [April 9, 2018, 2:17pm UTC](https://discourse.julialang.org/t/correct-way-to-declare-global-constant-in-modules/10234 "2018-04-09T14:17:42Z")

</div>

Hi guys, I have a module with a lot of global constants. Those are related to physical quantities, like Earth gravitational parameter. These are declared as: const R0 = 6378137.0 I was analyzing the type-stability of …

---

## [Is it possible to write to a (UTF8) data file like ANSI? (iso\_8859\_2")](https://discourse.julialang.org/t/is-it-possible-to-write-to-a-utf8-data-file-like-ansi-iso-8859-2/10219)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 1\
**Last updated:** [April 7, 2018, 12:19pm UTC](https://discourse.julialang.org/t/is-it-possible-to-write-to-a-utf8-data-file-like-ansi-iso-8859-2/10219 "2018-04-07T12:19:39Z")

</div>

Is posible write to file data (UTF8) like ANSI ? (iso\_8859\_2") i need to write array as txt file coding iso\_8859\_2? in Julia my\_array=\["żyć" "błąd";1 5;3 6\] how to save my\_array as file.txt coding by iso\_8859\_2? Pa…

---

## [ZMQ Assertion failed error](https://discourse.julialang.org/t/zmq-assertion-failed-error/10208)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 0\
**Last updated:** [April 6, 2018, 10:12pm UTC](https://discourse.julialang.org/t/zmq-assertion-failed-error/10208 "2018-04-06T22:12:52Z")

</div>

ZMQ hasn’t worked on my main development computer for almost a year now. This means IJulia hasn’t worked. Here’s the issue: https://github.com/JuliaInterop/ZMQ.jl/issues/147 The errors are still the same. And it’s only…

---

## [Rules of thumb for choosing between storing information as struct field or static parameters](https://discourse.julialang.org/t/rules-of-thumb-for-choosing-between-storing-information-as-struct-field-or-static-parameters/10202)

<div class="topic-metadata">

**Author:** [@favba](https://discourse.julialang.org/u/favba)\
**Replies:** 8\
**Last updated:** [April 6, 2018, 7:04pm UTC](https://discourse.julialang.org/t/rules-of-thumb-for-choosing-between-storing-information-as-struct-field-or-static-parameters/10202 "2018-04-06T19:04:57Z")

</div>

TLDR; When is it interesting to “store” field values as static parameters instead of struct fields? as in struct test{fieldA #= This is a Tuple{Int,Int}=#} fieldB::Vector{Int} end vs struct test fieldA::Tuple…

---

## [Question about abs()](https://discourse.julialang.org/t/question-about-abs/10198)

<div class="topic-metadata">

**Author:** [@s920128](https://discourse.julialang.org/u/s920128)\
**Replies:** 6\
**Last updated:** [April 6, 2018, 2:34pm UTC](https://discourse.julialang.org/t/question-about-abs/10198 "2018-04-06T14:34:22Z")

</div>

I use abs(-9223372036854775808) in Julia but output is -9223372036854775808 Is this a bug?

---

## [PDF version of docs for v0.6?](https://discourse.julialang.org/t/pdf-version-of-docs-for-v0-6/4559)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 20\
**Last updated:** [April 6, 2018, 1:11pm UTC](https://discourse.julialang.org/t/pdf-version-of-docs-for-v0-6/4559 "2018-04-06T13:11:47Z")

</div>

Where can I find a PDF version of Julia docs for v0.6?

---

## [some question about Ipopt package](https://discourse.julialang.org/t/some-question-about-ipopt-package/10150)

<div class="topic-metadata">

**Author:** [@Jelly](https://discourse.julialang.org/u/Jelly)\
**Replies:** 6\
**Last updated:** [April 6, 2018, 3:33am UTC](https://discourse.julialang.org/t/some-question-about-ipopt-package/10150 "2018-04-06T03:33:56Z")

</div>

After i install Ipopt for Julia , when i execute Pkg.test(“Ipopt”) , it come errors with \*\* ERROR: LoadError: UndefVarError: use\_BinaryProvider not defined ERROR: LoadError: Failed to precompile Ipopt to d:\\JuliaPro-…

---

## [Type inference for vcat](https://discourse.julialang.org/t/type-inference-for-vcat/10169)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 7\
**Last updated:** [April 6, 2018, 1:48am UTC](https://discourse.julialang.org/t/type-inference-for-vcat/10169 "2018-04-06T01:48:04Z")

</div>

Hi all, I’m just trying to understand the rules for type inference when using vcat. Consider the following operations on v0.7: vcat(Int\[\], 1) vcat(String\[\], "a") vcat(UnitRange{Int}\[\], 1:1) vcat(Vector{Int}\[\], \[1\]) re…

---

## [Complex where clause in promote\_rule](https://discourse.julialang.org/t/complex-where-clause-in-promote-rule/10156)

<div class="topic-metadata">

**Author:** [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Replies:** 6\
**Last updated:** [April 5, 2018, 7:48pm UTC](https://discourse.julialang.org/t/complex-where-clause-in-promote-rule/10156 "2018-04-05T19:48:14Z")

</div>

I’d like to better understand what is possible to do in the where clause of a typed function. In my case, I’m trying to enhance fixed-point arithmetics for a project that verifies an algorithm to be implemented on an em…

---

## [ForwardDiff and GradientConfig memory usage](https://discourse.julialang.org/t/forwarddiff-and-gradientconfig-memory-usage/10145)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 10\
**Last updated:** [April 5, 2018, 4:46pm UTC](https://discourse.julialang.org/t/forwarddiff-and-gradientconfig-memory-usage/10145 "2018-04-05T16:46:39Z")

</div>

I noticed the following issue when trying to minimize my memory allocation while using ForwardDiff.gradient! . My example looks like: using ForwardDiff function run0(x, f, n) out = similar(x); cfg = Forwar…

---

## [New identity matrix constructor (0.7) in 0.6](https://discourse.julialang.org/t/new-identity-matrix-constructor-0-7-in-0-6/10172)

<div class="topic-metadata">

**Author:** [@jonas-kr](https://discourse.julialang.org/u/jonas-kr)\
**Replies:** 2\
**Last updated:** [April 5, 2018, 10:22am UTC](https://discourse.julialang.org/t/new-identity-matrix-constructor-0-7-in-0-6/10172 "2018-04-05T10:22:18Z")

</div>

I noticed some rather strange behavior running julia 0.6.2. On a ‘fresh’ instance of julia without any packages, Matrix(1.0I, 3, 3) does not work. However, as soon as I load the BenchmarkTools package, the identity mat…

---

## [Parallel windowing](https://discourse.julialang.org/t/parallel-windowing/10170)

<div class="topic-metadata">

**Author:** [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Replies:** 6\
**Last updated:** [April 5, 2018, 7:22am UTC](https://discourse.julialang.org/t/parallel-windowing/10170 "2018-04-05T07:22:24Z")

</div>

To determine the values of a simple moving average, where the length of the MA window is much smaller than the length of the data vector, one may … and usually does … run through the data sequentially, moving the window …

---

## [Local function redefinition: feature or bug?](https://discourse.julialang.org/t/local-function-redefinition-feature-or-bug/10158)

<div class="topic-metadata">

**Author:** [@longqian95](https://discourse.julialang.org/u/longqian95)\
**Replies:** 3\
**Last updated:** [April 4, 2018, 10:33pm UTC](https://discourse.julialang.org/t/local-function-redefinition-feature-or-bug/10158 "2018-04-04T22:33:27Z")

</div>

For the followed function, t() will output 12 in Julia0.4 and output 22 since Julia0.5. Is that a feature or bug? Anyway, it looks strange to output 22 and cause a hard bug after I upgrade my some old Julia code from 0.4…

---

## [Performance of findfirst in 0.7](https://discourse.julialang.org/t/performance-of-findfirst-in-0-7/10160)

<div class="topic-metadata">

**Author:** [@sambitdash](https://discourse.julialang.org/u/sambitdash)\
**Replies:** 10\
**Last updated:** [April 4, 2018, 9:02pm UTC](https://discourse.julialang.org/t/performance-of-findfirst-in-0-7/10160 "2018-04-04T21:02:55Z")

</div>

Hi All, The performance of findfirst(A, value) has significantly been affected in 0.7. It’s understandable that the method is deprecated. But changing the functionality in a manner that performance is substantially affe…

---

## [Mod not defined for two identical irrationals](https://discourse.julialang.org/t/mod-not-defined-for-two-identical-irrationals/10153)

<div class="topic-metadata">

**Author:** [@mvhulten](https://discourse.julialang.org/u/mvhulten)\
**Replies:** 8\
**Last updated:** [April 4, 2018, 6:56pm UTC](https://discourse.julialang.org/t/mod-not-defined-for-two-identical-irrationals/10153 "2018-04-04T18:56:35Z")

</div>

julia\> mod(π,ℯ) 0.423310825130748 julia\> mod(√2,π) 1.4142135623730951 julia\> mod(π,π) ERROR: mod not defined for Irrational{:π} Stacktrace: \[1\] error(::String, ::String, ::Type) at ./error.jl:42 \[2\] no\_op\_err at ./pr…

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

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