# General Usage

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

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

**Page:** 846

---

## [Can I rely on sleep waking up from a call to yield(task)](https://discourse.julialang.org/t/can-i-rely-on-sleep-waking-up-from-a-call-to-yield-task/26910)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 6\
**Last updated:** [July 29, 2019, 12:59pm UTC](https://discourse.julialang.org/t/can-i-rely-on-sleep-waking-up-from-a-call-to-yield-task/26910 "2019-07-29T12:59:37Z")

</div>

The documentation for sleep() doesn’t mention that yield wakes it up, which I guess makes it an undocumented feature…But I’d really like to utilize that if possible… Example: using Dates task = schedule(Task() do …

---

## [Threading issue - working on a view of a bool array](https://discourse.julialang.org/t/threading-issue-working-on-a-view-of-a-bool-array/26907)

<div class="topic-metadata">

**Author:** [@timmm](https://discourse.julialang.org/u/timmm)\
**Replies:** 4\
**Last updated:** [July 29, 2019, 10:59am UTC](https://discourse.julialang.org/t/threading-issue-working-on-a-view-of-a-bool-array/26907 "2019-07-29T10:59:32Z")

</div>

Appears to be an issue for me on both Julia 1.1 and 1.3.alpha-0. Not tried other builds. I am using a array of falses AList=(falses(n)) and A=view(AList) inside the the threaded loop. See the following repo: https://g…

---

## [PackageCompiler errors on compile\_incremental second run](https://discourse.julialang.org/t/packagecompiler-errors-on-compile-incremental-second-run/26932)

<div class="topic-metadata">

**Author:** [@KestutisMa](https://discourse.julialang.org/u/KestutisMa)\
**Replies:** 0\
**Last updated:** [July 29, 2019, 9:23am UTC](https://discourse.julialang.org/t/packagecompiler-errors-on-compile-incremental-second-run/26932 "2019-07-29T09:23:45Z")

</div>

I use Fezzik.jl (nice API for PackageCompiler). It allows to compile all statements used in REPL, that allows simple snooping, and tries to solve “time to first anything” problem. But I faced issue that it can’t run it o…

---

## [Inconsistent \`@code\_warntype\` and \`@inferred\`](https://discourse.julialang.org/t/inconsistent-code-warntype-and-inferred/24998)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 2\
**Last updated:** [July 29, 2019, 1:15am UTC](https://discourse.julialang.org/t/inconsistent-code-warntype-and-inferred/24998 "2019-07-29T01:15:07Z")

</div>

I have a function that has good looking @code\_warntype but @inferred fails: julia\> @inferred waterdose(int, pts, ncase=ncase) ERROR: return type Array{UncertaintyPropagation.Errorful{Float64},1} does not match inferred …

---

## [Optional parts in Cmd](https://discourse.julialang.org/t/optional-parts-in-cmd/26911)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 3\
**Last updated:** [July 28, 2019, 10:56pm UTC](https://discourse.julialang.org/t/optional-parts-in-cmd/26911 "2019-07-28T22:56:24Z")

</div>

I would like to construct a Cmd with some optional parts, depending in the caller. I got this working by collecting strings and then interpolating a vector of them, and this actually works fine (with escaping, etc) but I…

---

## [Precompile a subset of all packgaes?](https://discourse.julialang.org/t/precompile-a-subset-of-all-packgaes/26723)

<div class="topic-metadata">

**Author:** [@jling](https://discourse.julialang.org/u/jling)\
**Replies:** 2\
**Last updated:** [July 28, 2019, 9:06pm UTC](https://discourse.julialang.org/t/precompile-a-subset-of-all-packgaes/26723 "2019-07-28T21:06:02Z")

</div>

Usage: I use external GPU and Cuda related stuff will fail to precompile if they are detached and will terminate the precompile process. can we have a syntax like: pkg\> precompile ^CuArrays ^CUDAnative

---

## [CUDAdrv fails to build](https://discourse.julialang.org/t/cudadrv-fails-to-build/26476)

<div class="topic-metadata">

**Author:** [@knavely](https://discourse.julialang.org/u/knavely)\
**Replies:** 0\
**Last updated:** [July 17, 2019, 6:47pm UTC](https://discourse.julialang.org/t/cudadrv-fails-to-build/26476 "2019-07-17T18:47:33Z")

</div>

Got it working but not quite sure exactly how so im just deleting this

---

## [Manually reloading a module in 1.1?](https://discourse.julialang.org/t/manually-reloading-a-module-in-1-1/25572)

<div class="topic-metadata">

**Author:** [@srs](https://discourse.julialang.org/u/srs)\
**Replies:** 13\
**Last updated:** [July 28, 2019, 11:42am UTC](https://discourse.julialang.org/t/manually-reloading-a-module-in-1-1/25572 "2019-07-28T11:42:04Z")

</div>

How do I manually reload a module in Julia 1.1? (I’m on 1.1.1 to be specific) I’m aware that Revise.jl exists, but it does have its known limitations and I’ve also seen issues and crashes together with Jupyter. These is…

---

## [Slow sparse matrix-vector product with symmetric matrices](https://discourse.julialang.org/t/slow-sparse-matrix-vector-product-with-symmetric-matrices/3968)

<div class="topic-metadata">

**Author:** [@dpo](https://discourse.julialang.org/u/dpo)\
**Replies:** 34\
**Last updated:** [July 28, 2019, 7:19am UTC](https://discourse.julialang.org/t/slow-sparse-matrix-vector-product-with-symmetric-matrices/3968 "2019-07-28T07:19:02Z")

</div>

julia\> A = rand(1000,1000); A = A + A'; A = sparse(A); julia\> e = ones(1000); julia\> @time A \* e 0.054203 seconds (17.26 k allocations: 990.259 KiB) julia\> @time A \* e; 0.001510 seconds (5 allocations: 8.094 KiB) jul…

---

## [Comparing different types doesn't raise an error?!?!?](https://discourse.julialang.org/t/comparing-different-types-doesnt-raise-an-error/26868)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 26\
**Last updated:** [July 27, 2019, 4:13pm UTC](https://discourse.julialang.org/t/comparing-different-types-doesnt-raise-an-error/26868 "2019-07-27T16:13:21Z")

</div>

I’m sorry but this is annoying, I try to convert 3.5 to an Int and I get an InexactError. I mean I really do just want to truncate the fricken number, but fine, I will truncate it, then convert it, hey maybe I’ll splurge…

---

## [Generic programming discussion](https://discourse.julialang.org/t/generic-programming-discussion/26888)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 0\
**Last updated:** [July 27, 2019, 4:11pm UTC](https://discourse.julialang.org/t/generic-programming-discussion/26888 "2019-07-27T16:11:35Z")

</div>

Unfortunately Julia is not mentioned at all: Models of Generics and Metaprogramming: Go, Rust, Swift, D and More - Tristan Hume Interesting discussion, though.

---

## [How to overwrite logging output for custom string types](https://discourse.julialang.org/t/how-to-overwrite-logging-output-for-custom-string-types/26865)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 2\
**Last updated:** [July 27, 2019, 5:30am UTC](https://discourse.julialang.org/t/how-to-overwrite-logging-output-for-custom-string-types/26865 "2019-07-27T05:30:06Z")

</div>

I’ve been playing with creating a custom Password string type which would be securely logged and printed in obfuscated form. I came up with: struct Password \<: AbstractString contents::String end Base.show(io::IO, …

---

## [Dot equals .=](https://discourse.julialang.org/t/dot-equals/26818)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 3\
**Last updated:** [July 26, 2019, 10:57pm UTC](https://discourse.julialang.org/t/dot-equals/26818 "2019-07-26T22:57:15Z")

</div>

I am sort of getting fuzzy on how to apply syntactic loop fusion from More Dots - Syntactic Loop Fusion in Julia | juliabloggers.com Is this: nnp.theta\[hl\] .= nnp.theta\[hl\] .+ (hp.alphaovermb .\* (hp.lambda .\* nnp.theta…

---

## [Error in Cuda function : ERROR: LoadError: CuError(1, nothing)](https://discourse.julialang.org/t/error-in-cuda-function-error-loaderror-cuerror-1-nothing/26808)

<div class="topic-metadata">

**Author:** [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Replies:** 8\
**Last updated:** [July 26, 2019, 10:11pm UTC](https://discourse.julialang.org/t/error-in-cuda-function-error-loaderror-cuerror-1-nothing/26808 "2019-07-26T22:11:04Z")

</div>

I have this error while running Cuda ERROR: LoadError: CuError(1, nothing) Stacktrace: \[1\] (::getfield(CUDAdrv, Symbol("##25#26")){Bool,Int64,CuStream,CuFunction})(::Array{Ptr{Nothing},1}) at C:\\Users\\Wiktor\\.julia\\pac…

---

## [How to log output to file](https://discourse.julialang.org/t/how-to-log-output-to-file/5219)

<div class="topic-metadata">

**Author:** [@innerlee](https://discourse.julialang.org/u/innerlee)\
**Replies:** 7\
**Last updated:** [July 26, 2019, 8:19pm UTC](https://discourse.julialang.org/t/how-to-log-output-to-file/5219 "2019-07-26T20:19:18Z")

</div>

This question has troubled me for some time. Basically, I want log outputs into a file. It should: Not for logging outputs of info(), warn(), etc, but for all printed outputs. They should be printed on the screen as we…

---

## [Vector{Float} times Vector{Complex} slower than Vector{Complex} times Vector{Complex}](https://discourse.julialang.org/t/vector-float-times-vector-complex-slower-than-vector-complex-times-vector-complex/26857)

<div class="topic-metadata">

**Author:** [@Oscar\_Smith](https://discourse.julialang.org/u/Oscar_Smith)\
**Replies:** 6\
**Last updated:** [July 26, 2019, 6:41pm UTC](https://discourse.julialang.org/t/vector-float-times-vector-complex-slower-than-vector-complex-times-vector-complex/26857 "2019-07-26T18:41:59Z")

</div>

If you define Q = collect(-10:.01:10) v = Q.-transpose(Q) cv = complex.(v) comp = exp.(-im.\*Q) then multiplying cvcomp takes 2.94ms on my computer compared with 3.41ms for vcomp (times measured with btime) Any idea why…

---

## [Pkg Proxy Cache / Automatic Mirror of installed packages](https://discourse.julialang.org/t/pkg-proxy-cache-automatic-mirror-of-installed-packages/26832)

<div class="topic-metadata">

**Author:** [@altre](https://discourse.julialang.org/u/altre)\
**Replies:** 1\
**Last updated:** [July 26, 2019, 5:39pm UTC](https://discourse.julialang.org/t/pkg-proxy-cache-automatic-mirror-of-installed-packages/26832 "2019-07-26T17:39:45Z")

</div>

We use Julia in a commercial context. The more productive things get, the more paranoid we are. Julia relies on the github repository of a dependency staying where it is. If it disappears, the package can not be installe…

---

## [How to understand the following function excepted from OpenStreetMapX package?](https://discourse.julialang.org/t/how-to-understand-the-following-function-excepted-from-openstreetmapx-package/26075)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 11\
**Last updated:** [July 26, 2019, 4:54pm UTC](https://discourse.julialang.org/t/how-to-understand-the-following-function-excepted-from-openstreetmapx-package/26075 "2019-07-26T16:54:08Z")

</div>

Hi, I’m reading the code from this great OpenStreetMapX package, and the following function confused me a little bit. I would really appreciate it if anyone can help me clarify some doubts. function get\_edges(nodes::Dic…

---

## [\[Note/suggestions\] Got Arpack, etc sort of working with MKL \[tested on macos\]](https://discourse.julialang.org/t/note-suggestions-got-arpack-etc-sort-of-working-with-mkl-tested-on-macos/21064)

<div class="topic-metadata">

**Author:** [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Replies:** 5\
**Last updated:** [July 26, 2019, 4:12pm UTC](https://discourse.julialang.org/t/note-suggestions-got-arpack-etc-sort-of-working-with-mkl-tested-on-macos/21064 "2019-07-26T16:12:10Z")

</div>

Update: With fflags from here and borrowing from the Arpack builder script, here’s a way to potentially get Arpack and packages that depend on it working with MKL( Pkg.test("Arpack") , Pkg.test("LightGraphs") or Pkg.…

---

## [How to split package?](https://discourse.julialang.org/t/how-to-split-package/26850)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 2\
**Last updated:** [July 26, 2019, 4:06pm UTC](https://discourse.julialang.org/t/how-to-split-package/26850 "2019-07-26T16:06:47Z")

</div>

Hey! I am a bit new to package development but I started making a package and now it has been a bit clouded with funtionality. Say I want to split my module into two files: PostSPH.jl (main file, which holds the module…

---

## [Return NaN instead of DomainError](https://discourse.julialang.org/t/return-nan-instead-of-domainerror/15493)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 21\
**Last updated:** [July 26, 2019, 2:19pm UTC](https://discourse.julialang.org/t/return-nan-instead-of-domainerror/15493 "2019-07-26T14:19:39Z")

</div>

I could not find a way to make function calls like sqrt(-2) return NaN instead of raising an error. Is that possible? It would be quite useful, at least sometimes, to just let the NaN propagate to the final result. Also…

---

## [What's the best way to compare items in an array to every other item?](https://discourse.julialang.org/t/whats-the-best-way-to-compare-items-in-an-array-to-every-other-item/26806)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 11\
**Last updated:** [July 26, 2019, 2:08pm UTC](https://discourse.julialang.org/t/whats-the-best-way-to-compare-items-in-an-array-to-every-other-item/26806 "2019-07-26T14:08:52Z")

</div>

Say I have the following array: names = \["John Doe", "Bugs Bunny", "Cosmo Kramer", "Jon Doe", "Elmer Fudd", "Kosmo Cramer"\] I would like to compare each string in the array with every other string in the array and comp…

---

## [Jupyterlab IJulia kernel "too many file descriptors in select()"](https://discourse.julialang.org/t/jupyterlab-ijulia-kernel-too-many-file-descriptors-in-select/26606)

<div class="topic-metadata">

**Author:** [@ralphmrm1](https://discourse.julialang.org/u/ralphmrm1)\
**Replies:** 8\
**Last updated:** [July 26, 2019, 11:34am UTC](https://discourse.julialang.org/t/jupyterlab-ijulia-kernel-too-many-file-descriptors-in-select/26606 "2019-07-26T11:34:53Z")

</div>

Jupyterlab (Windows 10, local) works for a while (~15 min), then the kernel dies with the message Server Connection Error A connection to the Jupyter server could not be established. JupyterLab will continue trying to …

---

## [Can this be done using a struct?](https://discourse.julialang.org/t/can-this-be-done-using-a-struct/26833)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 2\
**Last updated:** [July 26, 2019, 10:27am UTC](https://discourse.julialang.org/t/can-this-be-done-using-a-struct/26833 "2019-07-26T10:27:50Z")

</div>

Hey guys. Say that I am reading an XML file and getting the following information: k\[1:2\] 2-element Array{XMLElement,1}: \<floating mkbound="1" mk="12" begin="7206" count="21" property="hard-wood"\> \<mas…

---

## [Error building FFTW](https://discourse.julialang.org/t/error-building-fftw/26827)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 1\
**Last updated:** [July 26, 2019, 7:20am UTC](https://discourse.julialang.org/t/error-building-fftw/26827 "2019-07-26T07:20:50Z")

</div>

Does anybody understand what the problem is here and how I can fix it? PS C:\\Users\\Ilja\> jlpkg build FFTW Building Conda → \`C:\\Users\\Ilja\\.julia\\packages\\Conda\\kLXeC\\deps\\build.log\` Building FFTW ─→ \`C:\\Users\\Ilja\\.…

---

## [Macro for enabling/disabling parts of code](https://discourse.julialang.org/t/macro-for-enabling-disabling-parts-of-code/26543)

<div class="topic-metadata">

**Author:** [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Replies:** 4\
**Last updated:** [July 26, 2019, 4:55am UTC](https://discourse.julialang.org/t/macro-for-enabling-disabling-parts-of-code/26543 "2019-07-26T04:55:55Z")

</div>

I’ve often desired to have “optional” execution paths in my code that I could activate from outside of the function. This would be helpful in situations where I have a complex function that does several data processing s…

---

## [What type of code is \`threads\` good for?](https://discourse.julialang.org/t/what-type-of-code-is-threads-good-for/26759)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 12\
**Last updated:** [July 26, 2019, 4:46am UTC](https://discourse.julialang.org/t/what-type-of-code-is-threads-good-for/26759 "2019-07-26T04:46:32Z")

</div>

I was reading the latest blog post on multithreading and have a few questions on what applications can benefit from threading. This is how I visualize threads in my head: Suppose a CPU has two threads. You can spawn tas…

---

## [Ignore CSV comments in a DataFrame](https://discourse.julialang.org/t/ignore-csv-comments-in-a-dataframe/26785)

<div class="topic-metadata">

**Author:** [@MuadhF](https://discourse.julialang.org/u/MuadhF)\
**Replies:** 1\
**Last updated:** [July 26, 2019, 3:14am UTC](https://discourse.julialang.org/t/ignore-csv-comments-in-a-dataframe/26785 "2019-07-26T03:14:12Z")

</div>

Hi, I’ve noticed that when creating a DataFrame using a CSV file, it registers comments as missing. For example, a section of my CSV file is “Annual Interest Rate, 0.08 #ignore this” but when I create the DataFra…

---

## [libLLVM Issue when Adding/Building Packages](https://discourse.julialang.org/t/libllvm-issue-when-adding-building-packages/17523)

<div class="topic-metadata">

**Author:** [@GabrielYin](https://discourse.julialang.org/u/GabrielYin)\
**Replies:** 3\
**Last updated:** [July 26, 2019, 2:37am UTC](https://discourse.julialang.org/t/libllvm-issue-when-adding-building-packages/17523 "2019-07-26T02:37:44Z")

</div>

Hi there, I tried to install JuMP 0.18.4 in Julia version 1.0.1, and it succeeded. When I tested the package, however, it told me to rebuild the SpecialFunctions. But then it failed to build this because of a LoadError:…

---

## [Should I use either Dataframes.jl or Named Array for a long and wide array for sci computing](https://discourse.julialang.org/t/should-i-use-either-dataframes-jl-or-named-array-for-a-long-and-wide-array-for-sci-computing/26803)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 7\
**Last updated:** [July 25, 2019, 11:41pm UTC](https://discourse.julialang.org/t/should-i-use-either-dataframes-jl-or-named-array-for-a-long-and-wide-array-for-sci-computing/26803 "2019-07-25T23:41:02Z")

</div>

I am writing a simulation that captures a lot of statistics from a mathematical model. Hence I have an array that is long (like 100,000) rows, but also very wide, like 100 columns. I am actually moving the simulation fro…

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

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