# General Usage

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

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

**Page:** 756

---

## ["memory mapping failed" when reading many CSVs](https://discourse.julialang.org/t/memory-mapping-failed-when-reading-many-csvs/27979)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 11\
**Last updated:** [May 8, 2020, 5:59pm UTC](https://discourse.julialang.org/t/memory-mapping-failed-when-reading-many-csvs/27979 "2020-05-08T17:59:13Z")

</div>

I use CSV.jl for reading many small CSV files, and at some point always encounter the following: “ERROR: SystemError: memory mapping failed: Cannot allocate memory”. Of course, there is plenty of free memory at the time.…

---

## [Revise and import](https://discourse.julialang.org/t/revise-and-import/23319)

<div class="topic-metadata">

**Author:** [@dhazeghi](https://discourse.julialang.org/u/dhazeghi)\
**Replies:** 3\
**Last updated:** [May 9, 2020, 12:52pm UTC](https://discourse.julialang.org/t/revise-and-import/23319 "2020-05-09T12:52:12Z")

</div>

Hi folks, a fairly basic question on Revise.jl usage: how should I use revise with packages (mine) that import other packages? For example: julia\> using Revise julia\> import MyPackage \<edit code in package imported by…

---

## [Trying to write a parquet writer. Please help!](https://discourse.julialang.org/t/trying-to-write-a-parquet-writer-please-help/38653)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 1\
**Last updated:** [May 9, 2020, 12:06pm UTC](https://discourse.julialang.org/t/trying-to-write-a-parquet-writer-please-help/38653 "2020-05-09T12:06:15Z")

</div>

I am trying to understand enough about parquet to get a parquet writer going. I am trying to read a parquet file and I am using Thrift.jl. It says at offset 4 there is DictionaryPageHeader so I read that using Thrift.jl…

---

## [How do you drop one quote inside another?](https://discourse.julialang.org/t/how-do-you-drop-one-quote-inside-another/39078)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 4\
**Last updated:** [May 9, 2020, 11:55am UTC](https://discourse.julialang.org/t/how-do-you-drop-one-quote-inside-another/39078 "2020-05-09T11:55:06Z")

</div>

In the following pseudocode, is it possible to drop the foo quote inside the fizzbuzz function? bar = quote foo = quote i = rand() j = 7 end function fizzbuzz() # want foo here k = i \* j end end…

---

## [Will decreasing the precision of intermediate variables improve performance of code?](https://discourse.julialang.org/t/will-decreasing-the-precision-of-intermediate-variables-improve-performance-of-code/39166)

<div class="topic-metadata">

**Author:** [@SambitMishra98](https://discourse.julialang.org/u/SambitMishra98)\
**Replies:** 12\
**Last updated:** [May 9, 2020, 9:47am UTC](https://discourse.julialang.org/t/will-decreasing-the-precision-of-intermediate-variables-improve-performance-of-code/39166 "2020-05-09T09:47:48Z")

</div>

I found from a Youtube video that half-precision is significantly faster than single and double precision. \[JuliaCon 2018 | Keynote - Tricks and Tips in Numerical Computing | Nick Higham - YouTube\](2018 | Keynote - Trick…

---

## [Difficulties with vectorized logical operations due to operator precedence](https://discourse.julialang.org/t/difficulties-with-vectorized-logical-operations-due-to-operator-precedence/39137)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 7\
**Last updated:** [May 9, 2020, 8:08am UTC](https://discourse.julialang.org/t/difficulties-with-vectorized-logical-operations-due-to-operator-precedence/39137 "2020-05-09T08:08:41Z")

</div>

I run into this problem all the time. Here’s an example where the vector x contains two kinds of missing, the missing singleton and a sentinel value of 99. julia\> x = \[1, 99, missing, 99, 2, missing, 1\]; julia\> xmissin…

---

## [Split an array into multiple smaller arrays - alternative to unsafe\_wrap without views](https://discourse.julialang.org/t/split-an-array-into-multiple-smaller-arrays-alternative-to-unsafe-wrap-without-views/39150)

<div class="topic-metadata">

**Author:** [@clinton](https://discourse.julialang.org/u/clinton)\
**Replies:** 0\
**Last updated:** [May 8, 2020, 11:58pm UTC](https://discourse.julialang.org/t/split-an-array-into-multiple-smaller-arrays-alternative-to-unsafe-wrap-without-views/39150 "2020-05-08T23:58:48Z")

</div>

I’m wondering if this is a good use case for unsafe\_wrap, or if there is a better way to do this. Basically I have a vector, and I want to be able to interpret the vector as a set of arrays. I cannot use subarrays or sim…

---

## [Speeding up summation inside comprehension](https://discourse.julialang.org/t/speeding-up-summation-inside-comprehension/39119)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 5\
**Last updated:** [May 8, 2020, 6:30pm UTC](https://discourse.julialang.org/t/speeding-up-summation-inside-comprehension/39119 "2020-05-08T18:30:27Z")

</div>

I currently do something similar to the code below (though I have axis arrays instead of regular arrays): A = 1:100 B = 1:200 C = 1:300 x = rand(length(A),length(B),length(C)) y = rand(length(B),length(C)) z = \[ s…

---

## [Segmentation fault when installing packages](https://discourse.julialang.org/t/segmentation-fault-when-installing-packages/39067)

<div class="topic-metadata">

**Author:** [@david\_m](https://discourse.julialang.org/u/david_m)\
**Replies:** 5\
**Last updated:** [May 8, 2020, 4:03pm UTC](https://discourse.julialang.org/t/segmentation-fault-when-installing-packages/39067 "2020-05-08T16:03:41Z")

</div>

Hello everyone, I don’t know since when that happens but I just noticed that I can not install new packages anymore. If I run “Pkg.add(“LightGraphs”)” for example, Julia crashes: These are the packages that are alr…

---

## [How to deprecate a macro?](https://discourse.julialang.org/t/how-to-deprecate-a-macro/17651)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 5\
**Last updated:** [May 8, 2020, 1:12pm UTC](https://discourse.julialang.org/t/how-to-deprecate-a-macro/17651 "2020-05-08T13:12:50Z")

</div>

I was wondering, is there a way to @deprecate a macro instead of a function? If so, what’s the syntax?

---

## [Question on behaviour and performance of getting the determinant](https://discourse.julialang.org/t/question-on-behaviour-and-performance-of-getting-the-determinant/38895)

<div class="topic-metadata">

**Author:** [@johanbluecreek](https://discourse.julialang.org/u/johanbluecreek)\
**Replies:** 7\
**Last updated:** [May 8, 2020, 12:51pm UTC](https://discourse.julialang.org/t/question-on-behaviour-and-performance-of-getting-the-determinant/38895 "2020-05-08T12:51:01Z")

</div>

Confusing behaviour I’ll jump directly into the behaviour I’m observing, please look below for context (under other header). Direct questions can be found in bold. I have a function that computes the determinant as a pa…

---

## [Scope of variables inside functions, for loops, and if statments](https://discourse.julialang.org/t/scope-of-variables-inside-functions-for-loops-and-if-statments/38981)

<div class="topic-metadata">

**Author:** [@asb](https://discourse.julialang.org/u/asb)\
**Replies:** 6\
**Last updated:** [May 8, 2020, 10:29am UTC](https://discourse.julialang.org/t/scope-of-variables-inside-functions-for-loops-and-if-statments/38981 "2020-05-08T10:29:55Z")

</div>

I don’t understand variable scope in Julia. I wrote a function to read some data files. The program reads nifti (a format for storing medical images) files inside a for loop. The data read is then returned to the callin…

---

## [Making efficient some small subroutines](https://discourse.julialang.org/t/making-efficient-some-small-subroutines/38917)

<div class="topic-metadata">

**Author:** [@O\_Julia](https://discourse.julialang.org/u/O_Julia)\
**Replies:** 22\
**Last updated:** [May 8, 2020, 10:10am UTC](https://discourse.julialang.org/t/making-efficient-some-small-subroutines/38917 "2020-05-08T10:10:31Z")

</div>

Hi, I am trying to convert some Python+numpy subroutines to Julia. These subroutines are most important part of my main progam and take much time. In the current version these codes are run faster in non-optimized Python…

---

## [Bayesian neural networks in Flux](https://discourse.julialang.org/t/bayesian-neural-networks-in-flux/39065)

<div class="topic-metadata">

**Author:** [@DeepQ](https://discourse.julialang.org/u/DeepQ)\
**Replies:** 2\
**Last updated:** [May 8, 2020, 9:50am UTC](https://discourse.julialang.org/t/bayesian-neural-networks-in-flux/39065 "2020-05-08T09:50:13Z")

</div>

I am trying to implement a Bayesian neural network in Flux. I have custom layers which return two outputs. One is the output of the layer and another is a conditional probability. I use these probabilities to define a lo…

---

## [How to run specific testsets in a test script?](https://discourse.julialang.org/t/how-to-run-specific-testsets-in-a-test-script/38944)

<div class="topic-metadata">

**Author:** [@JesperMartinsson](https://discourse.julialang.org/u/JesperMartinsson)\
**Replies:** 2\
**Last updated:** [May 8, 2020, 9:12am UTC](https://discourse.julialang.org/t/how-to-run-specific-testsets-in-a-test-script/38944 "2020-05-08T09:12:14Z")

</div>

Is there a build in or preferred way to run a specific testset in a script, based on e.g. the testset’s description, as opposed to running all testsets in the script? In many packages, see e.g. LightGraphs.jl, seem to h…

---

## [More convenient Julia document](https://discourse.julialang.org/t/more-convenient-julia-document/39062)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 1\
**Last updated:** [May 8, 2020, 8:17am UTC](https://discourse.julialang.org/t/more-convenient-julia-document/39062 "2020-05-08T08:17:57Z")

</div>

Is it possible to add the content and URL at the beginning of some module as Qt document. This will save the beginning users a lot of time to find some functions. The following figures are the comparison between Qt and J…

---

## [How to set the length of fft](https://discourse.julialang.org/t/how-to-set-the-length-of-fft/38885)

<div class="topic-metadata">

**Author:** [@Andy.Yang](https://discourse.julialang.org/u/Andy.Yang)\
**Replies:** 26\
**Last updated:** [May 8, 2020, 1:03am UTC](https://discourse.julialang.org/t/how-to-set-the-length-of-fft/38885 "2020-05-08T01:03:35Z")

</div>

Hi, I can’t find how to set the length of FFTW.fft, just like python or matlab. Maybe this’s a naive question, but it troubles me a littele. Thanks for your time.

---

## [Limiting the maximum number of parallel threads with @spawn, as with @threads](https://discourse.julialang.org/t/limiting-the-maximum-number-of-parallel-threads-with-spawn-as-with-threads/38986)

<div class="topic-metadata">

**Author:** [@gipert](https://discourse.julialang.org/u/gipert)\
**Replies:** 2\
**Last updated:** [May 8, 2020, 12:46am UTC](https://discourse.julialang.org/t/limiting-the-maximum-number-of-parallel-threads-with-spawn-as-with-threads/38986 "2020-05-08T00:46:41Z")

</div>

I would like to write a parallel for loop over files in a directory tree, open them and do some long computation. I started writing something like this: @threads for (root, dirs, files) in walkdir(path) open\_and\_proce…

---

## [Solve Constrained Nonlinear System (?)](https://discourse.julialang.org/t/solve-constrained-nonlinear-system/38921)

<div class="topic-metadata">

**Author:** [@duncanam](https://discourse.julialang.org/u/duncanam)\
**Replies:** 9\
**Last updated:** [May 7, 2020, 10:04pm UTC](https://discourse.julialang.org/t/solve-constrained-nonlinear-system/38921 "2020-05-07T22:04:05Z")

</div>

I’m a little sad, because it seems like we don’t have any packages for solving nonlinear equations (not odes, not pdes) on a domain range. An equivalent function in the MATLAB world is vpasolve() in which I can feed it a…

---

## [Is it possible to make this function faster?](https://discourse.julialang.org/t/is-it-possible-to-make-this-function-faster/38434)

<div class="topic-metadata">

**Author:** [@alvrg](https://discourse.julialang.org/u/alvrg)\
**Replies:** 11\
**Last updated:** [May 7, 2020, 9:32pm UTC](https://discourse.julialang.org/t/is-it-possible-to-make-this-function-faster/38434 "2020-05-07T21:32:45Z")

</div>

Hi all: I have a function foo that iterates through a ComplexF64 vector A. For each element A\[i\], it computes all distances |A\[i\] - A\[j\]| in the complex plane and then stores in B\[i\] the ratio of the minimum distance by…

---

## [Running for loop in parallel and appending result to vector](https://discourse.julialang.org/t/running-for-loop-in-parallel-and-appending-result-to-vector/20487)

<div class="topic-metadata">

**Author:** [@gregory](https://discourse.julialang.org/u/gregory)\
**Replies:** 19\
**Last updated:** [May 7, 2020, 8:49pm UTC](https://discourse.julialang.org/t/running-for-loop-in-parallel-and-appending-result-to-vector/20487 "2020-05-07T20:49:32Z")

</div>

I have the following snippet of code where I am looping over and would like to append/push to curetime or progressiontime based on conditions met. As I want to increase the size of the loop it would be helpful to run thi…

---

## [Background running of Julia on ubuntu](https://discourse.julialang.org/t/background-running-of-julia-on-ubuntu/38925)

<div class="topic-metadata">

**Author:** [@Jing\_Zhang](https://discourse.julialang.org/u/Jing_Zhang)\
**Replies:** 17\
**Last updated:** [May 7, 2020, 7:53pm UTC](https://discourse.julialang.org/t/background-running-of-julia-on-ubuntu/38925 "2020-05-07T19:53:54Z")

</div>

Dear Julia users, I am on a ubuntu machine. I want to run my Julia codes “main.jl” in background. What commend to realize this? Something like “nohup Julia command main.jl &”? Thanks a lot!

---

## ["Unsatisfiable requirements" when local packages use local packages (fixed in v1.4)](https://discourse.julialang.org/t/unsatisfiable-requirements-when-local-packages-use-local-packages-fixed-in-v1-4/36807)

<div class="topic-metadata">

**Author:** [@tuckermcclure](https://discourse.julialang.org/u/tuckermcclure)\
**Replies:** 12\
**Last updated:** [May 7, 2020, 6:54pm UTC](https://discourse.julialang.org/t/unsatisfiable-requirements-when-local-packages-use-local-packages-fixed-in-v1-4/36807 "2020-05-07T18:54:08Z")

</div>

I have a project with a few local packages. Some packages use dev path/to/Package to use another package, but this only works for one level. That is, if activate PkgB and do dev path/to/PkgA, then if we activate PkgC and…

---

## [Plot range not working as excpected](https://discourse.julialang.org/t/plot-range-not-working-as-excpected/38978)

<div class="topic-metadata">

**Author:** [@Eris](https://discourse.julialang.org/u/Eris)\
**Replies:** 1\
**Last updated:** [May 7, 2020, 6:44pm UTC](https://discourse.julialang.org/t/plot-range-not-working-as-excpected/38978 "2020-05-07T18:44:14Z")

</div>

I’m plotting a divergent function and I want the graph to reflect a certain value of y. For example the function y=-log(1-x) approaches infinity at x=1 however the output shows that it stops before y=10 using Plots f(…

---

## [Outdated documentation](https://discourse.julialang.org/t/outdated-documentation/38972)

<div class="topic-metadata">

**Author:** [@Laszlo\_Nagy](https://discourse.julialang.org/u/Laszlo_Nagy)\
**Replies:** 4\
**Last updated:** [May 7, 2020, 5:33pm UTC](https://discourse.julialang.org/t/outdated-documentation/38972 "2020-05-07T17:33:05Z")

</div>

The example at the end of Constructors · The Julia Language does not work for me as shown. I’m using Julia 1.4. According to the documentation this object construction should throw a MethodError, but it doesn’t: juli…

---

## [I recive error when add pkg in julia](https://discourse.julialang.org/t/i-recive-error-when-add-pkg-in-julia/38959)

<div class="topic-metadata">

**Author:** [@Jasmine](https://discourse.julialang.org/u/Jasmine)\
**Replies:** 0\
**Last updated:** [May 7, 2020, 2:30pm UTC](https://discourse.julialang.org/t/i-recive-error-when-add-pkg-in-julia/38959 "2020-05-07T14:30:40Z")

</div>

---

## [Cannot subtype of Distribution](https://discourse.julialang.org/t/cannot-subtype-of-distribution/38954)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 2\
**Last updated:** [May 7, 2020, 2:05pm UTC](https://discourse.julialang.org/t/cannot-subtype-of-distribution/38954 "2020-05-07T14:05:27Z")

</div>

I don’t get why I cannot create custom Distribution subtypes: using Distributions julia\> struct Foo \<: ContinuousUnivariateDistribution end julia\> Foo isa Distribution false julia\> Foo isa ContinuousUnivariateD…

---

## [Julia or Python: Which is faster for Deep Learning](https://discourse.julialang.org/t/julia-or-python-which-is-faster-for-deep-learning/38935)

<div class="topic-metadata">

**Author:** [@Eldho.Ashna](https://discourse.julialang.org/u/Eldho.Ashna)\
**Replies:** 3\
**Last updated:** [May 7, 2020, 11:11am UTC](https://discourse.julialang.org/t/julia-or-python-which-is-faster-for-deep-learning/38935 "2020-05-07T11:11:04Z")

</div>

Hi everyone. Is there any difference in the time taken by a julia code and python code to complete 100 epochs? For example, suppose I’m trying to do mnist classification for 100 epochs. I wrote the code in python using…

---

## [Nd level sets](https://discourse.julialang.org/t/nd-level-sets/38532)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 14\
**Last updated:** [May 7, 2020, 6:18am UTC](https://discourse.julialang.org/t/nd-level-sets/38532 "2020-05-07T06:18:11Z")

</div>

Hi, I want to compute the level sets of a Nd scalar function. Furthermore, I would like to be able to access the list of values on the level set. I am looking for suggestions. I know of the following possibilities: c…

---

## [COM client](https://discourse.julialang.org/t/com-client/38916)

<div class="topic-metadata">

**Author:** [@cojua8](https://discourse.julialang.org/u/cojua8)\
**Replies:** 0\
**Last updated:** [May 6, 2020, 10:40pm UTC](https://discourse.julialang.org/t/com-client/38916 "2020-05-06T22:40:56Z")

</div>

Hi!, I’ve been working with PyCall to access an API through the comtypes python’s package, and now I’m wondering if there is something similar written in pure julia. The following is the overview of the API I’m trying t…

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

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