[julia-users] Re: Easy way to copy structs.

2014-12-09 Thread Utkarsh Upadhyay
That was what exactly I was looking for. I have subscribed to 
https://github.com/JuliaLang/julia/issues/5333 now.

Thanks!

On Monday, December 8, 2014 10:16:23 PM UTC+1, Tobias Knopp wrote:
>
> please have a look at https://github.com/JuliaLang/julia/pull/6122 which 
> looks like the way to go (once merged)
>
> Cheers
>
> Tobi
>
> Am Montag, 8. Dezember 2014 20:18:18 UTC+1 schrieb Josh Langsfeld:
>>
>> On Monday, December 8, 2014 12:15:23 PM UTC-5, Utkarsh Upadhyay wrote:
>>>
>>> I have just tried playing with Julia and I find myself often copying 
>>> `immutable` objects while changing just one field:
>>>
>>> function setX(pt::Point, x::Float64)
>>>   # Only changing the `x` field
>>>   return Point(x, pt.y, pt.z, pt.color, pt.collision, pt.foo, pt.bar);
>>> end
>>>
>>> Is there is any syntactical sugar to avoid having to write out all the 
>>> other fields which are not changing (e.g. pt.y, pt.z, etc.) while creating 
>>> a new object?
>>> Apart from making the function much easier to understand, this will also 
>>> make it much less of a hassle to change fields on the type.
>>>
>>> Thanks.
>>>
>>
>> I played with it some more and this seems to work:
>>
>> defn = setdiff(names(Point), [:x])
>>  @eval Point(x, $([:(pt.$n) for n in defn]...))
>>
>> Of course, this will only work for the x parameter which comes first in 
>> the field list. I'm not sure how you might extend it to arguments in the 
>> middle of the list, but maybe you can figure it out.
>>
>

Re: [julia-users] scoping and begin

2014-12-09 Thread Toivo Henningsson
That explains a lot. Is it documented?

[julia-users] Too many warnings

2014-12-09 Thread Avik Sengupta
On running the Gadfly tests on 0.4, there are too many warnings generated 
on STDOUT. As a result, Travis terminates the build, complaining that the 
build output has crossed 4 MB. 

Warnings of the following nature are generated, over and over again. More 
here: https://travis-ci.org/dcjones/Gadfly.jl/jobs/43356151 

Is there a flag suppress these kinds of warnings? 

WARNING: (iround{T})(::Type{T},x) is deprecated, use round(T,x) instead.
 in svg_print_float at /home/travis/.julia/v0.4/Compose/src/svg.jl:45
 in print_svg_path at /home/travis/.julia/v0.4/Compose/src/svg.jl:536
 in finish at /home/travis/.julia/v0.4/Compose/src/svg.jl:368
 in draw at /home/travis/.julia/v0.4/Compose/src/container.jl:395
 in draw at /home/travis/.julia/v0.4/Gadfly/src/Gadfly.jl:774
 in run_tests at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:116
 in include at ./boot.jl:242
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:300
 in _start at ./client.jl:382
 in _start_3B_4080 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
Rendering points on png backend.
WARNING: iround(x) is deprecated, use round(Integer,x) instead.
 in newsurface at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:253
 in call at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:127
 in call at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:139
 in anonymous at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:91
 in run_tests at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:116
 in include at ./boot.jl:242
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:300
 in _start at ./client.jl:382
 in _start_3B_4080 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so




Re: [julia-users] Too many warnings

2014-12-09 Thread Tim Holy
https://github.com/JuliaLang/julia/issues/9212

Currently the only fix Iis to eliminate the warning. See 
https://github.com/JuliaLang/Compat.jl

--Tim

On Tuesday, December 09, 2014 04:04:49 AM Avik Sengupta wrote:
> On running the Gadfly tests on 0.4, there are too many warnings generated
> on STDOUT. As a result, Travis terminates the build, complaining that the
> build output has crossed 4 MB.
> 
> Warnings of the following nature are generated, over and over again. More
> here: https://travis-ci.org/dcjones/Gadfly.jl/jobs/43356151
> 
> Is there a flag suppress these kinds of warnings?
> 
> WARNING: (iround{T})(::Type{T},x) is deprecated, use round(T,x) instead.
>  in svg_print_float at /home/travis/.julia/v0.4/Compose/src/svg.jl:45
>  in print_svg_path at /home/travis/.julia/v0.4/Compose/src/svg.jl:536
>  in finish at /home/travis/.julia/v0.4/Compose/src/svg.jl:368
>  in draw at /home/travis/.julia/v0.4/Compose/src/container.jl:395
>  in draw at /home/travis/.julia/v0.4/Gadfly/src/Gadfly.jl:774
>  in run_tests at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:116
>  in include at ./boot.jl:242
>  in include_from_node1 at loading.jl:128
>  in process_options at ./client.jl:300
>  in _start at ./client.jl:382
>  in _start_3B_4080 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
> Rendering points on png backend.
> WARNING: iround(x) is deprecated, use round(Integer,x) instead.
>  in newsurface at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:253
> in call at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:127 in
> call at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:139 in
> anonymous at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:91 in
> run_tests at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:116 in
> include at ./boot.jl:242
>  in include_from_node1 at loading.jl:128
>  in process_options at ./client.jl:300
>  in _start at ./client.jl:382
>  in _start_3B_4080 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so



[julia-users] Re: Too many warnings

2014-12-09 Thread Simon Danisch
I started fixing these warnings, but haven't made a PR yet, as I still had 
some issues with the tests in Gadfly...

Am Dienstag, 9. Dezember 2014 13:04:49 UTC+1 schrieb Avik Sengupta:
>
> On running the Gadfly tests on 0.4, there are too many warnings generated 
> on STDOUT. As a result, Travis terminates the build, complaining that the 
> build output has crossed 4 MB. 
>
> Warnings of the following nature are generated, over and over again. More 
> here: https://travis-ci.org/dcjones/Gadfly.jl/jobs/43356151 
>
> Is there a flag suppress these kinds of warnings? 
>
> WARNING: (iround{T})(::Type{T},x) is deprecated, use round(T,x) instead.
>  in svg_print_float at /home/travis/.julia/v0.4/Compose/src/svg.jl:45
>  in print_svg_path at /home/travis/.julia/v0.4/Compose/src/svg.jl:536
>  in finish at /home/travis/.julia/v0.4/Compose/src/svg.jl:368
>  in draw at /home/travis/.julia/v0.4/Compose/src/container.jl:395
>  in draw at /home/travis/.julia/v0.4/Gadfly/src/Gadfly.jl:774
>  in run_tests at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:116
>  in include at ./boot.jl:242
>  in include_from_node1 at loading.jl:128
>  in process_options at ./client.jl:300
>  in _start at ./client.jl:382
>  in _start_3B_4080 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
> Rendering points on png backend.
> WARNING: iround(x) is deprecated, use round(Integer,x) instead.
>  in newsurface at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:253
>  in call at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:127
>  in call at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:139
>  in anonymous at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:91
>  in run_tests at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:116
>  in include at ./boot.jl:242
>  in include_from_node1 at loading.jl:128
>  in process_options at ./client.jl:300
>  in _start at ./client.jl:382
>  in _start_3B_4080 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
>
>
>

[julia-users] win , julia start from start_julia.bat with commands, wahat wrong ?

2014-12-09 Thread paul analyst
file start_julia.bat
include 

C:\Users\SAMSUNG2\AppData\Local\Julia-0.3.3\bin\julia.exe -L "job.jl"

Julia run, but not run the job.jl 

how to run job.jl automaticly in start_julia.bat file  ?

Paul.


Re: [julia-users] Julia iPython notebook doesn't display inline graphics

2014-12-09 Thread RecentConvert
It's not working for me either. PyPlot will plot to an external window but 
I can't seem to get it to plot inline in the notebook. I've even tried 
other input arguments as well with no luck.

ipython notebook --matplotlib=qt --profile=julia

Kubuntu 14.04 64-bit
Qt 4.8.6
Julia Version 0.3.2
Commit 8227746* (2014-10-21 22:05 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz
  WORD_SIZE: 64
   Ubuntu 14.04.1 LTS
  uname: Linux 3.13.0-40-generic #69-Ubuntu SMP Thu Nov 13 17:53:56 UTC 
2014 x86_64 x86_64
Memory: 15.586982727050781 GB (10886.7734375 MB free)
Uptime: 31616.0 sec
Load Avg:  0.3779296875  0.29638671875  0.2958984375
Intel(R) Core(TM) i5-4570 CPU @ 3.20GHz: 
   speed user nice  sys idle  
irq
#1   800 MHz 159332 s   3587 s  63328 s2834790 s  8 
s
#2   800 MHz 162030 s   4625 s  59546 s2828052 s  0 
s
#3  3201 MHz 162877 s   5141 s  61669 s2804879 s  1 
s
#4   800 MHz 153968 s   5087 s  64039 s2836716 s  0 
s

  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
Environment:
  TERM = xterm
  XDG_SESSION_PATH = /org/freedesktop/DisplayManager/Session0
  XDG_SEAT_PATH = /org/freedesktop/DisplayManager/Seat0
  DEFAULTS_PATH = /usr/share/gconf/kde-plasma.default.path
  PATH = 
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
  MANDATORY_PATH = /usr/share/gconf/kde-plasma.mandatory.path
  HOME = /home/somebody
  PROFILEHOME = 
  QT_PLUGIN_PATH = 
/home/somebody/.kde/lib/kde4/plugins/:/usr/lib/kde4/plugins/
  PYTHONHOME = /usr:/usr

Package Directory: /home/somebody/.julia/v0.3
6 required packages:
 - DataFrames0.5.12
 - Dates 0.3.2
 - Distributions 0.6.1
 - IJulia0.1.16
 - PyPlot1.4.3
 - ZMQ   0.1.15
18 additional packages:
 - ArrayViews0.4.8
 - BinDeps   0.3.7
 - Color 0.3.14
 - Compat0.2.5
 - DataArrays0.2.5
 - FixedPointNumbers 0.0.6
 - GZip  0.2.13
 - JSON  0.3.9
 - LaTeXStrings  0.1.2
 - Nettle0.1.7
 - PDMats0.3.1
 - PyCall0.7.1
 - REPLCompletions   0.0.3
 - Reexport  0.0.2
 - SHA   0.0.3
 - SortingAlgorithms 0.0.2
 - StatsBase 0.6.10
 - URIParser 0.0.3



Re: [julia-users] Julia iPython notebook doesn't display inline graphics

2014-12-09 Thread Steven G. Johnson


On Tuesday, December 9, 2014 11:15:23 AM UTC-5, RecentConvert wrote:
>
> It's not working for me either. PyPlot will plot to an external window but 
> I can't seem to get it to plot inline in the notebook. I've even tried 
> other input arguments as well with no luck.
>
> ipython notebook --matplotlib=qt --profile=julia
>

What is the output of:

using PyPlot
PyPlot.backend

?  Note that --matplotlib=qt does nothing in IJulia AFAIK.   If you want to 
force the Qt backend, you should either put that in your .matplotlibrc file 
or do:

using PyCall
pygui(:qt)
using PyPlot


[julia-users] Adding Compose circles/lines/polygons to Gadfly plots?

2014-12-09 Thread Sheehan Olver

I want to add, say, a triangle or circle to a Gadfly plot.  The following 
works

compose(render(plot(x=1:10,y=1:10)),circle(0.5,0.5,0.1))

But I want the circle to use the same coordinate system as the plot.  Any 
advice?




[julia-users] Re: DataFrames and NamedArrays: are they suitable for heavier computations ?

2014-12-09 Thread David van Leeuwen
Hello Ján,

On Monday, December 8, 2014 11:04:08 AM UTC+1, Ján Dolinský wrote:
>
>
>> Hi,
>
> Thanks for the explanation. Suppose I have a named array X with 3 columns 
> "x1", "x2" and "x3" and I do prod(X, 2). Will the resulting array (a single 
> columns in this case) have a sensible name like "x1x2x3" ? Or more 
> generally, how are these new names generated and for which operations ?
>
> For some operators NamedArrays tries to generate sensible names, including 
prod():

julia> n = NamedArray(rand(2,3), ([:a, :b], [:x1, :x2, :x3]), ("rows", 
"cols"))

2x3 NamedArray{Float64,2,Array{Float64,2},(Dict{Symbol,Int64},Dict{Symbol,
Int64})}
rows \ cols x1 x2 x3 
a 0.712609 0.607843 0.18794
b 0.208052 0.4409 0.282238

julia> prod(n, 2) 
2x1 NamedArray{Float64,2,Array{Float64,2},(Dict{Symbol,Int64},Dict{
ASCIIString,Int64})} 
rows \ cols prod(cols) 
a 0.0814106 
b 0.0258897 


So the column in this case is called "prod(cols)".  Note that we started 
with symbols as names for columns indices in this example but prod() 
"normalizes" this to ASCIIStrings.  

I've worked hard to make the index type a free choice, but some 
automatically generated names default to Strings.  

You can find the list of operations for which NamedArrays tries to give 
sensible names here 
, 
in the source code.  I am open for suggestions and pull requests for more 
functions or other names.

As a result of your original question I am now implementing the matrix 
operation support more thoroughly, basically following the Julia manual for 
possible matrix operations.  Some take a bit of effort to implement, for 
some I need to think about sensible names for the dimensions.   Expect an 
update within the next week or so. 

Cheers, 

---david

Thanks,
> Jan 
>


[julia-users] home page content

2014-12-09 Thread Stefan Karpinski
We're looking to redesign the JuliaLang.org home page and try to give it a
little more focus than it currently has. Which raises the question of what
to focus on. We could certainly have better code examples and maybe
highlight features of the language and its ecosystem better. What do people
think we should include?


[julia-users] Re: home page content

2014-12-09 Thread elextr


On Wednesday, December 10, 2014 8:23:26 AM UTC+10, Stefan Karpinski wrote:
>
> We're looking to redesign the JuliaLang.org home page and try to give it a 
> little more focus than it currently has. Which raises the question of what 
> to focus on. We could certainly have better code examples and maybe 
> highlight features of the language and its ecosystem better. What do people 
> think we should include?
>

The whole site seems to be offline?  Is that because of this? 


Re: [julia-users] Re: home page content

2014-12-09 Thread Elliot Saba
We're having intermittent DNS issues.  http://julialang.org is now up for
me however, and I can dig it: (I couldn't, previously)

$ dig julialang.org

; <<>> DiG 9.8.3-P1 <<>> julialang.org
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56740
;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4

;; QUESTION SECTION:
;julialang.org. IN  A

;; ANSWER SECTION:
julialang.org.  2202IN  CNAME   julialang.github.io.
julialang.github.io.2202IN  CNAME   github.map.fastly.net.
github.map.fastly.net.  15  IN  A   199.27.79.133
...
-E



On Tue, Dec 9, 2014 at 2:46 PM,  wrote:

>
>
> On Wednesday, December 10, 2014 8:23:26 AM UTC+10, Stefan Karpinski wrote:
>>
>> We're looking to redesign the JuliaLang.org home page and try to give it
>> a little more focus than it currently has. Which raises the question of
>> what to focus on. We could certainly have better code examples and maybe
>> highlight features of the language and its ecosystem better. What do people
>> think we should include?
>>
>
> The whole site seems to be offline?  Is that because of this?
>


Re: [julia-users] Re: home page content

2014-12-09 Thread Leah Hanson
Seeing code examples of a type and a couple of functions that use it would
probably give a good idea of what the code looks like. The JuMP seems
exciting enough to highlight both as a package and a use of macros.

I don't know if you want to encourage different styles, but seeing examples
of Python like, c like, and functional-ish ways of writing Julia would be a
way to show off the variety of things you can do.

--Leah
On Wed, Dec 10, 2014 at 8:50 AM Elliot Saba  wrote:

> We're having intermittent DNS issues.  http://julialang.org is now up for
> me however, and I can dig it: (I couldn't, previously)
>
> $ dig julialang.org
>
> ; <<>> DiG 9.8.3-P1 <<>> julialang.org
> ;; global options: +cmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56740
> ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4
>
> ;; QUESTION SECTION:
> ;julialang.org. IN  A
>
> ;; ANSWER SECTION:
> julialang.org.  2202IN  CNAME   julialang.github.io.
> julialang.github.io.2202IN  CNAME   github.map.fastly.net.
> github.map.fastly.net.  15  IN  A   199.27.79.133
> ...
> -E
>
>
>
> On Tue, Dec 9, 2014 at 2:46 PM,  wrote:
>
>>
>>
>> On Wednesday, December 10, 2014 8:23:26 AM UTC+10, Stefan Karpinski wrote:
>>>
>>> We're looking to redesign the JuliaLang.org home page and try to give it
>>> a little more focus than it currently has. Which raises the question of
>>> what to focus on. We could certainly have better code examples and maybe
>>> highlight features of the language and its ecosystem better. What do people
>>> think we should include?
>>>
>>
>> The whole site seems to be offline?  Is that because of this?
>>
>
>


Re: [julia-users] Re: home page content

2014-12-09 Thread Elliot Saba
Perhaps not now, but as a long-term goal, having a live, editable widget of
code on the homepage is such an awesome draw-in, IMO.
-E

On Tue, Dec 9, 2014 at 3:43 PM, Leah Hanson  wrote:

> Seeing code examples of a type and a couple of functions that use it would
> probably give a good idea of what the code looks like. The JuMP seems
> exciting enough to highlight both as a package and a use of macros.
>
> I don't know if you want to encourage different styles, but seeing
> examples of Python like, c like, and functional-ish ways of writing Julia
> would be a way to show off the variety of things you can do.
>
> --Leah
>
> On Wed, Dec 10, 2014 at 8:50 AM Elliot Saba  wrote:
>
>> We're having intermittent DNS issues.  http://julialang.org is now up
>> for me however, and I can dig it: (I couldn't, previously)
>>
>> $ dig julialang.org
>>
>> ; <<>> DiG 9.8.3-P1 <<>> julialang.org
>> ;; global options: +cmd
>> ;; Got answer:
>> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56740
>> ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4
>>
>> ;; QUESTION SECTION:
>> ;julialang.org. IN  A
>>
>> ;; ANSWER SECTION:
>> julialang.org.  2202IN  CNAME   julialang.github.io.
>> julialang.github.io.2202IN  CNAME   github.map.fastly.net.
>> github.map.fastly.net.  15  IN  A   199.27.79.133
>> ...
>> -E
>>
>>
>>
>> On Tue, Dec 9, 2014 at 2:46 PM,  wrote:
>>
>>>
>>>
>>> On Wednesday, December 10, 2014 8:23:26 AM UTC+10, Stefan Karpinski
>>> wrote:

 We're looking to redesign the JuliaLang.org home page and try to give
 it a little more focus than it currently has. Which raises the question of
 what to focus on. We could certainly have better code examples and maybe
 highlight features of the language and its ecosystem better. What do people
 think we should include?

>>>
>>> The whole site seems to be offline?  Is that because of this?
>>>
>>
>>


Re: [julia-users] Re: home page content

2014-12-09 Thread Joey Huchette
I think the [Rust website](http://www.rust-lang.org/) is pretty fantastic, 
in terms of both design and content. Having the code examples runnable and 
editable (via JuliaBox) would be a killer feature, though I have no idea 
how feasible that is.

On Tuesday, December 9, 2014 6:54:33 PM UTC-5, Elliot Saba wrote:
>
> Perhaps not now, but as a long-term goal, having a live, editable widget 
> of code on the homepage is such an awesome draw-in, IMO.
> -E
>
> On Tue, Dec 9, 2014 at 3:43 PM, Leah Hanson  > wrote:
>
>> Seeing code examples of a type and a couple of functions that use it 
>> would probably give a good idea of what the code looks like. The JuMP seems 
>> exciting enough to highlight both as a package and a use of macros.
>>
>> I don't know if you want to encourage different styles, but seeing 
>> examples of Python like, c like, and functional-ish ways of writing Julia 
>> would be a way to show off the variety of things you can do.
>>
>> --Leah
>>
>> On Wed, Dec 10, 2014 at 8:50 AM Elliot Saba > > wrote:
>>
>>> We're having intermittent DNS issues.  http://julialang.org is now up 
>>> for me however, and I can dig it: (I couldn't, previously)
>>>
>>> $ dig julialang.org
>>>
>>> ; <<>> DiG 9.8.3-P1 <<>> julialang.org
>>> ;; global options: +cmd
>>> ;; Got answer:
>>> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56740
>>> ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4
>>>
>>> ;; QUESTION SECTION:
>>> ;julialang.org. IN  A
>>>
>>> ;; ANSWER SECTION:
>>> julialang.org.  2202IN  CNAME   julialang.github.io.
>>> julialang.github.io.2202IN  CNAME   github.map.fastly.net.
>>> github.map.fastly.net.  15  IN  A   199.27.79.133
>>> ...
>>> -E
>>>
>>>
>>>
>>> On Tue, Dec 9, 2014 at 2:46 PM, > wrote:
>>>


 On Wednesday, December 10, 2014 8:23:26 AM UTC+10, Stefan Karpinski 
 wrote:
>
> We're looking to redesign the JuliaLang.org home page and try to give 
> it a little more focus than it currently has. Which raises the question 
> of 
> what to focus on. We could certainly have better code examples and maybe 
> highlight features of the language and its ecosystem better. What do 
> people 
> think we should include?
>

 The whole site seems to be offline?  Is that because of this? 

>>>
>>>  
>

[julia-users] Re: home page content

2014-12-09 Thread Arch Call
The Python web site:  "Python.org" is pretty well organized.  It has quite 
a few pull down menus that give good feedback to the user community. 
 Sometimes a fresh look to the web site generates new interest.  Most of 
these flashy web sites are driven on the back end by something like 
Drupal...Archie Call

On Tuesday, December 9, 2014 5:23:26 PM UTC-5, Stefan Karpinski wrote:
>
> We're looking to redesign the JuliaLang.org home page and try to give it a 
> little more focus than it currently has. Which raises the question of what 
> to focus on. We could certainly have better code examples and maybe 
> highlight features of the language and its ecosystem better. What do people 
> think we should include?
>


Re: [julia-users] Initializing a SharedArray Memory Error

2014-12-09 Thread benFranklin
I've made a small example of the memory problems I've been running into. I 
can't find a way to deallocate a SharedArray, if the code below runs once, 
it means the computer has enough memory to run this. If I can properly 
deallocate the memory I should be able to do it again, however, I run out 
of memory. Am I misunderstanding something about garbage collection in 
Julia?

Thanks for your attention

Code: 

@everywhere nQ = 60

@everywhere function inF(x::SharedArray,nQ::Int64)

number = myid()-1;
targetLength = nQ*nQ*3

startN = floor((number-1)*targetLength/nworkers()) + 1
endN = floor(number*targetLength/nworkers())

myIndexes = int64(startN:endN)
for j in myIndexes
inds = ind2sub((nQ,nQ,nQ),j)
x[inds[1],inds[2],inds[3],:,:,:] = rand(nQ,nQ,nQ)
end


end

while true
zeroMatrix = SharedArray(Float64,(nQ,nQ,3,nQ,nQ,nQ),pids=workers(), init = 
x->inF(x,nQ))
println("ran!")
@everywhere zeroMatrix = 1
@everywhere gc()
end

On Monday, 8 December 2014 23:43:03 UTC-5, Isaiah wrote:
>
> Hopefully you will get an answer on pmap from someone more familiar with 
> the parallel stuff, but: have you tried splitting the init step? (see the 
> example in the manual for how to init an array in chunks done by different 
> workers). Just guessing though: I'm not sure if/how those will be 
> serialized if each worker is contending for the whole array.
>
> On Fri, Dec 5, 2014 at 4:23 PM, benFranklin  > wrote:
>
>> Hi all, I'm trying to figure out how to best initialize a SharedArray, 
>> using a C function to fill it up that computes a huge matrix in parts, and 
>> all comments are appreciated. To summarise: Is A, making an empty shared 
>> array, computing the matrix in parallel using pmap and then filling it up 
>> serially, better than using B, computing in parallel and storing in one 
>> step by using an init function in the SharedArray declaration?
>>
>>
>> The difference tends to be that B uses a lot more memory, each process 
>> using the exact same amount of memory. However it is much faster than A, as 
>> the copy step takes longer than the computation, but in A most of the 
>> memory usage is in one process, using less memory overall.
>>
>> Any tips on how to do this better? Also, this pmap is how I'm handling 
>> more complex paralellizations in Julia. Any comments on that approach?
>>
>> Thanks a lot!
>>
>> Best,
>> Ben
>>
>>
>> CODE A:
>>
>> Is this, making an empty shared array, computing the matrix in parallel 
>> and then filling it up serially:
>>
>> function findZeroDividends(model::ModelPrivate)
>>
>> nW = length(model.vW)
>> nZ = length(model.vZ)
>> nK = length(model.vK)
>> nQ = length(model.vQ)
>>  zeroMatrix = SharedArray(Float64,(nW,nZ,nK,nQ,nQ,nQ),pids=workers())
>>
>> input = [stateFindZeroK(w,z,k,model) for w in 1:nW, z in 1:nZ,  k in 
>> 1:nK];
>> results = pmap(findZeroInC,input);
>>
>> for w in 1:nW
>> for z in 1:nZ
>> for k in 1:nK
>>
>> zeroMatrix[w,z,k,:,:,:] = results[w + nW*((z-1) + nZ*(k-1))]
>>  end
>> end
>> end
>>
>> return zeroMatrix
>> end
>>
>> ___
>>
>> CODE B:
>>
>> Better than these two:
>>
>> function 
>> start(x::SharedArray,nW::Int64,nZ::Int64,nK::Int64,model::ModelPrivate)
>>
>> for j in myid()-1:nworkers():(nW*nZ*nK)
>> inds = ind2sub((nW,nZ,nK),j)
>> x[inds[1],inds[2],inds[3],:,:,:] 
>> =findZeroInC(stateFindZeroK(inds[1],inds[2],inds[3],model))
>> end
>>
>> x
>>
>> end
>>
>> function findZeroDividendsSmart(model::ModelPrivate)
>>
>> nW = length(model.vW)
>> nZ = length(model.vZ)
>> nK = length(model.vK)
>> nQ = length(model.vQ)
>>
>> #input = [stateFindZeroK(w,z,k,model) for w in 1:nW, z in 1:nZ,  k in 
>> 1:nK];
>> #results = pmap(findZeroInC,input);
>>
>> zeroMatrix = SharedArray(Float64,(nW,nZ,nK,nQ,nQ,nQ),pids=workers(), init 
>> = x->start(x,nW,nZ,nK,model) )
>>
>> return zeroMatrix
>> end
>>
>> 
>>
>> The C function being called is inside this wrapper and returns the 
>> pointer to  double *capitalChoices = (double 
>> *)malloc(sizeof(double)*nQ*nQ*nQ);
>>
>> function findZeroInC(state::stateFindZeroK)
>>
>> w = state.wealth
>> z = state.z
>> k = state.k
>> model = state.model
>>
>> #findZeroInC(double wealth, int z,int k,  double theta, double delta, 
>>  double* vK,
>> # int nK, double* vQ, int nQ, double* transition, double betaGov)
>>
>> nQ = length(model.vQ)
>>
>> t = ccall((:findZeroInC,"findP.so"), 
>> Ptr{Float64},(Float64,Int64,Int64,Float64,Float64,Ptr{Float64},Int64,Ptr{Float64},Int64,Ptr{Float64},Float64),
>>
>> model.vW[w],z-1,k-1,model.theta,model.delta,model.vK,length(model.vK),model.vQ,nQ,model.transition,model.betaGov)
>> if t == C_NULL
>> error("NULL")
>> end
>>
>> return pointer_to_array(t,(nQ,nQ,nQ),true)
>>
>> end
>>
>>
>> 
>>
>>
>>
>

Re: [julia-users] Re: home page content

2014-12-09 Thread John Myles White
+1 for emulating the Rust site

 -- John

On Dec 9, 2014, at 4:46 PM, Joey Huchette  wrote:

> I think the [Rust website](http://www.rust-lang.org/) is pretty fantastic, in 
> terms of both design and content. Having the code examples runnable and 
> editable (via JuliaBox) would be a killer feature, though I have no idea how 
> feasible that is.
> 
> On Tuesday, December 9, 2014 6:54:33 PM UTC-5, Elliot Saba wrote:
> Perhaps not now, but as a long-term goal, having a live, editable widget of 
> code on the homepage is such an awesome draw-in, IMO.
> -E
> 
> On Tue, Dec 9, 2014 at 3:43 PM, Leah Hanson  wrote:
> Seeing code examples of a type and a couple of functions that use it would 
> probably give a good idea of what the code looks like. The JuMP seems 
> exciting enough to highlight both as a package and a use of macros.
> 
> I don't know if you want to encourage different styles, but seeing examples 
> of Python like, c like, and functional-ish ways of writing Julia would be a 
> way to show off the variety of things you can do.
> 
> --Leah
> 
> On Wed, Dec 10, 2014 at 8:50 AM Elliot Saba  wrote:
> We're having intermittent DNS issues.  http://julialang.org is now up for me 
> however, and I can dig it: (I couldn't, previously)
> 
> $ dig julialang.org
> 
> ; <<>> DiG 9.8.3-P1 <<>> julialang.org
> ;; global options: +cmd
> ;; Got answer:
> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56740
> ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4
> 
> ;; QUESTION SECTION:
> ;julialang.org. IN  A
> 
> ;; ANSWER SECTION:
> julialang.org.  2202IN  CNAME   julialang.github.io.
> julialang.github.io.2202IN  CNAME   github.map.fastly.net.
> github.map.fastly.net.  15  IN  A   199.27.79.133
> ...
> -E
> 
> 
> 
> On Tue, Dec 9, 2014 at 2:46 PM,  wrote:
> 
> 
> On Wednesday, December 10, 2014 8:23:26 AM UTC+10, Stefan Karpinski wrote:
> We're looking to redesign the JuliaLang.org home page and try to give it a 
> little more focus than it currently has. Which raises the question of what to 
> focus on. We could certainly have better code examples and maybe highlight 
> features of the language and its ecosystem better. What do people think we 
> should include?
> 
> The whole site seems to be offline?  Is that because of this? 
> 
> 



Re: [julia-users] set LC_ALL=C using run()

2014-12-09 Thread David Koslicki
Thanks! That worked perfectly!

On Sunday, December 7, 2014 7:28:03 PM UTC-8, Isaiah wrote:
>
> You could use setenv:
> http://julia.readthedocs.org/en/latest/stdlib/base/#Base.setenv
>
> `run` in Julia executes calls directly (setting up the environment, 
> interpolating, and spawning subprocess) - not via the shell. So, built-ins 
> like `export` don't work.
>
> See this blog post for some more information:
> http://julialang.org/blog/2012/03/shelling-out-sucks/
>
> (I do think it would be convenient to allow single-shot environment 
> changes as keyword arguments to `run`. not sure if there is an open issue 
> for this already, but it feels like something that has come up before)
>
> On Sun, Dec 7, 2014 at 9:48 PM, David Koslicki  > wrote:
>
>> Hello,
>>
>> I am trying to sort a large (4G) file consisting only of strings of 
>> length 50 on the alphabet {A,C,T,G}. While the built in Julia sort() works, 
>> it uses quite a bit of memory. I have had good success using the linux 
>> command LC_ALL=C sort larg_file.txt -o out.txt, but get the following error 
>> when I try to evaluate the command run(`LC_ALL=C sort larg_file.txt -o 
>> out.txt`) in Julia:
>>
>> ERROR: could not spawn `LC_ALL=C sort large_file.txt -o out.txt`: no such 
>> file or directory (ENOENT)
>>  in _jl_spawn at process.jl:217
>>  in spawn at process.jl:348
>>  in spawn at process.jl:389
>>  in run at process.jl:470
>>
>> Running the command
>> export LC_ALL=C in the shell before running Julia works, but I would like 
>> to be able to do this directly from Julia. Unfortunately, the command 
>> run(`export LC_ALL=C`) also returns the error:
>>
>> ERROR: could not spawn `export LC_ALL=C`: no such file or directory 
>> (ENOENT)
>>  in _jl_spawn at process.jl:217
>>  in spawn at process.jl:348
>>  in spawn at process.jl:389
>>  in run at process.jl:470
>>
>> Does anyone know how to set LC_ALL=C in julia using run()?
>>
>> Thanks,
>>
>> ~David
>>
>
>

Re: [julia-users] Initializing a SharedArray Memory Error

2014-12-09 Thread elextr


On Wednesday, December 10, 2014 12:28:29 PM UTC+10, benFranklin wrote:
>
> I've made a small example of the memory problems I've been running into. I 
> can't find a way to deallocate a SharedArray,
>

Someone more expert might find it, but I can't see anywhere that the 
mmapped memory is unmapped.

 

> if the code below runs once, it means the computer has enough memory to 
> run this. If I can properly deallocate the memory I should be able to do it 
> again, however, I run out of memory. Am I misunderstanding something about 
> garbage collection in Julia?
>
> Thanks for your attention
>
> Code: 
>
> @everywhere nQ = 60
>
> @everywhere function inF(x::SharedArray,nQ::Int64)
>
> number = myid()-1;
> targetLength = nQ*nQ*3
>
> startN = floor((number-1)*targetLength/nworkers()) + 1
> endN = floor(number*targetLength/nworkers())
>
> myIndexes = int64(startN:endN)
> for j in myIndexes
> inds = ind2sub((nQ,nQ,nQ),j)
> x[inds[1],inds[2],inds[3],:,:,:] = rand(nQ,nQ,nQ)
> end
>
>
> end
>
> while true
> zeroMatrix = SharedArray(Float64,(nQ,nQ,3,nQ,nQ,nQ),pids=workers(), init = 
> x->inF(x,nQ))
> println("ran!")
> @everywhere zeroMatrix = 1
> @everywhere gc()
> end
>
> On Monday, 8 December 2014 23:43:03 UTC-5, Isaiah wrote:
>>
>> Hopefully you will get an answer on pmap from someone more familiar with 
>> the parallel stuff, but: have you tried splitting the init step? (see the 
>> example in the manual for how to init an array in chunks done by different 
>> workers). Just guessing though: I'm not sure if/how those will be 
>> serialized if each worker is contending for the whole array.
>>
>> On Fri, Dec 5, 2014 at 4:23 PM, benFranklin  wrote:
>>
>>> Hi all, I'm trying to figure out how to best initialize a SharedArray, 
>>> using a C function to fill it up that computes a huge matrix in parts, and 
>>> all comments are appreciated. To summarise: Is A, making an empty shared 
>>> array, computing the matrix in parallel using pmap and then filling it up 
>>> serially, better than using B, computing in parallel and storing in one 
>>> step by using an init function in the SharedArray declaration?
>>>
>>>
>>> The difference tends to be that B uses a lot more memory, each process 
>>> using the exact same amount of memory. However it is much faster than A, as 
>>> the copy step takes longer than the computation, but in A most of the 
>>> memory usage is in one process, using less memory overall.
>>>
>>> Any tips on how to do this better? Also, this pmap is how I'm handling 
>>> more complex paralellizations in Julia. Any comments on that approach?
>>>
>>> Thanks a lot!
>>>
>>> Best,
>>> Ben
>>>
>>>
>>> CODE A:
>>>
>>> Is this, making an empty shared array, computing the matrix in parallel 
>>> and then filling it up serially:
>>>
>>> function findZeroDividends(model::ModelPrivate)
>>>
>>> nW = length(model.vW)
>>> nZ = length(model.vZ)
>>> nK = length(model.vK)
>>> nQ = length(model.vQ)
>>>  zeroMatrix = SharedArray(Float64,(nW,nZ,nK,nQ,nQ,nQ),pids=workers())
>>>
>>> input = [stateFindZeroK(w,z,k,model) for w in 1:nW, z in 1:nZ,  k in 
>>> 1:nK];
>>> results = pmap(findZeroInC,input);
>>>
>>> for w in 1:nW
>>> for z in 1:nZ
>>> for k in 1:nK
>>>
>>> zeroMatrix[w,z,k,:,:,:] = results[w + nW*((z-1) + nZ*(k-1))]
>>>  end
>>> end
>>> end
>>>
>>> return zeroMatrix
>>> end
>>>
>>> ___
>>>
>>> CODE B:
>>>
>>> Better than these two:
>>>
>>> function 
>>> start(x::SharedArray,nW::Int64,nZ::Int64,nK::Int64,model::ModelPrivate)
>>>
>>> for j in myid()-1:nworkers():(nW*nZ*nK)
>>> inds = ind2sub((nW,nZ,nK),j)
>>> x[inds[1],inds[2],inds[3],:,:,:] 
>>> =findZeroInC(stateFindZeroK(inds[1],inds[2],inds[3],model))
>>> end
>>>
>>> x
>>>
>>> end
>>>
>>> function findZeroDividendsSmart(model::ModelPrivate)
>>>
>>> nW = length(model.vW)
>>> nZ = length(model.vZ)
>>> nK = length(model.vK)
>>> nQ = length(model.vQ)
>>>
>>> #input = [stateFindZeroK(w,z,k,model) for w in 1:nW, z in 1:nZ,  k in 
>>> 1:nK];
>>> #results = pmap(findZeroInC,input);
>>>
>>> zeroMatrix = SharedArray(Float64,(nW,nZ,nK,nQ,nQ,nQ),pids=workers(), 
>>> init = x->start(x,nW,nZ,nK,model) )
>>>
>>> return zeroMatrix
>>> end
>>>
>>> 
>>>
>>> The C function being called is inside this wrapper and returns the 
>>> pointer to  double *capitalChoices = (double 
>>> *)malloc(sizeof(double)*nQ*nQ*nQ);
>>>
>>> function findZeroInC(state::stateFindZeroK)
>>>
>>> w = state.wealth
>>> z = state.z
>>> k = state.k
>>> model = state.model
>>>
>>> #findZeroInC(double wealth, int z,int k,  double theta, double delta, 
>>>  double* vK,
>>> # int nK, double* vQ, int nQ, double* transition, double betaGov)
>>>
>>> nQ = length(model.vQ)
>>>
>>> t = ccall((:findZeroInC,"findP.so"), 
>>> Ptr{Float64},(Float64,Int64,Int64,Float64,Float64,Ptr{Float64},Int64,Ptr{Float64},Int64,Ptr{Float64},Float64),
>>>
>>> model.vW[w],z-1,k-1,model.theta,model.delta,model.vK,length(model.vK),model.vQ,nQ,model.transition,model.betaGov)
>>> if t == C_NULL
>>> error("N

Re: [julia-users] Re: home page content

2014-12-09 Thread Stefan Karpinski
On Tue, Dec 9, 2014 at 6:43 PM, Leah Hanson  wrote:

> I don't know if you want to encourage different styles, but seeing
> examples of Python like, c like, and functional-ish ways of writing Julia
> would be a way to show off the variety of things you can do.


I really this idea. Having a grid of four code examples with different
styles – Pythonic/Matlabish, C-like, functional and Julian (i.e. with types
and multiple dispatch). Now we just need to come up with good examples.
Another thing I wonder if it would be good to highlight is how tight the
code generated for simple, high-level Julia code is. Maybe not on the main
page though but on the about page.


Re: [julia-users] Re: home page content

2014-12-09 Thread Stefan Karpinski
The Rust site is very nice – although I do feel that it has too little
content on it and feels like a landing page that you just have to click
through to somewhere else from. I can see having something like the Rust
page but with more content "below the fold".

On Tue, Dec 9, 2014 at 9:36 PM, John Myles White 
wrote:

> +1 for emulating the Rust site
>
>  -- John
>
> On Dec 9, 2014, at 4:46 PM, Joey Huchette  wrote:
>
> I think the [Rust website](http://www.rust-lang.org/) is pretty
> fantastic, in terms of both design and content. Having the code examples
> runnable and editable (via JuliaBox) would be a killer feature, though I
> have no idea how feasible that is.
>
> On Tuesday, December 9, 2014 6:54:33 PM UTC-5, Elliot Saba wrote:
>>
>> Perhaps not now, but as a long-term goal, having a live, editable widget
>> of code on the homepage is such an awesome draw-in, IMO.
>> -E
>>
>> On Tue, Dec 9, 2014 at 3:43 PM, Leah Hanson  wrote:
>>
>>> Seeing code examples of a type and a couple of functions that use it
>>> would probably give a good idea of what the code looks like. The JuMP seems
>>> exciting enough to highlight both as a package and a use of macros.
>>>
>>> I don't know if you want to encourage different styles, but seeing
>>> examples of Python like, c like, and functional-ish ways of writing Julia
>>> would be a way to show off the variety of things you can do.
>>>
>>> --Leah
>>>
>>> On Wed, Dec 10, 2014 at 8:50 AM Elliot Saba  wrote:
>>>
 We're having intermittent DNS issues.  http://julialang.org is now up
 for me however, and I can dig it: (I couldn't, previously)

 $ dig julialang.org

 ; <<>> DiG 9.8.3-P1 <<>> julialang.org
 ;; global options: +cmd
 ;; Got answer:
 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56740
 ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4

 ;; QUESTION SECTION:
 ;julialang.org. IN  A

 ;; ANSWER SECTION:
 julialang.org.  2202IN  CNAME   julialang.github.io.
 julialang.github.io.2202IN  CNAME   github.map.fastly.net.
 github.map.fastly.net.  15  IN  A   199.27.79.133
 ...
 -E



 On Tue, Dec 9, 2014 at 2:46 PM,  wrote:

>
>
> On Wednesday, December 10, 2014 8:23:26 AM UTC+10, Stefan Karpinski
> wrote:
>>
>> We're looking to redesign the JuliaLang.org home page and try to
>> give it a little more focus than it currently has. Which raises the
>> question of what to focus on. We could certainly have better code 
>> examples
>> and maybe highlight features of the language and its ecosystem better. 
>> What
>> do people think we should include?
>>
>
> The whole site seems to be offline?  Is that because of this?
>


>>
>


Re: [julia-users] Re: home page content

2014-12-09 Thread David Smith
+1 for a runnable code widget.  

I think the typical scientific user will want to see immediately how to

1. create some variables.
2. do some math, probably with a matrix or vector.
3. plot something.
4. make a function.

That is a basic fooling-around paradigm.  Having a plot in the browser will 
be tricky, but I think it is crucial.





On Tuesday, December 9, 2014 5:54:33 PM UTC-6, Elliot Saba wrote:
>
> Perhaps not now, but as a long-term goal, having a live, editable widget 
> of code on the homepage is such an awesome draw-in, IMO.
> -E
>
> On Tue, Dec 9, 2014 at 3:43 PM, Leah Hanson  > wrote:
>
>> Seeing code examples of a type and a couple of functions that use it 
>> would probably give a good idea of what the code looks like. The JuMP seems 
>> exciting enough to highlight both as a package and a use of macros.
>>
>> I don't know if you want to encourage different styles, but seeing 
>> examples of Python like, c like, and functional-ish ways of writing Julia 
>> would be a way to show off the variety of things you can do.
>>
>> --Leah
>>
>> On Wed, Dec 10, 2014 at 8:50 AM Elliot Saba > > wrote:
>>
>>> We're having intermittent DNS issues.  http://julialang.org is now up 
>>> for me however, and I can dig it: (I couldn't, previously)
>>>
>>> $ dig julialang.org
>>>
>>> ; <<>> DiG 9.8.3-P1 <<>> julialang.org
>>> ;; global options: +cmd
>>> ;; Got answer:
>>> ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 56740
>>> ;; flags: qr rd ra; QUERY: 1, ANSWER: 3, AUTHORITY: 4, ADDITIONAL: 4
>>>
>>> ;; QUESTION SECTION:
>>> ;julialang.org. IN  A
>>>
>>> ;; ANSWER SECTION:
>>> julialang.org.  2202IN  CNAME   julialang.github.io.
>>> julialang.github.io.2202IN  CNAME   github.map.fastly.net.
>>> github.map.fastly.net.  15  IN  A   199.27.79.133
>>> ...
>>> -E
>>>
>>>
>>>
>>> On Tue, Dec 9, 2014 at 2:46 PM, > wrote:
>>>


 On Wednesday, December 10, 2014 8:23:26 AM UTC+10, Stefan Karpinski 
 wrote:
>
> We're looking to redesign the JuliaLang.org home page and try to give 
> it a little more focus than it currently has. Which raises the question 
> of 
> what to focus on. We could certainly have better code examples and maybe 
> highlight features of the language and its ecosystem better. What do 
> people 
> think we should include?
>

 The whole site seems to be offline?  Is that because of this? 

>>>
>>>  
>

[julia-users] Re: THANKS to Julia core developers!

2014-12-09 Thread David Smith
Hear hear!

I hope the sheer number of contributors back to the language is evidence of 
how appreciative we all are to have Julia.  And besides the language being 
great, the community is really extraordinary. 

Beers are on me if you guys find yourselves in Nashville.  

On Monday, December 8, 2014 11:02:10 PM UTC-6, Petr Krysl wrote:
>
> I've been playing in Julia for the past week or so, but already the 
> results are convincing.  This language is GREAT.   I've coded hundreds of 
> thousands of lines in Fortran, C, C++, Matlab, and this is the first 
> language that feels good. And it is precisely what I envision for my 
> project.
>
> So, THANKS! 
>
> Petr Krysl
>


Re: [julia-users] Re: home page content

2014-12-09 Thread cdm

re tight code ...

S. Danisch's code length v. speed plot may well be deserving of some real 
esate:


https://lh3.googleusercontent.com/-7IPcrjXuxFY/VICwQ3TrgRI/JV0/_HmDWZiBrXQ/s1600/benchmarks.png



awesome.

cdm


On Tuesday, December 9, 2014 9:09:03 PM UTC-8, Stefan Karpinski wrote:
>
> On Tue, Dec 9, 2014 at 6:43 PM, Leah Hanson  > wrote:
>
>> I don't know if you want to encourage different styles, but seeing 
>> examples of Python like, c like, and functional-ish ways of writing Julia 
>> would be a way to show off the variety of things you can do.
>
>
> I really this idea. Having a grid of four code examples with different 
> styles – Pythonic/Matlabish, C-like, functional and Julian (i.e. with types 
> and multiple dispatch). Now we just need to come up with good examples. 
> Another thing I wonder if it would be good to highlight is how tight the 
> code generated for simple, high-level Julia code is. Maybe not on the main 
> page though but on the about page.
>


Re: [julia-users] Re: home page content

2014-12-09 Thread Pontus Stenetorp
On 10 December 2014 at 08:43, Leah Hanson  wrote:
>
> Seeing code examples of a type and a couple of functions that use it would
> probably give a good idea of what the code looks like.

This would be excellent, maybe with some JavaScript magic we could
have a set of examples to switch between and the default one changing
upon each visit.  We already have a nice tutorial, but perhaps we
could link it more prominently.  I would also be really excited to
have blurbs [1], a personal favourite of mine would be this one [2],
but there ought to be a lot more.

Pontus

[1]: https://en.wikipedia.org/wiki/Blurb
[2]: https://news.ycombinator.com/item?id=7679386


Re: [julia-users] Re: home page content

2014-12-09 Thread Valentin Churavy
An other nice example might be the new haskell 
homepage http://new-www.haskell.org/

For the runnable part. Maybe we could use tmpnb/juliabox to host an example 
notebook. We should probably use a docker image with an userimages 
otherwise the attention span will be over before Gadfly is loaded.

Does this work for more than 10 
minutes? 
https://cfa4733.tmpnb.org/user-C6qXAatonjbQ/notebooks/Julia%20Test.ipynb#?

On Wednesday, 10 December 2014 07:16:42 UTC+1, cdm wrote:
>
>
> re tight code ...
>
> S. Danisch's code length v. speed plot may well be deserving of some real 
> esate:
>
>
>
> https://lh3.googleusercontent.com/-7IPcrjXuxFY/VICwQ3TrgRI/JV0/_HmDWZiBrXQ/s1600/benchmarks.png
>
>
>
> awesome.
>
> cdm
>
>
> On Tuesday, December 9, 2014 9:09:03 PM UTC-8, Stefan Karpinski wrote:
>>
>> On Tue, Dec 9, 2014 at 6:43 PM, Leah Hanson  wrote:
>>
>>> I don't know if you want to encourage different styles, but seeing 
>>> examples of Python like, c like, and functional-ish ways of writing Julia 
>>> would be a way to show off the variety of things you can do.
>>
>>
>> I really this idea. Having a grid of four code examples with different 
>> styles – Pythonic/Matlabish, C-like, functional and Julian (i.e. with types 
>> and multiple dispatch). Now we just need to come up with good examples. 
>> Another thing I wonder if it would be good to highlight is how tight the 
>> code generated for simple, high-level Julia code is. Maybe not on the main 
>> page though but on the about page.
>>
>

Re: [julia-users] Re: home page content

2014-12-09 Thread Jake Bolewski
Am I the only one who thinks these runnable code widgets are totally 
useless?  I'm curious as to how users interact with them in the real 
world.  I bet 99% of them either ignore it or just press the button and see 
the default output.  The ones who probably interact with it the most are 
going to be the same users that are going to download and run the language 
anyway.  They displace huge amounts of real estate for basically no 
practical value.  

To me the landing page to a programming language is really a nice backdrop 
for four things, A giant button where I can go download what I want because 
I'm lazy and just click on the top google hit.  Another prominent link to 
the Julia package ecosystem because I'm lazy and typing "julia" AND 
"packages" is way too much work (haskell did a survey a while back, if I 
remember correctly a majority of users to the front page fell under this 
category). In addition, enough background information to get people to 
click on the manual and a nice community / development activity section so 
I can see that things are happening.  Please, please don't make me scroll 
past a huge useless web 2.0 header to get to what I actually want (again, 
lazy).  I like the  Racket, Haskell, and OCaml websites as I think they are 
utilitarian but actually useful. I agree that the Rust site is a bit too 
minimalist. I absolutely hate the python website.  The R website is just 
laughably bad.  Altogether, I don't think PL's set a high bar in this 
regard. 

-Jake



On Wednesday, December 10, 2014 1:16:42 AM UTC-5, cdm wrote:
>
>
> re tight code ...
>
> S. Danisch's code length v. speed plot may well be deserving of some real 
> esate:
>
>
>
> https://lh3.googleusercontent.com/-7IPcrjXuxFY/VICwQ3TrgRI/JV0/_HmDWZiBrXQ/s1600/benchmarks.png
>
>
>
> awesome.
>
> cdm
>
>
> On Tuesday, December 9, 2014 9:09:03 PM UTC-8, Stefan Karpinski wrote:
>>
>> On Tue, Dec 9, 2014 at 6:43 PM, Leah Hanson  wrote:
>>
>>> I don't know if you want to encourage different styles, but seeing 
>>> examples of Python like, c like, and functional-ish ways of writing Julia 
>>> would be a way to show off the variety of things you can do.
>>
>>
>> I really this idea. Having a grid of four code examples with different 
>> styles – Pythonic/Matlabish, C-like, functional and Julian (i.e. with types 
>> and multiple dispatch). Now we just need to come up with good examples. 
>> Another thing I wonder if it would be good to highlight is how tight the 
>> code generated for simple, high-level Julia code is. Maybe not on the main 
>> page though but on the about page.
>>
>