# General Usage

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

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

**Page:** 1003

---

## [Difficulty installing Ipopt](https://discourse.julialang.org/t/difficulty-installing-ipopt/8303)

<div class="topic-metadata">

**Author:** [@Curious1](https://discourse.julialang.org/u/Curious1)\
**Replies:** 0\
**Last updated:** [January 12, 2018, 5:31am UTC](https://discourse.julialang.org/t/difficulty-installing-ipopt/8303 "2018-01-12T05:31:02Z")

</div>

I want to install Ipopt package but when I run Pkg.build("Ipopt") , it throws the following error. /opt/JuliaPro/JuliaPro-0.5.2.2/JuliaPro/pkgs-0.5.2.2/v0.5/Ipopt/deps/src/Ipopt-3.12.1/Ipopt/src/Interfaces/.libs/libipop…

---

## [What can and can I not put into an expression](https://discourse.julialang.org/t/what-can-and-can-i-not-put-into-an-expression/8438)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 6\
**Last updated:** [January 18, 2018, 10:16am UTC](https://discourse.julialang.org/t/what-can-and-can-i-not-put-into-an-expression/8438 "2018-01-18T10:16:59Z")

</div>

TL DR: Why does this work: ex = :(X --\> Y) but not this: ex = :(X \<--\> Y) Longer description: I work with biochemical reaction systems and I want to create a macro into which I can type the reactions and which the …

---

## [Performance enhancement for setindex! for sparse array](https://discourse.julialang.org/t/performance-enhancement-for-setindex-for-sparse-array/8451)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 1\
**Last updated:** [January 18, 2018, 5:39am UTC](https://discourse.julialang.org/t/performance-enhancement-for-setindex-for-sparse-array/8451 "2018-01-18T05:39:04Z")

</div>

I have a function that spends most of its time in setindex! for sparse array. Part of the profiling results is 5339 ...rse/sparsematrix.jl:2316; setindex!(::SparseMatrixCSC{C... 5338 ./array.jl:852; insert! …

---

## [Dagger error, parallel computing](https://discourse.julialang.org/t/dagger-error-parallel-computing/8440)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 2\
**Last updated:** [January 18, 2018, 5:01am UTC](https://discourse.julialang.org/t/dagger-error-parallel-computing/8440 "2018-01-18T05:01:25Z")

</div>

When I am using Dagger to run functions parallelly. I got errors. The code is as follows. Can anyone show how to run functions parallelly using Dagger? Thanks! addprocs() using Dagger function f1(x) sleep(2) r…

---

## [Eachindex / Tuple conversion](https://discourse.julialang.org/t/eachindex-tuple-conversion/8443)

<div class="topic-metadata">

**Author:** [@tpoisot](https://discourse.julialang.org/u/tpoisot)\
**Replies:** 4\
**Last updated:** [January 17, 2018, 10:23pm UTC](https://discourse.julialang.org/t/eachindex-tuple-conversion/8443 "2018-01-17T22:23:07Z")

</div>

This may already be implemented, but I’ve failed to find it in the documentation. If I have a two dimensional array, for which I know the index, is there a way to get the same information but in a tuple of position? So…

---

## [Speeding up FVM code](https://discourse.julialang.org/t/speeding-up-fvm-code/8430)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 7\
**Last updated:** [January 17, 2018, 5:10pm UTC](https://discourse.julialang.org/t/speeding-up-fvm-code/8430 "2018-01-17T17:10:04Z")

</div>

Dear All, I have been trying to speed up the following piece of code for a FVM method. I used Threads in the first for-loop but it is slower. Ideally, I would like it to be parallel. So I am about to re-write it using s…

---

## [Naming of singleton types and their instance](https://discourse.julialang.org/t/naming-of-singleton-types-and-their-instance/8399)

<div class="topic-metadata">

**Author:** [@helgee](https://discourse.julialang.org/u/helgee)\
**Replies:** 10\
**Last updated:** [January 17, 2018, 3:50pm UTC](https://discourse.julialang.org/t/naming-of-singleton-types-and-their-instance/8399 "2018-01-17T15:50:18Z")

</div>

Based on the discussion in the above thread I am refactoring my code to dispatch on instances instead of types (which also helps me to avoid some illegal stuff I was doing, e.g. overloading Base.show for types). But no…

---

## [Println and nohup](https://discourse.julialang.org/t/println-and-nohup/8428)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 1\
**Last updated:** [January 17, 2018, 3:52am UTC](https://discourse.julialang.org/t/println-and-nohup/8428 "2018-01-17T03:52:08Z")

</div>

I have a long julia job running, so I started it up with nohup on my server. But I find that the diagnostic information, which would be printed to the screen, isn’t showing up in the nohup.out. I’m wondering if it’s ju…

---

## [Julia GUI programming. What bindings are there ?](https://discourse.julialang.org/t/julia-gui-programming-what-bindings-are-there/8404)

<div class="topic-metadata">

**Author:** [@anon48172955](https://discourse.julialang.org/u/anon48172955)\
**Replies:** 6\
**Last updated:** [January 17, 2018, 7:02am UTC](https://discourse.julialang.org/t/julia-gui-programming-what-bindings-are-there/8404 "2018-01-17T07:02:27Z")

</div>

Hi there, i am running Julia on Linux and want to build a GUI with TK. For this i have downloaded the bindings from github. file TK.jl-master Where to copy this folder in ? Julia cannot find TK until i…

---

## [Tk GUI works not like expected ? Widget appears only for 1 second!](https://discourse.julialang.org/t/tk-gui-works-not-like-expected-widget-appears-only-for-1-second/8420)

<div class="topic-metadata">

**Author:** [@anon48172955](https://discourse.julialang.org/u/anon48172955)\
**Replies:** 1\
**Last updated:** [January 17, 2018, 6:31am UTC](https://discourse.julialang.org/t/tk-gui-works-not-like-expected-widget-appears-only-for-1-second/8420 "2018-01-17T06:31:04Z")

</div>

using Tk Messagebox(title=“title” , message=“message”) The code works. Message - Warning could not import Base.Text into Tk ########################################### Example 2 code for Tk: using Base.Graphics us…

---

## [Compiling .exe in Julia and distribute the App to a user !  How ?](https://discourse.julialang.org/t/compiling-exe-in-julia-and-distribute-the-app-to-a-user-how/8417)

<div class="topic-metadata">

**Author:** [@anon48172955](https://discourse.julialang.org/u/anon48172955)\
**Replies:** 2\
**Last updated:** [January 16, 2018, 9:46pm UTC](https://discourse.julialang.org/t/compiling-exe-in-julia-and-distribute-the-app-to-a-user-how/8417 "2018-01-16T21:46:21Z")

</div>

Hello again, first question every new programmer asks is if it is possible in the computer language to compile the program to a standalone .exe in Windows , or a executable file in Linux. (also a bundle option) I hav…

---

## [Reference or copy: segment of an array as function argument](https://discourse.julialang.org/t/reference-or-copy-segment-of-an-array-as-function-argument/8331)

<div class="topic-metadata">

**Author:** [@SepandMeenu](https://discourse.julialang.org/u/SepandMeenu)\
**Replies:** 9\
**Last updated:** [January 16, 2018, 9:32pm UTC](https://discourse.julialang.org/t/reference-or-copy-segment-of-an-array-as-function-argument/8331 "2018-01-16T21:32:32Z")

</div>

Sometimes, a segment of an array needs to be used as an argument to a function; e.g., consider searching for x in a part of an (sorted) array A: searchsortedfirst(A\[5:end\], x) Does this way produce a new copy of the co…

---

## [Speed of push! and filter](https://discourse.julialang.org/t/speed-of-push-and-filter/8418)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 0\
**Last updated:** [January 16, 2018, 8:14pm UTC](https://discourse.julialang.org/t/speed-of-push-and-filter/8418 "2018-01-16T20:14:40Z")

</div>

It is known that push! is not very fast. There are various ways of avoiding push!, all of which make code uglier. Unfortunately, I get a 30% slowdown in my real code when using push! (graph search; the push! is into long…

---

## [Fastest way to count unique elements in \`Vector{Union{Bool, Missing})\`](https://discourse.julialang.org/t/fastest-way-to-count-unique-elements-in-vector-union-bool-missing/8355)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 35\
**Last updated:** [January 16, 2018, 7:09pm UTC](https://discourse.julialang.org/t/fastest-way-to-count-unique-elements-in-vector-union-bool-missing/8355 "2018-01-16T19:09:08Z")

</div>

Given that missing is now in base I was testing ways to count unique element in a vector of boolean or missing. My code is below and I wonder if there is a faster way to achieve the count; I think not. I looked up the do…

---

## [Error installing PyPlot: The Python package mpl\_toolkits.mplot3d could not be found by pyimport](https://discourse.julialang.org/t/error-installing-pyplot-the-python-package-mpl-toolkits-mplot3d-could-not-be-found-by-pyimport/6372)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 12\
**Last updated:** [January 16, 2018, 5:50pm UTC](https://discourse.julialang.org/t/error-installing-pyplot-the-python-package-mpl-toolkits-mplot3d-could-not-be-found-by-pyimport/6372 "2018-01-16T17:50:44Z")

</div>

I’m trying to install PyPlot on my system ( OSX 10.10 ) and is getting this error: $ julia \_ \_ \_ \_(\_)\_ | A fresh approach to technical computing (\_) | (\_) (\_) | Documentation: http…

---

## [How to unpack result from extrema function](https://discourse.julialang.org/t/how-to-unpack-result-from-extrema-function/8406)

<div class="topic-metadata">

**Author:** [@Paethon](https://discourse.julialang.org/u/Paethon)\
**Replies:** 2\
**Last updated:** [January 16, 2018, 5:13pm UTC](https://discourse.julialang.org/t/how-to-unpack-result-from-extrema-function/8406 "2018-01-16T17:13:39Z")

</div>

Hi I have a multi dimensional array and previously used minimum() and maximum() to scale the entries between 0 and 1 independently along one of the dimensions. arr = randn(3,128,128,1000) mi = minimum(arr, (2,3,4)) ma …

---

## [Any plans for non-LGPL alternatives for GMP and MPFR?](https://discourse.julialang.org/t/any-plans-for-non-lgpl-alternatives-for-gmp-and-mpfr/8374)

<div class="topic-metadata">

**Author:** [@ces](https://discourse.julialang.org/u/ces)\
**Replies:** 24\
**Last updated:** [January 16, 2018, 12:09pm UTC](https://discourse.julialang.org/t/any-plans-for-non-lgpl-alternatives-for-gmp-and-mpfr/8374 "2018-01-16T12:09:29Z")

</div>

Hi! While I can use LGPL libraries in this moment, I’m not sure if any projects that I face in the future might have static linking requirements that would make it impossible to use LGPL libs without all the project bec…

---

## [Julia Scientific Computing 4Week Course](https://discourse.julialang.org/t/julia-scientific-computing-4week-course/8387)

<div class="topic-metadata">

**Author:** [@Joshua\_Bowles](https://discourse.julialang.org/u/Joshua_Bowles)\
**Replies:** 3\
**Last updated:** [January 16, 2018, 6:15am UTC](https://discourse.julialang.org/t/julia-scientific-computing-4week-course/8387 "2018-01-16T06:15:12Z")

</div>

The course link starts today and looks like it’s gonna be a great resource. I have not taken it so I can’t speak to the quality or effectiveness. But I’m excited for it and thought I’d share. https://www.coursera.org/le…

---

## [Defensive programming & assert](https://discourse.julialang.org/t/defensive-programming-assert/8383)

<div class="topic-metadata">

**Author:** [@Vincent\_Picaud](https://discourse.julialang.org/u/Vincent_Picaud)\
**Replies:** 13\
**Last updated:** [January 16, 2018, 4:18am UTC](https://discourse.julialang.org/t/defensive-programming-assert/8383 "2018-01-16T04:18:59Z")

</div>

I come from the C++ world and I would like to use Julia more often. I generally use a lot of asserts in my code (a “defensive” programming approach), for instance imagine a function reading the first N records of a file.…

---

## [Recommended workflow for creating and maintaining Jupyter tutorials. Weave?](https://discourse.julialang.org/t/recommended-workflow-for-creating-and-maintaining-jupyter-tutorials-weave/8163)

<div class="topic-metadata">

**Author:** [@jlperla](https://discourse.julialang.org/u/jlperla)\
**Replies:** 20\
**Last updated:** [January 15, 2018, 11:04pm UTC](https://discourse.julialang.org/t/recommended-workflow-for-creating-and-maintaining-jupyter-tutorials-weave/8163 "2018-01-15T23:04:44Z")

</div>

I am creating a bunch of Jupyter notebooks for students with code, markdown, and embedded latex, and am wondering what the suggested workflow for this is (including version control, etc.). Hopefully the reasons for this…

---

## [Julia v0.3 interface with C / C++](https://discourse.julialang.org/t/julia-v0-3-interface-with-c-c/8321)

<div class="topic-metadata">

**Author:** [@nextr](https://discourse.julialang.org/u/nextr)\
**Replies:** 2\
**Last updated:** [January 15, 2018, 1:49pm UTC](https://discourse.julialang.org/t/julia-v0-3-interface-with-c-c/8321 "2018-01-15T13:49:53Z")

</div>

Hello, I’m new in Julia. I inherited of a project on Julia v0.3 and need to use it from within a C program. The steps I want to achieve are : Compile my Julia project to create a .ji file create .so library of my jul…

---

## [UndefVarError when trying to build MbedTLS package](https://discourse.julialang.org/t/undefvarerror-when-trying-to-build-mbedtls-package/8363)

<div class="topic-metadata">

**Author:** [@martenskogh](https://discourse.julialang.org/u/martenskogh)\
**Replies:** 2\
**Last updated:** [January 15, 2018, 9:39am UTC](https://discourse.julialang.org/t/undefvarerror-when-trying-to-build-mbedtls-package/8363 "2018-01-15T09:39:01Z")

</div>

I have been trying to get Juno up and running on Linux but I can’t seem to be able to build the MbedTLS package. I added the package in Atom and then navigated to ‘Packages’-\>‘Julia’-\>‘Start Julia’. This runs for some ti…

---

## [LoadError: could not spawn \`curl --version\`](https://discourse.julialang.org/t/loaderror-could-not-spawn-curl-version/3367)

<div class="topic-metadata">

**Author:** [@leiteiro](https://discourse.julialang.org/u/leiteiro)\
**Replies:** 10\
**Last updated:** [January 14, 2018, 2:40pm UTC](https://discourse.julialang.org/t/loaderror-could-not-spawn-curl-version/3367 "2018-01-14T14:40:08Z")

</div>

Can someone please help me understand this error message? On my Sytem (Windows10), any call to ‘PkgDev.publish()’ fails with this error message. LoadError: could not spawn curl --version: no such file or directory (ENO…

---

## [Multi-threading doesn't seem to scale well on this counting problem](https://discourse.julialang.org/t/multi-threading-doesnt-seem-to-scale-well-on-this-counting-problem/8318)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 15\
**Last updated:** [January 14, 2018, 3:48am UTC](https://discourse.julialang.org/t/multi-threading-doesnt-seem-to-scale-well-on-this-counting-problem/8318 "2018-01-14T03:48:24Z")

</div>

I have been reading about multithreading and the general feel is that it’s very hard to get good performance out of it. After reading the post (https://github.com/JuliaLang/julia/issues/17395), I still feel hazy on what …

---

## [Addprocs crashes if localhost added before remote host](https://discourse.julialang.org/t/addprocs-crashes-if-localhost-added-before-remote-host/8335)

<div class="topic-metadata">

**Author:** [@polypus74](https://discourse.julialang.org/u/polypus74)\
**Replies:** 3\
**Last updated:** [January 13, 2018, 3:14pm UTC](https://discourse.julialang.org/t/addprocs-crashes-if-localhost-added-before-remote-host/8335 "2018-01-13T15:14:15Z")

</div>

May or may not be a bug, it’s my first day using parallel Julia. I do find it odd however that if i do an addprocs on localhost first and then on remote: addprocs(1) addprocs(\[("\<myotherbox\>", 1)\]) I get a crash, but i…

---

## [Passing a reference to Julia struct into ccall and let C manage the memory](https://discourse.julialang.org/t/passing-a-reference-to-julia-struct-into-ccall-and-let-c-manage-the-memory/8325)

<div class="topic-metadata">

**Author:** [@ksimon](https://discourse.julialang.org/u/ksimon)\
**Replies:** 4\
**Last updated:** [January 13, 2018, 7:55am UTC](https://discourse.julialang.org/t/passing-a-reference-to-julia-struct-into-ccall-and-let-c-manage-the-memory/8325 "2018-01-13T07:55:44Z")

</div>

Hi Julia users, I am having trouble with a ccall. Here my problem in a simplified form: Declare a struct MyArray in Julia that holds a pointer ‘data’ to a Cdouble array and two Cints for the size ‘m’ and ‘n’, Init…

---

## [For Loops giving weird results](https://discourse.julialang.org/t/for-loops-giving-weird-results/8316)

<div class="topic-metadata">

**Author:** [@Swopnil\_Ojha](https://discourse.julialang.org/u/Swopnil_Ojha)\
**Replies:** 8\
**Last updated:** [January 13, 2018, 2:32am UTC](https://discourse.julialang.org/t/for-loops-giving-weird-results/8316 "2018-01-13T02:32:11Z")

</div>

Julia is giving me weird results when I run the following code. using Plots plotly() using PyCall @pyimport numpy as np """function for calculating the corner frequency of the ijth subfault""" function corner\_f0ij(M0…

---

## [autocomplete for contents of custom type](https://discourse.julialang.org/t/autocomplete-for-contents-of-custom-type/8304)

<div class="topic-metadata">

**Author:** [@rmar](https://discourse.julialang.org/u/rmar)\
**Replies:** 2\
**Last updated:** [January 12, 2018, 12:59pm UTC](https://discourse.julialang.org/t/autocomplete-for-contents-of-custom-type/8304 "2018-01-12T12:59:49Z")

</div>

I am trying to build some better inspection for some custom types in a scripting workflow. The working example of what I am after is from a Dict() where tab-suggestions are available for keys of a dictionary in the jupy…

---

## [Setting JULIA\_NUM\_THREADS in an IJulia kernel](https://discourse.julialang.org/t/setting-julia-num-threads-in-an-ijulia-kernel/8301)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 3\
**Last updated:** [January 12, 2018, 10:45am UTC](https://discourse.julialang.org/t/setting-julia-num-threads-in-an-ijulia-kernel/8301 "2018-01-12T10:45:21Z")

</div>

Is there a way to set the JULIA\_NUM\_THREADS environment variable for the IJulia session or kernel?

---

## [Precompile files are generated not according to umask](https://discourse.julialang.org/t/precompile-files-are-generated-not-according-to-umask/8305)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 0\
**Last updated:** [January 12, 2018, 5:57am UTC](https://discourse.julialang.org/t/precompile-files-are-generated-not-according-to-umask/8305 "2018-01-12T05:57:35Z")

</div>

Due to the slowness of having METADATA on a network drive (where user’s home directory is located), we have an installation of Julia that has JULIA\_PKGDIR set up to be in a local drive and we made a group-writable direct…

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

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