# General Usage

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

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

**Page:** 866

---

## [Thread-local let bindings?](https://discourse.julialang.org/t/thread-local-let-bindings/24290)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 1\
**Last updated:** [May 16, 2019, 8:07pm UTC](https://discourse.julialang.org/t/thread-local-let-bindings/24290 "2019-05-16T20:07:06Z")

</div>

I’m running into performance problems when my multithreaded code allocates heavily, so I’m trying to use let bindings to avoid reallocating large arrays, but I don’t see any way to make the bindings thread-local. For ex…

---

## [How to use debugger with HTTP.jl](https://discourse.julialang.org/t/how-to-use-debugger-with-http-jl/24248)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 7\
**Last updated:** [May 16, 2019, 6:14pm UTC](https://discourse.julialang.org/t/how-to-use-debugger-with-http-jl/24248 "2019-05-16T18:14:23Z")

</div>

I’ve been struggling to use the new debugging tools with HTTP but I can’t get it to work. Take this simple example: using HTTP, Sockets function handleReq(req) "200 OK" end HTTP.serve(ip"127.0.0.1", 8000, verbose = …

---

## [writeMPS()](https://discourse.julialang.org/t/writemps/21669)

<div class="topic-metadata">

**Author:** [@Di11on](https://discourse.julialang.org/u/Di11on)\
**Replies:** 10\
**Last updated:** [May 16, 2019, 3:28pm UTC](https://discourse.julialang.org/t/writemps/21669 "2019-05-16T15:28:08Z")

</div>

Hi folks, In JuMP 0.19, has writeMPS been removed? This issue alludes to it : https://github.com/JuliaOpt/JuMP.jl/issues/1403 If so, why and is there a replacement? And if not, where is the function documented - a go…

---

## [Sprint/writedlm digit precision](https://discourse.julialang.org/t/sprint-writedlm-digit-precision/24275)

<div class="topic-metadata">

**Author:** [@timmm](https://discourse.julialang.org/u/timmm)\
**Replies:** 2\
**Last updated:** [May 16, 2019, 2:59pm UTC](https://discourse.julialang.org/t/sprint-writedlm-digit-precision/24275 "2019-05-16T14:59:57Z")

</div>

Hi, Is there a simple why for me to set the number of digits when writing to a file? I have something like: using DelimitedFiles writedlm ("$filename.xyz",\[x y z\]," ") or write(io, "xyz");print(io,"\\r\\n"); print(io,…

---

## [Bypassing Forced Termination in Nlopt](https://discourse.julialang.org/t/bypassing-forced-termination-in-nlopt/24224)

<div class="topic-metadata">

**Author:** [@CPPhysics](https://discourse.julialang.org/u/CPPhysics)\
**Replies:** 5\
**Last updated:** [May 16, 2019, 2:19pm UTC](https://discourse.julialang.org/t/bypassing-forced-termination-in-nlopt/24224 "2019-05-16T14:19:30Z")

</div>

So, I am using Nlopt to minimize a nonlinear optimization problem, and for awhile I have been running the code and I will get zero as my return value after 2 iterations, with Nlopt showing “Forced\_Stop” I just read that…

---

## [How to use Dagger.jl's blocks to read a multifile NCDataset?](https://discourse.julialang.org/t/how-to-use-dagger-jls-blocks-to-read-a-multifile-ncdataset/24264)

<div class="topic-metadata">

**Author:** [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Replies:** 3\
**Last updated:** [May 16, 2019, 11:08am UTC](https://discourse.julialang.org/t/how-to-use-dagger-jls-blocks-to-read-a-multifile-ncdataset/24264 "2019-05-16T11:08:46Z")

</div>

Hi! I’m trying to load a multifile dataset using NCDatasets, and to speed things up I am trying to use dagger in this way include("test/test\_catarrays.jl") # this creates some small test files mfds = Dataset(fnames); X…

---

## [Broadcast of .== slow performance, allocations](https://discourse.julialang.org/t/broadcast-of-slow-performance-allocations/24259)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 5\
**Last updated:** [May 16, 2019, 9:57am UTC](https://discourse.julialang.org/t/broadcast-of-slow-performance-allocations/24259 "2019-05-16T09:57:53Z")

</div>

Why is .== so slow compared to broadcast in this example? julia\> test = \[1\] 1-element Array{Int64,1}: 1 julia\> @btime test .== 1 3.304 μs (13 allocations: 4.72 KiB) 1-element BitArray{1}: true julia\> @btime broadc…

---

## [Own module and how to run it](https://discourse.julialang.org/t/own-module-and-how-to-run-it/24273)

<div class="topic-metadata">

**Author:** [@wiktorkujawa](https://discourse.julialang.org/u/wiktorkujawa)\
**Replies:** 3\
**Last updated:** [May 16, 2019, 10:44am UTC](https://discourse.julialang.org/t/own-module-and-how-to-run-it/24273 "2019-05-16T10:44:54Z")

</div>

I have to files: test.jl x=5 y=4 include("./file.jl") using .File xyzadd(x,y) xyzmultiply(x,y) and 2)file.jl module File export xyzadd,xyzmultiply function xyzadd(a,b) print("Add: ") return a+b end functi…

---

## [Error while including a file](https://discourse.julialang.org/t/error-while-including-a-file/24238)

<div class="topic-metadata">

**Author:** [@RaulDurand](https://discourse.julialang.org/u/RaulDurand)\
**Replies:** 6\
**Last updated:** [May 16, 2019, 9:13am UTC](https://discourse.julialang.org/t/error-while-including-a-file/24238 "2019-05-16T09:13:01Z")

</div>

Sometimes I get this error while including a file include("filename.jl"). Then I have to restart Julia and it works again. I am using Revise. No a single line of the included file is executed. What could be the problem…

---

## [Possible ways to accelerate LinearMapping computation](https://discourse.julialang.org/t/possible-ways-to-accelerate-linearmapping-computation/24270)

<div class="topic-metadata">

**Author:** [@Mr.Robot](https://discourse.julialang.org/u/Mr.Robot)\
**Replies:** 5\
**Last updated:** [May 16, 2019, 7:57am UTC](https://discourse.julialang.org/t/possible-ways-to-accelerate-linearmapping-computation/24270 "2019-05-16T07:57:48Z")

</div>

Problem I am trying to solve a large scale (about 1 million webpages) PageRank problem with iterative solvers. The problem could be cast into solving the linear system \\left\[\\frac{1}{n}(1-p)\\mathbf{11}^T+p\\mathbf{A}^T\\…

---

## [How to iterate over a RemoteChannel?](https://discourse.julialang.org/t/how-to-iterate-over-a-remotechannel/24263)

<div class="topic-metadata">

**Author:** [@jonas-schulze](https://discourse.julialang.org/u/jonas-schulze)\
**Replies:** 1\
**Last updated:** [May 16, 2019, 4:40am UTC](https://discourse.julialang.org/t/how-to-iterate-over-a-remotechannel/24263 "2019-05-16T04:40:03Z")

</div>

For regular Channels chan it is ok to do for val in chan @show val end but for a RemoteChannel there is no iterate(::RemoteChannel). Is that one missing on purpose? What’s the proper way to spawn a task on a worker…

---

## [Why is it \`close(::Channel)\` instead of \`close!(::Channel)\`?](https://discourse.julialang.org/t/why-is-it-close-channel-instead-of-close-channel/24261)

<div class="topic-metadata">

**Author:** [@jonas-schulze](https://discourse.julialang.org/u/jonas-schulze)\
**Replies:** 4\
**Last updated:** [May 16, 2019, 4:27am UTC](https://discourse.julialang.org/t/why-is-it-close-channel-instead-of-close-channel/24261 "2019-05-16T04:27:35Z")

</div>

Out of curiosity, why does closing a channel not have a ! in its name?

---

## [JuliaDB column names](https://discourse.julialang.org/t/juliadb-column-names/24250)

<div class="topic-metadata">

**Author:** [@alphasig329](https://discourse.julialang.org/u/alphasig329)\
**Replies:** 4\
**Last updated:** [May 16, 2019, 2:11am UTC](https://discourse.julialang.org/t/juliadb-column-names/24250 "2019-05-16T02:11:55Z")

</div>

I have pulled data from an Oracle database using JDBC and collected the results using the following code: oracle\_cursor = JDBC.cursor(oracle\_connection) execute!(oracle\_cursor, "SQL STATEMENT") column\_names = map(x -\> …

---

## [Untyped keyword arguments](https://discourse.julialang.org/t/untyped-keyword-arguments/24228)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 2\
**Last updated:** [May 16, 2019, 12:02am UTC](https://discourse.julialang.org/t/untyped-keyword-arguments/24228 "2019-05-16T00:02:23Z")

</div>

Summary: Is there any performance benefit to annotating keyword arguments with types? I understand that typed keyword arguments are as efficient as positional arguments. Is that correct? But what are the performance ch…

---

## [Easiest way oj getting Julia with MKL on ubuntu](https://discourse.julialang.org/t/easiest-way-oj-getting-julia-with-mkl-on-ubuntu/24260)

<div class="topic-metadata">

**Author:** [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)\
**Replies:** 0\
**Last updated:** [May 15, 2019, 10:13pm UTC](https://discourse.julialang.org/t/easiest-way-oj-getting-julia-with-mkl-on-ubuntu/24260 "2019-05-15T22:13:47Z")

</div>

Hi folks, i know this is not the standard, and from other, older posts, not quite an easy thing to have… but I was wondering if there is a simplemway to get/compile Julia with the MKL libraries instead of OpenBlas. What…

---

## [Right-handed unary operator?](https://discourse.julialang.org/t/right-handed-unary-operator/6280)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 4\
**Last updated:** [May 15, 2019, 8:18pm UTC](https://discourse.julialang.org/t/right-handed-unary-operator/6280 "2019-05-15T20:18:24Z")

</div>

Is it possible to define unary operators that act from the right? For example, typically ! is placed on the right for factorial like 5!. Specifically, I’d like to define some operation like xˡ and xʳ or alternatively x…

---

## [Selecting parts of an array based on the conjunction of two conditions in v1](https://discourse.julialang.org/t/selecting-parts-of-an-array-based-on-the-conjunction-of-two-conditions-in-v1/24255)

<div class="topic-metadata">

**Author:** [@jhcooperman](https://discourse.julialang.org/u/jhcooperman)\
**Replies:** 1\
**Last updated:** [May 15, 2019, 7:30pm UTC](https://discourse.julialang.org/t/selecting-parts-of-an-array-based-on-the-conjunction-of-two-conditions-in-v1/24255 "2019-05-15T19:30:16Z")

</div>

I am updating some code from v0.6 to v1, and I have not been able to resolve one particular issue (except by workaround). In v0.6 my code included the construction A\[:,(A\[1,:\].==1) & (A\[2,:\].==10)\] for selecting the pa…

---

## [Advice on using singleton types for dispatch](https://discourse.julialang.org/t/advice-on-using-singleton-types-for-dispatch/24245)

<div class="topic-metadata">

**Author:** [@jbmuir](https://discourse.julialang.org/u/jbmuir)\
**Replies:** 1\
**Last updated:** [May 15, 2019, 4:41pm UTC](https://discourse.julialang.org/t/advice-on-using-singleton-types-for-dispatch/24245 "2019-05-15T16:41:02Z")

</div>

I’m writing an extension for LightGraphs.jl to calculate solutions of the eikonal equation over weighted graphs; I would like to provide for the option to use different norms when calculating solutions. Currently my setu…

---

## [How to formulate a complex JuMP variable array](https://discourse.julialang.org/t/how-to-formulate-a-complex-jump-variable-array/24222)

<div class="topic-metadata">

**Author:** [@CPPhysics](https://discourse.julialang.org/u/CPPhysics)\
**Replies:** 3\
**Last updated:** [May 15, 2019, 3:53pm UTC](https://discourse.julialang.org/t/how-to-formulate-a-complex-jump-variable-array/24222 "2019-05-15T15:53:10Z")

</div>

I would like to create a complex jump array variable and I have been looking through the documentation for awhile and things are still not clear. Lets say for a trivial example I want to minimize the trace of a DxD comp…

---

## [Very slow array creation (and Benchmark iterate error)](https://discourse.julialang.org/t/very-slow-array-creation-and-benchmark-iterate-error/24020)

<div class="topic-metadata">

**Author:** [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)\
**Replies:** 6\
**Last updated:** [May 15, 2019, 3:03pm UTC](https://discourse.julialang.org/t/very-slow-array-creation-and-benchmark-iterate-error/24020 "2019-05-15T15:03:28Z")

</div>

I am a beginner Julia user and am having a hard time developing a model because it takes a very long time to initialize certain arrays. I tried using BenchmarkTools.jl to get an accurate time but it generated an iterate …

---

## [Library for (algebraically) complicated sums (and other expressions)?](https://discourse.julialang.org/t/library-for-algebraically-complicated-sums-and-other-expressions/17810)

<div class="topic-metadata">

**Author:** [@rotsoc](https://discourse.julialang.org/u/rotsoc)\
**Replies:** 10\
**Last updated:** [May 15, 2019, 2:08pm UTC](https://discourse.julialang.org/t/library-for-algebraically-complicated-sums-and-other-expressions/17810 "2019-05-15T14:08:29Z")

</div>

I was wondering if anyone knows of a library that easily handles expressions like this: This would greatly help in what I am trying to do… This expression can be calculated using loops but in what I am writing end-u…

---

## [Compute functions on a grid of parameters](https://discourse.julialang.org/t/compute-functions-on-a-grid-of-parameters/24198)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 16\
**Last updated:** [May 15, 2019, 12:26pm UTC](https://discourse.julialang.org/t/compute-functions-on-a-grid-of-parameters/24198 "2019-05-15T12:26:25Z")

</div>

Hi! The problem sounds very simple on the surface: compute something like f1(f2(f3(a3), a2), a1) on a grid of values for a1, a2, a2, and save results into array of corresponding shape. Of course, it can be done with ((a1…

---

## [Interpolate expression into macro](https://discourse.julialang.org/t/interpolate-expression-into-macro/24204)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 27\
**Last updated:** [May 15, 2019, 12:43pm UTC](https://discourse.julialang.org/t/interpolate-expression-into-macro/24204 "2019-05-15T12:43:18Z")

</div>

I create some expressions during runtime, which I would like to end up in the expression returned by a macro. I can’t seem to get this to work, and wonder if it is a fundamental limitation? Example: function makeexpr(a)…

---

## [Sorting nested dictionary](https://discourse.julialang.org/t/sorting-nested-dictionary/24182)

<div class="topic-metadata">

**Author:** [@FinlayDaG33k](https://discourse.julialang.org/u/FinlayDaG33k)\
**Replies:** 11\
**Last updated:** [May 15, 2019, 8:08am UTC](https://discourse.julialang.org/t/sorting-nested-dictionary/24182 "2019-05-15T08:08:55Z")

</div>

Hii there, I’m new to the world of Julia (I’m mostly a web dev) so please be patient :slight\_smile: Let’s talk about my issue shall we? I have a dictionary, which in terms contain dictionaries as well: servers = Dict…

---

## [Multiple Julia instances in a C++ software](https://discourse.julialang.org/t/multiple-julia-instances-in-a-c-software/23961)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 5\
**Last updated:** [May 15, 2019, 5:55am UTC](https://discourse.julialang.org/t/multiple-julia-instances-in-a-c-software/23961 "2019-05-15T05:55:22Z")

</div>

Hi guys! Sometime ago I asked about calling Julia in multiple threads. It was said that this is on roadmap but with low priority, IIRC. Something that would help me a lot would be the possibility to have multiple Julia…

---

## [Advice for building sparsematrix](https://discourse.julialang.org/t/advice-for-building-sparsematrix/18178)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 10\
**Last updated:** [May 14, 2019, 5:25pm UTC](https://discourse.julialang.org/t/advice-for-building-sparsematrix/18178 "2019-05-14T17:25:03Z")

</div>

Hi, I feel that my problem must be shared by some of you. I need to build the sparse matrix associated to a 2d Finite Element method. Following the advice of Viral, I built 3 lists I,J,values containing the indices of …

---

## [Problems using Sockets](https://discourse.julialang.org/t/problems-using-sockets/24212)

<div class="topic-metadata">

**Author:** [@wolfgang](https://discourse.julialang.org/u/wolfgang)\
**Replies:** 0\
**Last updated:** [May 14, 2019, 3:27pm UTC](https://discourse.julialang.org/t/problems-using-sockets/24212 "2019-05-14T15:27:26Z")

</div>

I have a problem using the sockets implementation of Julia. I’m trying to write a test program for a networking application and decided to do this in Julia instead of Python, since I am free to ue what I want and I want …

---

## [Access C stdout in Julia](https://discourse.julialang.org/t/access-c-stdout-in-julia/24187)

<div class="topic-metadata">

**Author:** [@abhinav\_mehndiratta](https://discourse.julialang.org/u/abhinav_mehndiratta)\
**Replies:** 4\
**Last updated:** [May 14, 2019, 5:55am UTC](https://discourse.julialang.org/t/access-c-stdout-in-julia/24187 "2019-05-14T05:55:26Z")

</div>

I am trying to write a wrapper for an external library(GraphBLAS). One of the matrix print functions expects a FILE\* pointer in its arguments so I tried this ccall(dlsym(hdl, "GxB\_Matrix\_fprint"), Cint, (GrB\_Matrix, Ptr…

---

## [How to correctly define and call templated/parametric methods using the new 'where' syntax](https://discourse.julialang.org/t/how-to-correctly-define-and-call-templated-parametric-methods-using-the-new-where-syntax/24129)

<div class="topic-metadata">

**Author:** [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Replies:** 10\
**Last updated:** [May 14, 2019, 2:44am UTC](https://discourse.julialang.org/t/how-to-correctly-define-and-call-templated-parametric-methods-using-the-new-where-syntax/24129 "2019-05-14T02:44:12Z")

</div>

I have already read the manual, the relevant issue, and have done some fair share of googling, so I am getting a little frustrated that I cannot find the missing information. I come from a C++ background, I wanted to fo…

---

## [Manipulate types of nested data structure](https://discourse.julialang.org/t/manipulate-types-of-nested-data-structure/24181)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 2\
**Last updated:** [May 13, 2019, 5:23pm UTC](https://discourse.julialang.org/t/manipulate-types-of-nested-data-structure/24181 "2019-05-13T17:23:19Z")

</div>

I have a type, let’s call it Special \<: Real, which wraps a vector of lengthN. I have defined methods of most standard functions. Sometimes, however, one or several objects of type Special are nested deep into some outer…

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

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