# General Usage

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

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

**Page:** 604

---

## [Doubled memory usage and computation time after update to 1.6.1 from 1.5.4](https://discourse.julialang.org/t/doubled-memory-usage-and-computation-time-after-update-to-1-6-1-from-1-5-4/60588)

<div class="topic-metadata">

**Author:** [@sebastianpech](https://discourse.julialang.org/u/sebastianpech)\
**Replies:** 0\
**Last updated:** [May 5, 2021, 3:04pm UTC](https://discourse.julialang.org/t/doubled-memory-usage-and-computation-time-after-update-to-1-6-1-from-1-5-4/60588 "2021-05-05T15:04:54Z")

</div>

Hi, today I updated a quite large code base to julia 1.6. I noticed that both computation time and memory usage (measured with TimerOutputs.jl) doubled. I wasn’t able to produce a MWE yet, however, I found that accessin…

---

## [Bug with dot() reported by Julia console](https://discourse.julialang.org/t/bug-with-dot-reported-by-julia-console/60570)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 3\
**Last updated:** [May 5, 2021, 3:04pm UTC](https://discourse.julialang.org/t/bug-with-dot-reported-by-julia-console/60570 "2021-05-05T15:04:43Z")

</div>

I have found that the simple operation of dot product using dot() is leading to a the julia program (v1.5.3) crashing. I think it is a serious bug. The following simple command using LinearAlgebra; N = 20000; t1= rand(C…

---

## [@cfunction help](https://discourse.julialang.org/t/cfunction-help/60263)

<div class="topic-metadata">

**Author:** [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Replies:** 24\
**Last updated:** [May 5, 2021, 2:54pm UTC](https://discourse.julialang.org/t/cfunction-help/60263 "2021-05-05T14:54:58Z")

</div>

Hello, I have a tricky question. Let me know if there’s anything I can do to help explain etc. I’m trying to make a fork of PortAudio that uses callback functions. You can see my progress here: When I run the follow…

---

## [Performance of DataFrames' subset and ByRow](https://discourse.julialang.org/t/performance-of-dataframes-subset-and-byrow/60577)

<div class="topic-metadata">

**Author:** [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Replies:** 10\
**Last updated:** [May 5, 2021, 2:31pm UTC](https://discourse.julialang.org/t/performance-of-dataframes-subset-and-byrow/60577 "2021-05-05T14:31:04Z")

</div>

What’s the difference between ByRow and an anonyomous function like julia\> subset(df, :x =\> (x -\> x .== 0)) 3×1 DataFrame Row │ x │ Float64 ─────┼───────── 1 │ 0.0 2 │ 0.0 3 │ 0.0

---

## [Using Latex features while plotting in Julia (using Jupyter Notebook)](https://discourse.julialang.org/t/using-latex-features-while-plotting-in-julia-using-jupyter-notebook/56668)

<div class="topic-metadata">

**Author:** [@Purvaash](https://discourse.julialang.org/u/Purvaash)\
**Replies:** 1\
**Last updated:** [May 5, 2021, 1:27pm UTC](https://discourse.julialang.org/t/using-latex-features-while-plotting-in-julia-using-jupyter-notebook/56668 "2021-05-05T13:27:07Z")

</div>

My code to plot with Latex features is, rc(“text”, usetex=true) rc(“font”, family=“serif”) Plot errorbar(ω, A, yerr=ΔA, fmt=“.”, label=“Messdaten”) plot(ω, model(ω, γ), label=“Fit”) title(“Schwingungsamplitude vs. M…

---

## [DataFrames vs ndsparse for indexed data](https://discourse.julialang.org/t/dataframes-vs-ndsparse-for-indexed-data/60553)

<div class="topic-metadata">

**Author:** [@jekyllstein](https://discourse.julialang.org/u/jekyllstein)\
**Replies:** 1\
**Last updated:** [May 5, 2021, 9:44am UTC](https://discourse.julialang.org/t/dataframes-vs-ndsparse-for-indexed-data/60553 "2021-05-05T09:44:36Z")

</div>

With the release of DataFrames 1.0 I was curious about the performance benefits of accessing data with it vs something like an indexed table. The example would be having tabular data with a column and wanting to return …

---

## ["Locally global" variable?](https://discourse.julialang.org/t/locally-global-variable/60471)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 22\
**Last updated:** [May 5, 2021, 7:28am UTC](https://discourse.julialang.org/t/locally-global-variable/60471 "2021-05-05T07:28:52Z")

</div>

Is there a way to make a julia variable locally global (for the lack of a better word) ? To give a little context, I am currently trying to implement some inter-process-communication using julia. With what I know (unde…

---

## [Profile until buffer is full](https://discourse.julialang.org/t/profile-until-buffer-is-full/60480)

<div class="topic-metadata">

**Author:** [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Replies:** 1\
**Last updated:** [May 5, 2021, 5:45am UTC](https://discourse.julialang.org/t/profile-until-buffer-is-full/60480 "2021-05-05T05:45:09Z")

</div>

function busy(n) a = 0.0 for i = 1:n a += sin(i) a += cos(a) end a end import Profile Profile.init(; n=5000, delay=0.001) Profile.@profile busy(10^7) Profile.fetch() shows that the buffe…

---

## [Efficient GPU dense-sparse matmul differentiable with Zygote](https://discourse.julialang.org/t/efficient-gpu-dense-sparse-matmul-differentiable-with-zygote/60502)

<div class="topic-metadata">

**Author:** [@jackd](https://discourse.julialang.org/u/jackd)\
**Replies:** 2\
**Last updated:** [May 5, 2021, 5:36am UTC](https://discourse.julialang.org/t/efficient-gpu-dense-sparse-matmul-differentiable-with-zygote/60502 "2021-05-05T05:36:17Z")

</div>

I’m trying to train some deep learning graph models and I’m looking for an efficient way of performing a dense-sparse matrix product on GPU that’s Zygote-differentiable with respect to entries of the dense matrix. I was …

---

## [Raising a flag for specific condition with multithreading](https://discourse.julialang.org/t/raising-a-flag-for-specific-condition-with-multithreading/60535)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 8\
**Last updated:** [May 5, 2021, 12:34am UTC](https://discourse.julialang.org/t/raising-a-flag-for-specific-condition-with-multithreading/60535 "2021-05-05T00:34:05Z")

</div>

Suppose that I have a bunch of threads that process array of some data (apply some function elementwise). Suppose also, that for some entries in array, the processing may fail (for concretness, we can assume that functio…

---

## [Porting challenge for MTK/Symbolics](https://discourse.julialang.org/t/porting-challenge-for-mtk-symbolics/60530)

<div class="topic-metadata">

**Author:** [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Replies:** 8\
**Last updated:** [May 4, 2021, 11:53pm UTC](https://discourse.julialang.org/t/porting-challenge-for-mtk-symbolics/60530 "2021-05-04T23:53:27Z")

</div>

The following SymPy code was given to me by someone who wanted to see if Symbolics/SymbolicUtils/MTK can handle these sorts of situations. using SymPy w\_1, w\_2 = symbols("w\_1, w\_2",real=true,positive=true) pi = symbols(…

---

## [Threading with @views and @tensor](https://discourse.julialang.org/t/threading-with-views-and-tensor/60466)

<div class="topic-metadata">

**Author:** [@Aroeira](https://discourse.julialang.org/u/Aroeira)\
**Replies:** 6\
**Last updated:** [May 4, 2021, 7:27pm UTC](https://discourse.julialang.org/t/threading-with-views-and-tensor/60466 "2021-05-04T19:27:34Z")

</div>

Hello, I am working on a code where array views are used in tensor contractions. I had written a similar one before and I was able to make it fast with the threading tools available in Julia, namely @sync and @spawn. Ho…

---

## [Linconstr @JuMP0.21](https://discourse.julialang.org/t/linconstr-jump0-21/60537)

<div class="topic-metadata">

**Author:** [@marouane](https://discourse.julialang.org/u/marouane)\
**Replies:** 0\
**Last updated:** [May 4, 2021, 5:23pm UTC](https://discourse.julialang.org/t/linconstr-jump0-21/60537 "2021-05-04T17:23:31Z")

</div>

when using JuMP@0.18 we use model.linconstr.lb to get the lower bound but i don’t know how it can happen using JuMP@0.21 i tried JuMP.LowerBoundRef(x) but instead of getting the values of the lower bounds i got nothing …

---

## [Digilent analog discovery interface](https://discourse.julialang.org/t/digilent-analog-discovery-interface/60528)

<div class="topic-metadata">

**Author:** [@TheLateKronos](https://discourse.julialang.org/u/TheLateKronos)\
**Replies:** 2\
**Last updated:** [May 4, 2021, 4:55pm UTC](https://discourse.julialang.org/t/digilent-analog-discovery-interface/60528 "2021-05-04T16:55:55Z")

</div>

Studying engineering, and we have access to a diligent analog discovery 2 board USB Oscilloscope and Logic Analyzer - Digilent Analog Discovery 2 (digilentinc.com) It is very capable, and has free software “Waveforms” i…

---

## [How to tell if \`stdin\` buffer is not empty](https://discourse.julialang.org/t/how-to-tell-if-stdin-buffer-is-not-empty/60514)

<div class="topic-metadata">

**Author:** [@jakewilliami](https://discourse.julialang.org/u/jakewilliami)\
**Replies:** 3\
**Last updated:** [May 4, 2021, 4:42pm UTC](https://discourse.julialang.org/t/how-to-tell-if-stdin-buffer-is-not-empty/60514 "2021-05-04T16:42:44Z")

</div>

I thought that bytesavailable would solve this issue (based on this), but I will demonstrate that it doesn’t work. Say I have the following script: println(bytesavailable(stdin)) Now I check how many bytes there are i…

---

## [Do type annotations help Julia determine which method to call?](https://discourse.julialang.org/t/do-type-annotations-help-julia-determine-which-method-to-call/60476)

<div class="topic-metadata">

**Author:** [@anon60034542](https://discourse.julialang.org/u/anon60034542)\
**Replies:** 4\
**Last updated:** [May 4, 2021, 3:59pm UTC](https://discourse.julialang.org/t/do-type-annotations-help-julia-determine-which-method-to-call/60476 "2021-05-04T15:59:23Z")

</div>

Consider the following methods: function do\_work(first::Number, second::Number) println("Calling function where the parameters are numbers.") end function do\_work(first::Number,second::AbstractFloat) println("C…

---

## [Find the location of the function I'm calling?](https://discourse.julialang.org/t/find-the-location-of-the-function-im-calling/55856)

<div class="topic-metadata">

**Author:** [@Daneel](https://discourse.julialang.org/u/Daneel)\
**Replies:** 3\
**Last updated:** [May 4, 2021, 1:05pm UTC](https://discourse.julialang.org/t/find-the-location-of-the-function-im-calling/55856 "2021-05-04T13:05:23Z")

</div>

How can I figure out where the calling function is located? I want an include to be relative to the function itself.

---

## [Days without updating the package registries](https://discourse.julialang.org/t/days-without-updating-the-package-registries/60510)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 5\
**Last updated:** [May 4, 2021, 12:48pm UTC](https://discourse.julialang.org/t/days-without-updating-the-package-registries/60510 "2021-05-04T12:48:58Z")

</div>

More than three days without updating the package registries. What to do? (@v1.5) pkg\> up No Changes to \`C:\\Users\\Hermesr\\.julia\\environments\\v1.5\\Project.toml\` No Changes to \`C:\\Users\\Hermesr\\.julia\\environments\\v1.5\\…

---

## [Peeling functions calling functions](https://discourse.julialang.org/t/peeling-functions-calling-functions/60452)

<div class="topic-metadata">

**Author:** [@RainerHeintzmann](https://discourse.julialang.org/u/RainerHeintzmann)\
**Replies:** 19\
**Last updated:** [May 4, 2021, 11:39am UTC](https://discourse.julialang.org/t/peeling-functions-calling-functions/60452 "2021-05-04T11:39:08Z")

</div>

I wonder, if there is a way in Julia to “peel away” an outer function calling an inner function julia\> f(x)=sqrt(abs2(x)) The task would be to generate a function g(x)=abs2(x) by only having access to f and knowing tha…

---

## [Read an existing txt file](https://discourse.julialang.org/t/read-an-existing-txt-file/60473)

<div class="topic-metadata">

**Author:** [@rahmani-hossein](https://discourse.julialang.org/u/rahmani-hossein)\
**Replies:** 2\
**Last updated:** [May 4, 2021, 8:03am UTC](https://discourse.julialang.org/t/read-an-existing-txt-file/60473 "2021-05-04T08:03:36Z")

</div>

I faced something strange when I create a file and writing sth(by hand) in it I can read it with readdlm and there isn’t any problem .but when I want to read an existed txt file on my desktop it says to me there isn’t an…

---

## [In what order are \`\_\_init\_\_\` functions called?](https://discourse.julialang.org/t/in-what-order-are-init-functions-called/60492)

<div class="topic-metadata">

**Author:** [@Krastanov](https://discourse.julialang.org/u/Krastanov)\
**Replies:** 1\
**Last updated:** [May 4, 2021, 7:52am UTC](https://discourse.julialang.org/t/in-what-order-are-init-functions-called/60492 "2021-05-04T07:52:05Z")

</div>

If a module C contains using A using B I know that C.\_\_init\_\_ is called last. But is there any promise about the order of A.\_\_init\_\_ and B.\_\_init\_\_?

---

## [Organization of multiple modules in same package](https://discourse.julialang.org/t/organization-of-multiple-modules-in-same-package/17287)

<div class="topic-metadata">

**Author:** [@Orbots](https://discourse.julialang.org/u/Orbots)\
**Replies:** 18\
**Last updated:** [May 4, 2021, 6:01am UTC](https://discourse.julialang.org/t/organization-of-multiple-modules-in-same-package/17287 "2021-05-04T06:01:48Z")

</div>

I’m developing a package which defines a number of types. Some types are helpers and some are specific implementations (parametric or abstract) of other types from this package. I’ve been poking around popular packages…

---

## [Broadcasting over a struct with two arrays](https://discourse.julialang.org/t/broadcasting-over-a-struct-with-two-arrays/26136)

<div class="topic-metadata">

**Author:** [@mateuszbaran](https://discourse.julialang.org/u/mateuszbaran)\
**Replies:** 7\
**Last updated:** [May 4, 2021, 5:50am UTC](https://discourse.julialang.org/t/broadcasting-over-a-struct-with-two-arrays/26136 "2021-05-04T05:50:55Z")

</div>

Hi! I have a type that looks like struct A{X1\<:AbstractArray, X2\<:AbstractArray} x1::X1 x2::X2 end a = A(\[1, 2\], \[1 2; 3 4\]) b = A(\[1, 4\], \[-1 2; -3 4\]) and I’d like to extend broadcasting such that, for examp…

---

## [2-D potential well](https://discourse.julialang.org/t/2-d-potential-well/60495)

<div class="topic-metadata">

**Author:** [@james1](https://discourse.julialang.org/u/james1)\
**Replies:** 0\
**Last updated:** [May 4, 2021, 2:44am UTC](https://discourse.julialang.org/t/2-d-potential-well/60495 "2021-05-04T02:44:23Z")

</div>

Ask for a big guy A programming language that can use Julia’s QuantumOptics package to solve single-particle and multi-particle problems in a 2-D potential well

---

## [Julia HTTP.jl performance vs python requests](https://discourse.julialang.org/t/julia-http-jl-performance-vs-python-requests/60490)

<div class="topic-metadata">

**Author:** [@serhii](https://discourse.julialang.org/u/serhii)\
**Replies:** 1\
**Last updated:** [May 4, 2021, 3:35am UTC](https://discourse.julialang.org/t/julia-http-jl-performance-vs-python-requests/60490 "2021-05-04T03:35:29Z")

</div>

Hello, I am currently trying to port some of my python code to Julia. And after some benchmarking, I’ve noticed that Julia’s HTTP.jl performance is somewhat worse than python’s requests (370ms vs 240ms). This is probab…

---

## [Multithreading @threads inside @spawn](https://discourse.julialang.org/t/multithreading-threads-inside-spawn/60491)

<div class="topic-metadata">

**Author:** [@Paul\_McVay](https://discourse.julialang.org/u/Paul_McVay)\
**Replies:** 2\
**Last updated:** [May 4, 2021, 2:57am UTC](https://discourse.julialang.org/t/multithreading-threads-inside-spawn/60491 "2021-05-04T02:57:46Z")

</div>

Are threads inside a spawn supposed to find empty threads to use? For example, my function uses @threads to perform 3 10 second sleeps in 10 seconds total. If I then try to spawn 3 of these function calls, ideally I woul…

---

## [How to break several nested 'for' loop in one 'if'](https://discourse.julialang.org/t/how-to-break-several-nested-for-loop-in-one-if/32726)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 18\
**Last updated:** [May 3, 2021, 11:57pm UTC](https://discourse.julialang.org/t/how-to-break-several-nested-for-loop-in-one-if/32726 "2021-05-03T23:57:46Z")

</div>

Hi community, Available manual and posts gave me some hints of break for ‘for’ loop. However, intending to break 2nd and 3rd ‘for’ loops and return to the 1st ‘for’ loop, two breaks don’t work here. s0=0.05; N=1e6; v…

---

## [PlotlyJS not working in Pluto](https://discourse.julialang.org/t/plotlyjs-not-working-in-pluto/60389)

<div class="topic-metadata">

**Author:** [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Replies:** 2\
**Last updated:** [May 3, 2021, 9:08pm UTC](https://discourse.julialang.org/t/plotlyjs-not-working-in-pluto/60389 "2021-05-03T21:08:26Z")

</div>

PlotlyJS.jl is a fantastic package for interactive plotting. It looks that using PlotlyJS with Pluto seems like a perfect match, but when I tried to use it I got the message: WebIO not detected. Is there anything I shoul…

---

## [How to "pull from the main branch"](https://discourse.julialang.org/t/how-to-pull-from-the-main-branch/60382)

<div class="topic-metadata">

**Author:** [@T-Shino-0603](https://discourse.julialang.org/u/T-Shino-0603)\
**Replies:** 2\
**Last updated:** [May 3, 2021, 8:23pm UTC](https://discourse.julialang.org/t/how-to-pull-from-the-main-branch/60382 "2021-05-03T20:23:00Z")

</div>

After doing " \]dev \*\*\*", how can I “pull from the main branch”? \*\*\* is the package name. Without doing so, some packages can not be imported.

---

## [Broadcasting iterator?](https://discourse.julialang.org/t/broadcasting-iterator/60349)

<div class="topic-metadata">

**Author:** [@Benny](https://discourse.julialang.org/u/Benny)\
**Replies:** 6\
**Last updated:** [May 3, 2021, 4:17pm UTC](https://discourse.julialang.org/t/broadcasting-iterator/60349 "2021-05-03T16:17:59Z")

</div>

Say I have x = \[1 2\] y = \[10, 20, 30\] f(a,b) = a+b+0.5 I want an iterator that goes through the elements of f.(x,y) (11.5, 21.5, 31.5, …) without allocating the output array. Bonus points for an iterator that can also …

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

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