# General Usage

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

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

**Page:** 688

---

## [How to run julia code remotely on another local machine?](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765)

<div class="topic-metadata">

**Author:** [@StatisticalMouse](https://discourse.julialang.org/u/StatisticalMouse)\
**Replies:** 12\
**Last updated:** [October 22, 2020, 12:33pm UTC](https://discourse.julialang.org/t/how-to-run-julia-code-remotely-on-another-local-machine/48765 "2020-10-22T12:33:43Z")

</div>

My main machine is a MacBook Pro, where I edit Julia. I also have a PC running Windows that has an 8-core CPU and a GTX-1070ti. I can connect them via local LAN. Is there some good way that I could send Julia that I e…

---

## [How to convert UniformScaling with single entry to Number?](https://discourse.julialang.org/t/how-to-convert-uniformscaling-with-single-entry-to-number/48751)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 8\
**Last updated:** [October 22, 2020, 11:56am UTC](https://discourse.julialang.org/t/how-to-convert-uniformscaling-with-single-entry-to-number/48751 "2020-10-22T11:56:20Z")

</div>

Copying a question from Zulip given that it may be useful in general to discuss in Discourse… A good trick to perform algebraic operations with both arrays and numbers generically is to use LinearAlgebra.I instead of 1: …

---

## [Indentifying pathological cases in IR form](https://discourse.julialang.org/t/indentifying-pathological-cases-in-ir-form/48746)

<div class="topic-metadata">

**Author:** [@wulpuqu](https://discourse.julialang.org/u/wulpuqu)\
**Replies:** 0\
**Last updated:** [October 21, 2020, 1:33pm UTC](https://discourse.julialang.org/t/indentifying-pathological-cases-in-ir-form/48746 "2020-10-21T13:33:54Z")

</div>

Hello everyone, I am currently playing with lowered code and I would like to understand how to identify pathological cases. In the following example, a variable b gets conditionnaly assigned at step 1 of the loop and th…

---

## [Threads.@spawn performance](https://discourse.julialang.org/t/threads-spawn-performance/48681)

<div class="topic-metadata">

**Author:** [@j\_tanu](https://discourse.julialang.org/u/j_tanu)\
**Replies:** 7\
**Last updated:** [October 22, 2020, 6:23am UTC](https://discourse.julialang.org/t/threads-spawn-performance/48681 "2020-10-22T06:23:37Z")

</div>

I am trying to perform a complex mathematical operation over the elements of two array. It’s a kind of broadcasting operation. I am trying to achieving the performance gain from threads.@spawn and @simd at the same time.…

---

## [How do I construct the initial condition in FEM for ODEProblem once, not twice?](https://discourse.julialang.org/t/how-do-i-construct-the-initial-condition-in-fem-for-odeproblem-once-not-twice/48688)

<div class="topic-metadata">

**Author:** [@kapple](https://discourse.julialang.org/u/kapple)\
**Replies:** 3\
**Last updated:** [October 21, 2020, 4:20pm UTC](https://discourse.julialang.org/t/how-do-i-construct-the-initial-condition-in-fem-for-odeproblem-once-not-twice/48688 "2020-10-21T16:20:16Z")

</div>

I am looking to obtain a solution approximation u = u(x, t) for a partial differential equation via FEM. I am using DifferentialEquations with the prospect utilizing its parameter estimation functionality. The parameter…

---

## [Design of related modules wrt pkg](https://discourse.julialang.org/t/design-of-related-modules-wrt-pkg/48708)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 1\
**Last updated:** [October 21, 2020, 2:37pm UTC](https://discourse.julialang.org/t/design-of-related-modules-wrt-pkg/48708 "2020-10-21T14:37:31Z")

</div>

tldr: regarding use of pkg, are these two examples both doing the same thing (one parent pkg exports functions from all the others)? is there case where one might instead do: each child pkg uses functions from a common…

---

## [BenchmarkTools.jl: @benchmark has big overhead](https://discourse.julialang.org/t/benchmarktools-jl-benchmark-has-big-overhead/48745)

<div class="topic-metadata">

**Author:** [@SonntagK](https://discourse.julialang.org/u/SonntagK)\
**Replies:** 6\
**Last updated:** [October 21, 2020, 2:10pm UTC](https://discourse.julialang.org/t/benchmarktools-jl-benchmark-has-big-overhead/48745 "2020-10-21T14:10:14Z")

</div>

Hello, I want to use BenchmarkTools to compare different model builds using JuMP for linear programming. Doing this for bigger linear problems took longer than I imagined. When looking at the results of @benchmark I no…

---

## [Extract String from Array](https://discourse.julialang.org/t/extract-string-from-array/48720)

<div class="topic-metadata">

**Author:** [@torieowers](https://discourse.julialang.org/u/torieowers)\
**Replies:** 4\
**Last updated:** [October 21, 2020, 1:43pm UTC](https://discourse.julialang.org/t/extract-string-from-array/48720 "2020-10-21T13:43:15Z")

</div>

Hello, I am wanting to get only a list of strings, but instead I am getting an array of arrays. I’ve run: all\_weights = vcat(map(get\_weight,about\_breeds\_links)) get\_weight is a function to take in a link and return o…

---

## [High-dimensional A\\b when running julia -p N](https://discourse.julialang.org/t/high-dimensional-a-b-when-running-julia-p-n/48669)

<div class="topic-metadata">

**Author:** [@fipelle](https://discourse.julialang.org/u/fipelle)\
**Replies:** 7\
**Last updated:** [October 21, 2020, 1:10pm UTC](https://discourse.julialang.org/t/high-dimensional-a-b-when-running-julia-p-n/48669 "2020-10-21T13:10:03Z")

</div>

Hi, I am trying to optimise a function that solves a series of high-dimensional systems (using A\\b) in parallel (one per iteration of a for-loop). I am not sure whether it would be a good idea to have more cores than wh…

---

## [Recording simulation data](https://discourse.julialang.org/t/recording-simulation-data/48498)

<div class="topic-metadata">

**Author:** [@stasz](https://discourse.julialang.org/u/stasz)\
**Replies:** 9\
**Last updated:** [October 21, 2020, 10:41am UTC](https://discourse.julialang.org/t/recording-simulation-data/48498 "2020-10-21T10:41:17Z")

</div>

When doing research, I like setting up experiments in Julia to verify my theoretical findings or to simply make sense of the concepts I’m dealing with. The point is, my experiments are usually simple, small and I’d like …

---

## [Inplace matrix sampling](https://discourse.julialang.org/t/inplace-matrix-sampling/48731)

<div class="topic-metadata">

**Author:** [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Replies:** 1\
**Last updated:** [October 21, 2020, 9:42am UTC](https://discourse.julialang.org/t/inplace-matrix-sampling/48731 "2020-10-21T09:42:20Z")

</div>

I wonder is there an algorithm, established package or some other way for inplace matrix sampling? Here is an example of what I am trying to achieve using StableRNGs using StatsBase using BenchmarkTools rng = StableRNG…

---

## [A question about JuMP](https://discourse.julialang.org/t/a-question-about-jump/48733)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 0\
**Last updated:** [October 21, 2020, 8:43am UTC](https://discourse.julialang.org/t/a-question-about-jump/48733 "2020-10-21T08:43:02Z")

</div>

I can’t add JuMP in JuliaPro why is that?thanks

---

## [Failed to add ParallelKMeans.jl](https://discourse.julialang.org/t/failed-to-add-parallelkmeans-jl/48728)

<div class="topic-metadata">

**Author:** [@zlq178](https://discourse.julialang.org/u/zlq178)\
**Replies:** 1\
**Last updated:** [October 21, 2020, 8:22am UTC](https://discourse.julialang.org/t/failed-to-add-parallelkmeans-jl/48728 "2020-10-21T08:22:36Z")

</div>

I want to add “ParallelKMeans.jl”. When I run code in REPL ,it shows me: How can I add the package successfully?

---

## [Viewing dataframe with vscodedisplay produces ERROR](https://discourse.julialang.org/t/viewing-dataframe-with-vscodedisplay-produces-error/48703)

<div class="topic-metadata">

**Author:** [@HaraldStein](https://discourse.julialang.org/u/HaraldStein)\
**Replies:** 1\
**Last updated:** [October 21, 2020, 7:22am UTC](https://discourse.julialang.org/t/viewing-dataframe-with-vscodedisplay-produces-error/48703 "2020-10-21T07:22:39Z")

</div>

Hello, I have a problem viewing into a dataframe. I have the latest VS Code version (1.50.1 and Julia plugin 1.08). What should I do? vscodedisplay(df) ERROR: MethodError: julia\_type\_to\_schema\_type(::Type{Union{}}) is…

---

## [Eachcol get name property](https://discourse.julialang.org/t/eachcol-get-name-property/48695)

<div class="topic-metadata">

**Author:** [@Cristian\_Suciava](https://discourse.julialang.org/u/Cristian_Suciava)\
**Replies:** 5\
**Last updated:** [October 21, 2020, 6:41am UTC](https://discourse.julialang.org/t/eachcol-get-name-property/48695 "2020-10-21T06:41:20Z")

</div>

How can I get the name property when using eachcol?

---

## [My Flux Application painfully slow](https://discourse.julialang.org/t/my-flux-application-painfully-slow/48705)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 21\
**Last updated:** [October 20, 2020, 10:45pm UTC](https://discourse.julialang.org/t/my-flux-application-painfully-slow/48705 "2020-10-20T22:45:47Z")

</div>

My Flux application runs painfully slowly. My training set is about 250,000 with about 100 inputs with the following setup: Chain(Dense(100,40,relu), Dense(40,40,relu), Dense(40,1,identity)) The mini-batches are about…

---

## [What is julia (insider) vs code extension](https://discourse.julialang.org/t/what-is-julia-insider-vs-code-extension/48535)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 3\
**Last updated:** [October 20, 2020, 6:53pm UTC](https://discourse.julialang.org/t/what-is-julia-insider-vs-code-extension/48535 "2020-10-20T18:53:58Z")

</div>

I stumbled upon this project which seems to let the host provide a running vs code instance to remote clients as a web-accessible ide. However, after logging in via the web site from the remote, the only julia extensio…

---

## [The plot (with Plots pkg) not displayed, if plot(...) is not the last operator](https://discourse.julialang.org/t/the-plot-with-plots-pkg-not-displayed-if-plot-is-not-the-last-operator/34410)

<div class="topic-metadata">

**Author:** [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Replies:** 4\
**Last updated:** [October 20, 2020, 5:45pm UTC](https://discourse.julialang.org/t/the-plot-with-plots-pkg-not-displayed-if-plot-is-not-the-last-operator/34410 "2020-10-20T17:45:32Z")

</div>

This works as expected: using Plots gr() x = 0:0.1:1 y = sin.(2π\*x) @show plot(x, y, lw=3) and this does not display anything, no produce any error messages: ... @show plot(x, y, lw=3) a=1 and this works again (worka…

---

## [Combining functors, broadcasting, and pipes](https://discourse.julialang.org/t/combining-functors-broadcasting-and-pipes/48691)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 2\
**Last updated:** [October 20, 2020, 4:27pm UTC](https://discourse.julialang.org/t/combining-functors-broadcasting-and-pipes/48691 "2020-10-20T16:27:12Z")

</div>

I’ve got another behavior I don’t quite understand. Here’s an MWE: begin struct MyStruct x end function(ms::MyStruct)(y) ms.x\*y end end ms1=MyStruct(2) ms1(2) # works 2 |\> ms1 # works ms1.((3,4)) # works b…

---

## [Weave won't convert a tex to pdf, because it says the directory is not empty](https://discourse.julialang.org/t/weave-wont-convert-a-tex-to-pdf-because-it-says-the-directory-is-not-empty/48670)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 2\
**Last updated:** [October 20, 2020, 12:56pm UTC](https://discourse.julialang.org/t/weave-wont-convert-a-tex-to-pdf-because-it-says-the-directory-is-not-empty/48670 "2020-10-20T12:56:18Z")

</div>

I’m getting an error that the directory is not empty. How do I fix this? @pdeffebach, you’re the weave guy, how do I resolve this?

---

## [@df macro under StatsPlots](https://discourse.julialang.org/t/df-macro-under-statsplots/48675)

<div class="topic-metadata">

**Author:** [@Mun\_Barimukh](https://discourse.julialang.org/u/Mun_Barimukh)\
**Replies:** 5\
**Last updated:** [October 20, 2020, 9:34am UTC](https://discourse.julialang.org/t/df-macro-under-statsplots/48675 "2020-10-20T09:34:34Z")

</div>

I have used “using StatsPlots;@df df plot(:a, \[:b :c\], colour = \[:red :blue\])”. Once I have got the result. But later on it has been showing @df not defined. How to fix it? Please help me out here.

---

## [How to use ConfParser.jl to read INI file with custom comment prefix](https://discourse.julialang.org/t/how-to-use-confparser-jl-to-read-ini-file-with-custom-comment-prefix/48652)

<div class="topic-metadata">

**Author:** [@vsskanth](https://discourse.julialang.org/u/vsskanth)\
**Replies:** 1\
**Last updated:** [October 20, 2020, 8:24am UTC](https://discourse.julialang.org/t/how-to-use-confparser-jl-to-read-ini-file-with-custom-comment-prefix/48652 "2020-10-20T08:24:55Z")

</div>

I’m new to Julia and I am trying to convert a piece of python code that reads a TIR file (which is like an INI file with different prefixes for comments). tir\_parser = ConfigParser( strict = False, c…

---

## [Adding a simple constraint in Optim.jl optimizer](https://discourse.julialang.org/t/adding-a-simple-constraint-in-optim-jl-optimizer/48497)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 1\
**Last updated:** [October 20, 2020, 6:11am UTC](https://discourse.julialang.org/t/adding-a-simple-constraint-in-optim-jl-optimizer/48497 "2020-10-20T06:11:40Z")

</div>

I have a simple optimizing code that I would like to add a constraint to. I think it may fall under nonlinear optimization (so potentially NLopt.jl) but I have no idea. The function is defined as the sum of squared diff…

---

## [Using test.jl to prove trig identies](https://discourse.julialang.org/t/using-test-jl-to-prove-trig-identies/48654)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 9\
**Last updated:** [October 19, 2020, 11:46pm UTC](https://discourse.julialang.org/t/using-test-jl-to-prove-trig-identies/48654 "2020-10-19T23:46:14Z")

</div>

I’m trying to do a proof using trig identities, I get a fail, and I,m not sure if I’m using @test wrong, or if I made a mistake in my math s.t. cos(x)-cos(y)=-2\*(sin((x+y)/2)\*sin((x-y)/2)) using Plots using test FX=f…

---

## [Reading multiple text files from a directory](https://discourse.julialang.org/t/reading-multiple-text-files-from-a-directory/48661)

<div class="topic-metadata">

**Author:** [@johnberg1](https://discourse.julialang.org/u/johnberg1)\
**Replies:** 1\
**Last updated:** [October 19, 2020, 10:57pm UTC](https://discourse.julialang.org/t/reading-multiple-text-files-from-a-directory/48661 "2020-10-19T22:57:13Z")

</div>

Hello all, I am very new to Julia and I have a question regarding reading some files. I need to read 12500 .txt files from the same directory and save them all into 1 array but I’m having performance issues. Is there a f…

---

## [Dynamic Code Loading to Use Packages on Demand](https://discourse.julialang.org/t/dynamic-code-loading-to-use-packages-on-demand/48655)

<div class="topic-metadata">

**Author:** [@TheCedarPrince](https://discourse.julialang.org/u/TheCedarPrince)\
**Replies:** 3\
**Last updated:** [October 19, 2020, 10:02pm UTC](https://discourse.julialang.org/t/dynamic-code-loading-to-use-packages-on-demand/48655 "2020-10-19T22:02:23Z")

</div>

I ran into an interesting problem today that I am trying to figure out (along with @Wikunia and @arsh). Basically, it stems from the idea of trying to load specific packages by user demand. The specific issue we are work…

---

## [Is UnionAll abstract? Is it bad for performance?](https://discourse.julialang.org/t/is-unionall-abstract-is-it-bad-for-performance/48653)

<div class="topic-metadata">

**Author:** [@JamesK](https://discourse.julialang.org/u/JamesK)\
**Replies:** 1\
**Last updated:** [October 19, 2020, 9:37pm UTC](https://discourse.julialang.org/t/is-unionall-abstract-is-it-bad-for-performance/48653 "2020-10-19T21:37:37Z")

</div>

Sorry in advance if this is covered somewhere; I’m still a beginner. I’m concerned about the two performance tips as they relate to UnionAll: 1) Avoid fields with abstract type and 2) Avoid containers with abstract type…

---

## [Fitting of distribution histogram - axis-limit issues and problems with defining goodness of fit?](https://discourse.julialang.org/t/fitting-of-distribution-histogram-axis-limit-issues-and-problems-with-defining-goodness-of-fit/48617)

<div class="topic-metadata">

**Author:** [@MJMAG](https://discourse.julialang.org/u/MJMAG)\
**Replies:** 1\
**Last updated:** [October 19, 2020, 1:48pm UTC](https://discourse.julialang.org/t/fitting-of-distribution-histogram-axis-limit-issues-and-problems-with-defining-goodness-of-fit/48617 "2020-10-19T13:48:57Z")

</div>

Hey Community, I am facing the following “problem”: I am supposed to find a growth rate distribution in a certain data set. For this I am looking at new objects being created at a timestep. These counts I want to illus…

---

## [TAR.create with a collection of file paths](https://discourse.julialang.org/t/tar-create-with-a-collection-of-file-paths/48626)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 0\
**Last updated:** [October 19, 2020, 1:19pm UTC](https://discourse.julialang.org/t/tar-create-with-a-collection-of-file-paths/48626 "2020-10-19T13:19:13Z")

</div>

Is there a simple way to build a tarball from a list of files? From the docs it seems like I’ll need to give it the parent directory of all of the files, so potentially /, and then a predicate function, so something lik…

---

## [How to read φ and π in @code\_typed output?](https://discourse.julialang.org/t/how-to-read-and-in-code-typed-output/48623)

<div class="topic-metadata">

**Author:** [@igloo](https://discourse.julialang.org/u/igloo)\
**Replies:** 2\
**Last updated:** [October 19, 2020, 1:09pm UTC](https://discourse.julialang.org/t/how-to-read-and-in-code-typed-output/48623 "2020-10-19T13:09:23Z")

</div>

Take for example the following snippet. 5 ── goto #6 6 ── %26 = Base.sub\_float(%23, 1.0)::Float64 └─── goto #7 7 ── goto #8 8 ── goto #9 9 ── %30 = Base.lt\_float(0.5, %26)::Bool └─── goto #…

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

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