# General Usage

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

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

**Page:** 1030

---

## [Hwloc.jl num\_physical\_cores()](https://discourse.julialang.org/t/hwloc-jl-num-physical-cores/5626)

<div class="topic-metadata">

**Author:** [@usefulhyun](https://discourse.julialang.org/u/usefulhyun)\
**Replies:** 2\
**Last updated:** [August 30, 2017, 9:59am UTC](https://discourse.julialang.org/t/hwloc-jl-num-physical-cores/5626 "2017-08-30T09:59:42Z")

</div>

I am using Julia 0.6.0. I have added Package Hwloc and imported Hwloc packages. And I’d like to call a function “num\_physical\_cores()” But this function does not exist. How do I do use this function?

---

## [Gtk open\_dialog](https://discourse.julialang.org/t/gtk-open-dialog/5624)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 4\
**Last updated:** [August 30, 2017, 9:07am UTC](https://discourse.julialang.org/t/gtk-open-dialog/5624 "2017-08-30T09:07:56Z")

</div>

Hi all! Does anyone else have a problem with Gtk.open\_dialog? I’ve submitted an issue, but wanted to reach out to other people that have used this function and hear what their experience is like. Here’s the gist of my…

---

## [Questions about fixed point numbers](https://discourse.julialang.org/t/questions-about-fixed-point-numbers/5604)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 4\
**Last updated:** [August 30, 2017, 5:39am UTC](https://discourse.julialang.org/t/questions-about-fixed-point-numbers/5604 "2017-08-30T05:39:45Z")

</div>

Should conversions between different fixed point representations work (example below) ? Also I’d like to use the library for some DSP algorithm implementation, so doing things like automatic promotion of multiplies to m…

---

## [Jl\_eval\_string vs jl\_load\_file\_string](https://discourse.julialang.org/t/jl-eval-string-vs-jl-load-file-string/5591)

<div class="topic-metadata">

**Author:** [@bdurin](https://discourse.julialang.org/u/bdurin)\
**Replies:** 2\
**Last updated:** [August 29, 2017, 8:12pm UTC](https://discourse.julialang.org/t/jl-eval-string-vs-jl-load-file-string/5591 "2017-08-29T20:12:58Z")

</div>

Hi, What is the difference between the two functions? (For jl\_load\_file\_string I am considering only the case when a string is passed, not a filename.) As far as I could understand from the source code, jl\_eval\_string …

---

## [Convert() vs constructors](https://discourse.julialang.org/t/convert-vs-constructors/4159)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 35\
**Last updated:** [August 29, 2017, 5:47pm UTC](https://discourse.julialang.org/t/convert-vs-constructors/4159 "2017-08-29T17:47:55Z")

</div>

Could someone please explain how to best define a concrete type conversion tree? Also what is the role of convert and promote\_type in converting from one concrete type to another? Thanks.

---

## [Multi-line macros for domain specific language](https://discourse.julialang.org/t/multi-line-macros-for-domain-specific-language/5622)

<div class="topic-metadata">

**Author:** [@kkmann](https://discourse.julialang.org/u/kkmann)\
**Replies:** 5\
**Last updated:** [August 29, 2017, 3:21pm UTC](https://discourse.julialang.org/t/multi-line-macros-for-domain-specific-language/5622 "2017-08-29T15:21:37Z")

</div>

Hi, I just wondered whether it would be feasible to implement something like @problem begin minimize: f(x) subject to: g1(x) = a g2(x) \<= b end or similar to work properly. Essentially this is …

---

## [Converting Ptr of subtype to Ref of supertype in ccall](https://discourse.julialang.org/t/converting-ptr-of-subtype-to-ref-of-supertype-in-ccall/5620)

<div class="topic-metadata">

**Author:** [@visr](https://discourse.julialang.org/u/visr)\
**Replies:** 4\
**Last updated:** [August 29, 2017, 1:35pm UTC](https://discourse.julialang.org/t/converting-ptr-of-subtype-to-ref-of-supertype-in-ccall/5620 "2017-08-29T13:35:00Z")

</div>

My question comes down to, should this be an error: julia\> Base.cconvert(Ref{Real}, Ptr{Integer}(1)) ERROR: MethodError: Cannot \`convert\` an object of type Ptr{Integer} to an object of type Real This may have arisen fro…

---

## [Static fieldnames](https://discourse.julialang.org/t/static-fieldnames/5619)

<div class="topic-metadata">

**Author:** [@bramtayl](https://discourse.julialang.org/u/bramtayl)\
**Replies:** 4\
**Last updated:** [August 28, 2017, 10:21pm UTC](https://discourse.julialang.org/t/static-fieldnames/5619 "2017-08-28T22:21:40Z")

</div>

Imagine I have a struct A a::Int b::String end I want to stringify it like this: string(A.a, A.b) However, I want to do this WITHOUT prior knowledge of the fieldnames of A. This is quite difficult to do in …

---

## [Understanding Dict](https://discourse.julialang.org/t/understanding-dict/5602)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 9\
**Last updated:** [August 28, 2017, 9:03pm UTC](https://discourse.julialang.org/t/understanding-dict/5602 "2017-08-28T21:03:25Z")

</div>

Hi everyone. I am coming from python background. In python, dictionary keys cannot be mutable because it is based on hash table. However, keys in Dict in julia do not need to be immutable. I wonder how this is achieved? …

---

## [Optionally loading a module](https://discourse.julialang.org/t/optionally-loading-a-module/5579)

<div class="topic-metadata">

**Author:** [@mforets](https://discourse.julialang.org/u/mforets)\
**Replies:** 6\
**Last updated:** [August 28, 2017, 7:11pm UTC](https://discourse.julialang.org/t/optionally-loading-a-module/5579 "2017-08-28T19:11:09Z")

</div>

suppose that a module foo.jl depends on external packages which take several seconds to load, e.g. julia\> tic(); using JuMP, GLPKMathProgInterface; toc() elapsed time: 4.929913064 seconds in my case, foo.jl only eventu…

---

## [Reactive.jl graph / tree grows very large](https://discourse.julialang.org/t/reactive-jl-graph-tree-grows-very-large/5618)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 0\
**Last updated:** [August 28, 2017, 4:43pm UTC](https://discourse.julialang.org/t/reactive-jl-graph-tree-grows-very-large/5618 "2017-08-28T16:43:41Z")

</div>

Hey, I’m using Reactive.jl to do some signal processing / simulation. I start off with a simple tick𝑆 = Signal(0). Each tick then generates a 1ms signal array containing multiple subsignals: signal𝑆s = map(1:11) do id …

---

## [Is Julia IDE or extension with code editiors will be developed or not?](https://discourse.julialang.org/t/is-julia-ide-or-extension-with-code-editiors-will-be-developed-or-not/5576)

<div class="topic-metadata">

**Author:** [@deepeshalways](https://discourse.julialang.org/u/deepeshalways)\
**Replies:** 15\
**Last updated:** [August 28, 2017, 3:35pm UTC](https://discourse.julialang.org/t/is-julia-ide-or-extension-with-code-editiors-will-be-developed-or-not/5576 "2017-08-28T15:35:28Z")

</div>

I want to know that is the IDE or extension for any code editor is in development.

---

## [Fixing errors reported by JuliaCIBot](https://discourse.julialang.org/t/fixing-errors-reported-by-juliacibot/5614)

<div class="topic-metadata">

**Author:** [@peterkovesi](https://discourse.julialang.org/u/peterkovesi)\
**Replies:** 1\
**Last updated:** [August 28, 2017, 1:49pm UTC](https://discourse.julialang.org/t/fixing-errors-reported-by-juliacibot/5614 "2017-08-28T13:49:44Z")

</div>

I am trying to tag a new release of a long neglected package that I have just updated. Using attobot I created a METADATA pull request. The travis-ci tests passed but the JuliaCIBot tests failed Looking the the log I s…

---

## [Dates with ranges and intervals](https://discourse.julialang.org/t/dates-with-ranges-and-intervals/5573)

<div class="topic-metadata">

**Author:** [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Replies:** 3\
**Last updated:** [August 28, 2017, 12:11pm UTC](https://discourse.julialang.org/t/dates-with-ranges-and-intervals/5573 "2017-08-28T12:11:16Z")

</div>

I’m considering an issue where all the elements are time stamps. An array of these elements can contain a single time stamp, an array, a range, an interval or combination of these. By range I intend a construction using …

---

## [Zero-sized array of parametric types](https://discourse.julialang.org/t/zero-sized-array-of-parametric-types/5609)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon](https://discourse.julialang.org/u/Philippe_Maincon)\
**Replies:** 8\
**Last updated:** [August 28, 2017, 9:09am UTC](https://discourse.julialang.org/t/zero-sized-array-of-parametric-types/5609 "2017-08-28T09:09:04Z")

</div>

I have a Parametric type mytype{N}. One of its field is an SVector, and I want to have no pointers. I use Vectors of mytype{N}. And of course, there comes a time when I have a vector v of length 0 of mytype{N}. Then I…

---

## [How to jump to definition in Juno?](https://discourse.julialang.org/t/how-to-jump-to-definition-in-juno/5607)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 6\
**Last updated:** [August 28, 2017, 9:07am UTC](https://discourse.julialang.org/t/how-to-jump-to-definition-in-juno/5607 "2017-08-28T09:07:33Z")

</div>

I am trying Juno once again, and I this time I will try to stick with it for a longer period. One of the basic things that I would like to have is ctags-like functionality to jump in the code to the definition of a meth…

---

## [Test empty cell in Taro package \[maybe basic pointer manipulation\]](https://discourse.julialang.org/t/test-empty-cell-in-taro-package-maybe-basic-pointer-manipulation/5588)

<div class="topic-metadata">

**Author:** [@Olivier\_Garet](https://discourse.julialang.org/u/Olivier_Garet)\
**Replies:** 1\
**Last updated:** [August 28, 2017, 1:04am UTC](https://discourse.julialang.org/t/test-empty-cell-in-taro-package-maybe-basic-pointer-manipulation/5588 "2017-08-28T01:04:07Z")

</div>

Hi, I’m using the Taro package to deal with excel sheets. I simply want to test if a cell is empty or not. When Cell 1 in line r is not empty, getCell(r,1) returns something like JavaCall.JavaObject{Symbol(“org.apache…

---

## [Where exactly memory copies happen in Julia code?](https://discourse.julialang.org/t/where-exactly-memory-copies-happen-in-julia-code/5595)

<div class="topic-metadata">

**Author:** [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Replies:** 6\
**Last updated:** [August 27, 2017, 9:05pm UTC](https://discourse.julialang.org/t/where-exactly-memory-copies-happen-in-julia-code/5595 "2017-08-27T21:05:53Z")

</div>

I have a simple question about memory management in Julia code. Coming from a C++ background with all that rvalue reference madness and move semantics stuff, I got my brain damaged, and I am having a hard time trying to …

---

## [Strange issue when using ccall](https://discourse.julialang.org/t/strange-issue-when-using-ccall/5600)

<div class="topic-metadata">

**Author:** [@noobIntern](https://discourse.julialang.org/u/noobIntern)\
**Replies:** 0\
**Last updated:** [August 27, 2017, 7:33pm UTC](https://discourse.julialang.org/t/strange-issue-when-using-ccall/5600 "2017-08-27T19:33:24Z")

</div>

Hello everyone. I am writing a small Julia module that call external C libraries from a third-party software package/API. The module appears to be working correctly. However when I include other modules ( I have test…

---

## [Issue when loading modules using ccall](https://discourse.julialang.org/t/issue-when-loading-modules-using-ccall/5599)

<div class="topic-metadata">

**Author:** [@noobIntern](https://discourse.julialang.org/u/noobIntern)\
**Replies:** 0\
**Last updated:** [August 27, 2017, 7:33pm UTC](https://discourse.julialang.org/t/issue-when-loading-modules-using-ccall/5599 "2017-08-27T19:33:21Z")

</div>

Hello everyone. I am writing a small Julia module that call external C libraries from a third-party software package/API. The module appears to be working correctly. However when I include other modules ( I have test…

---

## [Unable to load Files in julia](https://discourse.julialang.org/t/unable-to-load-files-in-julia/5589)

<div class="topic-metadata">

**Author:** [@Hitesh\_Khandelwal](https://discourse.julialang.org/u/Hitesh_Khandelwal)\
**Replies:** 2\
**Last updated:** [August 27, 2017, 4:28pm UTC](https://discourse.julialang.org/t/unable-to-load-files-in-julia/5589 "2017-08-27T16:28:40Z")

</div>

There is a CSV file called orders\_data stored in my system, but when I try to load this file in Julia using readdlm command in Jupyter Notebook(running in my browser), it says “NO SUCH FILE DIRECTORY FOUND” I’m not sure…

---

## [A bug report with steps to reproduce this fault](https://discourse.julialang.org/t/a-bug-report-with-steps-to-reproduce-this-fault/3551)

<div class="topic-metadata">

**Author:** [@kEviN1H](https://discourse.julialang.org/u/kEviN1H)\
**Replies:** 2\
**Last updated:** [August 27, 2017, 3:26pm UTC](https://discourse.julialang.org/t/a-bug-report-with-steps-to-reproduce-this-fault/3551 "2017-08-27T15:26:50Z")

</div>

Julia Version 0.5.1 Commit 6445c82 (2017-03-05 13:25 UTC) Platform Info: OS: Windows (x86\_64-w64-mingw32) CPU: Intel(R) Core™ i7 CPU Q 720 @ 1.60GHz WORD\_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC\_ARCH …

---

## [Include\_string third argument fname](https://discourse.julialang.org/t/include-string-third-argument-fname/5590)

<div class="topic-metadata">

**Author:** [@bdurin](https://discourse.julialang.org/u/bdurin)\
**Replies:** 2\
**Last updated:** [August 27, 2017, 2:34pm UTC](https://discourse.julialang.org/t/include-string-third-argument-fname/5590 "2017-08-27T14:34:39Z")

</div>

Hi, What is the meaning / use of the third argument fname in include\_string? I saw it used this way in IJulia: include\_string(Main, code, "In\[$n\]") where n is a number (say 1), In is a mapping of Int to String, which…

---

## [How can I ping an IP adress in Julia?](https://discourse.julialang.org/t/how-can-i-ping-an-ip-adress-in-julia/3380)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 3\
**Last updated:** [August 27, 2017, 2:10pm UTC](https://discourse.julialang.org/t/how-can-i-ping-an-ip-adress-in-julia/3380 "2017-08-27T14:10:23Z")

</div>

Hello, I need a script to measure the ping time to another computer in Julia. How can I do that? All hints welcome! Uwe

---

## [Accuracy of sleep()](https://discourse.julialang.org/t/accuracy-of-sleep/5546)

<div class="topic-metadata">

**Author:** [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Replies:** 4\
**Last updated:** [August 26, 2017, 6:56am UTC](https://discourse.julialang.org/t/accuracy-of-sleep/5546 "2017-08-26T06:56:28Z")

</div>

Problem I didn’t expect sleep(seconds) to be super accurate, but I must admit I was surprised over how inaccurate it is. See a benchmark below. Relative error of 10% for sleep times under 0.01 seconds is quite a lot, and…

---

## [How to shutdown a socket](https://discourse.julialang.org/t/how-to-shutdown-a-socket/5561)

<div class="topic-metadata">

**Author:** [@danielmatz](https://discourse.julialang.org/u/danielmatz)\
**Replies:** 1\
**Last updated:** [August 25, 2017, 11:42pm UTC](https://discourse.julialang.org/t/how-to-shutdown-a-socket/5561 "2017-08-25T23:42:56Z")

</div>

I’ve been working on a simple example with a Julia server and a C client communicating over a UNIX domain socket. If I call shutdown(my\_socket, SHUT\_RDWR) from the C client, then calling isopen(my\_socket) in Julia retur…

---

## [Finding the memory allocation in some code](https://discourse.julialang.org/t/finding-the-memory-allocation-in-some-code/5556)

<div class="topic-metadata">

**Author:** [@Ward9250](https://discourse.julialang.org/u/Ward9250)\
**Replies:** 3\
**Last updated:** [August 25, 2017, 2:48pm UTC](https://discourse.julialang.org/t/finding-the-memory-allocation-in-some-code/5556 "2017-08-25T14:48:12Z")

</div>

Hi, I’ve been trying to find where the memory allocations are in my code if possible. I have this function in a package, which I don’t expect to allocate, because I avoid arrays, and use immutable types: const CDN = Un…

---

## [Glade and Gtk](https://discourse.julialang.org/t/glade-and-gtk/5558)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 1\
**Last updated:** [August 25, 2017, 2:14pm UTC](https://discourse.julialang.org/t/glade-and-gtk/5558 "2017-08-25T14:14:45Z")

</div>

Using GtkReactive and Gtk, I can create a GUI that creates new GUI elements: using GtkReactive, Gtk.ShortNames w = Window("a") a = button("a") b = Box(:h) push!(b, a) foreach(a) do \_ cb = checkbox(rand(Bool)) fo…

---

## [Conventions for mutable shared structure](https://discourse.julialang.org/t/conventions-for-mutable-shared-structure/5536)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 4\
**Last updated:** [August 25, 2017, 12:35pm UTC](https://discourse.julialang.org/t/conventions-for-mutable-shared-structure/5536 "2017-08-25T12:35:07Z")

</div>

I have a function which takes a user-defined callable object, say f, which when called with a vector of numbers is expected to return the value f(x) and the gradient \\nabla f(x) at x. DiffBase.GradientResult is a natural…

---

## [Julia Simple Plot Problem (x^4)](https://discourse.julialang.org/t/julia-simple-plot-problem-x-4/5549)

<div class="topic-metadata">

**Author:** [@Romero\_Azzalini](https://discourse.julialang.org/u/Romero_Azzalini)\
**Replies:** 7\
**Last updated:** [August 25, 2017, 11:55am UTC](https://discourse.julialang.org/t/julia-simple-plot-problem-x-4/5549 "2017-08-25T11:55:03Z")

</div>

Hi, why isn’t it working? g(x) works, g2(x) fails aswell. Best, Hannes!

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

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