# General Usage

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

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

**Page:** 1011

---

## [Runtime Currying / Runtime Partial Functions](https://discourse.julialang.org/t/runtime-currying-runtime-partial-functions/7555)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 1\
**Last updated:** [December 6, 2017, 7:11am UTC](https://discourse.julialang.org/t/runtime-currying-runtime-partial-functions/7555 "2017-12-06T07:11:10Z")

</div>

Hi, Is there a package or some construct in Julia, which provides partial functions? Thanks

---

## [Declare multiple variables type like C++](https://discourse.julialang.org/t/declare-multiple-variables-type-like-c/7551)

<div class="topic-metadata">

**Author:** [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Replies:** 10\
**Last updated:** [December 6, 2017, 5:44am UTC](https://discourse.julialang.org/t/declare-multiple-variables-type-like-c/7551 "2017-12-06T05:44:17Z")

</div>

In C++, I can declare my variables in one line like: int x, y, z; In Julia, it seems that I have to declare their types one by one, x :: Int64 y :: Int64 z :: Int64 Can I do this at once?

---

## [Eigenvalues of matrices with rational entries](https://discourse.julialang.org/t/eigenvalues-of-matrices-with-rational-entries/7550)

<div class="topic-metadata">

**Author:** [@harven](https://discourse.julialang.org/u/harven)\
**Replies:** 1\
**Last updated:** [December 6, 2017, 3:21am UTC](https://discourse.julialang.org/t/eigenvalues-of-matrices-with-rational-entries/7550 "2017-12-06T03:21:00Z")

</div>

When I compute the eigenvalues of an Array{Rational{Int64},2}, I get Float32 values. julia\> eigvals(\[1//2 1//4 1//4 1//2 0 1//2 1//4 1//4 1//2\]) 3-element Array{…

---

## [Package causing DataFrames downgrade?](https://discourse.julialang.org/t/package-causing-dataframes-downgrade/7541)

<div class="topic-metadata">

**Author:** [@sam81](https://discourse.julialang.org/u/sam81)\
**Replies:** 7\
**Last updated:** [December 5, 2017, 8:26pm UTC](https://discourse.julialang.org/t/package-causing-dataframes-downgrade/7541 "2017-12-05T20:26:13Z")

</div>

Installing PlotlyJS currently downgrades DataFrames from v0.11.1 to v0.10.1. The two packages (v0.11.1 of DataFrames, and the latest PlotlyJS version available yesterday, which I think was v0.7.1 as it is still today) we…

---

## [Calculate precision](https://discourse.julialang.org/t/calculate-precision/7484)

<div class="topic-metadata">

**Author:** [@Diger](https://discourse.julialang.org/u/Diger)\
**Replies:** 16\
**Last updated:** [December 5, 2017, 6:30pm UTC](https://discourse.julialang.org/t/calculate-precision/7484 "2017-12-05T18:30:03Z")

</div>

say I want a number x up to 10^6 decimal precision using BigFloat. What is the value I need to specify in setprecision() ?? How do I calculate it?

---

## [Calculating cos(0.9528) in BigFloat](https://discourse.julialang.org/t/calculating-cos-0-9528-in-bigfloat/7489)

<div class="topic-metadata">

**Author:** [@Diger](https://discourse.julialang.org/u/Diger)\
**Replies:** 20\
**Last updated:** [December 5, 2017, 5:54pm UTC](https://discourse.julialang.org/t/calculating-cos-0-9528-in-bigfloat/7489 "2017-12-05T17:54:08Z")

</div>

So I (incited by some others) calculated the following setprecision(15\*10^5) x=big(9528)/10000; y=cos(x); ys=string(y); ys\[306890:306931\] "459423813195289597370437889596885962619893..." Now this is somehow wrong…The co…

---

## [Why does output/warnings come sliced into many lines?](https://discourse.julialang.org/t/why-does-output-warnings-come-sliced-into-many-lines/7540)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 1\
**Last updated:** [December 5, 2017, 4:59pm UTC](https://discourse.julialang.org/t/why-does-output-warnings-come-sliced-into-many-lines/7540 "2017-12-05T16:59:13Z")

</div>

Recently, I see more and more of this behaviour in Juno/Atom: Does anybody know what is causing this problem?

---

## [Types, constructors, and docstrings](https://discourse.julialang.org/t/types-constructors-and-docstrings/7529)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 0\
**Last updated:** [December 5, 2017, 1:14pm UTC](https://discourse.julialang.org/t/types-constructors-and-docstrings/7529 "2017-12-05T13:14:35Z")

</div>

If I have a type with a convenience constructor struct Foo x y end Foo(x) = Foo(x, x+1) should I document the type, the constructor(s), or both? If I document both, I am not sure cross-references \[\`Foo\`\](@r…

---

## [trace(A'\*A)](https://discourse.julialang.org/t/trace-a-a/7508)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 6\
**Last updated:** [December 5, 2017, 6:55am UTC](https://discourse.julialang.org/t/trace-a-a/7508 "2017-12-05T06:55:48Z")

</div>

Given a (dense) matrix A, what would be a fast, idiomatic way of calculating \\text{tr}(A'A)? I can solve it as A = Float64.(reshape(1:20, :, 2)) trace(A\*A') # = 2870, but obviously wasteful sum(i -\> …

---

## [How to know where a specific function is called without resorting to debugger?](https://discourse.julialang.org/t/how-to-know-where-a-specific-function-is-called-without-resorting-to-debugger/7513)

<div class="topic-metadata">

**Author:** [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Replies:** 7\
**Last updated:** [December 5, 2017, 5:35am UTC](https://discourse.julialang.org/t/how-to-know-where-a-specific-function-is-called-without-resorting-to-debugger/7513 "2017-12-05T05:35:54Z")

</div>

I’m going through a large julia package where I’m particularly interested in how the computing is done in one specific function (I’m certain that this function is called, as I added a print line therein so that if the fu…

---

## [Segfault on BLAS operation with incorrect character input](https://discourse.julialang.org/t/segfault-on-blas-operation-with-incorrect-character-input/7515)

<div class="topic-metadata">

**Author:** [@colintbowers](https://discourse.julialang.org/u/colintbowers)\
**Replies:** 4\
**Last updated:** [December 5, 2017, 4:12am UTC](https://discourse.julialang.org/t/segfault-on-blas-operation-with-incorrect-character-input/7515 "2017-12-05T04:12:29Z")

</div>

Hi all, I’m getting the following segfault by directly calling a BLAS routine, but using the wrong character to indicate the type of operation. I’m on julia v0.6, but don’t have a v0.7 install on which to test this. Sho…

---

## [Horner rule](https://discourse.julialang.org/t/horner-rule/7504)

<div class="topic-metadata">

**Author:** [@Diger](https://discourse.julialang.org/u/Diger)\
**Replies:** 46\
**Last updated:** [December 5, 2017, 2:43am UTC](https://discourse.julialang.org/t/horner-rule/7504 "2017-12-05T02:43:26Z")

</div>

macro horner(x, p...) ex = p\[end\] for i = length(p)-1:-1:1 ex = :($(p\[i\]) + $x \* $ex) end ex end I was looking at this https://github.com/JuliaLang/julia/pull/2987/commits/9c24795ac2918df7…

---

## [Allocation - groupby](https://discourse.julialang.org/t/allocation-groupby/7505)

<div class="topic-metadata">

**Author:** [@rojo](https://discourse.julialang.org/u/rojo)\
**Replies:** 5\
**Last updated:** [December 5, 2017, 12:11am UTC](https://discourse.julialang.org/t/allocation-groupby/7505 "2017-12-05T00:11:42Z")

</div>

I’m attempting to create a function groupby(f, itr) that returns a dictionary whose keys are the results of applying f to the elements of itr, and the values are some collection of the elements themselves. Similar to Mat…

---

## [Unregistered packages with name equal to registered packages](https://discourse.julialang.org/t/unregistered-packages-with-name-equal-to-registered-packages/7510)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 2\
**Last updated:** [December 4, 2017, 11:01pm UTC](https://discourse.julialang.org/t/unregistered-packages-with-name-equal-to-registered-packages/7510 "2017-12-04T23:01:09Z")

</div>

Hi guys! Since 2014 I create a package called Rotations.jl(https://github.com/ronisbr/Rotations.jl) that has the solely purpose to provide a MATLAB-like interface for 3D rotations and coordinate transformations. I never…

---

## [Personalized Recommender System packages](https://discourse.julialang.org/t/personalized-recommender-system-packages/7497)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 13\
**Last updated:** [December 4, 2017, 8:41pm UTC](https://discourse.julialang.org/t/personalized-recommender-system-packages/7497 "2017-12-04T20:41:35Z")

</div>

Wondering if anybody has recently developed a personalized recommender system with Julia? What relevant packages, approach, tips, etc came up? I found https://github.com/takuti/Recommendation.jl and https://github.com/a…

---

## [Unexpected behavior while creating an array of arrays](https://discourse.julialang.org/t/unexpected-behavior-while-creating-an-array-of-arrays/7503)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 8\
**Last updated:** [December 4, 2017, 7:20pm UTC](https://discourse.julialang.org/t/unexpected-behavior-while-creating-an-array-of-arrays/7503 "2017-12-04T19:20:52Z")

</div>

Below I have a simplified example of a function that creates an array of arrays in a loop. A while back code similar to this tripped me up because I was unwittingly creating references in each component array. However,…

---

## [Using @inbounds](https://discourse.julialang.org/t/using-inbounds/7499)

<div class="topic-metadata">

**Author:** [@drjoke](https://discourse.julialang.org/u/drjoke)\
**Replies:** 1\
**Last updated:** [December 4, 2017, 4:34pm UTC](https://discourse.julialang.org/t/using-inbounds/7499 "2017-12-04T16:34:43Z")

</div>

@inbounds for j = 1:networks\_hidden\_layer\_size\[1\] hidden\_sums\[j, 1, s, y, n\] = 0 for i = 1:networks\_input\_count\[1\] hidden\_sums\[j, 1, s, y, n\] += networks\_in…

---

## [View into HDF5 dataset](https://discourse.julialang.org/t/view-into-hdf5-dataset/7495)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 1\
**Last updated:** [December 4, 2017, 4:10pm UTC](https://discourse.julialang.org/t/view-into-hdf5-dataset/7495 "2017-12-04T16:10:59Z")

</div>

Is it possible, for writing, to get a “view” into part of a HDF5 dataset containing an array of some dimension? I have a HDF5 file with some dataset, let’s say, data, where data is an array of some dimension. I want to …

---

## [A generator with two "for" keywords is slow](https://discourse.julialang.org/t/a-generator-with-two-for-keywords-is-slow/7407)

<div class="topic-metadata">

**Author:** [@Jan\_Dolinsky](https://discourse.julialang.org/u/Jan_Dolinsky)\
**Replies:** 14\
**Last updated:** [December 4, 2017, 3:53pm UTC](https://discourse.julialang.org/t/a-generator-with-two-for-keywords-is-slow/7407 "2017-12-04T15:53:07Z")

</div>

Hello, I create a vector of vectors as follows. v = map(rand, fill(10^4, 5)); I want to compute a mean of all the elements in all 5 vectors, i.e. flattening the “v”. I approached this in the following three different …

---

## [Conversion/rounding from Float64 to Int64](https://discourse.julialang.org/t/conversion-rounding-from-float64-to-int64/7496)

<div class="topic-metadata">

**Author:** [@sdwfrost](https://discourse.julialang.org/u/sdwfrost)\
**Replies:** 1\
**Last updated:** [December 4, 2017, 2:32pm UTC](https://discourse.julialang.org/t/conversion-rounding-from-float64-to-int64/7496 "2017-12-04T14:32:50Z")

</div>

I have some C++ code as follows: const double fm = n\*p + p; const int64\_t m = (int64\_t) fm; n is int64\_t and p is double. How can I replicate what this code does in Julia, as the following (rightly) throws an InexactEr…

---

## [Empty space generated under Sliders in Interact](https://discourse.julialang.org/t/empty-space-generated-under-sliders-in-interact/7440)

<div class="topic-metadata">

**Author:** [@rand5](https://discourse.julialang.org/u/rand5)\
**Replies:** 0\
**Last updated:** [December 1, 2017, 3:39pm UTC](https://discourse.julialang.org/t/empty-space-generated-under-sliders-in-interact/7440 "2017-12-01T15:39:04Z")

</div>

I’ve noticed that a lot of unnecessary white space is generated under sliders when using a flexible layout. Any idea how to get rid of this? Here is a MWE showing the issue: using Interact S1 = slider(1:1:10) T = repma…

---

## [Type inference through an if statement on a type parameter](https://discourse.julialang.org/t/type-inference-through-an-if-statement-on-a-type-parameter/7488)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 2\
**Last updated:** [December 4, 2017, 2:35am UTC](https://discourse.julialang.org/t/type-inference-through-an-if-statement-on-a-type-parameter/7488 "2017-12-04T02:35:12Z")

</div>

I am trying to make a function that specializes on the type parameter and Julia seems unable to concretely infer the types. Here is a MWE: function h(a::NTuple{dim,Int}) where {dim} b = dim == 2 ? 2. : "a" …

---

## [Isbits object lifetimes on 0.7](https://discourse.julialang.org/t/isbits-object-lifetimes-on-0-7/7482)

<div class="topic-metadata">

**Author:** [@miles.lubin](https://discourse.julialang.org/u/miles.lubin)\
**Replies:** 4\
**Last updated:** [December 4, 2017, 1:27am UTC](https://discourse.julialang.org/t/isbits-object-lifetimes-on-0-7/7482 "2017-12-04T01:27:10Z")

</div>

I’ve been chasing down a segfault in SCS.jl on 0.7 (0.7.0-DEV.2725), and I believe I’ve narrowed it down to the following issue: # Not standalone code struct A val::Float64 ... # lots of plain data fields (isbits(A) == …

---

## [Domains/Statistics not working](https://discourse.julialang.org/t/domains-statistics-not-working/7483)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 2\
**Last updated:** [December 4, 2017, 12:49am UTC](https://discourse.julialang.org/t/domains-statistics-not-working/7483 "2017-12-04T00:49:11Z")

</div>

pulls up a 500 error (and so does every post in that subcategory). edit: example includes Http://juliastats.org domain seems to have expired? this is the first subcategory in the list (on the front page), so it seem…

---

## [Stop in code](https://discourse.julialang.org/t/stop-in-code/7479)

<div class="topic-metadata">

**Author:** [@Diger](https://discourse.julialang.org/u/Diger)\
**Replies:** 5\
**Last updated:** [December 3, 2017, 10:59pm UTC](https://discourse.julialang.org/t/stop-in-code/7479 "2017-12-03T22:59:50Z")

</div>

Will there be functionality in 1.0 to stop in your code with some command and not continue further to execute it?

---

## [big float variable (visibility)](https://discourse.julialang.org/t/big-float-variable-visibility/7423)

<div class="topic-metadata">

**Author:** [@Diger](https://discourse.julialang.org/u/Diger)\
**Replies:** 14\
**Last updated:** [December 3, 2017, 7:22pm UTC](https://discourse.julialang.org/t/big-float-variable-visibility/7423 "2017-12-03T19:22:36Z")

</div>

first of all how do I generate a random bigfloat variable? rand() is not bigfloat. second: If I have a bigfloat with 10^7 digits, can I suppress most digits and only show say the first 10 or 20 ?

---

## [Broadcasting and arrays of arrays](https://discourse.julialang.org/t/broadcasting-and-arrays-of-arrays/7444)

<div class="topic-metadata">

**Author:** [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Replies:** 8\
**Last updated:** [December 3, 2017, 3:31pm UTC](https://discourse.julialang.org/t/broadcasting-and-arrays-of-arrays/7444 "2017-12-03T15:31:24Z")

</div>

I was hoping that this would work for centering some data that is e.g. Array{SVector} d = \[rand(2) for i=1:10\] d - mean(d) or even the broadcasting version d .- mean(d) But they don’t work. I understand why they don’…

---

## [Push!, and interfacing to the runtime library](https://discourse.julialang.org/t/push-and-interfacing-to-the-runtime-library/7461)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 2\
**Last updated:** [December 3, 2017, 3:02pm UTC](https://discourse.julialang.org/t/push-and-interfacing-to-the-runtime-library/7461 "2017-12-03T15:02:06Z")

</div>

When looking over my code\_native, I recently saw that every push! costs me a call into the runtime library. This appears…excessive, at least for the standard case where the push can be accommodated without copying. So, …

---

## [Juno and using LD\_PRELOAD](https://discourse.julialang.org/t/juno-and-using-ld-preload/6658)

<div class="topic-metadata">

**Author:** [@njwalker](https://discourse.julialang.org/u/njwalker)\
**Replies:** 7\
**Last updated:** [December 3, 2017, 12:06pm UTC](https://discourse.julialang.org/t/juno-and-using-ld-preload/6658 "2017-12-03T12:06:51Z")

</div>

Does anyone know how I could use the LD\_PRELOAD trick (see here https://github.com/JuliaPy/PyPlot.jl/issues/151) so as to get Julia working properly with several Python based libraries (e.g. PyPlot, Pandas) in Juno. Trie…

---

## [segfault in Libdl.dlpath("libjulia")](https://discourse.julialang.org/t/segfault-in-libdl-dlpath-libjulia/7455)

<div class="topic-metadata">

**Author:** [@vhd](https://discourse.julialang.org/u/vhd)\
**Replies:** 16\
**Last updated:** [December 3, 2017, 8:11am UTC](https://discourse.julialang.org/t/segfault-in-libdl-dlpath-libjulia/7455 "2017-12-03T08:11:03Z")

</div>

julia\> Libdl.dlpath("libjulia") Two passes with the same argument (-LowerSIMDLoop) attempted to be registered! signal (11): Segmentation fault while loading no file, in expression starting on line 0 unknown function (ip…

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

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