Re: [julia-users] Intel Xeon Phi support?

2015-03-12 Thread Stefan Karpinski
0.5 should be released around end of 2015, but there will be support on master before that. On Tue, Mar 10, 2015 at 2:00 PM, Jeff Waller truth...@gmail.com wrote: On Tuesday, March 10, 2015 at 1:39:42 PM UTC-4, Stefan Karpinski wrote: I'm not sure what that would mean – CPUs don't ship with

Re: [julia-users] Specifying return type of a function

2015-03-12 Thread Shivkumar Chandrasekaran
Just documentation and readability of the functions themselves. For now I will just stick the return type in a comment (and hope I don't forget to change it if needed). On Tuesday, March 10, 2015 at 3:20:42 PM UTC-7, Milan Bouchet-Valat wrote: Le mardi 10 mars 2015 à 15:12 -0700, Shivkumar

[julia-users] Re: Error array could not be broadcast to a common size

2015-03-12 Thread David P. Sanders
El martes, 10 de marzo de 2015, 18:14:45 (UTC-6), Rafael Guariento escribió: Hi I am trying to run the following code but I get an error when I try to run the model (evaluate the result variable (calling the ODE23)) the error is: Error array could not be broadcast to a common size Does

[julia-users] how to paste png into ipython julia notebook?

2015-03-12 Thread Edward Chen
from IPython.display import Image Image(filename='image.png') doesn't seem to work Thanks! -Ed

[julia-users] Why don't copied arrays change in function calls?

2015-03-12 Thread Peter Drummond
How do you pass two arrays to a function so that the function can copy one to the other, and return the values in place? Of course, a=b won't work, but neither does a=copy(b). See the following example: julia function copytest!(a,b) b=copy(a) println (copytest: a,b ,a,b)

[julia-users] How can I convert a set into an array?

2015-03-12 Thread Ali Rezaee
In Python I would normally to something like this: a = set([1,2,1,3]) a = list(a) What is the equivalent way to do this in Julia? Thanks a lot in advance for your help

[julia-users] Serving static files in a Julia web app

2015-03-12 Thread jock . lawrie
Hi all, I am building a bare bones web app https://bitbucket.org/jocklawrie/skeleton-webapp.jl for displaying data with interactive charts. The app currently serves static files from root/static/xxx/filename, where xxx is, for example, css or js. It does this via:

Re: [julia-users] How can I convert a set into an array?

2015-03-12 Thread Kevin Squire
Should be obvious, but if your set doesn't contain integers, you would use a = Set(['a','c','d','c']) b = collect(a) In either case, in Julia, it's usually better not to change the type of a from Set (or IntSet) to Array. Another option is to do a = [1,2,1,3] a = unique(a) which actually uses

Re: [julia-users] Saving timing results from @time

2015-03-12 Thread Stefan Karpinski
I generally find that using a comprehension around @elapsed is pretty terse and clear – it also makes it easy to compose with reducers like min, max, median, and quantile, which is convenient for analysis. On Wed, Mar 11, 2015 at 12:51 PM, Patrick Kofod Mogensen patrick.mogen...@gmail.com wrote:

Re: [julia-users] Intel Xeon Phi support?

2015-03-12 Thread Karel Zapfe
Hello: Is it true then, that Knight's Landing will have Julia out-of-the-box? I was checking the page of Intel, but found nothing to the respect. At my laboratory we had some extra money, and were considering on getting one, but the point is that none of us is really good at using fortran+mpi

[julia-users] Re: Sparse matrix with diagonal index

2015-03-12 Thread Steven G. Johnson
On Tuesday, March 10, 2015 at 2:40:24 PM UTC-4, Amit Jamadagni wrote: Thank you very much for the response. But the behavior of the same in scipy is different i.e., it omits the elements. Is this not the expected behavior ?? Why would you expect the function to silently ignore some of

[julia-users] Re: Why is Forward Reference possible?

2015-03-12 Thread Matt Bauman
This is very intentional and is addressed in the manual (http://docs.julialang.org/en/release-0.3/manual/variables-and-scoping/?highlight=forward). The key thing to realize is that functions are just global identifiers, too. If forward references weren't possible, Julia would require c-style

Re: [julia-users] Re: webpy equivalent

2015-03-12 Thread Paul Analyst
Thx for info look nice but I am using win7 , usualy using Pkg.add. How to install skeleton-webapp on my Julia under win? ? julia Pkg.available() 551-element Array{ASCIIString,1}: AffineTransforms ... Sims SIUnits SliceSampler Smile SmoothingKernels SMTPClient Snappy Sobol ... No

Re: [julia-users] for and function don't work in the same way in terms of scope

2015-03-12 Thread Mauro
I think this is the soft vs hard scope issue. See: https://github.com/JuliaLang/julia/issues/9955 That issue could use some fleshing out though... On Tue, 2015-03-10 at 20:03, Wendell Zheng zhengwend...@gmail.com wrote: *Input 1:* y = 0 function foo() y = 10 end foo() y *Output 1:*

[julia-users] Specifying return type of a function

2015-03-12 Thread Shivkumar Chandrasekaran
I am new to Julia, so forgive the elementary question, but I could not seem to find the answer in the docs or by googling the news group. Is it possible to specify the return type of a function in Julia? Thanks. --shiv--

Re: [julia-users] How to interpolate a variable as a macro argument?

2015-03-12 Thread Isaiah Norton
There are tools mentioned in the Metaprogramming section of the manual which will help to better understand what is going on. In particular, macroexpand. http://docs.julialang.org/en/latest/manual/metaprogramming/#basics Are there better ways to do this, is it OK to use eval() in this context?

Re: [julia-users] for and function don't work in the same way in terms of scope

2015-03-12 Thread Mauro
On Wed, 2015-03-11 at 10:24, Wendell Zheng zhengwend...@gmail.com wrote: I did more experiments. *Input 1:* y = 0 begin y = 10 end y *Output 1:* 10 *Input 2:* y = 0 begin local y = 10 end y *Output 2:* 0 It's the same for *if *block. begin-end and if-end blocks

Re: [julia-users] How can I convert a set to an array?

2015-03-12 Thread Jameson Nash
a = collect(a) On Wed, Mar 11, 2015 at 12:07 PM Jacob Quinn quinn.jac...@gmail.com wrote: a = IntSet([1,2,3]) a = [a...] On Wed, Mar 11, 2015 at 9:35 AM, Ali Rezaee arv.ka...@gmail.com wrote: In Python I would do a = set([1,2]) a = list(a) How can I do that in Julia? Thanks a lot in

[julia-users] sum array

2015-03-12 Thread pip7kids
Hi I was playing with Comprehension syntax and then trying to sum the output and failed! My example ... the next two lines work ok for me (using 0.3.5 on Windows). const x = rand(8) [ x[i-4:i-1] for i = 6] .. this gives me a 4 element array. I now want to sum the ouput - this is what I tried ...

[julia-users] Saving timings from @time

2015-03-12 Thread Patrick Kofod Mogensen
This might be sort of a duplicate posts, but I think the other post wasn't actually posted, so I'll try again. If I time a function 500 times and want to save all the times, how would I go about this? [@time algo(input) for i = 1:500] Catches all the algo returns instead of output from @time.

[julia-users] How can I convert a set to an array?

2015-03-12 Thread Ali Rezaee
In Python I would do a = set([1,2]) a = list(a) How can I do that in Julia? Thanks a lot in advance for your help

[julia-users] Re: How does Measure work at y-axis in Gadfly.jl?

2015-03-12 Thread nanaya tachibana
Thank you very much. Can anything affect the orientation of the absolute measurement of Measure? It goes from left-to-right and top-to-bottom, no matter how I set the units in the context. On Thursday, March 12, 2015 at 3:14:28 PM UTC+8, Daniel Jones wrote: It can actually actually work

Re: [julia-users] Memory allocation in Closed loop Control Simulation

2015-03-12 Thread Tim Holy
--track-allocation doesn't report the _net_ memory allocated, it reports the _gross_ memory allocation. In other words, allocate/free adds to the tally, even if all memory is eventually freed. If you're still concerned about memory allocation and its likely impact on performance: there are

[julia-users] Re: how to paste png into ipython julia notebook?

2015-03-12 Thread Patrick O'Leary
You can do this with Images.jl. Example: http://htmlpreview.github.io/?https://github.com/timholy/Images.jl/blob/master/ImagesDemo.html On Wednesday, March 11, 2015 at 11:05:07 AM UTC-5, Edward Chen wrote: from IPython.display import Image Image(filename='image.png') doesn't seem to work

[julia-users] Re: RFC: JuliaWeb Roadmap + Call for Contributors

2015-03-12 Thread Avik Sengupta
I think this is very useful. The web stack is a bit lacking in documentation, so this is great. Maybe flesh out the doucumentation a bit, explaining the usage of the morsel/meddle/mustache API's in this code. And possibly host the documentation separately on bitbucket-pages. I think it would

Re: [julia-users] sum array

2015-03-12 Thread Mauro
const x = rand(8) [ x[i-4:i-1] for i = 6] .. this gives me a 4 element array. This seems a bit odd, what are you trying to achieve here? Anyway it produces a Array{Array{Float64,1},1}, i.e. an array of arrays containing one array. I now want to sum the ouput - this is what I tried ... sum([

[julia-users] Automatic doc tools for Julia

2015-03-12 Thread Ján Adamčák
Hi guys, Can I ask you for something like best practice with auto doc tools for parsing Julia code? I try use Doxygen and Sphinx, but I think this is not good solutions in this timeversion(0.3.6). And/Or some tool for generate UML diagrams from julia code? Thanks. P.S.: My idea with this

Re: [julia-users] sum array

2015-03-12 Thread pip7kids
Hi I was simply dabbling whilst learning - nothing specific. Can I still sum? Regards On Thursday, 12 March 2015 09:50:19 UTC, Mauro wrote: const x = rand(8) [ x[i-4:i-1] for i = 6] .. this gives me a 4 element array. This seems a bit odd, what are you trying to achieve here? Anyway it

[julia-users] Re: Help: Too many open files -- How do I figure out which files are open?

2015-03-12 Thread René Donner
More are hint than a direct answer, are you using the do syntax for opening the files? open(somefile, w) do file write(file, ...); read(file, ); end Regardless of how you exit that block, regularly or via exceptions, the file will be closed, so at least there are no files

Re: [julia-users] Memory allocation in Closed loop Control Simulation

2015-03-12 Thread Bartolomeo Stellato
I installed valgrind 3.11 SVN with homebrew and tried to run the code but I am not familiar with the generated output. I added a valgrind-julia.supp and used the command parameters explained here https://github.com/JuliaLang/julia/blob/master/doc/devdocs/valgrind.rst I executed: valgrind

Re: [julia-users] sum array

2015-03-12 Thread pip7kids
Hi Mauro - thanks for that as that makes it clear whats happening under the bonnet. So, what if you then wanted to sum... 1.4827 1.48069 0.884897 1.22739 is that possible or am I being a bit dumb here. Regards On Thursday, 12 March 2015 10:59:34 UTC, Mauro wrote: Can I still

Re: [julia-users] How can I convert a set to an array?

2015-03-12 Thread Ali Rezaee
Thanks a lot for your help :) On Wednesday, March 11, 2015 at 5:07:45 PM UTC+1, Jacob Quinn wrote: a = IntSet([1,2,3]) a = [a...] On Wed, Mar 11, 2015 at 9:35 AM, Ali Rezaee arv@gmail.com javascript: wrote: In Python I would do a = set([1,2]) a = list(a) How can I do that in

[julia-users] Re: Help: Too many open files -- How do I figure out which files are open?

2015-03-12 Thread René Donner
With that I was able to debug the problem in a snap. It turns out that one of my functions had readlines(open(...)) instead of open(readlines,...). The critical difference is that the former leaves a file pointer dangling. Ah, ok, that's exactly the difference: using open(myfunc,

Re: [julia-users] Different ways to create a vector of strings in Julia

2015-03-12 Thread Ismael VC
@Tammas Array{T}(0) works in 0.4-dev, but I think that's why there is also a Vector{T} typealias for Array{T,1}, so it could be Vector{T}(0) which is slightly better IMHO. julia Vector{Int}(0) 0-element Array{Int64,1} julia Array{Int,1}(0) 0-element Array{Int64,1} julia Array{Int}(0)

Re: [julia-users] Swapping two columns (or rows) of an array efficiently

2015-03-12 Thread Steven G. Johnson
As a general rule, with Julia one needs to unlearn the instinct (from Matlab or Python) that efficiency == clever use of library functions, which turns all optimization questions into is there a built-in function for X (and if the answer is no you are out of luck). Loops are fast, and you

Re: [julia-users] Different ways to create a vector of strings in Julia

2015-03-12 Thread Ivar Nesje
So, what you would want to do is `Array{String,1}()`. That ought to construct a array of strings with dimension 1 but doesn't. But in 0.4 you can use Array{String,1}(0) to create a 1d array with 0 elements. Note that you have to provide the size of the array, and 0 is not default (, but

Re: [julia-users] sum array

2015-03-12 Thread pip7kids
Hi Thanks Mauro for the advice - all makes sense now. Regards On Thursday, 12 March 2015 11:28:22 UTC, Mauro wrote: Hi Mauro - thanks for that as that makes it clear whats happening under the bonnet. So, what if you then wanted to sum... 1.4827 1.48069 0.884897 1.22739

[julia-users] Re: Something equivalent to Python's xrange()?

2015-03-12 Thread Ivar Nesje
Python learned that lesson in moving from python 2 to python 3, so Julia creates lazy ranges by default. With the focus Julia has on performance, this would probably an obvious choice anyway. For the ideom you present, we actually don't even create a range (because of inlining), but generate

Re: [julia-users] Automatic doc tools for Julia

2015-03-12 Thread Ismael VC
tshort, could you provide us an example please? El jueves, 12 de marzo de 2015, 4:59:14 (UTC-6), tshort escribió: The Lexicon package works well for me along with Mkdocs. On Mar 12, 2015 6:03 AM, Ján Adamčák jada...@gmail.com javascript: wrote: Hi guys, Can I ask you for something like

[julia-users] Something equivalent to Python's xrange()?

2015-03-12 Thread Ali Rezaee
Hi, I am trying to iterate over a range of numbers. I know I can do this: for i in 1:10 println(i) end but, if I am not wrong, it creates a list from 1 to 10 and iterates over it. Is there a more memory efficient method so that it does not create and store the list? something that returns an

[julia-users] Re: Something equivalent to Python's xrange()?

2015-03-12 Thread Ali Rezaee
That's cool. Thank you On Thursday, March 12, 2015 at 2:19:31 PM UTC+1, Ali Rezaee wrote: Hi, I am trying to iterate over a range of numbers. I know I can do this: for i in 1:10 println(i) end but, if I am not wrong, it creates a list from 1 to 10 and iterates over it. Is there a

Re: [julia-users] Different ways to create a vector of strings in Julia

2015-03-12 Thread Tamas Papp
On Thu, Mar 12 2015, Ivar Nesje wrote: So, what you would want to do is `Array{String,1}()`. That ought to construct a array of strings with dimension 1 but doesn't. But in 0.4 you can use Array{String,1}(0) to create a 1d array with 0 elements. Note that you have to provide the size of

Re: [julia-users] Different ways to create a vector of strings in Julia

2015-03-12 Thread Charles Novaes de Santana
Thank you all for the explanation! We don't stop learning in this list! Best, Charles On Thu, Mar 12, 2015 at 3:10 PM, Tamas Papp tkp...@gmail.com wrote: On Thu, Mar 12 2015, Ivar Nesje wrote: So, what you would want to do is `Array{String,1}()`. That ought to construct a array of

Re: [julia-users] Swapping two columns (or rows) of an array efficiently

2015-03-12 Thread Steven G. Johnson
On Thursday, March 12, 2015 at 10:08:47 AM UTC-4, Ján Dolinský wrote: Hi, Is this an efficient way to swap two columns of a matrix ? e.g. 1st column with the 5th X = rand(10,5) X[:,1], X[:,5] = X[:,5], X[:,1] It is not optimal, because it allocates temporary arrays. Instead, you can

Re: [julia-users] Something equivalent to Python's xrange()?

2015-03-12 Thread Mauro
1:10 creates a UnitRange which stores just two numbers, start and stop: julia typeof(1:10) UnitRange{Int64} (constructor with 1 method) julia names(UnitRange) 2-element Array{Symbol,1}: :start :stop To actually create the list you'd use collect(1:10) On Thu, 2015-03-12 at 14:19, Ali Rezaee

Re: [julia-users] Plotting table of numbers in Gadfly?

2015-03-12 Thread Jiahao Chen
Daniel is the authoritative source, but for such situations I use layers and manual color schemes like this: using Color, Gadfly xgrid=0:10:100 data=rand(10,10) nrows = size(data, 1) cm = distinguishable_colors(nrows, lchoices=0:50) #lchoices between 50 and 100 are too bright for my taste for

[julia-users] Plotting table of numbers in Gadfly?

2015-03-12 Thread Sheehan Olver
I have a table of numbers that I want to line plot in Gadfly: i.e., each column corresponds to values of a function. Is this possible without creating a DataFrame?

[julia-users] Re: Best practices for migrating 0.3 code to 0.4? (specifically constructors)

2015-03-12 Thread Avik Sengupta
I think this is simply due to your passing a UTF8String, while your function defined only for ASCIIString. Since there is no function defined for UTF8String, julia falls back to the default constructor that calls convert. julia type A a::ASCIIString b::Int end julia

Re: [julia-users] Re: Getting people to switch to Julia - tales of no(?) success

2015-03-12 Thread Jiahao Chen
the biggest drawback was the risk that the language might die in 5 years. With virtualization technology, one can always take a snapshot of a working installation, and then the problem is simply reduced to finding a virtualization environment that is sufficiently backwards compatible that it can

[julia-users] Some simple use cases for multi-threading

2015-03-12 Thread Viral Shah
I am looking to put together a set of use cases for our multi-threading capabilities - mainly to push forward as well as a showcase. I am thinking of starting with stuff in the microbenchmarks and the shootout implementations that are already in test/perf. I am looking for other ideas that

[julia-users] Parallel for-loops

2015-03-12 Thread Pieter Barendrecht
I'm wondering how to save data/results in a parallel for-loop. Let's assume there is a single Int64 array, initialised using zeros() before starting the for-loop. In the for-loop (typically ~100,000 iterations, that's the reason I'm interested in parallel processing) the entries of this Int64

[julia-users] Re: Block Matrices: problem enforcing parametric type constraints

2015-03-12 Thread Greg Plowman
I don't really understand how this works, but this might point someone in the right direction. It seems Julia can't fully infer types, in particular the element type S. So we get further if we give a hint: type BlockMatrix{S,TA:AbstractMatrix{S},TB:AbstractMatrix{S},TC:

Re: [julia-users] Automatic doc tools for Julia

2015-03-12 Thread Ismael VC
Thank you very much Tom! On Thu, Mar 12, 2015 at 9:26 AM, Tom Short tshort.rli...@gmail.com wrote: Here is an example of documentation for a package I maintain: https://tshort.github.io/Sims.jl/ Here are examples of docstrings:

Re: [julia-users] Re: Getting people to switch to Julia - tales of no(?) success

2015-03-12 Thread Tamas Papp
IMO there is no way to ensure that a new language like Julia will live (= have a viable, active community which keeps improving the language and the libraries) over a 5-year timeframe. I really hope it will, but there is no way to be sure. That said, since it is open source, the client will

[julia-users] Re: Help: Too many open files -- How do I figure out which files are open?

2015-03-12 Thread ggggg
The other suggestions are good practice. If you are on linux the following commands will help you figure out which file or files you have open, and therefore where in your code to look: pidof julia lsof -p # is from previous command On Thursday, March 12, 2015 at 6:46:10 AM UTC-6,

Re: [julia-users] Swapping two columns (or rows) of an array efficiently

2015-03-12 Thread Ján Dolinský
Hi Steven, This is very cool. Indeed de-vectorizing will do the job. Thanks, Jan Dňa štvrtok, 12. marca 2015 15:49:50 UTC+1 Steven G. Johnson napísal(-a): As a general rule, with Julia one needs to unlearn the instinct (from Matlab or Python) that efficiency == clever use of library

Re: [julia-users] Memory allocation in Closed loop Control Simulation

2015-03-12 Thread Tim Holy
Hmm, looks borked. I may be able to try sometime, but it could be a few days until I get to it. You posted all the code earlier in this thread? Jim Garrison is probably the current expert on combining Julia valgrind. --Tim On Thursday, March 12, 2015 03:01:59 AM Bartolomeo Stellato wrote: I

Re: [julia-users] Swapping two columns (or rows) of an array efficiently

2015-03-12 Thread Tim Holy
This is something that many people (understandably) have a hard time appreciating, so I think this post should be framed and put up on the julia wall. We go to considerable lengths to try to make code work efficiently in the general case (check out subarray.jl and subarray2.jl in master some

[julia-users] question about module, using/import

2015-03-12 Thread antony schutz
Hello I'm trying to generalize an algorithm for alpha user. The algorithm can draw plot but I dont want this to be mandatory, so in the module i don't import the library (for example, i dont call using PyPlot) I want the plot drawing to be an option and has to be done by the user.

Re: [julia-users] Re: Getting people to switch to Julia - tales of no(?) success

2015-03-12 Thread Ken B
Back on topic, I just convinced a client to use Julia with my current project. It will be an online image processing tool. The other choices were Matlab and Python with C#. The fast speed and short development time were the deciding factors here, but the biggest drawback was the risk that the

[julia-users] Re: How does Measure work at y-axis in Gadfly.jl?

2015-03-12 Thread Daniel Jones
No, absolute measures are always left-to-right, top-to-bottom. On Thursday, March 12, 2015 at 2:13:57 AM UTC-7, nanaya tachibana wrote: Thank you very much. Can anything affect the orientation of the absolute measurement of Measure? It goes from left-to-right and top-to-bottom, no matter

[julia-users] dict comprehension syntax in 0.4

2015-03-12 Thread Jim Garrison
It is well known that the dict syntax in 0.4 has changed julia [1=2,3=4] WARNING: deprecated syntax [a=b, ...]. Use Dict(a=b, ...) instead. However, I was surprised to notice that a similar syntax still works for dict comprehensions, without warning: julia [i = 2i for i =

Re: [julia-users] How to introduce scope inside macro

2015-03-12 Thread Tim Holy
Now I understand. Yes, the problem is you're running the operations in global scope. If you really want to go this way, then you'll probably have to make your macro create a function and then call it. --Tim On Thursday, March 12, 2015 09:41:18 AM Johan Sigfrids wrote: But the compile time

Re: [julia-users] Swapping two columns (or rows) of an array efficiently

2015-03-12 Thread Ethan Anderes
Just quick addendum to what Steven wrote, be sure to note that the function swapcols mutates the argument X.

Re: [julia-users] Re: Memory allocation questions

2015-03-12 Thread Phil Tomson
On Thursday, March 12, 2015 at 2:14:34 AM UTC-7, Mauro wrote: Julia is not yet very good with producing fast vectorized code which does not allocate temporaries. The temporaries is what gets you here. However, running your example, I get a slightly different a different *.mem file

Re: [julia-users] How to introduce scope inside macro

2015-03-12 Thread Johan Sigfrids
But the compile time shouldn't be very big, should it? For some bigger data set and more complex computation the compile time should add pretty insignificantly to the running time. The case I'm running into is something like this: function test(a, b, c) @map(sqrt(a^2 + b^2) + c, a, b) end

Re: [julia-users] Re: Getting people to switch to Julia - tales of no(?) success

2015-03-12 Thread Isaiah Norton
The fast speed and short development time were the deciding factors here, but the biggest drawback was the risk that the language might die in 5 years. Any material that I could use if that argument comes up again? The argument I would make is that Julia already has a fairly substantial core

Re: [julia-users] Re: Memory allocation questions

2015-03-12 Thread Phil Tomson
On Thursday, March 12, 2015 at 2:14:34 AM UTC-7, Mauro wrote: Julia is not yet very good with producing fast vectorized code which does not allocate temporaries. The temporaries is what gets you here. However, running your example, I get a slightly different a different *.mem file

[julia-users] Re: 1 - 0.8

2015-03-12 Thread Patrick O'Leary
Julia does not try to hide the complexities of floating-point representations, so this is expected. There's a brief section in the manual [1] which lists some references on this topic--I personally recommend reading What Every Computer Scientist Should Know About Floating-Point Arithmetic

[julia-users] 1 - 0.8

2015-03-12 Thread Hanrong Chen
julia 1-0.8 0.19996 Is this a bug?

Re: [julia-users] 1 - 0.8

2015-03-12 Thread René Donner
Just the limitations of floating point numbers: https://en.wikipedia.org/wiki/Floating_point Am 12.03.2015 um 20:23 schrieb Hanrong Chen hc...@cornell.edu: julia 1-0.8 0.19996 Is this a bug?

Re: [julia-users] Automatic doc tools for Julia

2015-03-12 Thread Tom Short
Here is an example of documentation for a package I maintain: https://tshort.github.io/Sims.jl/ Here are examples of docstrings: https://github.com/tshort/Sims.jl/blob/master/src/sim.jl#L1-L96 Here is the config file for Mkdocs: https://github.com/tshort/Sims.jl/blob/master/mkdocs.yml Here

[julia-users] Question: Variable Names lenght / speed

2015-03-12 Thread Julia User
I'm new to julia and read Allowed Variable Names http://docs.julialang.org/en/release-0.3/manual/variables/#allowed-variable-names and have three general question. - Is there no limit to the lenght a variable name can have? - Does the lenght of a variable name in some way effect the

[julia-users] Re: Block Matrices: problem enforcing parametric type constraints

2015-03-12 Thread ggggg
BlockMatrix only needs one type parameter to fully specify the type, so you should probably only use one type parameter. Like so: *type BlockMatrix{S} : AbstractMatrix{S}* *A::AbstractMatrix{S}* *B::AbstractMatrix{S}* *C::AbstractMatrix{S}* *

Re: [julia-users] Swapping two columns (or rows) of an array efficiently

2015-03-12 Thread Tim Holy
That's a very satisfying result :-). --Tim On Thursday, March 12, 2015 07:19:01 PM Milan Bouchet-Valat wrote: Le jeudi 12 mars 2015 à 11:01 -0500, Tim Holy a écrit : This is something that many people (understandably) have a hard time appreciating, so I think this post should be framed and

Re: [julia-users] Re: Memory allocation questions

2015-03-12 Thread Tim Holy
On Thursday, March 12, 2015 10:31:21 AM Phil Tomson wrote: Will this always be the case or is this a current limitation of the Julia compiler? It seems like the more idiomatic, compact code should be handled more efficiently. Having to break this out into nested for-loops definitely hurts

[julia-users] Question: Variable Names lenght / speed

2015-03-12 Thread Ivar Nesje
There seems to be a limit on 524,288 bytes. (See https://github.com/JuliaLang/julia/pull/8241) Naturally we use a little bit more memory for long variable names when parsing, but I highly doubt that it is measurable. At runtime the length of variable name does not affect the speed.

Re: [julia-users] Swapping two columns (or rows) of an array efficiently

2015-03-12 Thread Milan Bouchet-Valat
Le jeudi 12 mars 2015 à 11:01 -0500, Tim Holy a écrit : This is something that many people (understandably) have a hard time appreciating, so I think this post should be framed and put up on the julia wall. We go to considerable lengths to try to make code work efficiently in the general

[julia-users] Block Matrices: problem enforcing parametric type constraints

2015-03-12 Thread Gabriel Mitchell
I have an application where I want to have a type to represent block matrices and then call various linear algebra function which are specialized to different situations. This can be neatly accomplished by writing (for 2x2 blocks) type BlockMatrix{TA,TB,TC,TD} A::TA B::TB C::TC

Re: [julia-users] Re: Memory allocation questions

2015-03-12 Thread Mauro
you should be able to write: @inbounds for y in 1:img.height @simd for x in 1:img.wid if 1 x img.wid left = img.data[x-1,y] center = img.data[x,y] @inbounds right = img.data[x+1,y] Just curious, why did you get rid of the @inbounds on the

Re: [julia-users] 1 - 0.8

2015-03-12 Thread Jameson Nash
Note that Julia tries to print numbers at full precision by default, except places like Array formatting where horizontal screen space is at premium. Erik's code does print more digits, but it does not provide any more accuracy for representing the number (this is contrary to most other

Re: [julia-users] 1 - 0.8

2015-03-12 Thread Erik Schnetter
Keeping this a bit less abstract: You can output the numbers 0.2 and 0.8 with a bit more precision using @sprintf. For Float64, I prefer to output values with 17 digits, since this corresponds approximately to the values' internal precision. julia @sprintf(%.17f, 0.2) 0.20001

[julia-users] Re: Block Matrices: problem enforcing parametric type constraints

2015-03-12 Thread Gabriel Mitchell
@g Sorry, I guess I didn't state my intent that clearly. While your example does enforce the Matrix/eltype constraint that is only part of what I am after. Having a type parameter for each block is a main thing that I am interested in. The reason is that I can write methods that dispatch on

[julia-users] Re: TSNE error related to blas

2015-03-12 Thread René Donner
I can reproduce this with the following code on both 0.3.6 and a 10 days old master with the following code: using TSne, MNIST data, labels = traindata() Y = tsne(data, 2, 50, 1000, 20.0) Filed an issue here: https://github.com/JuliaLang/julia/issues/10487 my versioninfo(): Julia Version

Re: [julia-users] Re: Memory allocation questions

2015-03-12 Thread René Donner
For inplace matrix multipliation you can also try the in-place BLAS operations: http://docs.julialang.org/en/release-0.3/stdlib/math/?highlight=at_mul_b#Base.A_mul_B! Am Donnerstag, 12. März 2015 10:14:34 UTC+1 schrieb Mauro: Julia is not yet very good with producing fast vectorized code

[julia-users] Help: Too many open files -- How do I figure out which files are open?

2015-03-12 Thread Daniel Carrera
Hello, My program is dying with the error message: ERROR: opening file ...file name...: Too many open files in open at ./iostream.jl:117 in open at ./iostream.jl:125 ... I have reviewed my program and as far as I can tell, everywhere that I open a file I close it immediately. I need to

[julia-users] Re: Help: Too many open files -- How do I figure out which files are open?

2015-03-12 Thread Daniel Carrera
On Thursday, 12 March 2015 12:07:36 UTC+1, René Donner wrote: More are hint than a direct answer, are you using the do syntax for opening the files? open(somefile, w) do file write(file, ...); read(file, ); end No, I'm using close(file) or open(readlines, ...) when I

Re: [julia-users] Re: webpy equivalent

2015-03-12 Thread Keith Campbell
You can clone the repo from the '...' icon on the left, or download it using cloud icon on the left. On Thursday, March 12, 2015 at 4:13:34 AM UTC-4, paul analyst wrote: Thx for info look nice but I am using win7 , usualy using Pkg.add. How to install skeleton-webapp on my Julia under win?

[julia-users] Re: webpy equivalent

2015-03-12 Thread jock . lawrie
Yep, clone it. Also, note the updated README - it gives a crash course in web app development (as I understand it, which may be flawed) aimed at data scientists who have never built a web app before. Hope it helps. On Friday, November 1, 2013 at 3:00:25 AM UTC+11, Jonathan Malmaud wrote:

[julia-users] Re: RFC: JuliaWeb Roadmap + Call for Contributors

2015-03-12 Thread jock . lawrie
Hi Avik, I've updated the README to explain web app development as I understand it (which may be flawed). It is aimed at data scientists who have never built a web app before. It falls short of explicitly explaining the stack APIs but should enable readers to follow what's happening anyway, as

Re: [julia-users] Different ways to create a vector of strings in Julia

2015-03-12 Thread Tamas Papp
Hi Charles, Array{String} is a type, not an array: julia isa(Array{String}, Type) true julia typeof(Array{String}) DataType See http://docs.julialang.org/en/release-0.3/manual/types/ . The function Array(eltype, dimensions...) can be used to instantiate an object of this type, which is the

Re: [julia-users] Different ways to create a vector of strings in Julia

2015-03-12 Thread Mauro
However, I supposed this other way should work too, but it didn't: names = Array{String}; push!(names,word2); It gives me the following error: ERROR: `push!` has no method matching push!(::Type{Array{String,N}}, ::ASCIIString) Why is String[] and Array(String,0) different from

Re: [julia-users] sum array

2015-03-12 Thread Mauro
Hi Mauro - thanks for that as that makes it clear whats happening under the bonnet. So, what if you then wanted to sum... 1.4827 1.48069 0.884897 1.22739 is that possible or am I being a bit dumb here. Just add another sum(ans) after below two statements, that then sums the

[julia-users] Re: How can I convert a set into an array?

2015-03-12 Thread Ali Rezaee
Thanks Rene and Kevin. The unique function is what I needed. On Wednesday, March 11, 2015 at 5:05:08 PM UTC+1, Ali Rezaee wrote: In Python I would normally to something like this: a = set([1,2,1,3]) a = list(a) What is the equivalent way to do this in Julia? Thanks a lot in advance for

Re: [julia-users] Automatic doc tools for Julia

2015-03-12 Thread Tom Short
The Lexicon package works well for me along with Mkdocs. On Mar 12, 2015 6:03 AM, Ján Adamčák jadam...@gmail.com wrote: Hi guys, Can I ask you for something like best practice with auto doc tools for parsing Julia code? I try use Doxygen and Sphinx, but I think this is not good solutions in

Re: [julia-users] sum array

2015-03-12 Thread Mauro
Can I still sum? Maybe it's clearer like this: julia [ x[i-4:i-1] for i = [6,7,8]] 3-element Array{Array{Float64,1},1}: [0.392471,0.775959,0.314272,0.390463] [0.775959,0.314272,0.390463,0.180162] [0.314272,0.390463,0.180162,0.656762] julia sum(ans) 4-element Array{Float64,1}: 1.4827

[julia-users] Different ways to create a vector of strings in Julia

2015-03-12 Thread Charles Novaes de Santana
Dear all, I was trying to create a vector of strings in Julia and I didn't understand why the following ways give me different results. Everything is fine If I try the following two approaches: names = String[]; push!(names,word1); names = Array(String,0); push!(names,word1); However, I

Re: [julia-users] Automatic doc tools for Julia

2015-03-12 Thread Julia User
@ tshort Thanks a lot for your examples. I just started with Mkdocs and it looks quite nice - but some adittional examples like yours are very helpful indeed. On Thursday, March 12, 2015 at 12:26:08 PM UTC-3, tshort wrote: Here is an example of documentation for a package I maintain:

[julia-users] Best practices for migrating 0.3 code to 0.4? (specifically constructors)

2015-03-12 Thread Phil Tomson
I thought I'd give 0.4 a spin to try out the new garbage collector. On my current codebase developed with 0.3 I ran into several warnings (*float32() should now be Float32()* - that sort of thing) And then this error: *ERROR: LoadError: LoadError: LoadError: LoadError: LoadError:

[julia-users] Indenting by 2 spaces in ESS[Julia]

2015-03-12 Thread Shivkumar Chandrasekaran
I have tried all possible combinations of suggestions from the ESS manual to get the ESS[Julia] mode to convert indentation to 2 spaces rather than 4 with no luck. Has anybody else succeeded, and if so could you please post your magic sauce? Thanks. --shiv--

  1   2   >