[julia-users] Re: parse Unicode string to Float64

2016-10-24 Thread Jeffrey Sarnoff
This is rather odd, your character codes are control codes (0x02 STX, start of text; 0x05 ENQ, enquiry) and really do not belong in a numeric string. Do all the entries use that pattern "\x002\anumber.\x005\bnumber"? If so, and the intended number is anumber.bnumber, there would be a way. What

[julia-users] parse Unicode string to Float64

2016-10-24 Thread Chris Stook
I'm trying to parse a text file which contains some floating point numbers. The number 2.5 is represented by the string "\x002\0.\x005\0". Parse will not convert this to a Float64. Print works (prints "2.5") in Atom and Jupyter, but not in the REPL. _ _ _ _(_)_ | A fresh approach

[julia-users] Re: Importing Python data to Julia

2016-10-24 Thread Corbin Foucart
How? If you don't mind my asking. It doesn't seem that documentation exists... Suppose in a python script, I have: [python imports] [pyjulia initialization] j = julia.Julia() randMat = np.random.rand(3, 3) # what should I put here to pass randMat to julia? result = j.eval("inv(julia_randmat)")

[julia-users] Re: pyjulia initialization error

2016-10-24 Thread Corbin Foucart
I am posting the solution to the problem in case anyone else has this issue. It is important to set the PYTHON variable in Julia to the binary used in the python virtual environment. For example, once the virtual environment is activated, % (venv) which python > /path/to/venv/binary then in

Re: [julia-users] Arrays with custom indices examples?

2016-10-24 Thread Angel de Vicente
Hi, Tim Holy writes: > That document is aimed at developers to tell them how to make their package > ready for arrays that have custom indices. As a user, the key line is: > >> Such array types are expected to be supplied through packages. > > I recommend the OffsetArrays

[julia-users] Re: ERROR: UndefVarError: PkgDev not defined

2016-10-24 Thread J Luis
Ok, sorry. Found it. Needed to using PkgDev but not that obvious since for using Pkg one do not need to 'using' it. segunda-feira, 24 de Outubro de 2016 às 22:57:06 UTC+1, J Luis escreveu: > > Hi, > > I'm trying to tag a new version of a package for the first time (initial > tag was done

Re: [julia-users] ERROR: UndefVarError: PkgDev not defined

2016-10-24 Thread Yichao Yu
On Mon, Oct 24, 2016 at 5:57 PM, J Luis wrote: > Hi, > > I'm trying to tag a new version of a package for the first time (initial tag > was done with 0.4) but > > Pkg.update() > ... > WARNING: julia is fixed at 0.5.0-rc4+0 conflicting with requirement for > GLFW: [0.5.0,∞) >

[julia-users] ERROR: UndefVarError: PkgDev not defined

2016-10-24 Thread J Luis
Hi, I'm trying to tag a new version of a package for the first time (initial tag was done with 0.4) but Pkg.update() ... WARNING: julia is fixed at 0.5.0-rc4+0 conflicting with requirement for GLFW : [0.5.0,∞) INFO: Upgrading ArgParse: v0.3.1 => v0.4.0 INFO: Upgrading Compat: v0.9.2 => v0.9.3

[julia-users] Re: Julia and the Tower of Babel

2016-10-24 Thread Jeffrey Sarnoff
Actually, all is good. The current docs do not take a stand on the use of case following an acronym. On Monday, October 24, 2016 at 1:38:39 PM UTC-4, Jeffrey Sarnoff wrote: > > update on package names that begin with an acronym .. following much > discussion, the rule which a strong

[julia-users] pyjulia initialization error

2016-10-24 Thread Corbin Foucart
I would like to use pyjulia, but I am having some issue setting it up in my python virtual environment. I have followed the instructions here: https://github.com/JuliaPy/pyjulia I am running the following script: import julia j =

Re: [julia-users] Re: Trait for exactness of numbers

2016-10-24 Thread Tim Holy
+1. We need number traits for a variety of circumstances; I was also contemplating them as a step in generalizing the FloatRange/StepRange distinction, for example to Unitful numbers (numbers with physical units). You need type-stability for the created range object, so I think a trait is the only

Re: [julia-users] Arrays with custom indices examples?

2016-10-24 Thread Tim Holy
That document is aimed at developers to tell them how to make their package ready for arrays that have custom indices. As a user, the key line is: > Such array types are expected to be supplied through packages. I recommend the OffsetArrays package. Great to see someone interested in trying

[julia-users] Re: Trait for exactness of numbers

2016-10-24 Thread Jeffrey Sarnoff
for values, something like this may do: function isexact(x) if isa(x, Integer) || isa(x, Rational) true elseif isa(x, Complex) isExact(x.re) else false end end On Monday, October 24, 2016 at 2:09:09 PM UTC-4, jw3126 wrote: > > A couple of times I was

[julia-users] How do I use Guide.yticks() with a log scale?

2016-10-24 Thread Dean Schulze
When I plot the DataFrame below using Scale.y_log10 the y-axis has ticks for half powers of 10 (e.g. 10^5.5). The plot is correct, but it's weird seeing half powers of 10 on a log plot. If I add Guide.yticks(ticks=ymarks) with the following values ymarks=[10^4,10^5,10^6,10^7] I get a plot

Re: [julia-users] Re: Nemo AcbField error

2016-10-24 Thread Jeffrey Sarnoff
and just run julia from the terminal, not cygwin On Monday, October 24, 2016 at 4:08:26 PM UTC-4, Jeffrey Sarnoff wrote: > > It is not clear to me what the difference is in your install and what I > did. I can do r=ArbField(64); r(1) .. there is a warning the first time, > but it works. > > If

Re: [julia-users] Re: Nemo AcbField error

2016-10-24 Thread Jeffrey Sarnoff
It is not clear to me what the difference is in your install and what I did. I can do r=ArbField(64); r(1) .. there is a warning the first time, but it works. If you want, go back to the new installation and do > Pkg.build("Nemo") then (a) show us what it says [everything] and then try >

[julia-users] Re: request many processes (addprocs()) simultaneously such that each can be used when obtained?

2016-10-24 Thread Ryan Gardner
Alright, well I hacked up a copy of ClusterManagers such that I added an obtain_procs() function that actually gets the available process and generates and stores the relevant WorkerConfigs with the ClusterManager. This function does not require any locks to be obtained. Then addprocs()

Re: [julia-users] Arrays with custom indices examples?

2016-10-24 Thread Mauro
I think you have to make your own type. You can't just request that ordinary arrays use different indexing. On Mon, 2016-10-24 at 20:34, Angel de Vicente wrote: > Hi, > > Isaiah Norton writes: >> mg = zeros(Int,(0:4,0:4)) >> >>

Re: [julia-users] Re: Nemo AcbField error

2016-10-24 Thread digxx
Maybe to point out: the installation in the part where I tried to do it directly via the repl command window was in a completely new .julia path (to try it fresh from the beginning) with no influence of already existing stuff...

Re: [julia-users] Re: Nemo AcbField error

2016-10-24 Thread digxx
Sorry again. But it is 64bit windows version just started in cygwin. I didn't think it makes any difference though However the behaviour seems different: When I start the Julia Repl command window directly I dont even get that far that Nemo is eventually installed: Following the steps

Re: [julia-users] Re: Nemo AcbField error

2016-10-24 Thread Jeffrey Sarnoff
Here are the usual Windows versions for 32-bit Windows and for 64-bit Windows On Monday, October 24, 2016 at 2:23:24 PM UTC-4, Bill Hart

Re: [julia-users] Arrays with custom indices examples?

2016-10-24 Thread Angel de Vicente
Hi, Isaiah Norton writes: > mg = zeros(Int,(0:4,0:4)) > > This isn't related to indexing -- it doesn't work with `1:4` > either. But it doesn't complain if I do: , | julia> mg=zeros(Int,(0:4)) | 5-element Array{Int64,1}: | 0 | 0 | 0 | 0 | 0 ` (though

Re: [julia-users] Re: Nemo AcbField error

2016-10-24 Thread 'Bill Hart' via julia-users
We don't support Cygwin. The Nemo binaries are native Windows binaries. I was unaware there was a Cygwin version of Julia. Bill. On 24 October 2016 at 19:48, Jeffrey Sarnoff wrote: > I tried this on windows, it worked: > delete the directory Nemo (found with

[julia-users] Trait for exactness of numbers

2016-10-24 Thread jw3126
A couple of times I was in a situation, where I had two algorithms solving the same problem, one which was faster and one which was more numerically stable. Now for some types of numbers (FloatingPoint, Complex{Float64}...) numerical stability is important while for others it does not matter

[julia-users] Re: request many processes (addprocs()) simultaneously such that each can be used when obtained?

2016-10-24 Thread Ryan Gardner
For reference, here is the 0.4.3 code for addprocs() # The main function for adding worker processes. # `manager` is of type ClusterManager. The respective managers are responsible

Re: [julia-users] Re: Nemo AcbField error

2016-10-24 Thread Jeffrey Sarnoff
I tried this on windows, it worked: delete the directory Nemo (found with Pkg.dir() subdir Nemo)) delete the corresponding directory METADATA/Nemo (Pkg.dir("METADATA") subdir Nemo) and if they exist, .cache/Nemo, METADATA/.cache/Nemo restart Julia, do Pkg.update() >

[julia-users] Re: Julia and the Tower of Babel

2016-10-24 Thread Jeffrey Sarnoff
update on package names that begin with an acronym .. following much discussion, the rule which a strong preponderance of participants favor: the acronym is to be uppercased and the following words camelcased, no separator. so: CSSscripts, HTMLlinks, XMLparser. This does not match the

[julia-users] request many processes (addprocs()) simultaneously such that each can be used when obtained?

2016-10-24 Thread Ryan Gardner
I'm trying to write code for sun grid engine (sge) although I think the general idea applies to any addprocs. I would like to be able to request a gazillion nodes, and start using each shortly after it becomes available. An example of what I want is roughly this code: for j=1:100

[julia-users] Re: using a module but with other name, similar to "import numpy as np" in python

2016-10-24 Thread Christoph Ortner
There is also an issue about this somewhere https://github.com/JuliaLang/julia/issues/1255

Re: [julia-users] Re: Nemo AcbField error

2016-10-24 Thread digxx
Hey, Thx for ur reply. I tried both deleting all the files and run Pkg.build again... It however did not work as are all the files present too :-( Julia in cygwin is correct...

Re: [julia-users] Arrays with custom indices examples?

2016-10-24 Thread Isaiah Norton
> > mg = zeros(Int,(0:4,0:4)) This isn't related to indexing -- it doesn't work with `1:4` either. Use: zeros(Int, 4, 4) (See also the help entry: `?zeros`) That said, be aware of the warnings in the referenced document: this feature is still considered experimental, so if you hit other

Re: [julia-users] Named for loops?

2016-10-24 Thread Mauro
On Mon, 2016-10-24 at 15:49, Milan Bouchet-Valat wrote: > Le lundi 24 octobre 2016 à 08:05 -0400, Isaiah Norton a écrit: >> >> >> On Monday, October 24, 2016, Angel de Vicente > gmail.com> wrote: ... >> > Is it possible now (or in the near future) to

Re: [julia-users] Named for loops?

2016-10-24 Thread Milan Bouchet-Valat
Le lundi 24 octobre 2016 à 08:05 -0400, Isaiah Norton a écrit : > > > On Monday, October 24, 2016, Angel de Vicente gmail.com> wrote: > > Hi, > > > > I don't see it in the documentation, but I'm wondering if there is > > a way > > to have named nested loops, so that

[julia-users] Re: stricter parsing of integers

2016-10-24 Thread Krisztián Pintér
validate with regex prior to converting? On Monday, October 24, 2016 at 3:30:08 PM UTC+2, Tamas Papp wrote: > > Is there a way to make > > parse(Int, " - 42 ") > > throw an error, or substitute with a different function that does this? >

Re: [julia-users] Re: Problem with julia-0.5 on Gentoo

2016-10-24 Thread 'Bill Hart' via julia-users
I can confirm that the Julia nightly is now working on our Gentoo systems. Will there be a Julia-0.5 binary provided with the same fix? Bill. On Thursday, 29 September 2016 22:50:35 UTC+2, Tony Kelman wrote: > > Okay, the buildbot that was down was running centos which is failing some > of the

Re: [julia-users] Named for loops?

2016-10-24 Thread Angel de Vicente
Hi, Isaiah Norton writes: > Is it possible now (or in the near future) to have named nested loops in > Julia? > > No, and I'm not aware of any plan to support this. But you can create custom > control flow with '@goto', so it could be probably be done with a

Re: [julia-users] stricter parsing of integers

2016-10-24 Thread Stefan Karpinski
You could check that there's no whitespace first. Otherwise, this isn't terribly hard to write a parser for, especially if you don't want any fancy features. On Mon, Oct 24, 2016 at 9:29 AM, Tamas Papp wrote: > Is there a way to make > > parse(Int, " - 42 ") > > throw an

Re: [julia-users] using a module but with other name, similar to "import numpy as np" in python

2016-10-24 Thread Tamas Papp
import DataFrames const DF = DataFrames DF.@data ... etc On Mon, Oct 24 2016, novatena2...@gmail.com wrote: > Hello, > > is there an official way to using a module but with different name (not the > name of the module), like "import numpy as np". > > Currently, I can do that with a hack, like

[julia-users] stricter parsing of integers

2016-10-24 Thread Tamas Papp
Is there a way to make parse(Int, " - 42 ") throw an error, or substitute with a different function that does this? Note that I am not advocating that this should be invalid syntax, just want to have a "strict" version for reading a dataset that throws an error unless the integer is not of the

[julia-users] using a module but with other name, similar to "import numpy as np" in python

2016-10-24 Thread novatena2015
Hello, is there an official way to using a module but with different name (not the name of the module), like "import numpy as np". Currently, I can do that with a hack, like the following hack. But I don't know if it really prevent method collision or not. ``` module DF using DataFrames

Re: [julia-users] Named for loops?

2016-10-24 Thread Isaiah Norton
On Monday, October 24, 2016, Angel de Vicente < angel.vicente.garr...@gmail.com> wrote: > Hi, > > I don't see it in the documentation, but I'm wondering if there is a way > to have named nested loops, so that one can specify those names to break > and continue, in order to have more control. > >

[julia-users] Arrays with custom indices examples?

2016-10-24 Thread Angel de Vicente
Hi, I'm trying to figure out how to use arrays with custom indices, and I've read http://docs.julialang.org/en/release-0.5/devdocs/offset-arrays/, but I don't seem to see how I could actually access array positions using arbitrary indices. A basic example of what I'd like to do would be

[julia-users] Named for loops?

2016-10-24 Thread Angel de Vicente
Hi, I don't see it in the documentation, but I'm wondering if there is a way to have named nested loops, so that one can specify those names to break and continue, in order to have more control. In the following examples, continue always skips the remaining loop for j, while break terminates

Re: [julia-users] use macros like a preprocessor directive?

2016-10-24 Thread Mauro
Maybe something like this: file pre.jl: if !isdefined(:proc) proc = false end module A macro pre(ex) if Main.proc return ex else :(println("doing nothing")) end end function f(x) @pre sort!(x) x end end v = rand(5) A.f(v) @show v Then use it with:

Re: [julia-users] use macros like a preprocessor directive?

2016-10-24 Thread Florian Oswald
Ok. any suggestions how to get close to the C preprocessor behaviour though? On Monday, 24 October 2016 11:13:18 UTC+2, Mauro wrote: > > On Mon, 2016-10-24 at 10:37, Florian Oswald > wrote: > > I have something that this in C++ I would write like > > > > double

Re: [julia-users] use macros like a preprocessor directive?

2016-10-24 Thread Mauro
On Mon, 2016-10-24 at 10:37, Florian Oswald wrote: > I have something that this in C++ I would write like > > double f(double x){ > // do something with x > #ifdef MACROVAR > // do something else with x > #endif > return(x) > } > > I was trying to

[julia-users] use macros like a preprocessor directive?

2016-10-24 Thread Florian Oswald
I have something that this in C++ I would write like double f(double x){ // do something with x #ifdef MACROVAR // do something else with x #endif return(x) } I was trying to understand how i could use julia macro's to achieve something similar. I have seen how the Logging.jl

Re: [julia-users] Re: Nemo AcbField error

2016-10-24 Thread Tommy Hofmann
Sorry, I meant arb and not pari. Something is off with the libraries. You can try the following: 1. Remove all files in .julia\v0.5\Nemo\local\lib and then do a Pkg.build("Nemo") again. 2. If 1. doesn't help, check if the following files are in Nemo\local\lib: "libwinpthread-1.dll",

Re: [julia-users] How to save an object of a defined type

2016-10-24 Thread Michele Zaffalon
Can you post a bit more of the code? From the error message, it looks like you are trying to open an already opened file... On Sat, Oct 22, 2016 at 7:42 PM, wrote: > I have a module defined as module *Core* within which I have defined > several types (*Node*, *Edge*, *Res*).