# General Usage

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

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

**Page:** 960

---

## [Different timing results when putting tic() toc() inside or outside a function](https://discourse.julialang.org/t/different-timing-results-when-putting-tic-toc-inside-or-outside-a-function/12806)

<div class="topic-metadata">

**Author:** [@Norman](https://discourse.julialang.org/u/Norman)\
**Replies:** 2\
**Last updated:** [August 2, 2018, 5:34am UTC](https://discourse.julialang.org/t/different-timing-results-when-putting-tic-toc-inside-or-outside-a-function/12806 "2018-08-02T05:34:47Z")

</div>

Here is a minimal working example to illustrate what I am trying to ask: function test(n::Int) tic() i = 0 while (i \<= n) A = randn(100,100) B = randn(100,100) C = A\*B i+=1 end toc() end test(100) I al…

---

## [Weave pkg to produce reports in Julia](https://discourse.julialang.org/t/weave-pkg-to-produce-reports-in-julia/12796)

<div class="topic-metadata">

**Author:** [@mvcavalcanti](https://discourse.julialang.org/u/mvcavalcanti)\
**Replies:** 7\
**Last updated:** [August 1, 2018, 9:56pm UTC](https://discourse.julialang.org/t/weave-pkg-to-produce-reports-in-julia/12796 "2018-08-01T21:56:29Z")

</div>

Hi. I’d like to do some reports in Julia as I used to do in R through RMarkdown. I found a pkg called Weave to do the same thing but it seems for me that it is necessary a greater integration with Latex (and also Python…

---

## [Vector of partially concrete parametric types](https://discourse.julialang.org/t/vector-of-partially-concrete-parametric-types/12795)

<div class="topic-metadata">

**Author:** [@dawbarton](https://discourse.julialang.org/u/dawbarton)\
**Replies:** 5\
**Last updated:** [August 1, 2018, 9:16pm UTC](https://discourse.julialang.org/t/vector-of-partially-concrete-parametric-types/12795 "2018-08-01T21:16:20Z")

</div>

I thought I understood the where syntax but apparently I don’t. I have a parameterised structure along the lines of struct MyStruct{T \<: Number, F} u::Vector{T} f::F end and I’d like to have a vector of these s…

---

## [Type instability if function inside a struct is run inside another function](https://discourse.julialang.org/t/type-instability-if-function-inside-a-struct-is-run-inside-another-function/12789)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 5\
**Last updated:** [August 1, 2018, 7:32pm UTC](https://discourse.julialang.org/t/type-instability-if-function-inside-a-struct-is-run-inside-another-function/12789 "2018-08-01T19:32:04Z")

</div>

Hello, If I have a function inside a struct and run that function inside another function, the output will be type-unstable. Example: struct StructWithFunction func::Function end struct\_with\_function = StructWithF…

---

## [Missing or NaN](https://discourse.julialang.org/t/missing-or-nan/12729)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 26\
**Last updated:** [August 1, 2018, 4:33pm UTC](https://discourse.julialang.org/t/missing-or-nan/12729 "2018-08-01T16:33:15Z")

</div>

I read the excellent write-up on the new Missing type and the value missing that will be more fully adopted in Julia 0.7, replacing the use of Nullable arrays (yeah!). I see that there are many concerns with R’s and oth…

---

## [Julia 0.7-rc1.5 hangs on \`build SpecialFunctions\`](https://discourse.julialang.org/t/julia-0-7-rc1-5-hangs-on-build-specialfunctions/12794)

<div class="topic-metadata">

**Author:** [@goedman](https://discourse.julialang.org/u/goedman)\
**Replies:** 1\
**Last updated:** [August 1, 2018, 4:30pm UTC](https://discourse.julialang.org/t/julia-0-7-rc1-5-hangs-on-build-specialfunctions/12794 "2018-08-01T16:30:16Z")

</div>

Not sure if I should report this on JuliaLang issues or here. But on a complete clean install of Julia 0.7-rc1.5, attempting to (v0.7) pkg\> add SpecialFunctions will get to the build step and never return. Build log fil…

---

## [Cannot add DifferentialEquations](https://discourse.julialang.org/t/cannot-add-differentialequations/8660)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 19\
**Last updated:** [August 1, 2018, 2:18pm UTC](https://discourse.julialang.org/t/cannot-add-differentialequations/8660 "2018-08-01T14:18:01Z")

</div>

Trying to add DifferentialEquations with DynamicalSystems installed results in a package requirements error in 0.6.2: julia\> Pkg.add("DifferentialEquations") ERROR: resolve is unable to satisfy package requirements. T…

---

## [Pkg.update() throws an error](https://discourse.julialang.org/t/pkg-update-throws-an-error/10797)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 2\
**Last updated:** [August 1, 2018, 1:39pm UTC](https://discourse.julialang.org/t/pkg-update-throws-an-error/10797 "2018-08-01T13:39:59Z")

</div>

Hi, In Julia 0.6, I type Pkg.update() which is the usual procedure to update all my packages. But this time, it throws an error: INFO: Updating METADATA... METADATA cannot be updated. Resolve problems manually in C:…

---

## [Find date-interval for ±n weekdays](https://discourse.julialang.org/t/find-date-interval-for-n-weekdays/12780)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 8\
**Last updated:** [August 1, 2018, 12:08pm UTC](https://discourse.julialang.org/t/find-date-interval-for-n-weekdays/12780 "2018-08-01T12:08:37Z")

</div>

I needed to find the dates for a plus-minus n weekdays interval, you know, when they say the product will be delivered in 5 working/week days. I couldn’t find anything, so I made this: function weekdaysinterval(today, w…

---

## [How to fix precompilation bug on NLsolve?](https://discourse.julialang.org/t/how-to-fix-precompilation-bug-on-nlsolve/6430)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 2\
**Last updated:** [August 1, 2018, 10:03am UTC](https://discourse.julialang.org/t/how-to-fix-precompilation-bug-on-nlsolve/6430 "2018-08-01T10:03:38Z")

</div>

Getting the following error from using NLsolve: INFO: Precompiling module NLsolve. Failed to precompile NLsolve to /home/ubuntu/.julia/lib/v0.6/NLsolve.ji. Stacktrace: \[1\] compilecache(::String) at ./loading.jl:703 \[…

---

## [Scraping a "scrap-unfriendly" web page in Julia](https://discourse.julialang.org/t/scraping-a-scrap-unfriendly-web-page-in-julia/10843)

<div class="topic-metadata">

**Author:** [@askvorts](https://discourse.julialang.org/u/askvorts)\
**Replies:** 8\
**Last updated:** [August 1, 2018, 6:38am UTC](https://discourse.julialang.org/t/scraping-a-scrap-unfriendly-web-page-in-julia/10843 "2018-08-01T06:38:43Z")

</div>

I am trying to get the html source of a public web page using the HTTP.request function, in such a way that it would be feasible to scrap some numeric data. r = HTTP.request("GET", "https://www.euronext.com/en/products/…

---

## [Different requirements for packages, using, building, and testing](https://discourse.julialang.org/t/different-requirements-for-packages-using-building-and-testing/2170)

<div class="topic-metadata">

**Author:** [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Replies:** 15\
**Last updated:** [August 1, 2018, 4:57am UTC](https://discourse.julialang.org/t/different-requirements-for-packages-using-building-and-testing/2170 "2018-08-01T04:57:47Z")

</div>

Is there a way of specifying distinct requirements for a package, for using it, for building, and for testing? For example, I have a package that needs LightXML, but only for running deps/build.jl, which downloads one o…

---

## [Macro behaves differently than manually running the output of macroexpand](https://discourse.julialang.org/t/macro-behaves-differently-than-manually-running-the-output-of-macroexpand/12727)

<div class="topic-metadata">

**Author:** [@yha](https://discourse.julialang.org/u/yha)\
**Replies:** 8\
**Last updated:** [July 31, 2018, 5:29pm UTC](https://discourse.julialang.org/t/macro-behaves-differently-than-manually-running-the-output-of-macroexpand/12727 "2018-07-31T17:29:15Z")

</div>

I’m trying to write a macro and found a problem that I fail to debug, since macroexpand gives code that runs just fine. MWE (on Julia 0.6.3): after defining function \_b(iter\_vars, ranges) iter\_exprs = \[:($(esc(v)) =…

---

## [Dependencies problem in new Pkg](https://discourse.julialang.org/t/dependencies-problem-in-new-pkg/12767)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 13\
**Last updated:** [July 31, 2018, 5:26pm UTC](https://discourse.julialang.org/t/dependencies-problem-in-new-pkg/12767 "2018-07-31T17:26:43Z")

</div>

Hi guys! I am making my packages ready for v0.7 but I am facing a problem. In new Pkg, I added my package using: \]add SatelliteToolbox dev SatelliteToolbox The problem is that, in the tests, it says that the package R…

---

## [ODBC problem: DSN and SQLTimestamp not defined](https://discourse.julialang.org/t/odbc-problem-dsn-and-sqltimestamp-not-defined/12768)

<div class="topic-metadata">

**Author:** [@guillempuig1](https://discourse.julialang.org/u/guillempuig1)\
**Replies:** 0\
**Last updated:** [July 31, 2018, 2:44pm UTC](https://discourse.julialang.org/t/odbc-problem-dsn-and-sqltimestamp-not-defined/12768 "2018-07-31T14:44:28Z")

</div>

Hi! I’m using ODBC package in Julia v0.6.4, however, I’m getting the followinf LoadError: UndefVarError Whereas I’m using ODBC at the very first line of the code, and it is working normmaly. To show more detail, I…

---

## [Accumulating mixed data and then accessing it](https://discourse.julialang.org/t/accumulating-mixed-data-and-then-accessing-it/12766)

<div class="topic-metadata">

**Author:** [@GlenHenshaw](https://discourse.julialang.org/u/GlenHenshaw)\
**Replies:** 2\
**Last updated:** [July 31, 2018, 1:58pm UTC](https://discourse.julialang.org/t/accumulating-mixed-data-and-then-accessing-it/12766 "2018-07-31T13:58:48Z")

</div>

I have code that iterates over a long, indeterminate period of time, and at the end of each iteration produces a mixed set of data. I would like to efficiently store all of this data and then do something useful with it …

---

## [Building documentation on travis via Documenter: can't find the installed packages](https://discourse.julialang.org/t/building-documentation-on-travis-via-documenter-cant-find-the-installed-packages/12763)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 3\
**Last updated:** [July 31, 2018, 12:13pm UTC](https://discourse.julialang.org/t/building-documentation-on-travis-via-documenter-cant-find-the-installed-packages/12763 "2018-07-31T12:13:07Z")

</div>

I would very much so appreciate some help with building documentation on Travis. I have this package which the only thing it does is host the documentation: https://github.com/JuliaMusic/JuliaMusic\_documentation.jl with…

---

## [Julian way of comparing two dictionaries](https://discourse.julialang.org/t/julian-way-of-comparing-two-dictionaries/5693)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 8\
**Last updated:** [July 31, 2018, 8:09am UTC](https://discourse.julialang.org/t/julian-way-of-comparing-two-dictionaries/5693 "2018-07-31T08:09:31Z")

</div>

How do you compare two dictionaries? d1 = Dict(1=\>2., 3=\>4.) d2 = Dict(3=\>4., 1=\>2.) d3 = Dict(1=\>0., 3=\>4.) d1 == d2 # true d1 == d3 # false

---

## [Memory allocation due to assignment in a fixed size mutable array](https://discourse.julialang.org/t/memory-allocation-due-to-assignment-in-a-fixed-size-mutable-array/12759)

<div class="topic-metadata">

**Author:** [@Snir\_Gazit](https://discourse.julialang.org/u/Snir_Gazit)\
**Replies:** 1\
**Last updated:** [July 31, 2018, 3:53am UTC](https://discourse.julialang.org/t/memory-allocation-due-to-assignment-in-a-fixed-size-mutable-array/12759 "2018-07-31T03:53:18Z")

</div>

I am writing a function that stores locally a temporary set of values saved for a later computation. During “compile” time I know the size of the array. To avoid memory allocation, I am using a mutable array from the Sta…

---

## [Broadcasting with vectors of static vectors](https://discourse.julialang.org/t/broadcasting-with-vectors-of-static-vectors/12693)

<div class="topic-metadata">

**Author:** [@tomlee](https://discourse.julialang.org/u/tomlee)\
**Replies:** 11\
**Last updated:** [July 30, 2018, 10:07pm UTC](https://discourse.julialang.org/t/broadcasting-with-vectors-of-static-vectors/12693 "2018-07-30T22:07:26Z")

</div>

Any advice on how to broadcast vectors of SVectors in Julia 0.7? eg: julia\> using StaticArrays julia\> const Vec = SVector{3, Float64} SArray{Tuple{3},Float64,1,3} julia\> a=\[Vec(i,i,i) for i in 1:5\] 5-element Array{SA…

---

## [Illegal inttopr trap on Julia Version 0.7.0-beta2.189 (nightly)](https://discourse.julialang.org/t/illegal-inttopr-trap-on-julia-version-0-7-0-beta2-189-nightly/12749)

<div class="topic-metadata">

**Author:** [@goedman](https://discourse.julialang.org/u/goedman)\
**Replies:** 3\
**Last updated:** [July 30, 2018, 7:20pm UTC](https://discourse.julialang.org/t/illegal-inttopr-trap-on-julia-version-0-7-0-beta2-189-nightly/12749 "2018-07-30T19:20:20Z")

</div>

Since this weekend I get below trap. Works on Julia 0.7.0-beta2.0 (and until last Thursday on nightly - beta2.135). Any hints where to look - or just hold my horses? Running PtFEM/PtFEM.jl tests: p41.1.jl \* Illegal i…

---

## [Extended method not being seen by original module](https://discourse.julialang.org/t/extended-method-not-being-seen-by-original-module/12748)

<div class="topic-metadata">

**Author:** [@jbmuir](https://discourse.julialang.org/u/jbmuir)\
**Replies:** 7\
**Last updated:** [July 30, 2018, 6:57pm UTC](https://discourse.julialang.org/t/extended-method-not-being-seen-by-original-module/12748 "2018-07-30T18:57:28Z")

</div>

I’m trying to implement a custom linear operator in for the LowRankApprox package, and some of my method definitions are not interacting with the methods in that package; e.g. julia\> ishermitian(A::CovarianceOperator) …

---

## [REPL Autocorrection](https://discourse.julialang.org/t/repl-autocorrection/12750)

<div class="topic-metadata">

**Author:** [@arnavsood](https://discourse.julialang.org/u/arnavsood)\
**Replies:** 1\
**Last updated:** [July 30, 2018, 6:39pm UTC](https://discourse.julialang.org/t/repl-autocorrection/12750 "2018-07-30T18:39:04Z")

</div>

Migrated from GitHub. One thing that’s great on macOS is the terminal utility fu&k, which looks at what you just typed (and other context, like where your terminal is), and pre-loads a series of corrections. For example…

---

## [Setting array values through sequential application of two sets of indices](https://discourse.julialang.org/t/setting-array-values-through-sequential-application-of-two-sets-of-indices/12743)

<div class="topic-metadata">

**Author:** [@dalekj](https://discourse.julialang.org/u/dalekj)\
**Replies:** 2\
**Last updated:** [July 30, 2018, 5:45pm UTC](https://discourse.julialang.org/t/setting-array-values-through-sequential-application-of-two-sets-of-indices/12743 "2018-07-30T17:45:47Z")

</div>

I recently ran into a bug in my code related to some unintuitive (to me) behavior of array indexing. Given an array, say A = reshape(collect(1:16),(4,4)) we can access elements of the array through multiple indexing c…

---

## [Fixing GCC/Homebrew building issues on macOS?](https://discourse.julialang.org/t/fixing-gcc-homebrew-building-issues-on-macos/12584)

<div class="topic-metadata">

**Author:** [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Replies:** 10\
**Last updated:** [July 30, 2018, 5:05pm UTC](https://discourse.julialang.org/t/fixing-gcc-homebrew-building-issues-on-macos/12584 "2018-07-30T17:05:39Z")

</div>

Context: A lot of packages that have binary dependencies on macOS use Homebrew to install them. A few months ago there was some changes that caused Homebrew to build GCC from sources instead of just downloading it. Build…

---

## [BinaryProvider can install a package with Julia 0.7 but not with 0.6](https://discourse.julialang.org/t/binaryprovider-can-install-a-package-with-julia-0-7-but-not-with-0-6/12725)

<div class="topic-metadata">

**Author:** [@giordano](https://discourse.julialang.org/u/giordano)\
**Replies:** 0\
**Last updated:** [July 29, 2018, 9:48pm UTC](https://discourse.julialang.org/t/binaryprovider-can-install-a-package-with-julia-0-7-but-not-with-0-6/12725 "2018-07-29T21:48:28Z")

</div>

I’m trying to switch a package to BinaryBuilder.jl. It works fine on most systems (at least, those that I can test with Travis), but I’m facing some difficulties with the Windows build: the library is successfully insta…

---

## [Repeated Function Call Leaking Memory](https://discourse.julialang.org/t/repeated-function-call-leaking-memory/12718)

<div class="topic-metadata">

**Author:** [@Juser](https://discourse.julialang.org/u/Juser)\
**Replies:** 3\
**Last updated:** [July 29, 2018, 6:16pm UTC](https://discourse.julialang.org/t/repeated-function-call-leaking-memory/12718 "2018-07-29T18:16:59Z")

</div>

Below is code to compute the gradient of the log likelihood of a conditional logit choice model. When I call the gradient multiple times, I eventually run out of memory, even though everything created within the function…

---

## [Easy way to see status of package migration to 0.7?](https://discourse.julialang.org/t/easy-way-to-see-status-of-package-migration-to-0-7/12706)

<div class="topic-metadata">

**Author:** [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Replies:** 2\
**Last updated:** [July 29, 2018, 4:18pm UTC](https://discourse.julialang.org/t/easy-way-to-see-status-of-package-migration-to-0-7/12706 "2018-07-29T16:18:37Z")

</div>

Other than installing a package and trying it out/running its tests is there an easier way for users to find out if a package is usable on 0.7? I poked around on the forums here and didn’t see anything. There is Julia Ob…

---

## [Set the state of the GLOBAL\_RNG](https://discourse.julialang.org/t/set-the-state-of-the-global-rng/12599)

<div class="topic-metadata">

**Author:** [@stakaz](https://discourse.julialang.org/u/stakaz)\
**Replies:** 5\
**Last updated:** [July 29, 2018, 2:32pm UTC](https://discourse.julialang.org/t/set-the-state-of-the-global-rng/12599 "2018-07-29T14:32:21Z")

</div>

Hello, I would like to know whether it is possible to set the Random.GLOBAL\_RNG to a specific state. I know that I can set the seed but this is not exactly the same. The goal is to save a state to potentially start at t…

---

## [Internal error in runtime Julia master](https://discourse.julialang.org/t/internal-error-in-runtime-julia-master/12723)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 0\
**Last updated:** [July 29, 2018, 2:26pm UTC](https://discourse.julialang.org/t/internal-error-in-runtime-julia-master/12723 "2018-07-29T14:26:04Z")

</div>

I reported an error with testing JuMP (see: test JuMP fails on 0.7 · Issue #1379 · jump-dev/JuMP.jl · GitHub ), it shows a JuMP releated error but also shows the following error: Internal error: encountered unexpected e…

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

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