# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1941

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

**Page:** 1942

---

## [JuliaCon 2019 Call for Sponsors](https://discourse.julialang.org/t/juliacon-2019-call-for-sponsors/19601)

<div class="topic-metadata">

**Author:** [@avik](https://discourse.julialang.org/u/avik)\
**Replies:** 0\
**Last updated:** [January 13, 2019, 11:15pm UTC](https://discourse.julialang.org/t/juliacon-2019-call-for-sponsors/19601 "2019-01-13T23:15:37Z")

</div>

JuliaCon depends on the generosity of its sponsors. As a community organised non-profit conference, our sponsors allow us pay for the usual expenses of running a conference while keeping prices (particularly student pri…

---

## [Reading matrices from an external file inside a function](https://discourse.julialang.org/t/reading-matrices-from-an-external-file-inside-a-function/27558)

<div class="topic-metadata">

**Author:** [@qwerytyui1234](https://discourse.julialang.org/u/qwerytyui1234)\
**Replies:** 8\
**Last updated:** [August 14, 2019, 10:11pm UTC](https://discourse.julialang.org/t/reading-matrices-from-an-external-file-inside-a-function/27558 "2019-08-14T22:11:07Z")

</div>

Hey guys, I’m wondering if anyone can help with this issue. So the minimal example is as follows. Suppose I have a “A.jl” file in the present working directory and it contains the following. f = \[x+y; x+2\]; And I w…

---

## [How to log all output in console to file?](https://discourse.julialang.org/t/how-to-log-all-output-in-console-to-file/27557)

<div class="topic-metadata">

**Author:** [@wenqi\_kou](https://discourse.julialang.org/u/wenqi_kou)\
**Replies:** 1\
**Last updated:** [August 14, 2019, 8:59pm UTC](https://discourse.julialang.org/t/how-to-log-all-output-in-console-to-file/27557 "2019-08-14T20:59:07Z")

</div>

I want to log all outputs in console into a file, including all records automatically generates at run time. For example, when I use Mosek to solve some problems, I need these data logged in the output file. These data …

---

## [Best way to convert a NTuple to a Set](https://discourse.julialang.org/t/best-way-to-convert-a-ntuple-to-a-set/27532)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 2\
**Last updated:** [August 14, 2019, 8:48pm UTC](https://discourse.julialang.org/t/best-way-to-convert-a-ntuple-to-a-set/27532 "2019-08-14T20:48:51Z")

</div>

I did: julia\> ntup = (1, 2, 3, 4, 5, 6), NTuple{6, Int} julia\> Set(ntup) Set(Any\[(1, 2, 3, 4, 5, 6), NTuple{6,Int64}\]) But I want to get a set of Int64. How can I achieve that?

---

## [Problems with executable compilation using PackageCompiler.jl](https://discourse.julialang.org/t/problems-with-executable-compilation-using-packagecompiler-jl/25892)

<div class="topic-metadata">

**Author:** [@vitreo12](https://discourse.julialang.org/u/vitreo12)\
**Replies:** 14\
**Last updated:** [August 14, 2019, 3:19pm UTC](https://discourse.julialang.org/t/problems-with-executable-compilation-using-packagecompiler-jl/25892 "2019-08-14T15:19:23Z")

</div>

Hello everyone, I was trying to build some julia code into command line applications with PackageCompiler.jl, but I have noticed that, still, they do rely on compiling the functions, or parts of it, on first call. As a…

---

## [Equivalent of setting "receive timeout" value on ZMQ socket](https://discourse.julialang.org/t/equivalent-of-setting-receive-timeout-value-on-zmq-socket/27552)

<div class="topic-metadata">

**Author:** [@Josiah\_Slack](https://discourse.julialang.org/u/Josiah_Slack)\
**Replies:** 0\
**Last updated:** [August 14, 2019, 8:15pm UTC](https://discourse.julialang.org/t/equivalent-of-setting-receive-timeout-value-on-zmq-socket/27552 "2019-08-14T20:15:53Z")

</div>

I’m wondering if there’s an idiomatic way of setting a timeout for recv(socket)?

---

## [Relative performance discrepancy across cpus even with --cpu-target set](https://discourse.julialang.org/t/relative-performance-discrepancy-across-cpus-even-with-cpu-target-set/27503)

<div class="topic-metadata">

**Author:** [@non-Jedi](https://discourse.julialang.org/u/non-Jedi)\
**Replies:** 5\
**Last updated:** [August 14, 2019, 8:02pm UTC](https://discourse.julialang.org/t/relative-performance-discrepancy-across-cpus-even-with-cpu-target-set/27503 "2019-08-14T20:02:11Z")

</div>

I’ve been trying to optimize the benchmarks game’s julia programs again, and I’m running into a problem I don’t really know how to work around. The gist is that between two implementations, one is significantly faster…

---

## [Create an array of arrays](https://discourse.julialang.org/t/create-an-array-of-arrays/27550)

<div class="topic-metadata">

**Author:** [@Fkazama](https://discourse.julialang.org/u/Fkazama)\
**Replies:** 10\
**Last updated:** [August 14, 2019, 6:57pm UTC](https://discourse.julialang.org/t/create-an-array-of-arrays/27550 "2019-08-14T18:57:56Z")

</div>

Hello, I need to create an array of arrays, I am trying the following code: "using JuMP populacao=10 individuo = Array{Array{Int64,2},1} for a=1:populacao individuo\[a\]=rand{\[0,1\],2,3} println(individuo\[a\]) end " …

---

## [Can a struct be created with field keywords?](https://discourse.julialang.org/t/can-a-struct-be-created-with-field-keywords/27531)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 2\
**Last updated:** [August 14, 2019, 4:25pm UTC](https://discourse.julialang.org/t/can-a-struct-be-created-with-field-keywords/27531 "2019-08-14T16:25:45Z")

</div>

I can do this: julia\> struct Mystruct x y end julia\> function (m::Mystruct)(z) m.x+m.y+z end julia\> m=Mystruct(1,2) Mystruct(1, 2) julia\> m(3) 6 but I would like to do this: m = M…

---

## ["New Terminal" does not work](https://discourse.julialang.org/t/new-terminal-does-not-work/27542)

<div class="topic-metadata">

**Author:** [@Zhong\_Pan](https://discourse.julialang.org/u/Zhong_Pan)\
**Replies:** 3\
**Last updated:** [August 14, 2019, 4:18pm UTC](https://discourse.julialang.org/t/new-terminal-does-not-work/27542 "2019-08-14T16:18:24Z")

</div>

I clicked on Atom tool bar New Terminal button and this error message came up: For more info check out the docs: https://nuclide.io/docs/features/terminal Error starting process: Error: Cannot find module 'C:\\Users\\zp…

---

## [Dataframe map function drops empty results](https://discourse.julialang.org/t/dataframe-map-function-drops-empty-results/27505)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 2\
**Last updated:** [August 14, 2019, 4:03pm UTC](https://discourse.julialang.org/t/dataframe-map-function-drops-empty-results/27505 "2019-08-14T16:03:59Z")

</div>

Which is the result i wanted, but not the result i expected. The result I expect in my example below is a group with an empty dataframe for each of the odd values from column a. p.s. documentation does not indicate wh…

---

## [Function calls in global scope, benchmarking, etc](https://discourse.julialang.org/t/function-calls-in-global-scope-benchmarking-etc/27513)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 6\
**Last updated:** [August 14, 2019, 3:10pm UTC](https://discourse.julialang.org/t/function-calls-in-global-scope-benchmarking-etc/27513 "2019-08-14T15:10:18Z")

</div>

I recently asked a Stack Overflow question about interpolating into benchmarking expressions. But I still have some lingering confusion about the impact on performance of passing global variables as arguments to function…

---

## [Overload write?](https://discourse.julialang.org/t/overload-write/27528)

<div class="topic-metadata">

**Author:** [@stephancb](https://discourse.julialang.org/u/stephancb)\
**Replies:** 1\
**Last updated:** [August 14, 2019, 2:44pm UTC](https://discourse.julialang.org/t/overload-write/27528 "2019-08-14T14:44:39Z")

</div>

write(io::IO, x) …

---

## [Top level vs global scope](https://discourse.julialang.org/t/top-level-vs-global-scope/27516)

<div class="topic-metadata">

**Author:** [@CameronBieganek](https://discourse.julialang.org/u/CameronBieganek)\
**Replies:** 4\
**Last updated:** [August 14, 2019, 2:23am UTC](https://discourse.julialang.org/t/top-level-vs-global-scope/27516 "2019-08-14T02:23:35Z")

</div>

The Julia docs contain the terms “top level” and “global scope”. Is the relation between the two this: "top level" === "global scope" or this: "top level" ≈ "global scope" or something else entirely?

---

## [Get an anonymous function as a string](https://discourse.julialang.org/t/get-an-anonymous-function-as-a-string/27523)

<div class="topic-metadata">

**Author:** [@Marco-Congedo](https://discourse.julialang.org/u/Marco-Congedo)\
**Replies:** 8\
**Last updated:** [August 14, 2019, 1:57pm UTC](https://discourse.julialang.org/t/get-an-anonymous-function-as-a-string/27523 "2019-08-14T13:57:57Z")

</div>

string returns the name of a function as a string: julia\> string(sqrt) “sqrt” but that does not work the same for an anonymous function: julia\> string(x-\>x^3) “getfield(Main, Symbol("##9#10"))()” How can i get an a…

---

## [Wrong dictionary key type does not give type error](https://discourse.julialang.org/t/wrong-dictionary-key-type-does-not-give-type-error/27515)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 5\
**Last updated:** [August 14, 2019, 12:35pm UTC](https://discourse.julialang.org/t/wrong-dictionary-key-type-does-not-give-type-error/27515 "2019-08-14T12:35:36Z")

</div>

Shouldn’t the example give a type error instead of key not found error ?? julia\> d=Dict{Tuple{Int,Int}, Int}() Dict{Tuple{Int64,Int64},Int64} with 0 entries julia\> d\[(1,1)\] = 5 5 julia\> d\[(1,1)\] 5 julia\> d\[1\] ERROR: …

---

## [Calculating Lyapunov Exponents with ModelingToolkit](https://discourse.julialang.org/t/calculating-lyapunov-exponents-with-modelingtoolkit/26641)

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 17\
**Last updated:** [August 14, 2019, 10:49am UTC](https://discourse.julialang.org/t/calculating-lyapunov-exponents-with-modelingtoolkit/26641 "2019-08-14T10:49:52Z")

</div>

Hi all, suggested in this thread here Chaostools tangent\_integrator stiff solvers - #26 by jamblejoe, one could use ModelingToolkit the approach the following scenario. One has a dynamical system defined by n different…

---

## [Documentation of keyword arguments confuses me](https://discourse.julialang.org/t/documentation-of-keyword-arguments-confuses-me/27524)

<div class="topic-metadata">

**Author:** [@cserteGT3](https://discourse.julialang.org/u/cserteGT3)\
**Replies:** 1\
**Last updated:** [August 14, 2019, 9:53am UTC](https://discourse.julialang.org/t/documentation-of-keyword-arguments-confuses-me/27524 "2019-08-14T09:53:41Z")

</div>

I was trying to pass keyword arguments from function-to-function and encountered the following: julia\> function foo(x;y=10, kwargs...) println(x,y) end foo (generic function with 1 method) julia\> …

---

## [Function does not work as expected](https://discourse.julialang.org/t/function-does-not-work-as-expected/27449)

<div class="topic-metadata">

**Author:** [@abdul-naaser](https://discourse.julialang.org/u/abdul-naaser)\
**Replies:** 6\
**Last updated:** [August 14, 2019, 8:10am UTC](https://discourse.julialang.org/t/function-does-not-work-as-expected/27449 "2019-08-14T08:10:28Z")

</div>

Hi all, I am on Julia 1.1.1 within Jupyter kernel. I wrote a dice program, but I get errors. Not sure what I am doing wrong? I consulted the docs with no gains. function playcr(bet\_amount ::Int64) die1 = rand(1:6, 1…

---

## [Way to slice an array of unknown number of dimensions?](https://discourse.julialang.org/t/way-to-slice-an-array-of-unknown-number-of-dimensions/27246)

<div class="topic-metadata">

**Author:** [@tianrluo](https://discourse.julialang.org/u/tianrluo)\
**Replies:** 15\
**Last updated:** [August 14, 2019, 6:24am UTC](https://discourse.julialang.org/t/way-to-slice-an-array-of-unknown-number-of-dimensions/27246 "2019-08-14T06:24:45Z")

</div>

This might be naive, but I couldn’t find an answer else where: Let A be an Nd-array, where Nd is unknown exactly till runtime, e.g., only sure that Nd\>=3. Is there a good way to slice it along, e.g., the n\<=3th dimensi…

---

## [Difference between \`A\[:\]\` and \`vec(A)\`](https://discourse.julialang.org/t/difference-between-a-and-vec-a/27507)

<div class="topic-metadata">

**Author:** [@tianrluo](https://discourse.julialang.org/u/tianrluo)\
**Replies:** 2\
**Last updated:** [August 14, 2019, 12:02am UTC](https://discourse.julialang.org/t/difference-between-a-and-vec-a/27507 "2019-08-14T00:02:22Z")

</div>

julia\> A, B = ones(3,), ones(3,); julia\> fn!(x) = begin x.=2 end; julia\> fn!(vec(A)); A 3×1 Array{Float64,2}: 2.0 2.0 2.0 julia\> fn!(B\[:\]); B 3×1 Array{Float64,2}: 1.0 1.0 1.0 vec’s behaviour is understood from th…

---

## [Bioinformatics.jl - Helper functions for bioinformatics and rosalind.info problems](https://discourse.julialang.org/t/bioinformatics-jl-helper-functions-for-bioinformatics-and-rosalind-info-problems/27506)

<div class="topic-metadata">

**Author:** [@mrtkp9993](https://discourse.julialang.org/u/mrtkp9993)\
**Replies:** 1\
**Last updated:** [August 13, 2019, 9:06pm UTC](https://discourse.julialang.org/t/bioinformatics-jl-helper-functions-for-bioinformatics-and-rosalind-info-problems/27506 "2019-08-13T21:06:51Z")

</div>

https://github.com/mrtkp9993/Bioinformatics.jl

---

## [Discussion: SPIR-V analog to CUDAnative?](https://discourse.julialang.org/t/discussion-spir-v-analog-to-cudanative/27427)

<div class="topic-metadata">

**Author:** [@wsphillips](https://discourse.julialang.org/u/wsphillips)\
**Replies:** 6\
**Last updated:** [August 13, 2019, 5:20pm UTC](https://discourse.julialang.org/t/discussion-spir-v-analog-to-cudanative/27427 "2019-08-13T17:20:13Z")

</div>

Almost certainly this has been thought of, but surprisingly I haven’t been able to find any mention of it on discourse and not really any repos…(although I noticed VulkanCore is perhaps waking up :smiley: ) Has there be…

---

## [Convex.jl: Trouble with partially specified function inside another problem?](https://discourse.julialang.org/t/convex-jl-trouble-with-partially-specified-function-inside-another-problem/26508)

<div class="topic-metadata">

**Author:** [@Jacob\_Stevens-Haas](https://discourse.julialang.org/u/Jacob_Stevens-Haas)\
**Replies:** 5\
**Last updated:** [August 13, 2019, 4:13pm UTC](https://discourse.julialang.org/t/convex-jl-trouble-with-partially-specified-function-inside-another-problem/26508 "2019-08-13T16:13:45Z")

</div>

I’m trying to use a partially defined function as in DCP documentation. I have a minimization problem including convex function that isn’t a disciplined convex function. It’s fenchel conjugate is, however, so I was hop…

---

## [Human-readable externalization for multi-dimensional arrays](https://discourse.julialang.org/t/human-readable-externalization-for-multi-dimensional-arrays/27214)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 23\
**Last updated:** [August 13, 2019, 3:53pm UTC](https://discourse.julialang.org/t/human-readable-externalization-for-multi-dimensional-arrays/27214 "2019-08-13T15:53:05Z")

</div>

Is there an externalization format that is more or less human-readable in a pinch (eg like JSON), but supports multi-dimensional arrays (eg like HDF5), and has a package for Julia?

---

## [Running External Program - getting the programs results not just the stdout](https://discourse.julialang.org/t/running-external-program-getting-the-programs-results-not-just-the-stdout/27499)

<div class="topic-metadata">

**Author:** [@timmm](https://discourse.julialang.org/u/timmm)\
**Replies:** 4\
**Last updated:** [August 13, 2019, 3:28pm UTC](https://discourse.julialang.org/t/running-external-program-getting-the-programs-results-not-just-the-stdout/27499 "2019-08-13T15:28:16Z")

</div>

Hi, I have managed to confuse myself but I am sure there is a simple answer. I have a c++ script I can call this in the terminal with: ./script $InputFile \> $OutputFilePathAndName With the terminal printing the stdou…

---

## [How to add Integer contraint to variables using the @variables macro?](https://discourse.julialang.org/t/how-to-add-integer-contraint-to-variables-using-the-variables-macro/27500)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 1\
**Last updated:** [August 13, 2019, 3:02pm UTC](https://discourse.julialang.org/t/how-to-add-integer-contraint-to-variables-using-the-variables-macro/27500 "2019-08-13T15:02:49Z")

</div>

To bound a variable to be integer I can use integer=true, e.g. @variable(m, 0 \<= p, integer=true, start=1), but how to do that when I use the @variables macro? I did try as such, but it is not recognised (also base\_name …

---

## [What is a good design pattern for developing parallel types, one designed for safety and the other for performance?](https://discourse.julialang.org/t/what-is-a-good-design-pattern-for-developing-parallel-types-one-designed-for-safety-and-the-other-for-performance/27464)

<div class="topic-metadata">

**Author:** [@philip](https://discourse.julialang.org/u/philip)\
**Replies:** 14\
**Last updated:** [August 13, 2019, 1:46pm UTC](https://discourse.julialang.org/t/what-is-a-good-design-pattern-for-developing-parallel-types-one-designed-for-safety-and-the-other-for-performance/27464 "2019-08-13T13:46:07Z")

</div>

Let’s say I plan to do something a billion times, like simulate draws from a probability distribution. I want to ensure that my code is correct by writing a bunch of checks into the type constructor. E.g. julia\> struct…

---

## [Is the design of lpad wrong?](https://discourse.julialang.org/t/is-the-design-of-lpad-wrong/27494)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 4\
**Last updated:** [August 13, 2019, 12:40pm UTC](https://discourse.julialang.org/t/is-the-design-of-lpad-wrong/27494 "2019-08-13T12:40:23Z")

</div>

I debugged today the columns no aligning OK on displaying a table, and found that the problem boiled down to the behaviour of lpad. Say I am using lpad to pad the titles of columns to width 5. Now consider julia\> s=“Ã…

---

## [\`consttype\` keyword](https://discourse.julialang.org/t/consttype-keyword/27497)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 2\
**Last updated:** [August 13, 2019, 12:33pm UTC](https://discourse.julialang.org/t/consttype-keyword/27497 "2019-08-13T12:33:35Z")

</div>

Has this ever been proposed? What about adding a consttype keyword, that forces a value to have a certain type: julia\> consttype x = 3 3 julia\> x = 1.5 Error: x must be of type Int # alternatively convert as in array …

[Previous page](https://discourse.julialang.org/latest.md?page=1940)

[Next page](https://discourse.julialang.org/latest.md?page=1942)
