[julia-users] Easy way to declare function works on array of floats

2014-05-24 Thread James Crist
I've been struggling with this for a while, and haven't found a way to do it that I'm happy with. I'm sure there is one though. Basically, I want to declare a function that works on an array of floats. Doesn't matter what kind of float. Doesn't matter if there are 2 different kinds of float arr

[julia-users] Easy way to declare function works on array of floats

2014-05-24 Thread James Crist
I've been struggling with this for a while, and haven't found a way to do it that I'm happy with. I'm sure there is one though. Basically, I want to declare a function that works on an array of floats. Doesn't matter what kind of float. Doesn't matter if there are 2 different kinds of float arr

Re: [julia-users] What is the ruby equivalent of this?

2014-05-24 Thread Elliot Saba
I stand corrected. At some point this may have been true, but it certainly isn't true now. I can confirm that they construct the exact same expressions, and there's no performance difference that I can find. Also thanks for the double-posting explanation Stefan, I'll keep that in mind. Sorry fo

[julia-users] instance, type & enumeration section in style guide

2014-05-24 Thread Rob J. Goedman
I've been trying to understand this particular section towards the end of the style guide, but seem to be going round and round in circles. A stripped down version is shown below. The definition of Unit_e and Diag_e goes directly against what is suggested in that section (I think). I've seen an

[julia-users] Re: Linear operators for Julia

2014-05-24 Thread Pierre-Yves Gérardy
I forgot to finish this: I've seen the immutable Transpose proposition, but if the underlying ... > ... array is mutable, it is not very robust. —Pierre-Yves > > Also: > > threedee = [|| 1, 2 | | 5, 6 || > || 3, 4 | | 7, 8 ||] > > fourdee = [||| 1, 2 | | 5, 6 || > || 3

[julia-users] Re: Linear operators for Julia

2014-05-24 Thread Pierre-Yves Gérardy
Now that I think of it, wouldn't it make sense to have this mechanism for matrix operations in general (for Julia, that is)? You'd need immutable matrices. Only evaluate the operations when a result is indexed, using some kind of linear operation interpreter works iteratively without allocatin

Re: [julia-users] What is the ruby equivalent of this?

2014-05-24 Thread Ivar Nesje
@staticfloat I was sure fullname(p::Person) = string(p.firstname, " ", p.lastname) And fullname(p::Person) = "$(p.firstname) $(p.lastname)" Created the exact same expression after parsing?

Re: [julia-users] How to code this trivial example in julia

2014-05-24 Thread Kevin Squire
I'll bite: how can we code the following trivial example in julia? > > class Person > attr_accessor :lastname, :firstname > > def fullname > "#{firstname} #{lastname}" > end > end > > jan = Person.new > jan.firstname = "Jan" > jan.lastname = "Janssen" > > puts jan.fullname > t

Re: [julia-users] What is the ruby equivalent of this?

2014-05-24 Thread Stefan Karpinski
The double posting that occasionally happens on these lists is usually because we moderate first-time posters and people post once and assume it was eaten by the system, and while their message is awaiting moderation, they post again. I generally just approve all of the posts. This is a bit annoyin

Re: [julia-users] Erratic behaviour of simple parallel programs

2014-05-24 Thread Kevin Squire
Hi there, I just ran your code, and everything worked for me without error. Some thoughts: 1. What version of julia are you on? (I'm on a 0.3.0 prerelease) 2. Have you run Pkg.update() recently? The error could be a package bug that was recently fixed. Generally, it's a good idea to include t

Re: [julia-users] What is the ruby equivalent of this?

2014-05-24 Thread Elliot Saba
Ah yes, I forgot to print out the fullname at the end, but between my answer and Avik's you should be able to piece it together. :) -E On Sat, May 24, 2014 at 2:46 PM, Elliot Saba wrote: > Hey there, Remco. Double-posting is not necessary to get a response, > things tend to get answered withi

Re: [julia-users] What is the ruby equivalent of this?

2014-05-24 Thread Elliot Saba
Hey there, Remco. Double-posting is not necessary to get a response, things tend to get answered within a day or so, often much sooner. To create an object type in Julia, you can take a look at the documentation for defining composite types

[julia-users] Re: What is the ruby equivalent of this?

2014-05-24 Thread Avik Sengupta
julia> type Person firstname lastname end julia> fullname(x::Person) = "$(x.firstname) $(x.lastname)" fullname (generic function with 1 method) julia> jan=Person("Jan", "Janssen") Person("Jan","Janssen") julia> print(fullname(jan)) Janssen Jan On Saturday, 24 May 201

Re: [julia-users] Shameless plug for DotPlot.jl - plots in your terminal

2014-05-24 Thread Adam Smith
Patrick: I hadn't seen urwid before. It looks powerful and slightly insane; I wouldn't want to make TextPlots depend on something so massive (or on python, for that matter). Keno, Stefan: I'll see what I can do using the recent Base.Terminals stuff when I work on the reporting process. I need t

[julia-users] How to code this trivial example in julia

2014-05-24 Thread Remco
Hi everybody, I am new to julia and my day to day language is ruby. how can we code the following trivial example in julia? class Person attr_accessor :lastname, :firstname def fullname "#{firstname} #{lastname}" end end jan = Person.new jan.firstname = "Jan" jan.lastna

[julia-users] What is the ruby equivalent of this?

2014-05-24 Thread Remco
Hi, I am new to julia and i am not sure how to do this in julia: class Person attr_accessor :lastname, :firstname def fullname "#{firstname} #{lastname}" end end jan = Person.new jan.firstname = "Jan" jan.lastname = "Janssen" puts jan.fullname Regards, Remco

Re: [julia-users] Shameless plug for DotPlot.jl - plots in your terminal

2014-05-24 Thread Stefan Karpinski
Given that we have our own terminal functionality and ncurses is generally considered to be not so easy to use, it may be worthwhile to have our own ncurses-like library. But better and simpler, of course. This terminal stuff is a lot easier if you make the radical assumption that people are using

Re: [julia-users] Can we have more examples in the help()?

2014-05-24 Thread Stefan Karpinski
Perfect. I'm just gonna go find a cash machine. On Sat, May 24, 2014 at 5:07 PM, Samuel Colvin wrote: > Couldn't it be "julia by alfa"? > > http://en.wikipedia.org/wiki/Alfa_Romeo_Giulia > > > On Saturday, 24 May 2014 21:17:55 UTC+1, Stefan Karpinski wrote: > >> In which I video blog about Juli

Re: [julia-users] Can we have more examples in the help()?

2014-05-24 Thread Samuel Colvin
Couldn't it be "julia by alfa"? http://en.wikipedia.org/wiki/Alfa_Romeo_Giulia On Saturday, 24 May 2014 21:17:55 UTC+1, Stefan Karpinski wrote: > > In which I video blog about Julia while sitting in small Italian cars. > > On May 24, 2014, at 4:15 PM, Stefan Karpinski > > > wrote: > > I'm consi

[julia-users] Re: Linear operators for Julia

2014-05-24 Thread Pierre-Yves Gérardy
Rather than accumulating callbacks, couldn't you keep an array of operators and devectorize the computation? A potential drawback would be a loss of extensibility... You could also cache the realized operator after the first evaluation (memoization). —Pierre-Yves On Saturday, May 24, 2014 9:

Re: [julia-users] build failure in vagrant/virtualbox?

2014-05-24 Thread S Wade
For future reference. The issue is that the default VirtualBox images for Ubuntu Saucy are configured with 256MB or RAM. The build step fails due to out-of-memory errors. Once I increased the memory allocated to the VM to 1gb it could build without errors. thanks, wade On May 15, 2014, at 7

Re: [julia-users] Can we have more examples in the help()?

2014-05-24 Thread Stefan Karpinski
In which I video blog about Julia while sitting in small Italian cars. > On May 24, 2014, at 4:15 PM, Stefan Karpinski > wrote: > > I'm considering starting a blog called "Julia by fiat". > >> On May 24, 2014, at 2:36 PM, Samuel Colvin wrote: >> >> By all means contribute! Even just adding a

Re: [julia-users] Can we have more examples in the help()?

2014-05-24 Thread Stefan Karpinski
I'm considering starting a blog called "Julia by fiat". > On May 24, 2014, at 2:36 PM, Samuel Colvin wrote: > > By all means contribute! Even just adding an issue with what you would like > to see would be a good start, obviously pull requests would be even better. > > It needs lots more examp

Re: [julia-users] What's with the Nothing type?

2014-05-24 Thread Patrick O'Leary
`Nothing` is a type inhabited by one value, which is spelled `nothing`. The type `None` is inhabited by no values. In other words, you can't even have a value of type `None` to dispatch on. This is why it is eliminated when you take the type union--all values in `Union(Int64, None)` are actually

[julia-users] Linear operators for Julia

2014-05-24 Thread Dominique Orban
I just put together a basic linear operator package for Julia: https://github.com/dpo/linop.jl The central idea is that operators act like matrices, but it would be too expensive to combine them before they are actually applied to a vector. Another benefit is that you can manipulate them as if

[julia-users] Erratic behaviour of simple parallel programs

2014-05-24 Thread St Elmo Wilken
Hi (again), I have a weird issue where I need to run a much simpler version of my code (test.jl) for the more "complicated" one to work (test2.jl). Suppose you have just started Julia then: If I run test.jl (this works without error), then test2.jl and then test2.jl again my code works, note:

Re: [julia-users] Can we have more examples in the help()?

2014-05-24 Thread Samuel Colvin
By all means contribute! Even just adding an issue with what you would like to see would be a good start, obviously pull requests would be even better. It needs lots more examples, and probably some refactoring to make logical sense as one reads through. More generally, I included all the examp

[julia-users] Design question

2014-05-24 Thread Abe Schneider
I'm currently working on a problem where I have a tree structure composed of: type Node value label children end which I want to traverse and have different functions called depending on the value of label. Normally I would just sub-type Node. However, the results are coming from a parse

Re: [julia-users] What's with the Nothing type?

2014-05-24 Thread Steve Kelly
I've done some quick experiments with None and Nothing, and I am seeing nearly identical performance and memory allocation. It seems 'Nothing' is more idiomatic Julia considering the role it plays in function return. Another insight I would like to add is the role it plays in type unions. In the R

Re: [julia-users] Can we have more examples in the help()?

2014-05-24 Thread Florian Oswald
Beautiful website! I may have some dumb beginners stuff, given that's my current julia level. Cheers On Saturday, 24 May 2014, Samuel Colvin wrote: > I agree one of the big things Julia is missing is examples. > > Particularly the "dumb" examples of how to do trivial things; this is > surely key

Re: [julia-users] Can we have more examples in the help()?

2014-05-24 Thread Samuel Colvin
I agree one of the big things Julia is missing is examples. Particularly the "dumb" examples of how to do trivial things; this is surely key to attracting new users. Specific examples of functions usage should be in the docs. But for general examples it's less clear. I started writing Julia B

[julia-users] Re: Parallel for slow initially

2014-05-24 Thread St Elmo Wilken
That does make a difference but quite as much as running it twice though.. No precompile: Run 1 = 0.76 s, Run 2 = 0.077 s (ish) With precompile: Run 1 = 0.56 s, Run 2 = 0.05 s (ish) Good to know though, thanks! On Saturday, May 24, 2014 5:57:08 PM UTC+2, Patrick O'Leary wrote: > > Scratch that,

Re: [julia-users] What's with the Nothing type?

2014-05-24 Thread Dom Luna
Thanks for all the helpful messages everyone, much appreciated:)

[julia-users] Re: Parallel for slow initially

2014-05-24 Thread Patrick O'Leary
Scratch that, I forgot about `precompile`: http://docs.julialang.org/en/latest/stdlib/base/#Base.precompile That may work for your needs. On Saturday, May 24, 2014 10:21:16 AM UTC-5, Patrick O'Leary wrote: > > The first time you run a Julia function, it is lowered, type-inferred, > generates LL

Re: [julia-users] Shameless plug for DotPlot.jl - plots in your terminal

2014-05-24 Thread Keno Fischer
There is NCurses bindings for Julia which used to work before Terminals was integrated into Julia: https://github.com/loladiro/NCurses.jl. Now I'm not sure anymore. Will put it on the list of things to do, but no promises. On Sat, May 24, 2014 at 5:14 PM, Patrick O'Leary wrote: > It might be pos

[julia-users] Re: Parallel for slow initially

2014-05-24 Thread Patrick O'Leary
The first time you run a Julia function, it is lowered, type-inferred, generates LLVM code which is then optimized and compiled down to native code. The second time you run a Julia function, the native code already generated is called. (This is why you'll see the first run of a Julia function

Re: [julia-users] Shameless plug for DotPlot.jl - plots in your terminal

2014-05-24 Thread Patrick O'Leary
It might be possible to PyCall into urwid, though I don't know if there's a way to rectify the event loops. On Friday, May 23, 2014 3:05:10 PM UTC-5, Adam Smith wrote: > > Sweet, that one turns out surprisingly well! When I get further on the > main project I'm building in Julia, I want to add a

Re: [julia-users] What's with the Nothing type?

2014-05-24 Thread Patrick O'Leary
On Friday, May 23, 2014 5:00:07 PM UTC-5, Dom Luna wrote: > > That cleared it up, thanks! Do functions that don't explicitly return > anything then implicitly return Nothing? > And to add to the other answers you've gotten, note that `Nothing` is the type of the value `nothing`. The usual return

[julia-users] Parallel for slow initially

2014-05-24 Thread St Elmo Wilken
Hi, I'm using a parallel for loop to evaluate a function a few times; the weird thing is that if I run the program more than once there is a significant speed improvement. The speed improvement phenomenon is independent of how many processes I have (the results discussed below are for 4 proces

Re: [julia-users] Re: Waterloo Graphics for Julia?

2014-05-24 Thread Isaiah Norton
> > > Still, it raises the question about an easy way to interface julia + java > (JVM). > https://github.com/aviks/JavaCall.jl

Re: [julia-users] Re: Waterloo Graphics for Julia?

2014-05-24 Thread Andreas Lobinger
Hello colleague, On Saturday, May 24, 2014 2:39:49 PM UTC+2, Stefan Karpinski wrote: > > This seems pretty tenuously related to Julia and a lot like an ad. > Still, it raises the question about an easy way to interface julia + java (JVM).

Re: [julia-users] Can we have more examples in the help()?

2014-05-24 Thread Stefan Karpinski
Just try to match the surrounding style and get the RST formatting right. > On May 24, 2014, at 8:47 AM, Florian Oswald wrote: > > alright cool will do! > is there anything special i need to keep in mind (format, conventions etc) or > i just add this below whatever I find in the curren help? >

Re: [julia-users] Can we have more examples in the help()?

2014-05-24 Thread Florian Oswald
alright cool will do! is there anything special i need to keep in mind (format, conventions etc) or i just add this below whatever I find in the curren help? cheers On 24 May 2014 13:44, Stefan Karpinski wrote: > We definitely need more examples in help. This is very tedious to add but > fortun

Re: [julia-users] Can we have more examples in the help()?

2014-05-24 Thread Stefan Karpinski
We definitely need more examples in help. This is very tedious to add but fortunately highly parellelizable – if you encounter a function that confuses you and needs an example, you can easily add one via a pull request. > On May 24, 2014, at 7:33 AM, Florian Oswald wrote: > > Hi all, > > I j

Re: [julia-users] Re: Waterloo Graphics for Julia?

2014-05-24 Thread Stefan Karpinski
This seems pretty tenuously related to Julia and a lot like an ad. > On May 23, 2014, at 7:17 AM, sigt...@kcl.ac.uk wrote: > > As an update to this, I have now posted waterlooFX. > > This is a rewrite using the new JavaFX RCP under-the-hood (which uses full > hardware acceleration) and require

[julia-users] Re: Problems with the scheduling example in the docs

2014-05-24 Thread St Elmo Wilken
Aahhh... That makes sense, thanks! On Friday, May 23, 2014 6:48:18 PM UTC+2, Peter Simon wrote: > > I haven't seen any other answers to these questions, so I'll take a shot > at providing some. Corrections are welcome. > > Answer 1) The purpose of the @sync block is to prevent execution (of the

[julia-users] Can we have more examples in the help()?

2014-05-24 Thread Florian Oswald
Hi all, I just spent 20 minutes trying to figure out why this is not working: A =[1,2,3] repeat(A,2,1) After looking at help(repeat), I (slightly) improved my attempt to repeat(A,[2,2,2],[1,1,1]) but still no luck. Now this may be completely my shortcoming of a proper understanding of the Jul

[julia-users] Re: Metaprogramming weirdness

2014-05-24 Thread Toivo Henningsson
You might want try Base.Meta.show_sexpr as well, it was created to be a more compact alternative to dump for expressions.

Re: [julia-users] Shameless plug for DotPlot.jl - plots in your terminal

2014-05-24 Thread Mike Innes
StreamPunkPlots.jl? On 24 May 2014 07:44, Keno Fischer wrote: > Do you mean StreamPunkPlot.jl? > > > On Sat, May 24, 2014 at 6:44 AM, Isaiah Norton wrote: > >> If the name is still up for debate, I'd like to nominate SteamPunkPlot.jl >> >> >> On Fri, May 23, 2014 at 3:56 PM, Stefan Karpinski >