# General Usage

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

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

**Page:** 887

---

## [Question about @inline](https://discourse.julialang.org/t/question-about-inline/21717)

<div class="topic-metadata">

**Author:** [@vitreo12](https://discourse.julialang.org/u/vitreo12)\
**Replies:** 0\
**Last updated:** [March 10, 2019, 9:37pm UTC](https://discourse.julialang.org/t/question-about-inline/21717 "2019-03-10T21:37:02Z")

</div>

Hello everyone, I have a question regarding @inline: Does it propagate on all function calls inside the function that is being inlined? For example: function compute\_something(a::Float64) #= Some calculation and, pe…

---

## [Checking number in String](https://discourse.julialang.org/t/checking-number-in-string/21714)

<div class="topic-metadata">

**Author:** [@yash](https://discourse.julialang.org/u/yash)\
**Replies:** 1\
**Last updated:** [March 10, 2019, 8:26pm UTC](https://discourse.julialang.org/t/checking-number-in-string/21714 "2019-03-10T20:26:30Z")

</div>

How to know if the string is number of not? example: str = “1234” This string is numeric.

---

## [Empty variable check](https://discourse.julialang.org/t/empty-variable-check/21711)

<div class="topic-metadata">

**Author:** [@yash](https://discourse.julialang.org/u/yash)\
**Replies:** 3\
**Last updated:** [March 10, 2019, 7:09pm UTC](https://discourse.julialang.org/t/empty-variable-check/21711 "2019-03-10T19:09:54Z")

</div>

How can i check whether a variable contains some value or not in julia ?

---

## [Julia best practices when it comes to file handling and string/symbol usage. Please provide a code review of the following:](https://discourse.julialang.org/t/julia-best-practices-when-it-comes-to-file-handling-and-string-symbol-usage-please-provide-a-code-review-of-the-following/21630)

<div class="topic-metadata">

**Author:** [@dnk8n](https://discourse.julialang.org/u/dnk8n)\
**Replies:** 10\
**Last updated:** [March 10, 2019, 5:04pm UTC](https://discourse.julialang.org/t/julia-best-practices-when-it-comes-to-file-handling-and-string-symbol-usage-please-provide-a-code-review-of-the-following/21630 "2019-03-10T17:04:47Z")

</div>

Is this the right place to ask for a quick code review from anyone with their expertise to offer? This is a simplified version of my code. I am reading a few files and their contents are streamed to multiple other file…

---

## [CPLEX.jl console output](https://discourse.julialang.org/t/cplex-jl-console-output/21704)

<div class="topic-metadata">

**Author:** [@Di11on](https://discourse.julialang.org/u/Di11on)\
**Replies:** 2\
**Last updated:** [March 10, 2019, 4:57pm UTC](https://discourse.julialang.org/t/cplex-jl-console-output/21704 "2019-03-10T16:57:15Z")

</div>

Hi folks, I’m using CPLEX with CPLEX.jl. I’m getting my model to solve and can retrieve the solution but I’m not getting any solver console output at all. Using Clp, I do see solver progress and solution status messages…

---

## [Iterate over hdf5 names()](https://discourse.julialang.org/t/iterate-over-hdf5-names/21706)

<div class="topic-metadata">

**Author:** [@davidavdav](https://discourse.julialang.org/u/davidavdav)\
**Replies:** 1\
**Last updated:** [March 10, 2019, 4:38pm UTC](https://discourse.julialang.org/t/iterate-over-hdf5-names/21706 "2019-03-10T16:38:49Z")

</div>

Hello, I’ve got a large, flat HDF5 file, and I’d like to iterate over the objects with a name matching r".\*-y". It seems I can iterate objects over fd = HFD5.h5open(filename) using for obj in fd ## use obj end but…

---

## [Partition a large CSV file into smaller files without loading into memory](https://discourse.julialang.org/t/partition-a-large-csv-file-into-smaller-files-without-loading-into-memory/21673)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 6\
**Last updated:** [March 10, 2019, 12:26pm UTC](https://discourse.julialang.org/t/partition-a-large-csv-file-into-smaller-files-without-loading-into-memory/21673 "2019-03-10T12:26:14Z")

</div>

I want to split (partition) a large csv file into separate smaller csv files based on the value of a particular column. I also want to do this row by row, without loading the entire file into memory. My current solutio…

---

## [How to delete method for call functions?](https://discourse.julialang.org/t/how-to-delete-method-for-call-functions/21697)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 3\
**Last updated:** [March 10, 2019, 9:39am UTC](https://discourse.julialang.org/t/how-to-delete-method-for-call-functions/21697 "2019-03-10T09:39:59Z")

</div>

Lets define call syntax for Int (i::Int)(n::Number) = i\*n 3(4) # 12 now I can list the methods by using Int.name.mt which will output # 1 method for generic function "(::Int64)": \[1\] (i::Int64)(n::Number) in Main at …

---

## [Can't connect Julia to Jupyter Notebook](https://discourse.julialang.org/t/cant-connect-julia-to-jupyter-notebook/21691)

<div class="topic-metadata">

**Author:** [@Theqbat](https://discourse.julialang.org/u/Theqbat)\
**Replies:** 3\
**Last updated:** [March 10, 2019, 7:47am UTC](https://discourse.julialang.org/t/cant-connect-julia-to-jupyter-notebook/21691 "2019-03-10T07:47:17Z")

</div>

Hello, I’ve posted this to github, but I was directed to this place. Wasn’t sure about where to post it exactly so I hope Usage is fine. I’m having issues with connecting Julia to Jupyter Notebook. I’ve been following t…

---

## [Is there a similar facility like numpy.ma.array of python in Julia?](https://discourse.julialang.org/t/is-there-a-similar-facility-like-numpy-ma-array-of-python-in-julia/21682)

<div class="topic-metadata">

**Author:** [@Gu\_Junhua](https://discourse.julialang.org/u/Gu_Junhua)\
**Replies:** 1\
**Last updated:** [March 9, 2019, 5:07pm UTC](https://discourse.julialang.org/t/is-there-a-similar-facility-like-numpy-ma-array-of-python-in-julia/21682 "2019-03-09T17:07:52Z")

</div>

I guess I can use Array{Option{Missing, Int}, 1} to emulate an array with mask?

---

## [Pandas to DataFrame conversion with nested arrays takes very long](https://discourse.julialang.org/t/pandas-to-dataframe-conversion-with-nested-arrays-takes-very-long/21671)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 0\
**Last updated:** [March 9, 2019, 11:35am UTC](https://discourse.julialang.org/t/pandas-to-dataframe-conversion-with-nested-arrays-takes-very-long/21671 "2019-03-09T11:35:14Z")

</div>

I wanted to work on the analysis of experimental data that I gathered with a python program. The data is saved in a pickled Pandas dataframe. Each row is a trial and there are about 20,000 of those. There are about 40 co…

---

## [@inbounds code slower than one without](https://discourse.julialang.org/t/inbounds-code-slower-than-one-without/21550)

<div class="topic-metadata">

**Author:** [@vitreo12](https://discourse.julialang.org/u/vitreo12)\
**Replies:** 17\
**Last updated:** [March 9, 2019, 11:23am UTC](https://discourse.julialang.org/t/inbounds-code-slower-than-one-without/21550 "2019-03-09T11:23:29Z")

</div>

Hello everyone, I was just noticing that this simple code with @inbounds is slower than the one without: using BenchmarkTools iterations = 10^7 simple\_vec = zeros(Float64, iterations) function test1(v::Vector{Float64…

---

## [Julia silently stop working while computing the rank of some not that big matrix](https://discourse.julialang.org/t/julia-silently-stop-working-while-computing-the-rank-of-some-not-that-big-matrix/21463)

<div class="topic-metadata">

**Author:** [@Adrien](https://discourse.julialang.org/u/Adrien)\
**Replies:** 9\
**Last updated:** [March 9, 2019, 10:29am UTC](https://discourse.julialang.org/t/julia-silently-stop-working-while-computing-the-rank-of-some-not-that-big-matrix/21463 "2019-03-09T10:29:23Z")

</div>

I wrote a custom function computing the rank of some matrices (I need an exact computation, and the entries are mod p integers for some small prime p which is why I’m not using the built-in rank function). This is nothin…

---

## [JuMP nonlinear constraints for different optimisation variables](https://discourse.julialang.org/t/jump-nonlinear-constraints-for-different-optimisation-variables/21658)

<div class="topic-metadata">

**Author:** [@ferrolho](https://discourse.julialang.org/u/ferrolho)\
**Replies:** 0\
**Last updated:** [March 9, 2019, 2:43am UTC](https://discourse.julialang.org/t/jump-nonlinear-constraints-for-different-optimisation-variables/21658 "2019-03-09T02:43:45Z")

</div>

I would like to define multiple nonlinear constraints in JuMP, where each constraint is applied to a subset of the total optimisation variables. For my concrete use-case, I am trying to constraint a robot motion plan: my…

---

## [Calling C++ library (CGAL) from Julia](https://discourse.julialang.org/t/calling-c-library-cgal-from-julia/21629)

<div class="topic-metadata">

**Author:** [@timmm](https://discourse.julialang.org/u/timmm)\
**Replies:** 7\
**Last updated:** [March 8, 2019, 10:21pm UTC](https://discourse.julialang.org/t/calling-c-library-cgal-from-julia/21629 "2019-03-08T22:21:58Z")

</div>

Hi, What would be the best route for me to call the C++ library CGAL (https://www.cgal.org/) from Julia? Does anyone have experience calling this specific library? I know there are a few different packages to call C++ f…

---

## [Error: Python GUI toolkit for qt5 is not installed](https://discourse.julialang.org/t/error-python-gui-toolkit-for-qt5-is-not-installed/21636)

<div class="topic-metadata">

**Author:** [@boutor2](https://discourse.julialang.org/u/boutor2)\
**Replies:** 0\
**Last updated:** [March 8, 2019, 3:25pm UTC](https://discourse.julialang.org/t/error-python-gui-toolkit-for-qt5-is-not-installed/21636 "2019-03-08T15:25:17Z")

</div>

Hi, I have a problem with PyCall. I want to use Qt5 backend (in Juno). I thus change the default backend (tk) doing: using PyCall pygui(:qt5) And I get the following message: “Python GUI toolkit for qt5 is not install…

---

## [How to sort two or more lists at once?](https://discourse.julialang.org/t/how-to-sort-two-or-more-lists-at-once/12073)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 12\
**Last updated:** [March 8, 2019, 10:43am UTC](https://discourse.julialang.org/t/how-to-sort-two-or-more-lists-at-once/12073 "2019-03-08T10:43:44Z")

</div>

Let’s say you have: cur\_x = shuffle(1:10) cur\_y = rand(10) And you want to sort cur\_x in the usual fashion, but drag cur\_y along for the ride. How do you – in one line – zip(cur\_x, cur\_y) and sort! by cur\_x? // so in…

---

## [Is there a way to unpack like a,\*rest=\[1,2,3,4\] in python?](https://discourse.julialang.org/t/is-there-a-way-to-unpack-like-a-rest-1-2-3-4-in-python/21572)

<div class="topic-metadata">

**Author:** [@Gu\_Junhua](https://discourse.julialang.org/u/Gu_Junhua)\
**Replies:** 4\
**Last updated:** [March 8, 2019, 11:50am UTC](https://discourse.julialang.org/t/is-there-a-way-to-unpack-like-a-rest-1-2-3-4-in-python/21572 "2019-03-08T11:50:35Z")

</div>

Hi, I’m trying to migrate a python program to Julia, I find array unpacking very convenient. I wonder is there something similar in Julia? In python we can write a=\[1,2,3,4,5\] b,\*p=a then b=1 and p=\[2,3,4,5\] and simi…

---

## [Subtyping NamedTuple](https://discourse.julialang.org/t/subtyping-namedtuple/21585)

<div class="topic-metadata">

**Author:** [@Pier](https://discourse.julialang.org/u/Pier)\
**Replies:** 5\
**Last updated:** [March 8, 2019, 10:16am UTC](https://discourse.julialang.org/t/subtyping-namedtuple/21585 "2019-03-08T10:16:49Z")

</div>

Is it possible to subtype NamedTuple? I unsuccessfully tried a million variations of “struct MyNamedTuple \<: NamedTuple{}(); end”

---

## [Memory allocation tracking](https://discourse.julialang.org/t/memory-allocation-tracking/21597)

<div class="topic-metadata">

**Author:** [@Suraj\_Pawar](https://discourse.julialang.org/u/Suraj_Pawar)\
**Replies:** 3\
**Last updated:** [March 8, 2019, 10:16am UTC](https://discourse.julialang.org/t/memory-allocation-tracking/21597 "2019-03-08T10:16:46Z")

</div>

I used --track-allocation to see the memory allocated to the code and I got below results for one of the function. I am just allocating a value from an array to the variable and it shows a large number as the memory allo…

---

## [Best way to create a struct with a variable data contents](https://discourse.julialang.org/t/best-way-to-create-a-struct-with-a-variable-data-contents/21580)

<div class="topic-metadata">

**Author:** [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Replies:** 7\
**Last updated:** [March 8, 2019, 8:53am UTC](https://discourse.julialang.org/t/best-way-to-create-a-struct-with-a-variable-data-contents/21580 "2019-03-08T08:53:36Z")

</div>

Hello everyone, I’m trying to create a mini materials database. In this database, I would have materials which can have a varying number of properties: optical, electrical, thermal … Each material can have only one of …

---

## [Dot-assignment ... what is going on here?](https://discourse.julialang.org/t/dot-assignment-what-is-going-on-here/2579)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 16\
**Last updated:** [March 8, 2019, 7:26am UTC](https://discourse.julialang.org/t/dot-assignment-what-is-going-on-here/2579 "2019-03-08T07:26:00Z")

</div>

Run the following example: x = zeros(2) y = zeros(3) \[x;y\] .= \[1.2, 4.5, 2.3, 4.5, 5.6\] Surprisingly (for me at least), x,y are still zero after this. Why? I am using v0.5.0.

---

## [Fastest way to unpack bigendian Int24?](https://discourse.julialang.org/t/fastest-way-to-unpack-bigendian-int24/21514)

<div class="topic-metadata">

**Author:** [@joshua\_jones](https://discourse.julialang.org/u/joshua_jones)\
**Replies:** 16\
**Last updated:** [March 8, 2019, 1:24am UTC](https://discourse.julialang.org/t/fastest-way-to-unpack-bigendian-int24/21514 "2019-03-08T01:24:36Z")

</div>

What’s the fastest way to unpack a vector of bigendian 24-bit signed integers stored in a binary file? Suppose the number of Int24s that I need to read is known.

---

## [Julia basic GPU usage](https://discourse.julialang.org/t/julia-basic-gpu-usage/21605)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 1\
**Last updated:** [March 7, 2019, 11:57pm UTC](https://discourse.julialang.org/t/julia-basic-gpu-usage/21605 "2019-03-07T23:57:08Z")

</div>

I am looking for some tutorials or a curated list of Julia code running on GPU. I have access to a cluster which has two K80s installed, and would like to use Julia to solve some problems. However, my knowledge of using…

---

## [Travis Julia Documentation error](https://discourse.julialang.org/t/travis-julia-documentation-error/21607)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 0\
**Last updated:** [March 7, 2019, 9:59pm UTC](https://discourse.julialang.org/t/travis-julia-documentation-error/21607 "2019-03-07T21:59:00Z")

</div>

Does anyone has an idea what happens here: ERROR: failed to fetch from /home/travis/build/lanl-ansi/Juniper.jl, error: GitError(Code:ENOTFOUND, Class:Odb, object not found - no match for id (1b5ad74cd12ea626667c007337d…

---

## [Profiling flame graph](https://discourse.julialang.org/t/profiling-flame-graph/21593)

<div class="topic-metadata">

**Author:** [@Suraj\_Pawar](https://discourse.julialang.org/u/Suraj_Pawar)\
**Replies:** 1\
**Last updated:** [March 7, 2019, 7:13pm UTC](https://discourse.julialang.org/t/profiling-flame-graph/21593 "2019-03-07T19:13:16Z")

</div>

I am using profiling to check the performance of my code. When I view the profiling flame graph, the bar chart is not shown properly. The bars are very thin and are at the extreme right. Is there an option to change the …

---

## [Setting up multiple chains in Turing.jl](https://discourse.julialang.org/t/setting-up-multiple-chains-in-turing-jl/20806)

<div class="topic-metadata">

**Author:** [@mkarikom](https://discourse.julialang.org/u/mkarikom)\
**Replies:** 23\
**Last updated:** [March 7, 2019, 5:02pm UTC](https://discourse.julialang.org/t/setting-up-multiple-chains-in-turing-jl/20806 "2019-03-07T17:02:55Z")

</div>

I’ve run a couple Metropolis chains and produced a Chains object for convergence diagnosis, but I’m pretty sure there is a better way to do this: fit1 = sample(SBM(Y = Y, Pi = π₀, B = B₀),MH(1000,)) fit2 = sample(SBM(Y…

---

## [Resulting type from multiplication of a sparse and full matrix](https://discourse.julialang.org/t/resulting-type-from-multiplication-of-a-sparse-and-full-matrix/21584)

<div class="topic-metadata">

**Author:** [@dalekj](https://discourse.julialang.org/u/dalekj)\
**Replies:** 0\
**Last updated:** [March 7, 2019, 4:08pm UTC](https://discourse.julialang.org/t/resulting-type-from-multiplication-of-a-sparse-and-full-matrix/21584 "2019-03-07T16:08:21Z")

</div>

Given a full matrix A and a sparse matrix B, matrix multiplication gives a different resulting type (either full or sparse) depending on the order of multiplication and whether or not a transpose is involved: julia\> A =…

---

## [Non-allocating A / B where A and B are matrices](https://discourse.julialang.org/t/non-allocating-a-b-where-a-and-b-are-matrices/21532)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 8\
**Last updated:** [March 7, 2019, 1:55pm UTC](https://discourse.julialang.org/t/non-allocating-a-b-where-a-and-b-are-matrices/21532 "2019-03-07T13:55:14Z")

</div>

Is there a non-allocating division for two matrices? For example: A = randn(10,10); B = randn(10,10); test(A,B) = A / B @benchmark test($A, $B) Output: BenchmarkTools.Trial: memory estimate: 2.81 KiB allocs est…

---

## [Troubleshooting Registration Error](https://discourse.julialang.org/t/troubleshooting-registration-error/21552)

<div class="topic-metadata">

**Author:** [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Replies:** 8\
**Last updated:** [March 7, 2019, 11:10am UTC](https://discourse.julialang.org/t/troubleshooting-registration-error/21552 "2019-03-07T11:10:26Z")

</div>

Hey everyone I got my package registered today. I was so excited to install it, and when I did I saw, ERROR: Unsatisfiable requirements detected for package ChemometricsTools \[a9718f02\]: ChemometricsTools \[a9718f02\] lo…

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

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