# General Usage

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

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

**Page:** 586

---

## [Running platforms?](https://discourse.julialang.org/t/running-platforms/63247)

<div class="topic-metadata">

**Author:** [@skypuppy](https://discourse.julialang.org/u/skypuppy)\
**Replies:** 1\
**Last updated:** [June 20, 2021, 5:38pm UTC](https://discourse.julialang.org/t/running-platforms/63247 "2021-06-20T17:38:25Z")

</div>

Can Julia run on these platforms? Raspberry Pi (RPi?) Beaglebone Black (BBB?) Jetson Nano/TX2//all Jetsons? Thanks. I read somewhere that an ARM port is out there…

---

## [Can't replicate neural network from Python's sklearn using Flux.jl](https://discourse.julialang.org/t/cant-replicate-neural-network-from-pythons-sklearn-using-flux-jl/63115)

<div class="topic-metadata">

**Author:** [@ultrapoci](https://discourse.julialang.org/u/ultrapoci)\
**Replies:** 11\
**Last updated:** [June 20, 2021, 3:10pm UTC](https://discourse.julialang.org/t/cant-replicate-neural-network-from-pythons-sklearn-using-flux-jl/63115 "2021-06-20T15:10:38Z")

</div>

I have a big dataset (250k rows x 30 columns) with which I would like to train a neural network for a classification task (it should classify one of two possible classes). I’ve built this model using Python’s MLPClassifi…

---

## ["Best practice" type piracy for package compatibility?](https://discourse.julialang.org/t/best-practice-type-piracy-for-package-compatibility/62792)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 9\
**Last updated:** [June 20, 2021, 10:51am UTC](https://discourse.julialang.org/t/best-practice-type-piracy-for-package-compatibility/62792 "2021-06-20T10:51:41Z")

</div>

I would love to know your opinion, whether the (pretty safe) type-piracy as described below is in your opinion OK, and whether this mechanism via Base.convert() could become a “best-practice” example to solve the issue o…

---

## [How to rename files with spaces in file and directory names](https://discourse.julialang.org/t/how-to-rename-files-with-spaces-in-file-and-directory-names/56727)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 10\
**Last updated:** [June 20, 2021, 10:50am UTC](https://discourse.julialang.org/t/how-to-rename-files-with-spaces-in-file-and-directory-names/56727 "2021-06-20T10:50:12Z")

</div>

Hello, I received a big folder with a lot of files and subfolders that have spaces in their name. I am trying to write a function that replaces the spaces with underscore characters. The following code does NOT work: …

---

## [Designing a parametric type for storing bits](https://discourse.julialang.org/t/designing-a-parametric-type-for-storing-bits/63142)

<div class="topic-metadata">

**Author:** [@cdawg](https://discourse.julialang.org/u/cdawg)\
**Replies:** 7\
**Last updated:** [June 20, 2021, 8:31am UTC](https://discourse.julialang.org/t/designing-a-parametric-type-for-storing-bits/63142 "2021-06-20T08:31:06Z")

</div>

So I want to build a barebones static BitArray and I can’t seem to use the type system properly. Here’s my first attempt at a definition: struct SBitVector{N} \<: AbstractVector{Bool} chunks::SVector{M,UInt64} l…

---

## [More effective function parameter?](https://discourse.julialang.org/t/more-effective-function-parameter/63160)

<div class="topic-metadata">

**Author:** [@Jojo\_Dad](https://discourse.julialang.org/u/Jojo_Dad)\
**Replies:** 9\
**Last updated:** [June 19, 2021, 10:38pm UTC](https://discourse.julialang.org/t/more-effective-function-parameter/63160 "2021-06-19T22:38:31Z")

</div>

I have a function that I frequently use function expectation(f::Function; μ=0.0, σ=1.0) and it works great for expectation(x -\> (x-1)^2) as well as a many other examples. However, when I have a variable, e.g., avg=…

---

## [Reading fixed-width files: a preliminary solution](https://discourse.julialang.org/t/reading-fixed-width-files-a-preliminary-solution/60525)

<div class="topic-metadata">

**Author:** [@jbshannon](https://discourse.julialang.org/u/jbshannon)\
**Replies:** 5\
**Last updated:** [June 19, 2021, 9:16pm UTC](https://discourse.julialang.org/t/reading-fixed-width-files-a-preliminary-solution/60525 "2021-06-19T21:16:01Z")

</div>

After browsing through the discussions about reading fixed-width files in Julia (e.g. here and here) I still hadn’t found a solution that was general enough for my case. I wrote a quick one I’d like to share here. Suppo…

---

## [Mmap Symmetric Matricies](https://discourse.julialang.org/t/mmap-symmetric-matricies/63158)

<div class="topic-metadata">

**Author:** [@RobertGregg](https://discourse.julialang.org/u/RobertGregg)\
**Replies:** 3\
**Last updated:** [June 19, 2021, 8:30pm UTC](https://discourse.julialang.org/t/mmap-symmetric-matricies/63158 "2021-06-19T20:30:48Z")

</div>

I have a matrix that is too large to fit into memory, so I’ve decided to use Mmap to store it on disk which works perfectly. However, the matrix I’m storing is symmetric and it seems like a waste to use twice the amount …

---

## [Do-while loop in Julia](https://discourse.julialang.org/t/do-while-loop-in-julia/49014)

<div class="topic-metadata">

**Author:** [@Haolun\_Li](https://discourse.julialang.org/u/Haolun_Li)\
**Replies:** 2\
**Last updated:** [June 19, 2021, 3:33pm UTC](https://discourse.julialang.org/t/do-while-loop-in-julia/49014 "2021-06-19T15:33:11Z")

</div>

Is there a way for Julia to run the content first and check the condition next? Like the do-while loop in C++? Thanks

---

## [Is SparseArrays solver parallel?](https://discourse.julialang.org/t/is-sparsearrays-solver-parallel/63163)

<div class="topic-metadata">

**Author:** [@RaulDurand](https://discourse.julialang.org/u/RaulDurand)\
**Replies:** 0\
**Last updated:** [June 19, 2021, 12:06am UTC](https://discourse.julialang.org/t/is-sparsearrays-solver-parallel/63163 "2021-06-19T00:06:35Z")

</div>

Is the sparse solver (AX=B) from SparseArrays parallel? If yes, is it multithreaded or multiprocess?

---

## [Efficient way to simulate large system of ODEs](https://discourse.julialang.org/t/efficient-way-to-simulate-large-system-of-odes/63057)

<div class="topic-metadata">

**Author:** [@colebrookson](https://discourse.julialang.org/u/colebrookson)\
**Replies:** 5\
**Last updated:** [June 18, 2021, 10:18pm UTC](https://discourse.julialang.org/t/efficient-way-to-simulate-large-system-of-odes/63057 "2021-06-18T22:18:49Z")

</div>

Edit: So the way I proposed doing it here does work, I just made a mistake that @Oscar\_Smith pointed out, so using the functions this way is fine. Original Q: Hi there! I’m still a bit new to Julia and trying to figure…

---

## [Package precompilation fails after updating to 1.6.0](https://discourse.julialang.org/t/package-precompilation-fails-after-updating-to-1-6-0/58004)

<div class="topic-metadata">

**Author:** [@Geometh](https://discourse.julialang.org/u/Geometh)\
**Replies:** 5\
**Last updated:** [June 18, 2021, 8:21pm UTC](https://discourse.julialang.org/t/package-precompilation-fails-after-updating-to-1-6-0/58004 "2021-06-18T20:21:36Z")

</div>

Hi everyone, I am a package Developer (WavesAndEigenvalues.jl) and just updated my local Julia installation to v1.6.0. Unfortunately this leads to my local development branch failing precompilation and eventually render…

---

## [Artifact hash mismatch when installing libpng (Julia 1.6.1)](https://discourse.julialang.org/t/artifact-hash-mismatch-when-installing-libpng-julia-1-6-1/61766)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 36\
**Last updated:** [June 18, 2021, 6:30pm UTC](https://discourse.julialang.org/t/artifact-hash-mismatch-when-installing-libpng-julia-1-6-1/61766 "2021-06-18T18:30:32Z")

</div>

During today I have tried several times to update Julia and I receive the following alert: up Updating registry at \`C:\\Users\\Hermesr\\.julia\\registries\\General\` Updating git-repo \`C:\\Users\\Hermesr\\Documents\\Git…

---

## [Alignment of printing of test set results with verbose=true](https://discourse.julialang.org/t/alignment-of-printing-of-test-set-results-with-verbose-true/63150)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 0\
**Last updated:** [June 18, 2021, 5:33pm UTC](https://discourse.julialang.org/t/alignment-of-printing-of-test-set-results-with-verbose-true/63150 "2021-06-18T17:33:52Z")

</div>

Is it possible to get the alignment of printing for test set results to line up when using @testset verbose=true ? When using @testset verbose=true ... with three nested test sets, I’m getting printing like this: Test …

---

## [Export jupyter to .jl does not preserve markdown cells](https://discourse.julialang.org/t/export-jupyter-to-jl-does-not-preserve-markdown-cells/57556)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 7\
**Last updated:** [June 18, 2021, 4:32pm UTC](https://discourse.julialang.org/t/export-jupyter-to-jl-does-not-preserve-markdown-cells/57556 "2021-06-18T16:32:33Z")

</div>

Hi, this is a problem that I’m constantly facing… I usually develop my Julia code in jupyter (as per the IJulia package). When my codes get a usable form, I export them as .jl files (with the Export functionality in jup…

---

## [Pairwise computation slower than Python (Cython) code (BallTree very slow!)](https://discourse.julialang.org/t/pairwise-computation-slower-than-python-cython-code-balltree-very-slow/62273)

<div class="topic-metadata">

**Author:** [@florpi](https://discourse.julialang.org/u/florpi)\
**Replies:** 27\
**Last updated:** [June 18, 2021, 3:08pm UTC](https://discourse.julialang.org/t/pairwise-computation-slower-than-python-cython-code-balltree-very-slow/62273 "2021-06-18T15:08:07Z")

</div>

Hi everyone ! I’m new to Julia, and so far have found it very nice and neat. However, my Julia implementation is still slower than the python one I was trying to beat. The goal is to compute the mean radial pairwise vel…

---

## [Help speedup a brute-force solution](https://discourse.julialang.org/t/help-speedup-a-brute-force-solution/62894)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 13\
**Last updated:** [June 18, 2021, 8:50am UTC](https://discourse.julialang.org/t/help-speedup-a-brute-force-solution/62894 "2021-06-18T08:50:36Z")

</div>

The following function calculates all possible subsets of a set 1:n such that all subsets are primes. This is only a brute-force algorithm to test a solution, so it’s too slow as expected. The number of allocations is hu…

---

## [Memory corruption](https://discourse.julialang.org/t/memory-corruption/63129)

<div class="topic-metadata">

**Author:** [@aml](https://discourse.julialang.org/u/aml)\
**Replies:** 0\
**Last updated:** [June 18, 2021, 8:00am UTC](https://discourse.julialang.org/t/memory-corruption/63129 "2021-06-18T08:00:40Z")

</div>

I have a plugin written in C# that uses an embedded Julia. Most things work OK, but I get a problem caused by memory corruption from time to time. After rereading the chapter on Embedding I noticed that I could be causin…

---

## [Iterator over upper triangular part of Cartesian product?](https://discourse.julialang.org/t/iterator-over-upper-triangular-part-of-cartesian-product/63118)

<div class="topic-metadata">

**Author:** [@jlapeyre](https://discourse.julialang.org/u/jlapeyre)\
**Replies:** 3\
**Last updated:** [June 18, 2021, 4:19am UTC](https://discourse.julialang.org/t/iterator-over-upper-triangular-part-of-cartesian-product/63118 "2021-06-18T04:19:12Z")

</div>

Is a (preferably efficient) implementation of the following available in some package? triiter(x) = ((a\[2\], b) for a in enumerate(x) for b in Iterators.drop(x, a\[1\])) julia\> collect(triiter('a':'d')) 6-element Vector{T…

---

## [Bug in unary operator overloading syntax?](https://discourse.julialang.org/t/bug-in-unary-operator-overloading-syntax/63117)

<div class="topic-metadata">

**Author:** [@greatpet](https://discourse.julialang.org/u/greatpet)\
**Replies:** 1\
**Last updated:** [June 17, 2021, 11:04pm UTC](https://discourse.julialang.org/t/bug-in-unary-operator-overloading-syntax/63117 "2021-06-17T23:04:25Z")

</div>

Why doesn’t the following code work? I’m using Julia 1.6.1 struct MyNumber value::Number end import Base.- -(a::MyNumber)::MyNumber = MyNumber(-a.value) ERROR: syntax: "a::MyNumber" is not a valid function argument…

---

## [How do I fit an MvNormal to a matrix with Distributions.jl?](https://discourse.julialang.org/t/how-do-i-fit-an-mvnormal-to-a-matrix-with-distributions-jl/63072)

<div class="topic-metadata">

**Author:** [@Ivan](https://discourse.julialang.org/u/Ivan)\
**Replies:** 6\
**Last updated:** [June 17, 2021, 6:26pm UTC](https://discourse.julialang.org/t/how-do-i-fit-an-mvnormal-to-a-matrix-with-distributions-jl/63072 "2021-06-17T18:26:36Z")

</div>

I have a matrix of absorbance readings (one column per item) at different wavenumbers (rows). I want to enlarge my dataset with more synthetic data, and I am trying to fit an MvNormal to my matrix -as opposed to fitting …

---

## [Remove an element from an array without changing the original](https://discourse.julialang.org/t/remove-an-element-from-an-array-without-changing-the-original/63103)

<div class="topic-metadata">

**Author:** [@Sebastian\_Mena](https://discourse.julialang.org/u/Sebastian_Mena)\
**Replies:** 5\
**Last updated:** [June 17, 2021, 5:34pm UTC](https://discourse.julialang.org/t/remove-an-element-from-an-array-without-changing-the-original/63103 "2021-06-17T17:34:13Z")

</div>

I want to delete a element from an array without changing the original. Like this: original\_array = \[12,13,14,15\] new\_array = function\_to\_delete\_a\_element(element\_to\_delete = 14, array = original\_array) print(new\_array)…

---

## [Stop(msg) Julia Program](https://discourse.julialang.org/t/stop-msg-julia-program/10051)

<div class="topic-metadata">

**Author:** [@iwelch](https://discourse.julialang.org/u/iwelch)\
**Replies:** 4\
**Last updated:** [June 17, 2021, 4:03pm UTC](https://discourse.julialang.org/t/stop-msg-julia-program/10051 "2021-06-17T16:03:19Z")

</div>

could you add a stop(msg) function that works like error(msg), but replaces the word ERROR with STOP and does not print a stack backtrace? /iaw

---

## [Doing strange things with DataTypes in functions](https://discourse.julialang.org/t/doing-strange-things-with-datatypes-in-functions/63086)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 5\
**Last updated:** [June 17, 2021, 2:21pm UTC](https://discourse.julialang.org/t/doing-strange-things-with-datatypes-in-functions/63086 "2021-06-17T14:21:15Z")

</div>

Hey all :slight\_smile: Initially I wanted to do this: julia\> f{T}(i::T) = i ERROR: UndefVarError: T not defined Stacktrace: \[1\] top-level scope @ REPL\[51\]:1 But it only works for constructor of structs. Then I th…

---

## [Oacle.jl use on windows](https://discourse.julialang.org/t/oacle-jl-use-on-windows/63088)

<div class="topic-metadata">

**Author:** [@bww00](https://discourse.julialang.org/u/bww00)\
**Replies:** 0\
**Last updated:** [June 17, 2021, 1:50pm UTC](https://discourse.julialang.org/t/oacle-jl-use-on-windows/63088 "2021-06-17T13:50:36Z")

</div>

We would like to use oracle.jl to on windows to access an oracle db on a different machine. Oracle.jl lists requirements of macos or linux. Is the a precompiled windows version floating around ? Thanks

---

## [Allocations when passing closure as parameter](https://discourse.julialang.org/t/allocations-when-passing-closure-as-parameter/63082)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 2\
**Last updated:** [June 17, 2021, 1:13pm UTC](https://discourse.julialang.org/t/allocations-when-passing-closure-as-parameter/63082 "2021-06-17T13:13:04Z")

</div>

I struggling to obtain a minimal working example. But I have one situation which looks like: function outer!(f::Function, output,x::AbstractVector) for i in 1:10 output = inner!(f,output,x) end return output …

---

## [Type instability with static matrices when full size not given?](https://discourse.julialang.org/t/type-instability-with-static-matrices-when-full-size-not-given/63079)

<div class="topic-metadata">

**Author:** [@nabla](https://discourse.julialang.org/u/nabla)\
**Replies:** 4\
**Last updated:** [June 17, 2021, 12:45pm UTC](https://discourse.julialang.org/t/type-instability-with-static-matrices-when-full-size-not-given/63079 "2021-06-17T12:45:20Z")

</div>

I ran across the following, very wierd situation: if I don’t specify the 4th parameter in a SMatrix (which is supposed to be computed as the product of the sizes, then the code slows down considerably. MWE: using Benchm…

---

## [Static Vector with two different units](https://discourse.julialang.org/t/static-vector-with-two-different-units/63070)

<div class="topic-metadata">

**Author:** [@Luapulu](https://discourse.julialang.org/u/Luapulu)\
**Replies:** 1\
**Last updated:** [June 17, 2021, 8:15am UTC](https://discourse.julialang.org/t/static-vector-with-two-different-units/63070 "2021-06-17T08:15:36Z")

</div>

I’m working with DifferentialEquations.jl and I have a state vector in 6-dimensional phase space. I would like to work with units and static vectors but my issue is that the momentum part of the phase space vector has a …

---

## [Evaluating the "for" condition](https://discourse.julialang.org/t/evaluating-the-for-condition/63050)

<div class="topic-metadata">

**Author:** [@marllos](https://discourse.julialang.org/u/marllos)\
**Replies:** 10\
**Last updated:** [June 17, 2021, 7:35am UTC](https://discourse.julialang.org/t/evaluating-the-for-condition/63050 "2021-06-17T07:35:12Z")

</div>

Hello everyone. The following simple example is just to ask the question: will Julia evaluate the length function 5 times? Thank you. function test() v = \[1,2,3,4,5\] for i = 1:length(v) println(v\[i\]) end end

---

## [Selectdim behaviour for arrays of dimension greater than 2](https://discourse.julialang.org/t/selectdim-behaviour-for-arrays-of-dimension-greater-than-2/52211)

<div class="topic-metadata">

**Author:** [@OlivierHnt](https://discourse.julialang.org/u/OlivierHnt)\
**Replies:** 5\
**Last updated:** [June 1, 2021, 2:27pm UTC](https://discourse.julialang.org/t/selectdim-behaviour-for-arrays-of-dimension-greater-than-2/52211 "2021-06-01T14:27:45Z")

</div>

I just noticed a type-instability with selectdim. Consider the function f(A) = selectdim(A, 1, 1) For a matrix, we have that the return type of f is a 1D SubArray (as expected): julia\> A = rand(2,2); julia\> @code\_war…

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

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