# General Usage

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

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

**Page:** 823

---

## [How to store many variables of type AffineMap?](https://discourse.julialang.org/t/how-to-store-many-variables-of-type-affinemap/30016)

<div class="topic-metadata">

**Author:** [@Moses](https://discourse.julialang.org/u/Moses)\
**Replies:** 2\
**Last updated:** [October 18, 2019, 6:15am UTC](https://discourse.julialang.org/t/how-to-store-many-variables-of-type-affinemap/30016 "2019-10-18T06:15:37Z")

</div>

Dear community. This is following up on an earlier question of me (here). I opened this thread, because my current question no longer fits the original one. My problem is that I need to loop through a stack of a few hu…

---

## [What is the type of called function in this case?](https://discourse.julialang.org/t/what-is-the-type-of-called-function-in-this-case/30038)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 1\
**Last updated:** [October 18, 2019, 12:54am UTC](https://discourse.julialang.org/t/what-is-the-type-of-called-function-in-this-case/30038 "2019-10-18T00:54:29Z")

</div>

struct MM a::Int end function (m::MM)(x::Int) MM(m.a+x) end m = MM(11) m(5) # what is the typeof the function called here? What really happens when I say m(5), is there a function like apply(m,5) somewhere? Tha…

---

## [Retrieve data from Amazon S3?](https://discourse.julialang.org/t/retrieve-data-from-amazon-s3/29959)

<div class="topic-metadata">

**Author:** [@joshhjacobson](https://discourse.julialang.org/u/joshhjacobson)\
**Replies:** 9\
**Last updated:** [October 17, 2019, 8:20pm UTC](https://discourse.julialang.org/t/retrieve-data-from-amazon-s3/29959 "2019-10-17T20:20:20Z")

</div>

I have a .tif file hosted on S3 and it looks like it should be possible to read it into memory using AWSS3.jl. I’ve tried the following: using AWSS3 aws = AWSCore.aws\_config() bucket = "projects" path = "path/to/file.…

---

## [Parallelizing a force assembly function](https://discourse.julialang.org/t/parallelizing-a-force-assembly-function/29752)

<div class="topic-metadata">

**Author:** [@touste](https://discourse.julialang.org/u/touste)\
**Replies:** 11\
**Last updated:** [October 17, 2019, 7:59pm UTC](https://discourse.julialang.org/t/parallelizing-a-force-assembly-function/29752 "2019-10-17T19:59:20Z")

</div>

Hello, I am writing a physical simulation code that I’m trying to optimize. The most critical function, called at every integration step, is the force assembly: for every triangle of the mesh, given the nodal positions,…

---

## [Passing Julia pointers back and forth from Julia PackageCompiled shared object libraries](https://discourse.julialang.org/t/passing-julia-pointers-back-and-forth-from-julia-packagecompiled-shared-object-libraries/29995)

<div class="topic-metadata">

**Author:** [@jay.stanley](https://discourse.julialang.org/u/jay.stanley)\
**Replies:** 1\
**Last updated:** [October 17, 2019, 5:27pm UTC](https://discourse.julialang.org/t/passing-julia-pointers-back-and-forth-from-julia-packagecompiled-shared-object-libraries/29995 "2019-10-17T17:27:40Z")

</div>

Hi all, I am having issues dereferencing Ptr{Cvoid} inside of a shared object library. I suspect it is due to garbage collection. I am working on a Python project that requires a Julia library that does not work with …

---

## [Julia blocked by CylanceUI](https://discourse.julialang.org/t/julia-blocked-by-cylanceui/28332)

<div class="topic-metadata">

**Author:** [@dylanjm](https://discourse.julialang.org/u/dylanjm)\
**Replies:** 23\
**Last updated:** [October 17, 2019, 2:16pm UTC](https://discourse.julialang.org/t/julia-blocked-by-cylanceui/28332 "2019-10-17T14:16:52Z")

</div>

I’m trying to use Julia for a work project and have installed it through brew cask install julia. I can launch the REPL but anytime I try to run any code, Julia gets killed by zsh. I then get a notification from CylanceU…

---

## [Appending/Prepending Inf-values to Int64-array](https://discourse.julialang.org/t/appending-prepending-inf-values-to-int64-array/30024)

<div class="topic-metadata">

**Author:** [@Jonas\_Hjulstad](https://discourse.julialang.org/u/Jonas_Hjulstad)\
**Replies:** 2\
**Last updated:** [October 17, 2019, 1:44pm UTC](https://discourse.julialang.org/t/appending-prepending-inf-values-to-int64-array/30024 "2019-10-17T13:44:30Z")

</div>

I’m trying to initialize an array where a for-loop checks the iterated index value, the previous and the next index. In order to prevent uneccessary if-statements, I will use Inf-guards on both sides of the array. I’m h…

---

## [Julia script running on Linux is slow](https://discourse.julialang.org/t/julia-script-running-on-linux-is-slow/30002)

<div class="topic-metadata">

**Author:** [@alka](https://discourse.julialang.org/u/alka)\
**Replies:** 9\
**Last updated:** [October 17, 2019, 8:51am UTC](https://discourse.julialang.org/t/julia-script-running-on-linux-is-slow/30002 "2019-10-17T08:51:54Z")

</div>

I am trying to run julia code in linux machine. But it takes around 4-5 mins to execute. How can I make it faster?

---

## [Package not being added](https://discourse.julialang.org/t/package-not-being-added/30010)

<div class="topic-metadata">

**Author:** [@Ayush\_Jha](https://discourse.julialang.org/u/Ayush_Jha)\
**Replies:** 1\
**Last updated:** [October 17, 2019, 6:16am UTC](https://discourse.julialang.org/t/package-not-being-added/30010 "2019-10-17T06:16:46Z")

</div>

Hi all, I am new to julia and am struggling with adding the Quandl API package. I’ve tried the standard Pkg.add(“Quandl”), the \] add with the github link, removing the general registries but all of them end up with thi…

---

## [Did SymPy change the syntax?](https://discourse.julialang.org/t/did-sympy-change-the-syntax/30007)

<div class="topic-metadata">

**Author:** [@marouane](https://discourse.julialang.org/u/marouane)\
**Replies:** 1\
**Last updated:** [October 17, 2019, 4:36am UTC](https://discourse.julialang.org/t/did-sympy-change-the-syntax/30007 "2019-10-17T04:36:39Z")

</div>

i have this function where i’m using PyCall and SymPy: using SymPy using PyCall function op\_mat(op) op = op\[:as\_poly\](domain="C") # return the input as a polynom op\_a = op.x\[:gens\] # give us the genera…

---

## [When is the signature of a method is a UnionAll?](https://discourse.julialang.org/t/when-is-the-signature-of-a-method-is-a-unionall/30000)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 2\
**Last updated:** [October 16, 2019, 9:22pm UTC](https://discourse.julialang.org/t/when-is-the-signature-of-a-method-is-a-unionall/30000 "2019-10-16T21:22:23Z")

</div>

let’s assume that I have a function f, and it has few methods. I want to see an example where one of those methods’ signature is UnionAll instead of Tuple? methods(f).ms\[1\].sig Is there such an example? And as my sec…

---

## [Is there a way to get a function's method signatures as data?](https://discourse.julialang.org/t/is-there-a-way-to-get-a-functions-method-signatures-as-data/21402)

<div class="topic-metadata">

**Author:** [@ninjaaron](https://discourse.julialang.org/u/ninjaaron)\
**Replies:** 3\
**Last updated:** [October 16, 2019, 9:10pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-get-a-functions-method-signatures-as-data/21402 "2019-10-16T21:10:41Z")

</div>

I would like to write something that looks at a function’s method signatures and builds a command-line interface based on that. I realize it is easy to get a function’s definition with a macro, but I don’t know if there …

---

## [Interpolation of a vector?](https://discourse.julialang.org/t/interpolation-of-a-vector/29916)

<div class="topic-metadata">

**Author:** [@nmatzke](https://discourse.julialang.org/u/nmatzke)\
**Replies:** 4\
**Last updated:** [October 16, 2019, 8:15pm UTC](https://discourse.julialang.org/t/interpolation-of-a-vector/29916 "2019-10-16T20:15:16Z")

</div>

Hi all, I have an ODE where n states evolve in time. I’d like to calculate this once, and then interpolate it at different time points to speed up other calculations. However, I can’t get DataInterpolations:LinearInter…

---

## [Global variables not visible within loops in scripts](https://discourse.julialang.org/t/global-variables-not-visible-within-loops-in-scripts/15849)

<div class="topic-metadata">

**Author:** [@David\_Ortley](https://discourse.julialang.org/u/David_Ortley)\
**Replies:** 7\
**Last updated:** [October 16, 2019, 7:26pm UTC](https://discourse.julialang.org/t/global-variables-not-visible-within-loops-in-scripts/15849 "2019-10-16T19:26:23Z")

</div>

All: If I have a simple script that sets a variable at the top level, and then tries to modify the variable from within a loop, I get an error stating that the variable is not defined: #!/usr/bin/env julia i = 0 for j…

---

## [Travis CI script does not clone Project.toml of dependent packages](https://discourse.julialang.org/t/travis-ci-script-does-not-clone-project-toml-of-dependent-packages/29709)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 9\
**Last updated:** [October 16, 2019, 5:45pm UTC](https://discourse.julialang.org/t/travis-ci-script-does-not-clone-project-toml-of-dependent-packages/29709 "2019-10-16T17:45:01Z")

</div>

I have two packages developed myself. Say they are MyPkg and MySubPkg. MyPkg uses MySubPkg, and both are pushed to GitHub. Both packages have .travis.yml defined for running unit tests automatically by Travis CI when …

---

## [Julia 1.3-rc4: make test hangs on mac](https://discourse.julialang.org/t/julia-1-3-rc4-make-test-hangs-on-mac/29952)

<div class="topic-metadata">

**Author:** [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Replies:** 2\
**Last updated:** [October 15, 2019, 10:19pm UTC](https://discourse.julialang.org/t/julia-1-3-rc4-make-test-hangs-on-mac/29952 "2019-10-15T22:19:50Z")

</div>

Building julia 1.3-rc4: I’m able to build julia (make and make install works), but make test hangs for ~1 hr; comparing with the official builder’s testing log here, looks like my test hangs before Executing tests that r…

---

## [Distributed Julia on a Nomad cluster](https://discourse.julialang.org/t/distributed-julia-on-a-nomad-cluster/27258)

<div class="topic-metadata">

**Author:** [@jackf](https://discourse.julialang.org/u/jackf)\
**Replies:** 1\
**Last updated:** [October 16, 2019, 2:11pm UTC](https://discourse.julialang.org/t/distributed-julia-on-a-nomad-cluster/27258 "2019-10-16T14:11:23Z")

</div>

Hi, I have access to a large Nomad (HashiCorp) cluster. Does anyone have experience configuring distributed Julia on such a cluster dynamically? Ideally I just want to add workers (which are Nomad jobs to just run e.g. …

---

## [SparseMatrixCSC{Float} \* Vector{SVector}](https://discourse.julialang.org/t/sparsematrixcsc-float-vector-svector/29984)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 0\
**Last updated:** [October 16, 2019, 1:59pm UTC](https://discourse.julialang.org/t/sparsematrixcsc-float-vector-svector/29984 "2019-10-16T13:59:25Z")

</div>

Julia allows me to multiply Matrix{Float} \* Vector{SVector} : using StaticArrays A = rand(10,10) x = rand(SVector{3, Float64}, 10) A \* x but not a SparseMatrixCSC{Float} \* Vector{SVector} : using SparseArrays, Static…

---

## [Bit Constraints for floats and integers](https://discourse.julialang.org/t/bit-constraints-for-floats-and-integers/29977)

<div class="topic-metadata">

**Author:** [@dataDiver](https://discourse.julialang.org/u/dataDiver)\
**Replies:** 4\
**Last updated:** [October 16, 2019, 11:41am UTC](https://discourse.julialang.org/t/bit-constraints-for-floats-and-integers/29977 "2019-10-16T11:41:51Z")

</div>

Sometimes you want to parameterize your function so that you can dispatch in 64, 32, 16, or some other bit numbers rather than just 64 bit numbers, the problem with this is that just using a single parametric type variab…

---

## [Cannot add certain packages (proxy error)](https://discourse.julialang.org/t/cannot-add-certain-packages-proxy-error/29940)

<div class="topic-metadata">

**Author:** [@mikolas](https://discourse.julialang.org/u/mikolas)\
**Replies:** 1\
**Last updated:** [October 16, 2019, 11:20am UTC](https://discourse.julialang.org/t/cannot-add-certain-packages-proxy-error/29940 "2019-10-16T11:20:05Z")

</div>

I keep getting an error when installing some packages on my work computer. I have successfully installed e.g. DataFrames and JSON packages, but have failed to install e.g. IJulia or Distributions. I am running Windows …

---

## [Using Makie.jl multithreaded](https://discourse.julialang.org/t/using-makie-jl-multithreaded/29968)

<div class="topic-metadata">

**Author:** [@fishy](https://discourse.julialang.org/u/fishy)\
**Replies:** 0\
**Last updated:** [October 16, 2019, 2:43am UTC](https://discourse.julialang.org/t/using-makie-jl-multithreaded/29968 "2019-10-16T02:43:01Z")

</div>

I am using Julia for a 6DOF vehicle simulation which is just fast enough to run in real-time. After performing a simulation I am visualising the results using Makie.jl. To demo the simulator I have modified it to accept…

---

## [Benchmark MATLAB & Julia for Matrix Operations](https://discourse.julialang.org/t/benchmark-matlab-julia-for-matrix-operations/2000)

<div class="topic-metadata">

**Author:** [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Replies:** 148\
**Last updated:** [October 15, 2019, 8:00pm UTC](https://discourse.julialang.org/t/benchmark-matlab-julia-for-matrix-operations/2000 "2019-10-15T20:00:15Z")

</div>

Hi, My first try with Julia was to compare its speed on Matrix Operations (Linear Algebra oriented) to MATLAB. Benchmark MATLAB & Julia for Matrix Operations As any test, it is far from being perfect, but it is tellin…

---

## [Puzzling behavior of icxx](https://discourse.julialang.org/t/puzzling-behavior-of-icxx/29950)

<div class="topic-metadata">

**Author:** [@Josiah\_Slack](https://discourse.julialang.org/u/Josiah_Slack)\
**Replies:** 1\
**Last updated:** [October 15, 2019, 7:35pm UTC](https://discourse.julialang.org/t/puzzling-behavior-of-icxx/29950 "2019-10-15T19:35:32Z")

</div>

I’m using Cxx, and my use case involves converting std::vector return values into Julia arrays. I’m able to define my functions in the REPL, and everything behaves as I would expect. However, if I wrap all this in a modu…

---

## [Trying to build Julia, downloaded file checksum failure](https://discourse.julialang.org/t/trying-to-build-julia-downloaded-file-checksum-failure/29795)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 6\
**Last updated:** [October 15, 2019, 3:01pm UTC](https://discourse.julialang.org/t/trying-to-build-julia-downloaded-file-checksum-failure/29795 "2019-10-15T15:01:21Z")

</div>

I’m trying to build julia myself from 1.2.0 so I can play with the parser. (If there’s an easier way to just do that, please let me know :slight\_smile: ) ‘make’ is downloading a file and it fails with a reported checksu…

---

## [Does @spawn with threads give speedup?](https://discourse.julialang.org/t/does-spawn-with-threads-give-speedup/29932)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 2\
**Last updated:** [October 15, 2019, 2:41pm UTC](https://discourse.julialang.org/t/does-spawn-with-threads-give-speedup/29932 "2019-10-15T14:41:46Z")

</div>

So far I haven’t gotten any. Anyone’s been successful?

---

## [Numpy 10x faster than Julia ?! What am I doing wrong ?! \[solved - julia faster now\]](https://discourse.julialang.org/t/numpy-10x-faster-than-julia-what-am-i-doing-wrong-solved-julia-faster-now/29922)

<div class="topic-metadata">

**Author:** [@joak](https://discourse.julialang.org/u/joak)\
**Replies:** 37\
**Last updated:** [October 15, 2019, 11:52am UTC](https://discourse.julialang.org/t/numpy-10x-faster-than-julia-what-am-i-doing-wrong-solved-julia-faster-now/29922 "2019-10-15T11:52:25Z")

</div>

With numpy I get ~100ns per element With julia ~1200ns I must be missing something… How can I reach same speed with julia ? Code below: Python: import time import numpy as np from numpy import sin, cos def f(p): …

---

## [Keyword argument method without overwriting original method](https://discourse.julialang.org/t/keyword-argument-method-without-overwriting-original-method/29927)

<div class="topic-metadata">

**Author:** [@Amin\_Yahyaabadi](https://discourse.julialang.org/u/Amin_Yahyaabadi)\
**Replies:** 3\
**Last updated:** [October 15, 2019, 9:32am UTC](https://discourse.julialang.org/t/keyword-argument-method-without-overwriting-original-method/29927 "2019-10-15T09:32:16Z")

</div>

julia\> fun(x::Integer) = 1 fun (generic function with 1 method) julia\> fun(x::Integer; y::Array) = 1 fun (generic function with 1 method) julia\> fun(x::Integer, y::Array) = 1 fun (generic function with 2 methods) Why …

---

## [Access columns by variable name with \`readdlm\` from \`DelimitedFiles\`](https://discourse.julialang.org/t/access-columns-by-variable-name-with-readdlm-from-delimitedfiles/29918)

<div class="topic-metadata">

**Author:** [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Replies:** 4\
**Last updated:** [October 15, 2019, 3:26am UTC](https://discourse.julialang.org/t/access-columns-by-variable-name-with-readdlm-from-delimitedfiles/29918 "2019-10-15T03:26:11Z")

</div>

Once again, the documentation of Julia is useless and provides no help. I read a .txt file with the command data=readdlm("data.txt", header=true) from the DelimitedFiles package. The result is a Tuple with the data separ…

---

## [I get variable not defined error in a trivial example](https://discourse.julialang.org/t/i-get-variable-not-defined-error-in-a-trivial-example/29917)

<div class="topic-metadata">

**Author:** [@gmouts](https://discourse.julialang.org/u/gmouts)\
**Replies:** 2\
**Last updated:** [October 15, 2019, 2:10am UTC](https://discourse.julialang.org/t/i-get-variable-not-defined-error-in-a-trivial-example/29917 "2019-10-15T02:10:38Z")

</div>

So at REPL I typed the following julia\> using Polynomials julia\> p=Poly(\[5,-3,-2,-2,1,1\]) Poly(5 - 3\*x - 2\*x^2 - 2\*x^3 + x^4 + x^5) julia\> dp=polyder(p) Poly(-3 - 4\*x - 6\*x^2 + 4\*x^3 + 5\*x^4) julia\> function newtonIt…

---

## [Using JuliaDB to create larger than memory datasets and work with them?](https://discourse.julialang.org/t/using-juliadb-to-create-larger-than-memory-datasets-and-work-with-them/18724)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 3\
**Last updated:** [October 15, 2019, 12:55am UTC](https://discourse.julialang.org/t/using-juliadb-to-create-larger-than-memory-datasets-and-work-with-them/18724 "2019-10-15T00:55:45Z")

</div>

JuliaDB docs explain how to perform some basic operations out-of-core, with data larger than memory. http://juliadb.org/latest/manual/out-of-core.html But it seems it can only load large data and produce small results. …

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

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