Re: [julia-users] German Wikipedia Article

2015-06-26 Thread René Donner
I proof-read the changes, they look good to me!

Thanks Tobias for tackling this, the previous entry was really not more than a 
stub.

[julia-users] Re: Redirecting output julia (log to file)

2015-06-26 Thread bernhard
This works perfectly. Thank you. Also the MS website (which is linked on 
the site you 
referred) 
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/redirection.mspx?mfr=true
 
is very good.

Am Dienstag, 23. Juni 2015 09:44:46 UTC+2 schrieb Avik Sengupta:

 From a batch file, you can redirect the output using  . See 
 http://blog.crankybit.com/redirecting-output-to-a-file-in-windows-batch-scripts/
  
 for some details. 

 Alternatively, if you control how the output is generated, you can use the 
 Logging.jl package to write them to file in reasonably flexible way. 

 Regards
 -
 Avik

 On Tuesday, 23 June 2015 07:55:54 UTC+1, bernhard wrote:

 Hi all

 I am invoking a Julia process from an external program (say a Java 
 script, Windows or any program). 
 Julia starts, does some calculations and closes again. While Julia runs I 
 can of course see the REPL which shows me some logging and evaluations.

 I now want to set up a web service (REST or similar) where people can 
 upload data, start of a model, and download results. For this I want to 
 have a log file which shows the same or similar output which the REPL 
 (=Julia session) displays. I understand that the REPL is does much more 
 than just displaying stdout and stderr (this is why is said similar before).

 Leah Hanson is describing 
 http://blog.leahhanson.us/running-shell-commands-from-julia.html  (Base.| 
 ) which works perfectly for me. But this only works if I use Julia to 
 start another Julia session. In my case I want to start Julia from windows 
 (a *.bat file) or any other software. How can I achieve the same result?

 I am aware of redirect_stdout and redirect_stderr. This does not work 
 properly for me, as the program might run for several minutes, and it seems 
 to me that output is only written after I flush or close the stream. But I 
 want to see the progress in the log file (just as the REPL does) while my 
 code runs. It would be tedious to add flush  everywhere in my code where 
 I have a print command.

 Is there a way to achieve this? 

 As mentioned above I can invoke a julia session which starts another 
 julia session with the actual code:
 (st,pr) = open(`$(juliaExecutable) $(juliaProgram) $(arguments)` | 
 logFilename)
 Is there a way to achieve the same result without the intermediate julia 
 session?

 Thanks
 Bernhard



[julia-users] Is ready to function returning the greater variable?

2015-06-26 Thread paul analyst
Is ready to function returning the greater variable? 

x = 1
y = 2
fun (x, y)
y

Paul


[julia-users] Supertypes in function arguments

2015-06-26 Thread Linus Härenstam-Nielsen
I ran into a problem with types today that I don't know how to interpret.

If I define a function according to 
f(x::Real) = x
it returns x as expected as long as the type of x is a subtype of Real. 
However if I define
f(x::Array{Real}) = x
it throws MethodError no matter what I pass as argument. For example when I 
try to pass it an Int array:
f([1 2 3; 3 4 5])
ERROR: MethodError: `f` has no method matching f(::Array{Int64,2})

I would expect it to work like
f{T:Real}(x::Array{T}) = x
and accept any array of reals. Am I missing something?





[julia-users] Re: Supertypes in function arguments

2015-06-26 Thread Tim Wheeler
Hello Linus,

This is based on how array types are defined. In general, Vector{subtype} 
is not a subtype of Vector{supertype}.
Try this:

f{R:Real}(x::Array{R}) = x

-Tim

On Friday, June 26, 2015 at 8:38:12 AM UTC-7, Linus Härenstam-Nielsen wrote:

 I ran into a problem with types today that I don't know how to interpret.

 If I define a function according to 
 f(x::Real) = x
 it returns x as expected as long as the type of x is a subtype of Real. 
 However if I define
 f(x::Array{Real}) = x
 it throws MethodError no matter what I pass as argument. For example when 
 I try to pass it an Int array:
 f([1 2 3; 3 4 5])
 ERROR: MethodError: `f` has no method matching f(::Array{Int64,2})

 I would expect it to work like
 f{T:Real}(x::Array{T}) = x
 and accept any array of reals. Am I missing something?





[julia-users] Re: Supertypes in function arguments

2015-06-26 Thread Linus Härenstam-Nielsen
Ok, that makes sense. In that case what would be the best way to write a 
funcion that accepts several Real arrays (of not necessarily the same 
type)? Currently I'm using 

function f{T1,T2,T3 : Real}(x::Array{T1}, y::Array{T2}, z::Array{T3})
 ...
end

But that gets messy very quickly if there are many arguments. 

On Friday, June 26, 2015 at 6:00:25 PM UTC+2, Tim Wheeler wrote:

 Hello Linus,

 This is based on how array types are defined. In general, Vector{subtype} 
 is not a subtype of Vector{supertype}.
 Try this:

 f{R:Real}(x::Array{R}) = x

 -Tim

 On Friday, June 26, 2015 at 8:38:12 AM UTC-7, Linus Härenstam-Nielsen 
 wrote:

 I ran into a problem with types today that I don't know how to interpret.

 If I define a function according to 
 f(x::Real) = x
 it returns x as expected as long as the type of x is a subtype of Real. 
 However if I define
 f(x::Array{Real}) = x
 it throws MethodError no matter what I pass as argument. For example when 
 I try to pass it an Int array:
 f([1 2 3; 3 4 5])
 ERROR: MethodError: `f` has no method matching f(::Array{Int64,2})

 I would expect it to work like
 f{T:Real}(x::Array{T}) = x
 and accept any array of reals. Am I missing something?





Re: [julia-users] Re: Problem with ZMQ and Ijulia

2015-06-26 Thread Miguel Bazdresch
I'm sorry for the confusion. I somehow thought they were related.

-- mb

On Thu, Jun 25, 2015 at 11:07 PM, Tony Kelman t...@kelman.net wrote:

 These are two different problems, sorry. The issues you pointed to appear
 to be Linux-only, and due to a version upgrade of libzmq - probably little
 or nothing to do with Julia base. And also not yet completely identified or
 solved.

 The original post here was on Windows, Provider PackageManager failed to
 satisfy dependency zmq, which arose from C++ ABI mismatches due to the
 openSUSE build service (which we use for many binary package dependencies
 on Windows) fixing a typo in a configure flag which changed the way
 libstdc++ deals with strings. C++ is filled with this nonsense, and even
 ZMQ's author regrets writing ZMQ in C++ instead of C.


 On Thursday, June 25, 2015 at 8:13:11 PM UTC-4, Miguel Bazdresch wrote:

 It doesn't, at least for me. ZMQ tests still segfault.

 -- mb

 On Thu, Jun 25, 2015 at 5:36 PM, Tony Kelman to...@kelman.net wrote:

 0.3.10 (released yesterday) should fix this error.


 On Thursday, June 25, 2015 at 10:02:09 AM UTC-4, Miguel Bazdresch wrote:

 These issues may be relevant:

 https://github.com/JuliaLang/ZMQ.jl/issues/83

 https://github.com/JuliaLang/IJulia.jl/issues/323


 -- mb

 On Thu, Jun 25, 2015 at 9:37 AM, Grigoriy Isaev grigoriy...@gmail.com
 wrote:

 It seems that there is unfixed bug somewhere in Juno distribution.
 Latest 64 bit Juno is version 0.3.7 and it has this bug. If i install
 latest Julia 0.4.0 - zero MQ builds correctly and everything is fine with
 Ijulia notebooks using 0.4.0 version



 четверг, 25 июня 2015 г., 16:32:33 UTC+3 пользователь Grigoriy Isaev
 написал:

 Hi!  I am trying to set up  Ijulia. I've cleand my PC from all
 previuos versions of Julia/Ipython and installed fresh 64 bit Anaconda 3
 python distribution + downloaded Juno 64 bit.

 After i launch Ipython i can see Ijulia option, but trying to create
 notebooks i get kernell has died message and a ZMQ error reference.

 I can not re-build ZMQ on my PC, i get the following errors:

 =[ ERROR: ZMQ
 ]=

 Provider PackageManager failed to satisfy dependency zmq
 while loading C:\Users\Gisaev\.julia\v0.3\ZMQ\deps\build.jl, in
 expression starting on line 23

 [ BUILD ERRORS
 ]

 WARNING: ZMQ had build errors.

  - packages with build errors remain installed in
 C:\Users\Gisaev\.julia\v0.3
  - build the package(s) and all dependencies with `Pkg.build(ZMQ)`
  - build a single package by running its `deps/build.jl` script


 I tried Pkg.checkout on both ZMQ and Ijulia but to no avail. Ipython
 notebooks work just fine.

 Any thoughts on what might be the problem?






[julia-users] Re: matlab-like textscan function?

2015-06-26 Thread Seth


On Tuesday, June 23, 2015 at 10:45:11 PM UTC-5, Garrett Jenkinson wrote:

 Sorry if this is overly basic question, but I searched around the 
 documentation and the user group questions and have not been able to find 
 an answer. I wondering if there was a way in Julia to read from a formatted 
 text file, in the same way as matlab's textscan function:

 http://www.mathworks.com/help/matlab/ref/textscan.html

 readdlm does not seem to do what I am looking for (or maybe I'm using it 
 wrong!). Suppose I have data coming from a bed file, which is formatted 
 like this:

 chr1  500  34543   1.433
 chr1  46546  3543   4.68
 chr2  454334456  6.3545

 It would be nice to specify the format chr%u %u %u %f and to get four 
 vectors (three with Ints and one with floats):

 [1,1,2]
 [500,46546,4543]
 [34543,3543,34456]
 [1.433,4.68,6.3545]

 Is there a function to do this? If not, is there a simple way to do this 
 with the functions that are available? 

 Thanks!
 Garrett

 P.S. I know that @printf basically allows the opposite of this to be done 
 (i.e., to write out to a file by specifying a format). Basically, my 
 question is if there exists the equivalent @readf to read in something that 
 was produced by @printf?



A quick and dirty way of doing this would be the following:

t = readdlm(filename)'  # note the transpose at the end


There are a couple of issues here:

1: you'll need to manipulate the chr strings (to get rid of chr) - see 
also #3, below
2: you've got an array instead of a set of vectors (easy to convert using 
comprehension or other methods)
3: the array is of type {Any,2} which may lead to inefficiencies. If you 
could get rid of chr before reading so that the file only contains things 
that parse into numbers, the array would be of type {Float64, 2} which is 
more precise, though still not 100% equivalent.

If you want to get more complicated, you could use split() and parse() to 
do what you need, iterating over each line. 

You could also use DataFrames to do something like this:

t = readtable(filename, separator = ' ', header=false)

but you'd still require some manipulation.

There also may be better / more clever ways, but these are the first that 
come to mind.


[julia-users] Julia operating mode (Juno, Jupyter)

2015-06-26 Thread Josef Heinen
Can anybody tell me, how to find out, whether we are running in a simple 
terminal session or in a GUI environment (Juni, Jupyter, ...) ?


[julia-users] How to insert new row/ egsisitng vector into array ?

2015-06-26 Thread paul analyst
Is posible insert new row (egsisitng vector)  into array ?  wihout hcat 
etc. ?  
Is something like insert! in iter ?

julia a=rand(5,5)
5x5 Array{Float64,2}:
 0.613346   0.864493  0.495873   0.571237   0.948809
 0.688794   0.168175  0.732427   0.0516122  0.439683
 0.740090.491623  0.0662683  0.160219   0.708842
 0.0678776  0.601627  0.425847   0.329719   0.108245
 0.689865   0.233258  0.171292   0.487139   0.452603

julia insert!(a,3,1,zeros(5))
ERROR: `insert!` has no method matching insert!(::Array{Float64,2}, 
::Int32, ::Int32, ::Array{Float64,1})

julia insert!(a,[:,3],,zeros(5))
ERROR: syntax: unexpected ,

Paul?


Re: [julia-users] Julia operating mode (Juno, Jupyter)

2015-06-26 Thread Isaiah Norton
The only option I'm aware of is to check `isdefined` for individual
packages:

isdefined(:Juno) || isdefined(:IJulia) || ...

But doing so is not very general.

Perhaps a more general question is: what capability do you want to detect?
Can you define what would be the lowest-common-denominator capability
represented by an `isgui()` function, analogous to `isinteractive`?

There have been some similar discussions around both MIME capabilities and
abstract graphics APIs. The first was resolved with the overloadable
`display` design in base. For the second, the consensus was to remove the
Graphics module from Base because a single abstract API could not be
general enough to cover the needs of all plotting packages (now this
functionality lives in  the Graphics.jl package for those  that use it; see
also https://github.com/JuliaLang/Graphics.jl/issues/1)


On Fri, Jun 26, 2015 at 9:48 AM, Josef Heinen j.hei...@me.com wrote:

 Can anybody tell me, how to find out, whether we are running in a simple
 terminal session or in a GUI environment (Juni, Jupyter, ...) ?



[julia-users] Re: Supertypes in function arguments

2015-06-26 Thread Scott T
I've seen a discussion on this somewhere... here it is: 
https://github.com/JuliaLang/julia/issues/6984, and there's more discussion 
at https://groups.google.com/forum/#!topic/julia-users/alavN8tRdyI

No built-in solution so far from what I can see, although following the 
first post there, you could define a type alias for an array that has 
elements that are all the same Real subtype:

typealias RealArray{R:Real} Array{R}

function f(x::RealArray, y::RealArray, z::RealArray) ...


On Friday, 26 June 2015 17:46:22 UTC+1, Linus Härenstam-Nielsen wrote:

 Ok, that makes sense. In that case what would be the best way to write a 
 funcion that accepts several Real arrays (of not necessarily the same 
 type)? Currently I'm using 

 function f{T1,T2,T3 : Real}(x::Array{T1}, y::Array{T2}, z::Array{T3})
  ...
 end

 But that gets messy very quickly if there are many arguments. 

 On Friday, June 26, 2015 at 6:00:25 PM UTC+2, Tim Wheeler wrote:

 Hello Linus,

 This is based on how array types are defined. In general, Vector{subtype} 
 is not a subtype of Vector{supertype}.
 Try this:

 f{R:Real}(x::Array{R}) = x

 -Tim

 On Friday, June 26, 2015 at 8:38:12 AM UTC-7, Linus Härenstam-Nielsen 
 wrote:

 I ran into a problem with types today that I don't know how to interpret.

 If I define a function according to 
 f(x::Real) = x
 it returns x as expected as long as the type of x is a subtype of Real. 
 However if I define
 f(x::Array{Real}) = x
 it throws MethodError no matter what I pass as argument. For example 
 when I try to pass it an Int array:
 f([1 2 3; 3 4 5])
 ERROR: MethodError: `f` has no method matching f(::Array{Int64,2})

 I would expect it to work like
 f{T:Real}(x::Array{T}) = x
 and accept any array of reals. Am I missing something?





[julia-users] Re: cycle detection and cycle basis

2015-06-26 Thread Seth
LightGraphs has cycle detection as well 
(https://github.com/JuliaGraphs/LightGraphs.jl).


On Monday, June 22, 2015 at 9:11:35 AM UTC-5, Michela Di Lullo wrote:

 Hi, 

 does anyone know if there is any algorithm for cycle detection or cycle 
 basis computation (for directed graphs) in julia? 

 Thank you in advance

 Michela Di Lullo

 ___
 INVESTI SUL FUTURO, FAI CRESCERE L’UNIVERSITÀ:

 *DONA IL 5 PER MILLE ALLA SAPIENZA*

 CODICE FISCALE *80209930587*



[julia-users] Re: Julia operating mode (Juno, Jupyter)

2015-06-26 Thread Josef Heinen
Hi,

isdefined(:Juno) || isdefined(:IJulia) || ... seems to work fine. Thanks 
for your help ...

Right now, when using the GR framework (GR.jl), the user has to decide, 
whether the software should produce inline graphics (in Jupyter or Juno) or 
open a new canvas (X / GDI / Cocoa - depending on the OS) using the 
GR.inline() function. It would be more convenient, if the software could 
detect whether we are in a GUI environment or in a simple terminal session 
and set a reasonable operation mode as default ...

Here are some examples:

   - Matplotlib animation example 
   http://pgi-jcns.fz-juelich.de/pub/doc/JuliaCon_2015/anim.html
   - A molecular dynamics example 
   http://pgi-jcns.fz-juelich.de/pub/doc/JuliaCon_2015/700K_460.html


Thanks,
Josef


On Friday, June 26, 2015 at 9:50:00 AM UTC-4, Josef Heinen wrote:

 Can anybody tell me, how to find out, whether we are running in a simple 
 terminal session or in a GUI environment (Juni, Jupyter, ...) ?



[julia-users] Re: Julia operating mode (Juno, Jupyter)

2015-06-26 Thread Josef Heinen
Well, at the time, when I want to use such a function, the display stack is 
empty. GR has its own graphics backends and can be used as a substitute for 
Gadfly, PyPlot, etc.

On Friday, June 26, 2015 at 9:50:00 AM UTC-4, Josef Heinen wrote:

 Can anybody tell me, how to find out, whether we are running in a simple 
 terminal session or in a GUI environment (Juni, Jupyter, ...) ?



Re: [julia-users] Re: Julia operating mode (Juno, Jupyter)

2015-06-26 Thread Isaiah Norton
Ok, for this purpose I think you can use the existing `displayable`
function:

http://docs.julialang.org/en/release-0.3/stdlib/io-network/#Base.displayable

 See how it is used to check various MIME capabilities in PyPlot:

https://github.com/stevengj/PyPlot.jl/blob/11c043170f86ea57eac35165c4a649e363028d02/src/PyPlot.jl#L15-L31

On Fri, Jun 26, 2015 at 3:14 PM, Josef Heinen j.hei...@me.com wrote:

 Hi,

 isdefined(:Juno) || isdefined(:IJulia) || ... seems to work fine. Thanks
 for your help ...

 Right now, when using the GR framework (GR.jl), the user has to decide,
 whether the software should produce inline graphics (in Jupyter or Juno) or
 open a new canvas (X / GDI / Cocoa - depending on the OS) using the
 GR.inline() function. It would be more convenient, if the software could
 detect whether we are in a GUI environment or in a simple terminal session
 and set a reasonable operation mode as default ...

 Here are some examples:

- Matplotlib animation example
http://pgi-jcns.fz-juelich.de/pub/doc/JuliaCon_2015/anim.html
- A molecular dynamics example
http://pgi-jcns.fz-juelich.de/pub/doc/JuliaCon_2015/700K_460.html


 Thanks,
 Josef


 On Friday, June 26, 2015 at 9:50:00 AM UTC-4, Josef Heinen wrote:

 Can anybody tell me, how to find out, whether we are running in a
 simple terminal session or in a GUI environment (Juni, Jupyter, ...) ?




[julia-users] JuliaCon Hacking

2015-06-26 Thread Jacob Quinn
A few of us are hacking tonight at the Hyatt Regency hotel for JuliaCon. 
We're on the 2nd floor at the end of the hall in the Aquarium room if 
anyone wants to join us.

-Jacob


[julia-users] Re: matlab-like textscan function?

2015-06-26 Thread Garrett Jenkinson
Thank you very much for the feedback! 

Since there is no efficient textscan-like function at this time, it seems 
to me that your DataFrames suggestion is perhaps the most sensible thing 
for me to do, since it appears to be a package built to do things somewhat 
close to my original goal (along with a lot of other statistical bells and 
whistles). Therefore, I would guess it would be more efficient than the 
{Any,2} array type from readdlm. 

If I do end up doing more complicated things using split() and parse(), I 
will post my solution back here with my code in case others come looking 
for a similar solution.


On Friday, June 26, 2015 at 9:06:08 AM UTC-5, Seth wrote:



 On Tuesday, June 23, 2015 at 10:45:11 PM UTC-5, Garrett Jenkinson wrote:

 Sorry if this is overly basic question, but I searched around the 
 documentation and the user group questions and have not been able to find 
 an answer. I wondering if there was a way in Julia to read from a formatted 
 text file, in the same way as matlab's textscan function:

 http://www.mathworks.com/help/matlab/ref/textscan.html

 readdlm does not seem to do what I am looking for (or maybe I'm using it 
 wrong!). Suppose I have data coming from a bed file, which is formatted 
 like this:

 chr1  500  34543   1.433
 chr1  46546  3543   4.68
 chr2  454334456  6.3545

 It would be nice to specify the format chr%u %u %u %f and to get four 
 vectors (three with Ints and one with floats):

 [1,1,2]
 [500,46546,4543]
 [34543,3543,34456]
 [1.433,4.68,6.3545]

 Is there a function to do this? If not, is there a simple way to do this 
 with the functions that are available? 

 Thanks!
 Garrett

 P.S. I know that @printf basically allows the opposite of this to be done 
 (i.e., to write out to a file by specifying a format). Basically, my 
 question is if there exists the equivalent @readf to read in something that 
 was produced by @printf?



 A quick and dirty way of doing this would be the following:

 t = readdlm(filename)'  # note the transpose at the end


 There are a couple of issues here:

 1: you'll need to manipulate the chr strings (to get rid of chr) - see 
 also #3, below
 2: you've got an array instead of a set of vectors (easy to convert using 
 comprehension or other methods)
 3: the array is of type {Any,2} which may lead to inefficiencies. If you 
 could get rid of chr before reading so that the file only contains things 
 that parse into numbers, the array would be of type {Float64, 2} which is 
 more precise, though still not 100% equivalent.

 If you want to get more complicated, you could use split() and parse() to 
 do what you need, iterating over each line. 

 You could also use DataFrames to do something like this:

 t = readtable(filename, separator = ' ', header=false)

 but you'd still require some manipulation.

 There also may be better / more clever ways, but these are the first that 
 come to mind.



Re: [julia-users] read(STDIN,Char); in Win ,

2015-06-26 Thread Seth
Given your use case, why aren't you using readline() and chomp()?

On Monday, June 22, 2015 at 2:31:38 PM UTC-5, paul analyst wrote:

 I now it. But how to do the code usefull ?

 Paul

 W dniu poniedziałek, 22 czerwca 2015 20:41:23 UTC+2 użytkownik Stefan 
 Karpinski napisał:

 You're on Windows – the line end is two characters, not one, so you have 
 to check for both characters:

 http://blog.codinghorror.com/the-great-newline-schism/

 On Mon, Jun 22, 2015 at 2:37 PM, paul analyst paul.a...@mail.com wrote:

 Why ? Mayby any user can help me ?
 Paul


 W dniu poniedziałek, 22 czerwca 2015 20:34:51 UTC+2 użytkownik Stefan 
 Karpinski napisał:

 C'mon, please stop starting new threads about this.

 On Mon, Jun 22, 2015 at 2:27 PM, paul analyst paul.a...@mail.com 
 wrote:

  in win 
 julia x= read(STDIN,Char)
 t
 't'

 julia

 julia

 julia x
 't'

 julia

 becose is \r and \n

 How to do  correctly ?

 for i=1:10println(i)println(if number is ok press 'y' 
 )read(STDIN,Char);end

 I nead to vave control the code in any steps on while . This while 
 jump 1  4  7 10 :/ 
 How do it ?
 Paul
  




Re: [julia-users] German Wikipedia Article

2015-06-26 Thread Tobias Ruck
With pleasure. I think this programming language deserves a good article in 
other languages as well. For German people who have no idea what Julia is, 
Wikipedia seems like an appropriate source of information, but when they 
see this small little text then they probably get distracted, thinking it 
would be some small project. Now, at least, it looks more professional.
I corrected some mistakes, if you find more, just correct them. I believe 
some links could be improved as well.

Am Freitag, 26. Juni 2015 07:57:52 UTC+1 schrieb René Donner:

 I proof-read the changes, they look good to me! 

 Thanks Tobias for tackling this, the previous entry was really not more 
 than a stub.



[julia-users] What's the best way to implement multiple methods with similar arguments?

2015-06-26 Thread Krystian Samp
Hello everyone,

I've just started to write a bit of code in Julia and I'm still exploring 
the best ways of doing this and that. I'm having this small problem now and 
wanted to ask for your advice.

I'd like to have two methods that retrieve some items. The first method 
takes the max number of items that should be retrieved. And the second 
method takes the max item id.

getitems( maxnumitems )
getitems( maxitemid )

In both cases the argument has the same type: Int. So how do I take the 
advantage of multiple dispatch mechanism in this situation? And is multiple 
dispatch really the recommended way of handling a situation like this one? 
Here're some alternatives that I thought of:

1. Use different function names: getitems, getitems_maxid. Not too elegant 
as you mix purpose and details of function usage in its name.
2. Use named arguments. This will cause the function implementation to grow 
(a series of if / else), again not too elegant.
3. Define a new type: ItemId which behaves exactly as Int but can be used 
to 'activate' multiple dispatch (one function would use Int and the second 
one would use ItemId). Generally not the best approach if you have methods 
each having an argument that should be really represented as an Int rather 
than a new type.
4. ...?

What would you recommend ?

Thank you,
ks


[julia-users] Is there a way to measure peak memory in Julia?

2015-06-26 Thread Kristen Lessel


Hi all,

I am looking for a way to measure the peak memory that a function uses.  I 
have looked into @time, and @allocated, but as far as I can tell, these 
give total memory only.  Is there currently any way, or workaround of some 
sort that might make it possible to measure peak memory?

Thank you in advance for any help you might be able to give!
Kristen


[julia-users] JuliaCon Hacking

2015-06-26 Thread Scott Jones
Are you all still up hacking? 

Re: [julia-users] JuliaCon Hacking

2015-06-26 Thread Jacob Quinn
They actually just kicked us out for the night, so we're calling it a
night. Looking forward to some more hacking tomorrow!

-Jacob

On Sat, Jun 27, 2015 at 1:11 AM, Scott Jones scott.paul.jo...@gmail.com
wrote:

 Are you all still up hacking?


[julia-users] Re: Is ready to function returning the greater variable?

2015-06-26 Thread paul analyst
Big thx , I tried maximum(x,y)
P.

W dniu piątek, 26 czerwca 2015 12:36:20 UTC+2 użytkownik Kristoffer 
Carlsson napisał:

 It is hard to understand your question but the function max(x,y) returns 
 the greater of x and y.

 On Friday, June 26, 2015 at 12:33:34 PM UTC+2, paul analyst wrote:

 Is ready to function returning the greater variable? 

 x = 1
 y = 2
 fun (x, y)
 y

 Paul



Re: [julia-users] German Wikipedia Article

2015-06-26 Thread Waldir Pimenta
Update: the changes have been marked as reviewed by user Kamsa Hapnida 
https://de.wikipedia.org/wiki/Benutzer:Kamsa_Hapnida, so now the new 
version is visible by default to everyone :)

On Friday, June 26, 2015 at 10:18:17 AM UTC+1, Tobias Ruck wrote:

 With pleasure. I think this programming language deserves a good article 
 in other languages as well. For German people who have no idea what Julia 
 is, Wikipedia seems like an appropriate source of information, but when 
 they see this small little text then they probably get distracted, thinking 
 it would be some small project. Now, at least, it looks more professional.
 I corrected some mistakes, if you find more, just correct them. I believe 
 some links could be improved as well.

 Am Freitag, 26. Juni 2015 07:57:52 UTC+1 schrieb René Donner:

 I proof-read the changes, they look good to me! 

 Thanks Tobias for tackling this, the previous entry was really not more 
 than a stub.



[julia-users] Re: Julia v0.3.10

2015-06-26 Thread Sisyphuss
We are all waiting for v0.4 !


On Thursday, June 25, 2015 at 5:47:51 AM UTC+2, Tony Kelman wrote:

 Hello all! The latest bugfix release of the 0.3.x Julia line has been 
 released. Binaries are available from the usual place 
 http://julialang.org/downloads/, and as is typical with such things, 
 please report all issues to either the issue tracker 
 https://github.com/JuliaLang/julia/issues, or email the julia-users 
 list.

 This is a bugfix release, primarily concerned with rebuilding the Windows 
 binaries against an updated libstdc++ ABI in order for packages using 
 WinRPM to work again. If you are on Windows and have hit Provider 
 PackageManager failed to satisfy dependency ... errors, please try this 
 version and hopefully it will be fixed. To see all other bugs fixed since 
 0.3.9, see this commit log 
 https://github.com/JuliaLang/julia/compare/v0.3.9...v0.3.10.

 This is a recommended upgrade for anyone using any of the previous 0.3.x 
 releases, and should act as a drop-in replacement for any of the 0.3.x 
 line. We would like to get feedback if someone has a working program that 
 breaks after this upgrade.

 -Tony



[julia-users] Re: Is ready to function returning the greater variable?

2015-06-26 Thread Kristoffer Carlsson
It is hard to understand your question but the function max(x,y) returns 
the greater of x and y.

On Friday, June 26, 2015 at 12:33:34 PM UTC+2, paul analyst wrote:

 Is ready to function returning the greater variable? 

 x = 1
 y = 2
 fun (x, y)
 y

 Paul



[julia-users] error while trying to plot a graph when using Graph.jl and GraphViz.jl

2015-06-26 Thread Michela Di Lullo
Hello, 

this is the procedure I'm following: 

*Pkg.add(Graphs)*

*using Graphs*


*Pkg.add(GraphViz)*

*using GraphViz*


*g=simple_graph(3)*

*add_edge!(g,1,2)*

*add_edge!(g,3,2)*

*add_edge!(g,3,1)*


*plot(g)*


and this is the error I get: 


*julia **plot(g)*

*ERROR: `to_dot` has no method matching 
to_dot(::GenericGraph{Int64,Edge{Int64},UnitRange{Int64},Array{Edge{Int64},1},Array{Array{Edge{Int64},1},1}},
 
::Pipe)*

* in plot at /Users/michela/.julia/v0.3/Graphs/src/dot.jl:86*


*julia **Format: x11 not recognized. Use one of: bmp canon cgimage cmap 
cmapx cmapx_np dot eps exr fig gif gv icns ico imap imap_np ismap jp2 jpe 
jpeg jpg pct pdf pic pict plain plain-ext png pov ps ps2 psd sgi svg svgz 
tga tif tiff tk vml vmlz xdot xdot1.2 xdot1.4*


does someone know what does it mean and how could I handle it? 

Thank you,


Michela

-- 
___
INVESTI SUL FUTURO, FAI CRESCERE L’UNIVERSITÀ:

*DONA IL 5 PER MILLE ALLA SAPIENZA*

CODICE FISCALE *80209930587*


[julia-users] Re: Embedding Julia with C++

2015-06-26 Thread Kostas Tavlaridis-Gyparakis
So, finally issue was solved by this answer here 
http://stackoverflow.com/questions/31051038/eclipse-c-having-trouble-with-including-a-file-with-extension-ji
.

On Thursday, June 25, 2015 at 3:33:45 PM UTC+2, Kostas Tavlaridis-Gyparakis 
wrote:

 But, sys.ji does exist in my folder of the path 
 /home/kostas/workspace/juli/Debug/../lib/x86_64-linux-gnu/julia/

 On Thursday, June 25, 2015 at 3:18:17 PM UTC+2, Scott Jones wrote:

  There is no .ji file anymore, although there is a command line option to 
 produce it, 
 --output-ji name


 On Monday, June 22, 2015 at 9:03:31 AM UTC-4, Kostas Tavlaridis-Gyparakis 
 wrote:

 Hello,
 I am trying to embed Julia in C++ but I currently face some sort of 
 issues.
 I am trying to follow the instructions shown here 
 http://julia.readthedocs.org/en/latest/manual/embedding/.
 First things first, I run Ubuntu 15.04 and my Julia version is v. 0.3.2 
 (it's the 
 version that is automatic installed when installing julia from ubuntu 
 center).
 I use eclipse for my C++ projects, yet again I have the following 
 issues, ac-
 cording to the instructions before trying to write any julia code in C 
 or C++ you
 need first to:
 1) link the julia library (assuming I undersand correctly this refers 
 to  libjulia.so),
 which should be located in Julia_DIR/usr/lib, yet again in my julia 
 directory
 there is no folder under the name usr. I did though find a libjulia.so 
 file in an
 other directory of my pc (/usr/lib/x86_64-linux-gnu/julia) and added 
 this one
 instead.
 2) include the path of julia.h which should be located in 
 Julia_DIR/inclue/julia
 now again in my julia directory there are no such folders and in general 
 there
 is nowhere in my pc any file such as julia.h. I did sth that is probably 
 wrong 
 and stupid but couldn't come up with anything else I downloaded this 
 https://github.com/JuliaLang/julia and I
 included the location of where julia.h is located to eclipse as well 
 with the direc-
 tions of all the other header files that were inculuded inside julia.h.

 Now when in Eclipse I am trying to compile and run a few simple julia 
 commands
 having included julia.h i receive an error saying that there is no uv.h 
 file in my
 system which is needed in one of the julia header files.
 I know that my whole approach is wrong, but yet again I couldn't find 
 anywhere
 in my pc the proper folders or files in order to follow the steps that 
 were sugges-
 ted in the julia website for running julia code inside C++.
 Any help would be much appreciated.

 Also, one more thing I wanted to ask is the following, in general 
 writing Julia
 code inside a C++ code is limited?
 What I want to do in general is write a JuMP model inside C++, so in 
 general
 is this possible, in the sense that by embedding Julia inside C++, will 
 I be able
 to use all of the tools and code of Julia language or is this only 
 limited to a cer-
 tain amount of commands and packages?



Re: [julia-users] Re: Julia v0.3.10

2015-06-26 Thread Michele Zaffalon
But nevertheless thank you for releasing a stable version for all of us to
use.

On Fri, Jun 26, 2015 at 2:25 PM, Sisyphuss zhengwend...@gmail.com wrote:

 We are all waiting for v0.4 !


 On Thursday, June 25, 2015 at 5:47:51 AM UTC+2, Tony Kelman wrote:

 Hello all! The latest bugfix release of the 0.3.x Julia line has been
 released. Binaries are available from the usual place
 http://julialang.org/downloads/, and as is typical with such things,
 please report all issues to either the issue tracker
 https://github.com/JuliaLang/julia/issues, or email the julia-users
 list.

 This is a bugfix release, primarily concerned with rebuilding the Windows
 binaries against an updated libstdc++ ABI in order for packages using
 WinRPM to work again. If you are on Windows and have hit Provider
 PackageManager failed to satisfy dependency ... errors, please try this
 version and hopefully it will be fixed. To see all other bugs fixed since
 0.3.9, see this commit log
 https://github.com/JuliaLang/julia/compare/v0.3.9...v0.3.10.

 This is a recommended upgrade for anyone using any of the previous 0.3.x
 releases, and should act as a drop-in replacement for any of the 0.3.x
 line. We would like to get feedback if someone has a working program that
 breaks after this upgrade.

 -Tony