# General Usage

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

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

**Page:** 839

---

## [Downsides to depending \`mutable\` field on \`DataType\`?](https://discourse.julialang.org/t/downsides-to-depending-mutable-field-on-datatype/27796)

<div class="topic-metadata">

**Author:** [@cshenton](https://discourse.julialang.org/u/cshenton)\
**Replies:** 4\
**Last updated:** [August 23, 2019, 3:46am UTC](https://discourse.julialang.org/t/downsides-to-depending-mutable-field-on-datatype/27796 "2019-08-23T03:46:50Z")

</div>

I need to check if a user defined type passed as an argument to a generated function is mutable or immutable (I’m doing a recursive vector of structs → struct of vectors transform, and I only want to split fields that ar…

---

## [Command line options for Julia kernels in Jupyter](https://discourse.julialang.org/t/command-line-options-for-julia-kernels-in-jupyter/732)

<div class="topic-metadata">

**Author:** [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Replies:** 3\
**Last updated:** [August 23, 2019, 2:59am UTC](https://discourse.julialang.org/t/command-line-options-for-julia-kernels-in-jupyter/732 "2019-08-23T02:59:16Z")

</div>

I haven’t been able to figure out how to specify command line options (specifically, -O3 and --check-bounds=no) for the Julia kernel that Jupyter uses. This would be handy for profiling. Any ideas? Thanks!

---

## [Debugging float SIMD Intrinsics via llvmcall](https://discourse.julialang.org/t/debugging-float-simd-intrinsics-via-llvmcall/27855)

<div class="topic-metadata">

**Author:** [@smallnamespace](https://discourse.julialang.org/u/smallnamespace)\
**Replies:** 4\
**Last updated:** [August 22, 2019, 4:56pm UTC](https://discourse.julialang.org/t/debugging-float-simd-intrinsics-via-llvmcall/27855 "2019-08-22T16:56:36Z")

</div>

I’m trying to set up a SIMD intrinsic for rsqrt: function rsqrt(f::Vec{4, Float32}) llvmcall(("declare \<4 x float\> @llvm.x86.sse.rsqrt.ps(\<4 x float\>) nounwind readnone", " %2 = call \<4 x float\> @llvm…

---

## [Logging messages don't display full array](https://discourse.julialang.org/t/logging-messages-dont-display-full-array/27868)

<div class="topic-metadata">

**Author:** [@fredcallaway](https://discourse.julialang.org/u/fredcallaway)\
**Replies:** 2\
**Last updated:** [August 22, 2019, 11:43pm UTC](https://discourse.julialang.org/t/logging-messages-dont-display-full-array/27868 "2019-08-22T23:43:16Z")

</div>

I have a log message which displays many variables, and I find that some values (e.g. length 3 arrays) don’t show up at all, e.g. ┌ Info: Loss │ total = 0.29817146330446415 │ losses = 3-element Array{Float64,1}: … t…

---

## [TableView works great for browsing data as a spreadsheet!](https://discourse.julialang.org/t/tableview-works-great-for-browsing-data-as-a-spreadsheet/27858)

<div class="topic-metadata">

**Author:** [@aaowens](https://discourse.julialang.org/u/aaowens)\
**Replies:** 6\
**Last updated:** [August 22, 2019, 11:33pm UTC](https://discourse.julialang.org/t/tableview-works-great-for-browsing-data-as-a-spreadsheet/27858 "2019-08-22T23:33:26Z")

</div>

Just wanted to share some appreciation for https://github.com/JuliaComputing/TableView.jl as I’ve observed that many people are not aware of its existence. You can browse a spreadsheet of data easily, and it works with J…

---

## [Edit a cell in TableView](https://discourse.julialang.org/t/edit-a-cell-in-tableview/25363)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 8\
**Last updated:** [June 17, 2019, 9:40pm UTC](https://discourse.julialang.org/t/edit-a-cell-in-tableview/25363 "2019-06-17T21:40:26Z")

</div>

Say I have a table that I want to show from the REPL: using Blink, TableView n = 10 t = (id = 1:n, good = rand(Bool, n)) w = Blink.Window() body!(w, showtable(t)) How exactly can I flip the true/false content in the ce…

---

## [How to make arrays of array?](https://discourse.julialang.org/t/how-to-make-arrays-of-array/27863)

<div class="topic-metadata">

**Author:** [@maxiumburn](https://discourse.julialang.org/u/maxiumburn)\
**Replies:** 2\
**Last updated:** [August 22, 2019, 8:43pm UTC](https://discourse.julialang.org/t/how-to-make-arrays-of-array/27863 "2019-08-22T20:43:25Z")

</div>

I would like to store an Array (Tic Tac Toe Game (initialized) position 3 X 3 array of string(A = fill(“”,3,3)) in a list array. The game A gets filled with moves of X and O, so my list of game positions would have a l…

---

## [What is T in : function pca(data::Array{T,2}) where T?](https://discourse.julialang.org/t/what-is-t-in-function-pca-data-array-t-2-where-t/27811)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 8\
**Last updated:** [August 22, 2019, 8:42pm UTC](https://discourse.julialang.org/t/what-is-t-in-function-pca-data-array-t-2-where-t/27811 "2019-08-22T20:42:09Z")

</div>

Is function: function pca(data::Array{T,2}) where T X = data .- mean(data, dims=2) Y = X' ./ sqrt(T(size(X,2)-1)) U,S,PC = svd(Y) S = diagm(0=\>S) V = S .\* S # find the least variance vector …

---

## [Multivariate Rootfinding: problem with NLsolve (dual numbers not applicable for a function I am using)](https://discourse.julialang.org/t/multivariate-rootfinding-problem-with-nlsolve-dual-numbers-not-applicable-for-a-function-i-am-using/27844)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 2\
**Last updated:** [August 22, 2019, 8:25pm UTC](https://discourse.julialang.org/t/multivariate-rootfinding-problem-with-nlsolve-dual-numbers-not-applicable-for-a-function-i-am-using/27844 "2019-08-22T20:25:09Z")

</div>

Hi there, I have a multivariate rootfinding problem, where one of the functions utilizes QuantEcon.jl’s qnwnorm which generates the nodes for the Gauss-Hermite quadrature. However, using NLsolve on one of the parameters…

---

## [PyError, RuntimeError('Error in qhull Delaunay triangulation calculation: singular input](https://discourse.julialang.org/t/pyerror-runtimeerror-error-in-qhull-delaunay-triangulation-calculation-singular-input/19088)

<div class="topic-metadata">

**Author:** [@yasirhassan](https://discourse.julialang.org/u/yasirhassan)\
**Replies:** 1\
**Last updated:** [August 22, 2019, 6:16pm UTC](https://discourse.julialang.org/t/pyerror-runtimeerror-error-in-qhull-delaunay-triangulation-calculation-singular-input/19088 "2019-08-22T18:16:29Z")

</div>

trying to run code: using Plots pyplot() x=y= range( 10, stop = 81, length = 12) r= sqrt.(x.^2 + y.^2) z = sin.(r) ./r ; Plots.plot(x,y,z, st= :surface, camera = (-30,30)) throws following error: Error showing va…

---

## [Speeding up DifferentialEquations solver by using different time steps for an ODE](https://discourse.julialang.org/t/speeding-up-differentialequations-solver-by-using-different-time-steps-for-an-ode/27724)

<div class="topic-metadata">

**Author:** [@rgalarcia](https://discourse.julialang.org/u/rgalarcia)\
**Replies:** 3\
**Last updated:** [August 22, 2019, 2:58pm UTC](https://discourse.julialang.org/t/speeding-up-differentialequations-solver-by-using-different-time-steps-for-an-ode/27724 "2019-08-22T14:58:23Z")

</div>

Dear developers, We are facing a project with the necessity of solving an ODE in Python. In order to do so we opted for a wrapper of Julia as it was the best option we found when a research on which ODE solver was a bet…

---

## [Best practice: modules and scripts for publishing](https://discourse.julialang.org/t/best-practice-modules-and-scripts-for-publishing/25375)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 6\
**Last updated:** [August 22, 2019, 11:54am UTC](https://discourse.julialang.org/t/best-practice-modules-and-scripts-for-publishing/25375 "2019-08-22T11:54:36Z")

</div>

I’m getting ready to publish an article using Julia-based code. I’m curious if anyone has thoughts about how such code should be arranged. Right now, I have a bunch of modules to separate functions, and a top-level scri…

---

## [Running out of memory saving files with HDF5](https://discourse.julialang.org/t/running-out-of-memory-saving-files-with-hdf5/27802)

<div class="topic-metadata">

**Author:** [@PhillipBC](https://discourse.julialang.org/u/PhillipBC)\
**Replies:** 7\
**Last updated:** [August 22, 2019, 8:56am UTC](https://discourse.julialang.org/t/running-out-of-memory-saving-files-with-hdf5/27802 "2019-08-22T08:56:40Z")

</div>

Hey, I am trying to run something quite large in Julia, and I need to store a large number of Arrays (for constructing sparse matrices). Below is a simplified version of what I need to do, where it creates a random array…

---

## [Does pmap() return in order?](https://discourse.julialang.org/t/does-pmap-return-in-order/27829)

<div class="topic-metadata">

**Author:** [@jchen975](https://discourse.julialang.org/u/jchen975)\
**Replies:** 1\
**Last updated:** [August 22, 2019, 2:51am UTC](https://discourse.julialang.org/t/does-pmap-return-in-order/27829 "2019-08-22T02:51:33Z")

</div>

Let’s say I have a function f where I do something with the ith column of a matrix available to all workers (~40). I then return an array of Any and length 4: @everywhere function f(i:Int) //do something with the i-…

---

## [Constant propagation of kwargs possible?](https://discourse.julialang.org/t/constant-propagation-of-kwargs-possible/27810)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 3\
**Last updated:** [August 22, 2019, 2:41am UTC](https://discourse.julialang.org/t/constant-propagation-of-kwargs-possible/27810 "2019-08-22T02:41:46Z")

</div>

I suspect the answer is ‘no’, but is current Julia able to constant-propagate kwargs? In other words, is it possible to make the following infer in some way while preserving the kwarg? Julia 1.2 julia\> h(; n) = ntuple(…

---

## [Determine whether any one-argument method exists](https://discourse.julialang.org/t/determine-whether-any-one-argument-method-exists/19917)

<div class="topic-metadata">

**Author:** [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Replies:** 7\
**Last updated:** [August 21, 2019, 11:29pm UTC](https://discourse.julialang.org/t/determine-whether-any-one-argument-method-exists/19917 "2019-08-21T23:29:55Z")

</div>

I would like to check whether a function f has any one-argument methods. Since Union{} \<: \[any type\], I would argue that the following should work: hasmethod(f, Tuple{Union{}}) It seems to only work if f has a one-argu…

---

## [How to get the principal components and variances from MultivariateStats?](https://discourse.julialang.org/t/how-to-get-the-principal-components-and-variances-from-multivariatestats/15843)

<div class="topic-metadata">

**Author:** [@jwu](https://discourse.julialang.org/u/jwu)\
**Replies:** 4\
**Last updated:** [August 21, 2019, 6:08pm UTC](https://discourse.julialang.org/t/how-to-get-the-principal-components-and-variances-from-multivariatestats/15843 "2019-08-21T18:08:40Z")

</div>

Hi all, I have run PCA and got the model, but I have not find any function to get the principal components and variances. https://multivariatestatsjl.readthedocs.io/en/latest/pca.html any hints would be appreciated. …

---

## [Extra allocation in @thread loop in v1.2](https://discourse.julialang.org/t/extra-allocation-in-thread-loop-in-v1-2/27775)

<div class="topic-metadata">

**Author:** [@shipengcheng1230](https://discourse.julialang.org/u/shipengcheng1230)\
**Replies:** 2\
**Last updated:** [August 21, 2019, 5:39pm UTC](https://discourse.julialang.org/t/extra-allocation-in-thread-loop-in-v1-2/27775 "2019-08-21T17:39:19Z")

</div>

Consider the following MWE of threaded element-wise computation: using Base.Threads using LinearAlgebra using BenchmarkTools const N = 100000 a = rand(N) b = rand(N) function foo(a, b) @threads for i ∈ eachindex(a…

---

## [Unregistered depency not being downloaded despite being listed in Manifest.toml](https://discourse.julialang.org/t/unregistered-depency-not-being-downloaded-despite-being-listed-in-manifest-toml/27232)

<div class="topic-metadata">

**Author:** [@cgeoga](https://discourse.julialang.org/u/cgeoga)\
**Replies:** 6\
**Last updated:** [August 21, 2019, 3:29pm UTC](https://discourse.julialang.org/t/unregistered-depency-not-being-downloaded-despite-being-listed-in-manifest-toml/27232 "2019-08-21T15:29:26Z")

</div>

Hello, I develop a package that depends on another unregistered package. I built the Manifest.toml file to include my unregistered package (link here, the unlisted dependcy is BlockDiagonal.jl), which even shows the URL…

---

## [Why do Tasks scheduled not print in the order they are called or not update the global variables in successive prints when called?](https://discourse.julialang.org/t/why-do-tasks-scheduled-not-print-in-the-order-they-are-called-or-not-update-the-global-variables-in-successive-prints-when-called/27799)

<div class="topic-metadata">

**Author:** [@mantzaris](https://discourse.julialang.org/u/mantzaris)\
**Replies:** 3\
**Last updated:** [August 21, 2019, 2:15pm UTC](https://discourse.julialang.org/t/why-do-tasks-scheduled-not-print-in-the-order-they-are-called-or-not-update-the-global-variables-in-successive-prints-when-called/27799 "2019-08-21T14:15:22Z")

</div>

I am confused as to why one versions of my MWE is not able to alter a global variable value within subsequent calls to a function which is scheduled as a Task but the other version is, when the original Task calls for s…

---

## [Plot limit at next tick label](https://discourse.julialang.org/t/plot-limit-at-next-tick-label/27704)

<div class="topic-metadata">

**Author:** [@aahaselgrove](https://discourse.julialang.org/u/aahaselgrove)\
**Replies:** 4\
**Last updated:** [August 21, 2019, 10:19am UTC](https://discourse.julialang.org/t/plot-limit-at-next-tick-label/27704 "2019-08-21T10:19:52Z")

</div>

I would like my plot axes to end at a tick label. How best may this be accomplished? Nice-looking plot: using Plots using Random Random.seed!(0) time = 0:20 spend = 0.8 \* rand(21) bar(time, spend, title="Spend over…

---

## [Encode a plot to base64?](https://discourse.julialang.org/t/encode-a-plot-to-base64/27765)

<div class="topic-metadata">

**Author:** [@Losses](https://discourse.julialang.org/u/Losses)\
**Replies:** 5\
**Last updated:** [August 21, 2019, 10:13am UTC](https://discourse.julialang.org/t/encode-a-plot-to-base64/27765 "2019-08-21T10:13:20Z")

</div>

Hello everyone, I’m trying to encode a plot to base64 string, but facing some trouble. That’s what I’m trying to do: using Plotly a = plot(x,y,title="Two Lines",label=\["Line 1" "Line 2"\],lw=3); io = IOBuffer(); iob64\_…

---

## [Is there a function \`hasspecialization\`?](https://discourse.julialang.org/t/is-there-a-function-hasspecialization/27790)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 2\
**Last updated:** [August 21, 2019, 8:49am UTC](https://discourse.julialang.org/t/is-there-a-function-hasspecialization/27790 "2019-08-21T08:49:43Z")

</div>

Is there a strict version of hasmethod which only gives true if there is a specialized method with precisely the types I provide in the Tuple? julia\> f(x::Any) = "any" f (generic function with 1 method) julia\> f(x::Int…

---

## [Updated to Julia1.2 Pkg status empty and problems adding Plots](https://discourse.julialang.org/t/updated-to-julia1-2-pkg-status-empty-and-problems-adding-plots/27782)

<div class="topic-metadata">

**Author:** [@thunder-road](https://discourse.julialang.org/u/thunder-road)\
**Replies:** 7\
**Last updated:** [August 21, 2019, 7:59am UTC](https://discourse.julialang.org/t/updated-to-julia1-2-pkg-status-empty-and-problems-adding-plots/27782 "2019-08-21T07:59:39Z")

</div>

Hi This is my first foray back into using Julia since about a year and had fun playing with DifferentialEquationsExamples in JupyterLab last night using Julia 1.1.1 Just now I updated to Julia1.2 using brew cask upgrad…

---

## [World age problem](https://discourse.julialang.org/t/world-age-problem/27759)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 20\
**Last updated:** [August 21, 2019, 7:55am UTC](https://discourse.julialang.org/t/world-age-problem/27759 "2019-08-21T07:55:30Z")

</div>

In the REPL, the following code works: julia\> func = Meta.parse("x-\>x^2 + 2x - 1") :(x-\>begin #= none:1 =# (x ^ 2 + 2x) - 1 end) julia\> map(eval(func), \[1,3,-1\]) 3-element Array{Int64,1}: 2 …

---

## [Inserting into sqlite DB en masse?](https://discourse.julialang.org/t/inserting-into-sqlite-db-en-masse/27777)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 3\
**Last updated:** [August 21, 2019, 4:08am UTC](https://discourse.julialang.org/t/inserting-into-sqlite-db-en-masse/27777 "2019-08-21T04:08:23Z")

</div>

I’m currently entering rows one-at-a time using Stmt,bind!,execute! and the process is quite slow, even though there are only 3 columns in the table, and I have a lot of rows to insert. I’ve been looking through the doc…

---

## [Understanding \`@everywhere\` and environments](https://discourse.julialang.org/t/understanding-everywhere-and-environments/27438)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 5\
**Last updated:** [August 20, 2019, 9:45pm UTC](https://discourse.julialang.org/t/understanding-everywhere-and-environments/27438 "2019-08-20T21:45:48Z")

</div>

I am working on a project that I’ve put into a module. The working directory of this module is in my Base.load\_path() and running using thvaccine works as expected. I can be in the v1.0 environment and still using thvacc…

---

## [@threadcall and dlsym in Julia 1.3](https://discourse.julialang.org/t/threadcall-and-dlsym-in-julia-1-3/27778)

<div class="topic-metadata">

**Author:** [@rkat](https://discourse.julialang.org/u/rkat)\
**Replies:** 1\
**Last updated:** [August 21, 2019, 12:34am UTC](https://discourse.julialang.org/t/threadcall-and-dlsym-in-julia-1-3/27778 "2019-08-21T00:34:13Z")

</div>

I have a dynamic library with a function in it that I’d like to call using @threadcall in Julia 1.3. This doesn’t seem to be possible. Here is a minimal example to reproduce the problem. /\* foo.c \*/ #include \<stdio.h\> v…

---

## [Type-stable threaded map?](https://discourse.julialang.org/t/type-stable-threaded-map/24498)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 9\
**Last updated:** [August 20, 2019, 7:44pm UTC](https://discourse.julialang.org/t/type-stable-threaded-map/24498 "2019-08-20T19:44:58Z")

</div>

Can anyone think of a way to write a threaded map function that is type stable? The only way I have come up with so far uses return\_type which I understand is not a good idea. function tmap(f, args...) cargs = colle…

---

## [Julia integral calculation - community module or own module?](https://discourse.julialang.org/t/julia-integral-calculation-community-module-or-own-module/24278)

<div class="topic-metadata">

**Author:** [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Replies:** 17\
**Last updated:** [August 20, 2019, 2:41pm UTC](https://discourse.julialang.org/t/julia-integral-calculation-community-module-or-own-module/24278 "2019-08-20T14:41:31Z")

</div>

I need to calculate some integrals in my program. Before using Julia i did it in C by using Complex Newton-Cotes formulas(Boole rule, Simpson rule and others): Here is the simplified example(only with Boole Rule): #inc…

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

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