# General Usage

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

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

**Page:** 619

---

## [@time and @btime show different allocations](https://discourse.julialang.org/t/time-and-btime-show-different-allocations/58632)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 2\
**Last updated:** [April 5, 2021, 7:15pm UTC](https://discourse.julialang.org/t/time-and-btime-show-different-allocations/58632 "2021-04-05T19:15:26Z")

</div>

Hey Julianners, What can be the difference, that makes @time and @btime time different time in these scenarios? a, b = 6, 7 foo(a, b) = begin for i = 1:2 a, b=a + 6, b + 7+i end end @time foo(a,b) @time foo(a,b…

---

## [Solve for upper/lower bound of a numerical definite integral](https://discourse.julialang.org/t/solve-for-upper-lower-bound-of-a-numerical-definite-integral/58164)

<div class="topic-metadata">

**Author:** [@carloslesmes](https://discourse.julialang.org/u/carloslesmes)\
**Replies:** 24\
**Last updated:** [April 5, 2021, 6:23pm UTC](https://discourse.julialang.org/t/solve-for-upper-lower-bound-of-a-numerical-definite-integral/58164 "2021-04-05T18:23:52Z")

</div>

Hi, I’m trying to solve for b, given f, a and k, please help, Is there a way to do it in julia? quadgk(f,a,b)=k Thanks

---

## [Crash Windows 10](https://discourse.julialang.org/t/crash-windows-10/58616)

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 2\
**Last updated:** [April 5, 2021, 2:39pm UTC](https://discourse.julialang.org/t/crash-windows-10/58616 "2021-04-05T14:39:52Z")

</div>

This is the second time that I crash the Julia client when using LinearAlgebra’ish code. I can not provide a minimal working example yet, but I am working on it. I want to ask here early, because maybe that kind of issue…

---

## [Trouble adding packages: "The connection with the server was terminated abnormally"](https://discourse.julialang.org/t/trouble-adding-packages-the-connection-with-the-server-was-terminated-abnormally/58612)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 2\
**Last updated:** [April 5, 2021, 1:26pm UTC](https://discourse.julialang.org/t/trouble-adding-packages-the-connection-with-the-server-was-terminated-abnormally/58612 "2021-04-05T13:26:43Z")

</div>

How to solve this problem: Some packages have a happy installation and others do not! (@v1.6) pkg\> add Plots Updating registry at \`C:\\Users\\hermesr\\.julia\\registries\\General\` ┌ Warning: could not download https://p…

---

## [Stray Julia Processes](https://discourse.julialang.org/t/stray-julia-processes/58270)

<div class="topic-metadata">

**Author:** [@Nicholaswogan](https://discourse.julialang.org/u/Nicholaswogan)\
**Replies:** 9\
**Last updated:** [April 5, 2021, 12:03am UTC](https://discourse.julialang.org/t/stray-julia-processes/58270 "2021-04-05T00:03:55Z")

</div>

I use Julia through Jupyter notebooks on MacOS Catalina (10.15.7). My “activity monitor app” (See screenshot here ) claims I have a TON of Julia stray processes eating up many GB of RAM. Why is this? What am I doing wron…

---

## [Non allocating tuple transformations which include index](https://discourse.julialang.org/t/non-allocating-tuple-transformations-which-include-index/58599)

<div class="topic-metadata">

**Author:** [@Skoffer](https://discourse.julialang.org/u/Skoffer)\
**Replies:** 4\
**Last updated:** [April 5, 2021, 10:11am UTC](https://discourse.julialang.org/t/non-allocating-tuple-transformations-which-include-index/58599 "2021-04-05T10:11:08Z")

</div>

When one is working with tuples, what is the idiomatic way to do operations, when it is necessary to use element indices? For example, consider that there is a tuple t = (0.1, 0.2, 0.3, 0.4) and it should be transform…

---

## [Convert to integer type of minimum required size](https://discourse.julialang.org/t/convert-to-integer-type-of-minimum-required-size/58567)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 6\
**Last updated:** [April 5, 2021, 7:30am UTC](https://discourse.julialang.org/t/convert-to-integer-type-of-minimum-required-size/58567 "2021-04-05T07:30:52Z")

</div>

I thought that this should be a trivial question, but I’m failing to find the answer. How can I convert an arbitrary value for which isinteger(x) is true, into the subtype of Signed or Unsigned with the minimum required …

---

## [For loop untill condition == True - Brute Force](https://discourse.julialang.org/t/for-loop-untill-condition-true-brute-force/58583)

<div class="topic-metadata">

**Author:** [@statspy](https://discourse.julialang.org/u/statspy)\
**Replies:** 2\
**Last updated:** [April 5, 2021, 1:27am UTC](https://discourse.julialang.org/t/for-loop-untill-condition-true-brute-force/58583 "2021-04-05T01:27:31Z")

</div>

I am trying to solve a diophantine equation using a simple for loop to solve this equation: f(x,y) = x^2 + y^3 == 31 So i have defined: X = collect(1:1:10) e Y= collect(1:1:10) and tried: for i in Y for j in X …

---

## [Executing Julia on iOS?](https://discourse.julialang.org/t/executing-julia-on-ios/58558)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 2\
**Last updated:** [April 4, 2021, 3:13pm UTC](https://discourse.julialang.org/t/executing-julia-on-ios/58558 "2021-04-04T15:13:26Z")

</div>

I am not asking about programming Julia on iOS, but I am asking about executing Julia programs on iOS. I have written several Julia programs that retrieve online information, do calculations and produce reports. The pro…

---

## [BrowseTables configure details of table](https://discourse.julialang.org/t/browsetables-configure-details-of-table/58486)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 9\
**Last updated:** [April 4, 2021, 2:10pm UTC](https://discourse.julialang.org/t/browsetables-configure-details-of-table/58486 "2021-04-04T14:10:05Z")

</div>

I have a table in a Pluto notebook that I would prefer to have as an HTML object, so that I can smoothly integrate it with test in markdown. BrowseTables.jl does exacly that - defining an HTMLTable and using the $variabl…

---

## [Julia 1.6 stacktrace displayed weirdly in iTerm2 with dark color scheme and transparent background](https://discourse.julialang.org/t/julia-1-6-stacktrace-displayed-weirdly-in-iterm2-with-dark-color-scheme-and-transparent-background/58554)

<div class="topic-metadata">

**Author:** [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Replies:** 3\
**Last updated:** [April 4, 2021, 12:12pm UTC](https://discourse.julialang.org/t/julia-1-6-stacktrace-displayed-weirdly-in-iterm2-with-dark-color-scheme-and-transparent-background/58554 "2021-04-04T12:12:08Z")

</div>

Please see the screenshots. I can hardly see some parts of each stacktrace \[1\], \[2\], \[3\], etc. How can I fix it? Julia versions before 1.6 have no problem.

---

## [Calling Julia from MATLAB](https://discourse.julialang.org/t/calling-julia-from-matlab/51542)

<div class="topic-metadata">

**Author:** [@Vangelis](https://discourse.julialang.org/u/Vangelis)\
**Replies:** 19\
**Last updated:** [April 4, 2021, 1:30am UTC](https://discourse.julialang.org/t/calling-julia-from-matlab/51542 "2021-04-04T01:30:28Z")

</div>

Hello everyone, I am trying to call a Julia algorithm from MATLAB. Looking at https://github.com/juliamatlab/ I found the: mexjulia jlcall I tried both and, after making some corrections (because are meant for Julia…

---

## [How to use a numerical type parameters in declaration](https://discourse.julialang.org/t/how-to-use-a-numerical-type-parameters-in-declaration/58535)

<div class="topic-metadata">

**Author:** [@jsjie](https://discourse.julialang.org/u/jsjie)\
**Replies:** 5\
**Last updated:** [April 4, 2021, 1:16am UTC](https://discourse.julialang.org/t/how-to-use-a-numerical-type-parameters-in-declaration/58535 "2021-04-04T01:16:43Z")

</div>

I’m trying to do something about physics, and I’ve written a struct like struct System charge\_density end now there is something called “spin” that may, but not must be considered in physics, and the data structure…

---

## [Using RegionTrees adaptivesampling! with MappedArrays](https://discourse.julialang.org/t/using-regiontrees-adaptivesampling-with-mappedarrays/58477)

<div class="topic-metadata">

**Author:** [@Crghilardi](https://discourse.julialang.org/u/Crghilardi)\
**Replies:** 0\
**Last updated:** [April 3, 2021, 1:32am UTC](https://discourse.julialang.org/t/using-regiontrees-adaptivesampling-with-mappedarrays/58477 "2021-04-03T01:32:40Z")

</div>

I’m playing around with RegionTrees and am trying to write a refinery that makes an octree given a bunch of points. The twist being my points are in a MappedArray. I can populate an initial Cell with the MappedArray data…

---

## [Trivial question about workers on a cluster](https://discourse.julialang.org/t/trivial-question-about-workers-on-a-cluster/58517)

<div class="topic-metadata">

**Author:** [@Frisus95](https://discourse.julialang.org/u/Frisus95)\
**Replies:** 1\
**Last updated:** [April 3, 2021, 10:40pm UTC](https://discourse.julialang.org/t/trivial-question-about-workers-on-a-cluster/58517 "2021-04-03T22:40:21Z")

</div>

Good day everyone! As the title suggests, I have a (probably trivial) question about how to run a parallel computation on multiple nodes in a cluster. My code calls an external library, written in C, and then paralleli…

---

## [Plotting a R→C function](https://discourse.julialang.org/t/plotting-a-r-c-function/57916)

<div class="topic-metadata">

**Author:** [@owiecc](https://discourse.julialang.org/u/owiecc)\
**Replies:** 3\
**Last updated:** [April 3, 2021, 10:35pm UTC](https://discourse.julialang.org/t/plotting-a-r-c-function/57916 "2021-04-03T22:35:56Z")

</div>

Is there a better way to plot a function that maps from real to complex numbers? f(x) = 2x+x^2\*1im plot(real∘f, imag∘f, 0, 2π, legend=false, xlabel="Re", ylabel="Im") When I plot an Array{Complex{Float64},1} I get the …

---

## [Issue with DataFrame type dispatch](https://discourse.julialang.org/t/issue-with-dataframe-type-dispatch/58504)

<div class="topic-metadata">

**Author:** [@emmettgb](https://discourse.julialang.org/u/emmettgb)\
**Replies:** 3\
**Last updated:** [April 3, 2021, 6:44pm UTC](https://discourse.julialang.org/t/issue-with-dataframe-type-dispatch/58504 "2021-04-03T18:44:21Z")

</div>

Hi guys, hope you are all well. I am having an issue with multiple dispatch and the DataFrame type from DataFrames.jl. Below is my code… mutable struct RandomForestClassifier{P} \<: Classifier predict::P stored…

---

## [Slow.jl: keep around a slow implementation of your functions](https://discourse.julialang.org/t/slow-jl-keep-around-a-slow-implementation-of-your-functions/58468)

<div class="topic-metadata">

**Author:** [@xzackli](https://discourse.julialang.org/u/xzackli)\
**Replies:** 7\
**Last updated:** [April 3, 2021, 6:28pm UTC](https://discourse.julialang.org/t/slow-jl-keep-around-a-slow-implementation-of-your-functions/58468 "2021-04-03T18:28:19Z")

</div>

There exists a tension between readability and speed. This is discussed briefly in Keeping track of simple vs high-performance versions - Usage / Performance - JuliaLang. Indeed, I often write two versions of a function…

---

## [Selective testing](https://discourse.julialang.org/t/selective-testing/34736)

<div class="topic-metadata">

**Author:** [@lostella](https://discourse.julialang.org/u/lostella)\
**Replies:** 7\
**Last updated:** [April 3, 2021, 5:56pm UTC](https://discourse.julialang.org/t/selective-testing/34736 "2021-04-03T17:56:55Z")

</div>

I’m wondering if there is a way in Julia to run a subset of a package’s tests. The use case is pretty simple: I have a failing test, and I’m working my way to fixing the bug; however, I don’t want to have to run the whol…

---

## [Get url of package](https://discourse.julialang.org/t/get-url-of-package/4212)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 5\
**Last updated:** [April 3, 2021, 5:56pm UTC](https://discourse.julialang.org/t/get-url-of-package/4212 "2021-04-03T17:56:19Z")

</div>

I have the name of a registered package and I want to get its url. Currently I use the following hack: function url(pkg) path = joinpath(Pkg.dir(), "METADATA", pkg, "url") strip(readstring(path)) end is there a…

---

## [How to save the name of a DataFrame to a dictionary?](https://discourse.julialang.org/t/how-to-save-the-name-of-a-dataframe-to-a-dictionary/58409)

<div class="topic-metadata">

**Author:** [@HJW019](https://discourse.julialang.org/u/HJW019)\
**Replies:** 12\
**Last updated:** [April 3, 2021, 2:12pm UTC](https://discourse.julialang.org/t/how-to-save-the-name-of-a-dataframe-to-a-dictionary/58409 "2021-04-03T14:12:51Z")

</div>

Hello! I am writing a function by which I intend to read in a DataFrame, do some analysis with the data, and save the results and the name of the DataFrame in a dictionary. I am almost done except saving the DataFrame n…

---

## [Error propagation with remote asynchronous tasks seems broken](https://discourse.julialang.org/t/error-propagation-with-remote-asynchronous-tasks-seems-broken/58489)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 0\
**Last updated:** [April 3, 2021, 10:40am UTC](https://discourse.julialang.org/t/error-propagation-with-remote-asynchronous-tasks-seems-broken/58489 "2021-04-03T10:40:19Z")

</div>

This works: julia\> @sync @spawnat 2 error("hi") ERROR: On worker 2: hi Stacktrace: \[1\] error @ ./error.jl:33 \[2\] #51 @ /buildworker/worker/package\_linux64/build/usr/share/julia/stdlib/v1.6/Distributed/src/macros…

---

## [How to implement embeddings in Flux that aren't tragically slow?](https://discourse.julialang.org/t/how-to-implement-embeddings-in-flux-that-arent-tragically-slow/55201)

<div class="topic-metadata">

**Author:** [@jjminton](https://discourse.julialang.org/u/jjminton)\
**Replies:** 3\
**Last updated:** [April 3, 2021, 8:56am UTC](https://discourse.julialang.org/t/how-to-implement-embeddings-in-flux-that-arent-tragically-slow/55201 "2021-04-03T08:56:43Z")

</div>

I have recently started learning Julia and Flux for machine learning. I am trying to implement word2vec as a starting point, but the gradient calculations slow down dramatically with larger vocabulary sizes. With negativ…

---

## [Timeout for connect (Socket)](https://discourse.julialang.org/t/timeout-for-connect-socket/58396)

<div class="topic-metadata">

**Author:** [@tknopp](https://discourse.julialang.org/u/tknopp)\
**Replies:** 6\
**Last updated:** [April 3, 2021, 6:21am UTC](https://discourse.julialang.org/t/timeout-for-connect-socket/58396 "2021-04-03T06:21:26Z")

</div>

Hi, I have a problem with a local server that sometimes is down and in turn connect("ip-of-server", port) is blocking infinitely. I would like to have some timeout that throws an exception that I could catch, e.g. a…

---

## [Could not download https://pkg.julialang.org/registries](https://discourse.julialang.org/t/could-not-download-https-pkg-julialang-org-registries/58467)

<div class="topic-metadata">

**Author:** [@hamorabi](https://discourse.julialang.org/u/hamorabi)\
**Replies:** 0\
**Last updated:** [April 2, 2021, 9:49pm UTC](https://discourse.julialang.org/t/could-not-download-https-pkg-julialang-org-registries/58467 "2021-04-02T21:49:22Z")

</div>

I am on pop os 20.10 and downloaded Julia 1.6 from here. After running Julia, I tried to download the DataFrames package, but got the following error: could not download https://pkg.julialang.org/registry/23338594-aafe-…

---

## [How to properly use Structs in Julia?](https://discourse.julialang.org/t/how-to-properly-use-structs-in-julia/58465)

<div class="topic-metadata">

**Author:** [@Renan\_Rabelo](https://discourse.julialang.org/u/Renan_Rabelo)\
**Replies:** 2\
**Last updated:** [April 2, 2021, 9:42pm UTC](https://discourse.julialang.org/t/how-to-properly-use-structs-in-julia/58465 "2021-04-02T21:42:26Z")

</div>

Hi, I’m using Julia about 6 months by now and I never understood Structs well. Before Julia I used to code in Processing, and OOP in Julia seems so different that I don’t even know how methods and objects work and how …

---

## [@select all columns in Query.jl](https://discourse.julialang.org/t/select-all-columns-in-query-jl/58448)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 4\
**Last updated:** [April 2, 2021, 9:24pm UTC](https://discourse.julialang.org/t/select-all-columns-in-query-jl/58448 "2021-04-02T21:24:24Z")

</div>

In the following code, how can I @select all columns from a dataframe? Do I have to explicitly list all columns I want to @select? x = @from r in DataFramesIO begin @where !isnan(r.SHARES) @select all @colle…

---

## [Question about floating-point precision in summation](https://discourse.julialang.org/t/question-about-floating-point-precision-in-summation/58334)

<div class="topic-metadata">

**Author:** [@Frisus95](https://discourse.julialang.org/u/Frisus95)\
**Replies:** 22\
**Last updated:** [April 2, 2021, 9:00pm UTC](https://discourse.julialang.org/t/question-about-floating-point-precision-in-summation/58334 "2021-04-02T21:00:13Z")

</div>

Hello everyone, I have a “technical” (probably trivial) question. My code computes a lot of matrices (calling an external library in C) by parallelizing on multiple processes, then finally adds these matrices and we get…

---

## [Lualatex in JuliaHub](https://discourse.julialang.org/t/lualatex-in-juliahub/58306)

<div class="topic-metadata">

**Author:** [@nandre7](https://discourse.julialang.org/u/nandre7)\
**Replies:** 4\
**Last updated:** [April 2, 2021, 7:46pm UTC](https://discourse.julialang.org/t/lualatex-in-juliahub/58306 "2021-04-02T19:46:00Z")

</div>

The use of PGFplotsX.jl requires the installation of Lualatex according to the documentation. It is not really obvious for all to understand how to install it in the Juliahub or even if it is possible. An answer here may…

---

## [Threads.@threads with ONE thread: how to remove the overhead?](https://discourse.julialang.org/t/threads-threads-with-one-thread-how-to-remove-the-overhead/58435)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 10\
**Last updated:** [April 2, 2021, 7:00pm UTC](https://discourse.julialang.org/t/threads-threads-with-one-thread-how-to-remove-the-overhead/58435 "2021-04-02T19:00:17Z")

</div>

If there is only one thread set, the overhead of Threads.@threads is significant. julia\> Threads.nthreads() 1 julia\> function single\_thread(v) s = 0.0 @inbounds for i = 1:length(v) …

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

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