# General Usage

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

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

**Page:** 742

---

## [Simple way to precompile standard package for batch](https://discourse.julialang.org/t/simple-way-to-precompile-standard-package-for-batch/41192)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 14\
**Last updated:** [June 11, 2020, 7:37pm UTC](https://discourse.julialang.org/t/simple-way-to-precompile-standard-package-for-batch/41192 "2020-06-11T19:37:22Z")

</div>

I have been Julia quite extensively for over a year now but because I’m me and Julia is Julia, I still consider myself a ‘newbie’, because I still struggle to do very basic things. \[I am not complaining about this, jus…

---

## [Julia tool to visualize code dependencies?](https://discourse.julialang.org/t/julia-tool-to-visualize-code-dependencies/41183)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 3\
**Last updated:** [June 11, 2020, 7:26pm UTC](https://discourse.julialang.org/t/julia-tool-to-visualize-code-dependencies/41183 "2020-06-11T19:26:08Z")

</div>

Is there a tool like this in Julia where we can visualise the dependencies of functions within a package?

---

## [How to specify function name specific functions? Is that possible?](https://discourse.julialang.org/t/how-to-specify-function-name-specific-functions-is-that-possible/41218)

<div class="topic-metadata">

**Author:** [@janrpeters](https://discourse.julialang.org/u/janrpeters)\
**Replies:** 2\
**Last updated:** [June 11, 2020, 6:48pm UTC](https://discourse.julialang.org/t/how-to-specify-function-name-specific-functions-is-that-possible/41218 "2020-06-11T18:48:11Z")

</div>

I currently have functions like function AnalyticalExpectation(distribution::Normal, g::Function) if(g==log) return ... else println("Not yet implemented") end end Is there a way to make t…

---

## [A question about data type](https://discourse.julialang.org/t/a-question-about-data-type/41204)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 1\
**Last updated:** [June 11, 2020, 6:41pm UTC](https://discourse.julialang.org/t/a-question-about-data-type/41204 "2020-06-11T18:41:05Z")

</div>

my data is not empty,but it always "missing ",so my initseeds function does not work. thanks! using CSV,Clustering,Gadfly data=CSV.read("D:\\\\数据\\\\数据.csv") load=convert(Array,data\[90001:120000,5\]) solar=convert(Array,…

---

## [Strange output](https://discourse.julialang.org/t/strange-output/41212)

<div class="topic-metadata">

**Author:** [@Wei\_Yang](https://discourse.julialang.org/u/Wei_Yang)\
**Replies:** 2\
**Last updated:** [June 11, 2020, 6:40pm UTC](https://discourse.julialang.org/t/strange-output/41212 "2020-06-11T18:40:20Z")

</div>

using Primes function Triangle(n) return sum(1:n) end num=1 temp=3 while num\<500 A=collect(factor(Triangle(temp))) if prod(i-\>A\[i\]\[2\]+1, 1:length(A) )\<500 temp+=1 else num=5000 ans=Triangle(temp) en…

---

## [Why sortperm(Int32\[\]) return Int64\[\]](https://discourse.julialang.org/t/why-sortperm-int32-return-int64/41216)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 1\
**Last updated:** [June 11, 2020, 6:37pm UTC](https://discourse.julialang.org/t/why-sortperm-int32-return-int64/41216 "2020-06-11T18:37:00Z")

</div>

Do you know, why is it? a=Int32\[1,2,3,4\] sortperm(a)

---

## [Scatter pyplot option: vector of value for colors, one for each point](https://discourse.julialang.org/t/scatter-pyplot-option-vector-of-value-for-colors-one-for-each-point/41211)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 0\
**Last updated:** [June 11, 2020, 5:02pm UTC](https://discourse.julialang.org/t/scatter-pyplot-option-vector-of-value-for-colors-one-for-each-point/41211 "2020-06-11T17:02:28Z")

</div>

How can we feed a vector of values as color input into scatter plot using pyplot? I read one need to specify cmap, but I could find a clear example. My aim to having a vector of values, one per observation, that makes th…

---

## [Is the best number of threads used in parallel computing by using distribute 4?](https://discourse.julialang.org/t/is-the-best-number-of-threads-used-in-parallel-computing-by-using-distribute-4/40139)

<div class="topic-metadata">

**Author:** [@MTone](https://discourse.julialang.org/u/MTone)\
**Replies:** 4\
**Last updated:** [June 11, 2020, 4:56pm UTC](https://discourse.julialang.org/t/is-the-best-number-of-threads-used-in-parallel-computing-by-using-distribute-4/40139 "2020-06-11T16:56:33Z")

</div>

I am doing a numerical calculation using Julia, and recently I just tested the speed of my code using parallel computing by applying @distributed in the summation: (It is just part of my code. The attached part is enc…

---

## [Register or not register (tiny packages)?](https://discourse.julialang.org/t/register-or-not-register-tiny-packages/41120)

<div class="topic-metadata">

**Author:** [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Replies:** 5\
**Last updated:** [June 11, 2020, 3:26pm UTC](https://discourse.julialang.org/t/register-or-not-register-tiny-packages/41120 "2020-06-11T15:26:08Z")

</div>

In a few recent threads there are discussions about the appropriateness of tiny packages with trivial code in the General registry. Those threads started discussing specific cases of packages that only have a couple of s…

---

## [Are there any packages where I can pass in an IP Address string and it returns back the country/city?](https://discourse.julialang.org/t/are-there-any-packages-where-i-can-pass-in-an-ip-address-string-and-it-returns-back-the-country-city/41203)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 1\
**Last updated:** [June 11, 2020, 2:42pm UTC](https://discourse.julialang.org/t/are-there-any-packages-where-i-can-pass-in-an-ip-address-string-and-it-returns-back-the-country-city/41203 "2020-06-11T14:42:28Z")

</div>

Hi how’s it going? I know there’s an IP2Location python library for getting the country and city etc based on an IP Address string. Do you know of anything similar in Julia? Or is PyCall the only option here Thank y…

---

## [Unpack array of tuples and structs](https://discourse.julialang.org/t/unpack-array-of-tuples-and-structs/41188)

<div class="topic-metadata">

**Author:** [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Replies:** 8\
**Last updated:** [June 11, 2020, 2:26pm UTC](https://discourse.julialang.org/t/unpack-array-of-tuples-and-structs/41188 "2020-06-11T14:26:57Z")

</div>

Hello everyone, I have a question which seems to be kind of related to Convert array of tuples to vector. Edit : I just realized I can do these things with StructArrays except for the tuple case. However, I wonder if …

---

## [Julia 1.5, 1.6 twice as fast in sparse matrix solve as 1.4.2](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 13\
**Last updated:** [June 11, 2020, 2:09pm UTC](https://discourse.julialang.org/t/julia-1-5-1-6-twice-as-fast-in-sparse-matrix-solve-as-1-4-2/41099 "2020-06-11T14:09:56Z")

</div>

On Windows 10. Any idea why that would be so?

---

## [Is it possible to force use Int32, instead of Int64](https://discourse.julialang.org/t/is-it-possible-to-force-use-int32-instead-of-int64/41179)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 14\
**Last updated:** [June 11, 2020, 1:34pm UTC](https://discourse.julialang.org/t/is-it-possible-to-force-use-int32-instead-of-int64/41179 "2020-06-11T13:34:56Z")

</div>

Is there any command, that will force to use Int32 instead of Int64?

---

## [Inference time](https://discourse.julialang.org/t/inference-time/41191)

<div class="topic-metadata">

**Author:** [@maarten\_van\_damme](https://discourse.julialang.org/u/maarten_van_damme)\
**Replies:** 1\
**Last updated:** [June 11, 2020, 12:58pm UTC](https://discourse.julialang.org/t/inference-time/41191 "2020-06-11T12:58:48Z")

</div>

Frequently I have run into problems with extremely long inference times, and those kind of issues are really difficult to debug (I have one right now) Is there a flag that will make julia just give up as soon as possibl…

---

## [Undefined symbol](https://discourse.julialang.org/t/undefined-symbol/41165)

<div class="topic-metadata">

**Author:** [@Zhang\_Wei](https://discourse.julialang.org/u/Zhang_Wei)\
**Replies:** 5\
**Last updated:** [June 11, 2020, 11:44am UTC](https://discourse.julialang.org/t/undefined-symbol/41165 "2020-06-11T11:44:37Z")

</div>

Hi, I creat my dynamic libray test.so on Linux, I can use it in my Intel Fortran code. But when I use it in Julia in ccall, I get error: undefined symbol. I have export LD\_LIBRARY=$PWD. Any idea about this error? …

---

## [Is there a template to implement simple solvers in MathOptInterface?](https://discourse.julialang.org/t/is-there-a-template-to-implement-simple-solvers-in-mathoptinterface/41190)

<div class="topic-metadata">

**Author:** [@SteffenPL](https://discourse.julialang.org/u/SteffenPL)\
**Replies:** 0\
**Last updated:** [June 11, 2020, 9:35am UTC](https://discourse.julialang.org/t/is-there-a-template-to-implement-simple-solvers-in-mathoptinterface/41190 "2020-06-11T09:35:04Z")

</div>

I am trying to implement an Uzawa algorithm and would like to use the MathOptInterface. However, I struggle to find a good template to extend for my purpose. The available nonlinear solver IPOPT has a complicated wrappe…

---

## [Pyimport() fuzzywuzzy (python module) error](https://discourse.julialang.org/t/pyimport-fuzzywuzzy-python-module-error/41187)

<div class="topic-metadata">

**Author:** [@john0017](https://discourse.julialang.org/u/john0017)\
**Replies:** 4\
**Last updated:** [June 11, 2020, 9:02am UTC](https://discourse.julialang.org/t/pyimport-fuzzywuzzy-python-module-error/41187 "2020-06-11T09:02:55Z")

</div>

Hi all, I am new to Julia. I have been trying to rewrite my Python code in Julia for performance. For this, I need to import the python module “fuzzywuzzy”. Its a string matching module. I have successfully imported p…

---

## [Variable rate jumps with DifferentialEquations.jl and matrices](https://discourse.julialang.org/t/variable-rate-jumps-with-differentialequations-jl-and-matrices/40996)

<div class="topic-metadata">

**Author:** [@TTolppanen](https://discourse.julialang.org/u/TTolppanen)\
**Replies:** 6\
**Last updated:** [June 11, 2020, 7:10am UTC](https://discourse.julialang.org/t/variable-rate-jumps-with-differentialequations-jl-and-matrices/40996 "2020-06-11T07:10:24Z")

</div>

I’ve been going through some examples on differential equations with variable jumps and I did this example for myself and got it working. function f(du, u, p, t) du .= u end prob = ODEProblem(f, \[1.0 2.0; 3.0 4.0\],…

---

## [GLM package failed to add](https://discourse.julialang.org/t/glm-package-failed-to-add/35089)

<div class="topic-metadata">

**Author:** [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Replies:** 4\
**Last updated:** [June 11, 2020, 6:49am UTC](https://discourse.julialang.org/t/glm-package-failed-to-add/35089 "2020-06-11T06:49:18Z")

</div>

Hello, Wondering if someone could help me with this. For some reason, GLM stopped working (I guess I had recently added the MD5 package which might have caused a conflict, but not really sure.) But now I’m seeing this…

---

## [Is there a way to execute a function on a remote worker which doesn't have the module?](https://discourse.julialang.org/t/is-there-a-way-to-execute-a-function-on-a-remote-worker-which-doesnt-have-the-module/41175)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 2\
**Last updated:** [June 11, 2020, 5:10am UTC](https://discourse.julialang.org/t/is-there-a-way-to-execute-a-function-on-a-remote-worker-which-doesnt-have-the-module/41175 "2020-06-11T05:10:43Z")

</div>

Consider the following code: module Foo using Distributed remote\_work(i) = Distributed.remotecall\_fetch(()-\>1+i, 2) end using Distributed addprocs(1) Foo.remote\_work(1) # errors The last line errors with, ERROR: On …

---

## [DSP.fft: Invalid Instruction crash for a particular array](https://discourse.julialang.org/t/dsp-fft-invalid-instruction-crash-for-a-particular-array/41170)

<div class="topic-metadata">

**Author:** [@casey\_watkins](https://discourse.julialang.org/u/casey_watkins)\
**Replies:** 1\
**Last updated:** [June 11, 2020, 12:40am UTC](https://discourse.julialang.org/t/dsp-fft-invalid-instruction-crash-for-a-particular-array/41170 "2020-06-11T00:40:16Z")

</div>

I have stumbled upon an array that causes the DSP.fft operation to crash. Here is the array in question: fftcrash.csv - Pastebin.com I have not been able to produce a smaller array than this that causes the same proble…

---

## [Is there a package to construct TUI in Julia?](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 14\
**Last updated:** [June 10, 2020, 11:38pm UTC](https://discourse.julialang.org/t/is-there-a-package-to-construct-tui-in-julia/19801 "2020-06-10T23:38:05Z")

</div>

Hi guys! Is there any package to build text user interfaces in Julia? I saw some NCurses wrappers but all old and does not seem to work anymore. The good side of a TUI is that, just like UnicodePlots, it should work 1…

---

## [Julia code formatter / code beautifier](https://discourse.julialang.org/t/julia-code-formatter-code-beautifier/11485)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 21\
**Last updated:** [June 10, 2020, 8:21pm UTC](https://discourse.julialang.org/t/julia-code-formatter-code-beautifier/11485 "2020-06-10T20:21:34Z")

</div>

Hello, Code formatting is an important task to keep code more easily understandable. Go have gofmt Rust have rustfmt Python have black I wonder if there’s an active project for such task in Julia. I’ve found https:…

---

## [Getting an exception IOError: stream is closed or unusable](https://discourse.julialang.org/t/getting-an-exception-ioerror-stream-is-closed-or-unusable/40968)

<div class="topic-metadata">

**Author:** [@Naba7](https://discourse.julialang.org/u/Naba7)\
**Replies:** 1\
**Last updated:** [June 10, 2020, 8:17pm UTC](https://discourse.julialang.org/t/getting-an-exception-ioerror-stream-is-closed-or-unusable/40968 "2020-06-10T20:17:03Z")

</div>

I am getting an exception while running Pluto.jl from terminal. All the version requirements satisfy. I am able to use Pluto on mozilla browser but still it would be nice if I can resolve the error. The error I am gettin…

---

## [Using a DataFrame to calculate another column in a separate DataFrame](https://discourse.julialang.org/t/using-a-dataframe-to-calculate-another-column-in-a-separate-dataframe/40747)

<div class="topic-metadata">

**Author:** [@Derek\_Vetsch](https://discourse.julialang.org/u/Derek_Vetsch)\
**Replies:** 6\
**Last updated:** [June 10, 2020, 6:36pm UTC](https://discourse.julialang.org/t/using-a-dataframe-to-calculate-another-column-in-a-separate-dataframe/40747 "2020-06-10T18:36:00Z")

</div>

I am using a DataFrame invoices that looks like this: to count the number of invoices for a given contract on a given date that have happened. The functions I’m using to do this are: using DataFrames, DataFramesMeta,…

---

## [Why \`mean\` with \`dims\` argument is so slow?](https://discourse.julialang.org/t/why-mean-with-dims-argument-is-so-slow/41105)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 4\
**Last updated:** [June 10, 2020, 12:15pm UTC](https://discourse.julialang.org/t/why-mean-with-dims-argument-is-so-slow/41105 "2020-06-10T12:15:16Z")

</div>

Consider: using BenchmarkTools, Statistics A = randn(4,3,2); @btime mean($A; dims=1); # 90.184 ns (1 allocation: 128 bytes) @btime mean($A); # 9.891 ns (0 allocations: 0 bytes) That’s a 10x factor difference! Is ther…

---

## [Something makes y-axis range too wide](https://discourse.julialang.org/t/something-makes-y-axis-range-too-wide/41092)

<div class="topic-metadata">

**Author:** [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)\
**Replies:** 3\
**Last updated:** [June 10, 2020, 9:56am UTC](https://discourse.julialang.org/t/something-makes-y-axis-range-too-wide/41092 "2020-06-10T09:56:04Z")

</div>

Something is odd.clearance max (0.9) and clearance min (0.522) are supposed to be constant throughout my simulation, so they should be straight lines, which they are. The strange thing is when plotting them, the y axis a…

---

## [Extracting Julia zip file doesn't create ~/juliax.x.x/lib/julia/sys.so automatically](https://discourse.julialang.org/t/extracting-julia-zip-file-doesnt-create-juliax-x-x-lib-julia-sys-so-automatically/41086)

<div class="topic-metadata">

**Author:** [@Hasan\_Em](https://discourse.julialang.org/u/Hasan_Em)\
**Replies:** 3\
**Last updated:** [June 10, 2020, 8:08am UTC](https://discourse.julialang.org/t/extracting-julia-zip-file-doesnt-create-juliax-x-x-lib-julia-sys-so-automatically/41086 "2020-06-10T08:08:53Z")

</div>

Hello, I’m trying to install Julia locally in a 64-bit online IDE (MimirIDE) but after downloading and extracting Julia folder: sudo wget https://julialang-s3.julialang.org/bin/linux/x64/1.4/julia-1.4.2-linux-x86\_64.ta…

---

## [Color Pallete functions?](https://discourse.julialang.org/t/color-pallete-functions/40959)

<div class="topic-metadata">

**Author:** [@HaoLi111](https://discourse.julialang.org/u/HaoLi111)\
**Replies:** 5\
**Last updated:** [June 10, 2020, 7:28am UTC](https://discourse.julialang.org/t/color-pallete-functions/40959 "2020-06-10T07:28:15Z")

</div>

We can select color palletes in Plots.jl, but is there any function that can take an normalized vector ranging from 0-1 and give an output of an array of color vectors of RGB\[R,G,B\] For example, 0 gets mapped onto RGB\[0…

---

## [Use @\_\_LINE\_\_ etc in another macro definition](https://discourse.julialang.org/t/use-line-etc-in-another-macro-definition/41077)

<div class="topic-metadata">

**Author:** [@barfo](https://discourse.julialang.org/u/barfo)\
**Replies:** 2\
**Last updated:** [June 10, 2020, 3:51am UTC](https://discourse.julialang.org/t/use-line-etc-in-another-macro-definition/41077 "2020-06-10T03:51:46Z")

</div>

This has been up on First Steps for five days without eliciting a comment, hoping a wider audience can provide me some assistance… How do I do this… verbosity\_tags = \[....\] macro noise(tag, args...) return :(if $ta…

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

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