Re: [julia-users] a floating point test for other's environments

2015-09-08 Thread René Donner
what is your versioninfo()? Am 09.09.2015 um 08:17 schrieb Arch Call : > I am getting fma not defined! It is probably related to line 22. > > On Wednesday, September 9, 2015 at 1:04:34 AM UTC-4, Jeffrey Sarnoff wrote: > I wrote this FloatTest to find out if three things that should be true of

Re: [julia-users] How to delete a file?

2015-09-06 Thread René Donner
It's "rm": http://docs.julialang.org/en/latest/stdlib/file/?highlight=rm#Base.rm Am 06.09.2015 um 17:56 schrieb J Luis : > Let's say that in a script I had to create a temporary file. How do I delete > it when no longer needed? Searched the docs for delete and remove but didn't > find a soluti

Re: [julia-users] @parallel and HDF5 is posible to work together?

2015-09-04 Thread René Donner
Only process number 1 has the actual underlying file handle. Therefore all other workers, when trying to read, report that the file is unaccessible. You could try to designate one worker for the reads, i.e. use something along the lines of @fetchfrom 1 dset=fid["punkty"*string(i)] You could

Re: [julia-users] Converting a string to an array?

2015-08-31 Thread René Donner
Hi, yes, it works almost the same: julia> eval(parse("[1,2,3]")) 3-element Array{Int64,1}: 1 2 3 parse parses the string into an expression (abstract syntax tree, AST), and eval, well, evaluates ;-) But take care, any valid code inside the string will get executed. Rene Am 31.08.2015

Re: [julia-users] When to use Symbol instead of ASCIIString on function arguments?

2015-08-30 Thread René Donner
There is no difference. identity is defined as "identity(x) = x", and this gets inlined by the compiler. You can also check, for example, the output of "@code_native f(1)" and compare it with g. Am 30.08.2015 um 16:06 schrieb Diego Javier Zea : > Thanks! > > One more question, what is the di

Re: [julia-users] Delayed output

2015-08-30 Thread René Donner
Thanks for the info. I filed an issue with IJulia about this: https://github.com/JuliaLang/IJulia.jl/issues/347 Am 29.08.2015 um 22:12 schrieb Christoph Ortner : > Many thanks for this: > * On 0.3.11, it works fine for me > * On Version 0.4.0-dev+6297 (2015-07-27 21:28 UTC) I have the same

Re: [julia-users] Delayed output

2015-08-28 Thread René Donner
Can you try whether adding a flush(STDOUT) after the print statement makes any difference? Am 28.08.2015 um 15:16 schrieb Christoph Ortner : > If I use `println` or `@show` to output intermediate results of a computation > in IJulia, the output is often delayed until the computation is complet

Re: [julia-users] Delayed output

2015-08-28 Thread René Donner
weeks, used to work just fine. Am 28.08.2015 um 15:20 schrieb René Donner : > Can you try whether adding a flush(STDOUT) after the print statement makes > any difference? > > > Am 28.08.2015 um 15:16 schrieb Christoph Ortner : > >> If I use `println` or `@show` to outp

Re: [julia-users] Re: packages that depend on unregistered packages (also: pkg REQUIRE allow urls)?

2015-08-25 Thread René Donner
Not yet, but see the discussion in https://github.com/JuliaLang/METADATA.jl/issues/2800 In the meantime, you could try https://github.com/rened/DeclarativePackages.jl Cheers, Rene Am 25.08.2015 um 19:26 schrieb Chris <7hunderstr...@gmail.com>: > Is this possible yet? It would be very useful

Re: [julia-users] Julia jobs in NYC

2015-08-25 Thread René Donner
Hi Michael, you might also want to post this on julia-j...@googlegroups.com (some people might be watching the lower-volume julia-jobs more closely). Rene Am 25.08.2015 um 14:42 schrieb Michael Francis : > > As way of an introduction I work for BlackRock and we are actively looking > for

Re: [julia-users] fork (multitasking, not SW)?

2015-08-20 Thread René Donner
It all depends on the details of what you want to achieve, but in the simplest case something along these lines? ref = @spawn someGUIstuff() othercomputations() guiresult = fetch(ref) This will move the work to one of the workers (if there are any available, see addprocs()). Something si

Re: [julia-users] Re: How to efficiently count the number of lines in a file

2015-08-19 Thread René Donner
You can use parse(Int,split(readall(`wc -l test.txt`))[1]) for that. FYI, a small benchmark of showed countlines to be 3x faster than run(wc..) and 4x faster than the mmap approach. The code for countlines is interesting, nice example for highly efficient Julia code: Am 19.08.2015 um 1

Re: [julia-users] How to efficiently count the number of lines in a file

2015-08-19 Thread René Donner
This should work: a = Mmap.mmap("test.txt") n = 1 for i in 1:length(a) if a[i]==10 n+=1 end end @show n Am 19.08.2015 um 12:13 schrieb René Donner : > I guess you could access it using mmap and simply loop through the array: > > http://docs.julialang.org/en/lates

Re: [julia-users] How to efficiently count the number of lines in a file

2015-08-19 Thread René Donner
I guess you could access it using mmap and simply loop through the array: http://docs.julialang.org/en/latest/stdlib/io-network/?highlight=mmap#memory-mapped-i-o I'd be curious, are there even faster alternatives? Am 19.08.2015 um 12:10 schrieb Daniel Carrera : > Hello, > > I need to count t

Re: [julia-users] Julia nightlies

2015-08-19 Thread René Donner
You can use the default .travis file which gets generated on current julia when you run Pkg.generate("MyPackage","MIT") # Documentation: http://docs.travis-ci.com/user/languages/julia/ language: julia os: - linux - osx julia: - release - nightly notifications: email: false # uncomment

Re: [julia-users] Re: How to define an array of floating point numbers?

2015-08-18 Thread René Donner
Hi, I think this does what you want: function sum{T<:FloatingPoint}(x::Array{T,1}) println("hi") end Cheers, Rene Am 18.08.2015 um 11:22 schrieb Uwe Fechner : > Ok, the following definition works on Julia 0.4, but not with 0.3: > > FloatArray = Union{Array{Float32, 1}, Array{Float64,

Re: [julia-users] fast columnwise norm of matrix/speed up mapslices?

2015-08-12 Thread René Donner
You could also try something like julia> a = rand(100,10); julia> @time [norm(sub(a,:,i)) for i in 1:size(a,2)]; 0.135117 seconds (1.80 M allocations: 40.381 MB, 14.14% gc time) As long as your slices are along the last dimension, i.e. columns in a matrix, you can use FunctionalData

Re: [julia-users] Re: The sate of the latest Docs

2015-08-12 Thread René Donner
just a typo for "state" Am 12.08.2015 um 14:23 schrieb Sisyphuss : > Just a somewhat irrelevant question: what is "sate"? > > > On Wednesday, August 12, 2015 at 1:42:15 PM UTC+2, J Luis wrote: > In the latest Docs I am now seeing several repetitions like the case in the > image bellow. > > >

Re: [julia-users] PSA: auto-precompile your modules

2015-08-07 Thread René Donner
Thanks a ton to everyone who made this happen! Absolutely fantastic stuff, especially that it made it into 0.4! Am 07.08.2015 um 06:39 schrieb Steven G. Johnson : > Many of you are aware that Julia 0.4 has some facilities for precompiling > modules, but in the last couple of days they have bec

Re: [julia-users] German Wikipedia Article

2015-06-25 Thread René Donner
I proof-read the changes, they look good to me! Thanks Tobias for tackling this, the previous entry was really not more than a stub.

Re: [julia-users] Re: How to deploy Julia

2015-06-23 Thread René Donner
Cross-linking this to the corresponding issue: https://github.com/JuliaLang/julia/issues/11816 Am 23.06.2015 um 12:17 schrieb Vladislav Falfushinsky : > Recently I`ve tried to deploy julia application, but I recieved an error. > > The code is rather simple: > > function main() > println(

Re: [julia-users] Re: How to read any lines with stream open(file)

2015-06-17 Thread René Donner
Hi, you can use strip() for that. This and some other very handy functions (e.g. lstrip / rstrip) are listed in http://docs.julialang.org/en/release-0.3/stdlib/strings/?highlight=strip#strings cheers, rene Am 17.06.2015 um 11:38 schrieb Paul Analyst : > Is another way [1:end-1] to lost "\

[julia-users] Vienna Julia Meetup

2015-06-12 Thread René Donner
Hi, are there any fellow Julia users in Vienna, Austria, which would be interested in setting up a monthly meetup? There are currently three of us, aiming for July 23rd for a small get-to-know-each-other session, where we can plan further talks / topics / meetings: http://www.meetup.com/Vie

Re: [julia-users] Julia parallel when number of tasks > number of CPUs

2015-05-22 Thread René Donner
You dont have to worry about this, pmap distributes the work onto the workers (one each), and once a worker is done it gets a new piece of work to do. Am 21.05.2015 um 09:49 schrieb Fred : > Hi ! > > When the number of tasks exceed the number of CPUs, is it safe to send all > the tasks in pma

Re: [julia-users] 4D interpolation from scattered points

2015-05-14 Thread René Donner
> ExtremelyRandomizedTrees.jl: Might be really good, but errored a lot on > version 4. Sorry, the fixes for 0.4 were only in master - I tagged a new version (0.0.11) just now. I use it mostly on 0.4, actually - if you find any issues please let me know!

[julia-users] Re: 4D interpolation from scattered points

2015-05-13 Thread René Donner
You could use an ensemble regression approach - see https://github.com/rened/ExtremelyRandomizedTrees.jl#regression for a 1D to 1D example. For your data you could use this (ndims == 2, for visualization): using ExtremelyRandomizedTrees, FunctionalDataUtils # train model ndim = 2 nsamples = 10

Re: [julia-users] Re: Thin Plate Splines

2015-05-13 Thread René Donner
> Thin plate splines are just a special case of Polyharmonic Splines. Would > there be interest of expanding this script into a package? Yes please, that would be great to have! > > -Luke > > On Wednesday, May 13, 2015 at 12:26:12 AM UTC-7, Jan Kybic wrote: > I have a set of irregularly gridde

Re: [julia-users] Save history of REPL

2015-05-12 Thread René Donner
The history can be found in ~/.julia_history Am 12.05.2015 um 15:14 schrieb cameyo : > Hi, > i'd like to save all (or a part of) the history of commands typed in REPL in > a file. > Is there a way to do it? > Thanks. > > Massimo > > > > > -- > View this message in context: > http://julia-pr

Re: [julia-users] Copying installed packages between different machines

2015-05-12 Thread René Donner
The packages are by default in ~/.julia/v0.3 (or v0.4 respectively). You can try to copy this over to Machine2 and see whether the packages you need work that way. One thing that will be missing are binary package dependencies which are installed using the package manager in a package's build s

Re: [julia-users] Installing JGUI: unknown package JGUI

2015-05-12 Thread René Donner
The package does not seem to be registered in METADATA, yet - you can install it with Pkg.clone("https://github.com/jverzani/JGUI.jl.git";) though. Am 12.05.2015 um 13:49 schrieb Peter Kristan <5er.kris...@gmail.com>: > ERROR: unknown package JGUI > in wait at task.jl:51 > in sync_end at task.

Re: [julia-users] how to check if a type has a certain field

2015-05-12 Thread René Donner
Hi, you could look up the name in the list of fieldnames: in(:asf, names(Tech)) will return true if Tech has a field "asf", false otherwise. I don't know what your usage scenario is, but perhaps a Dict() might be an alternative, where you can set arbitrary fields and query their existence wi

Re: [julia-users] Compose.jl: How to draw shapes(circles) from an array in different colors?

2015-05-11 Thread René Donner
Hi, the contexts in Compose form a tree, so you need to combine the points you want in the same color in a unique context, and then compose each of these contexts with the "main" context. You can see an example of this here: https://github.com/rened/ImagePlot.jl/blob/master/src/ImagePlot.jl#

Re: [julia-users] How to flush output of print?

2015-05-08 Thread René Donner
You can see such behaviour implemented in https://github.com/timholy/ProgressMeter.jl (which might already do what you want ;-) Am 08.05.2015 um 12:39 schrieb Ali Rezaee : > Hi, > > I would like to show the progress of my Julia code while its running. But I > do not want each different perce

Re: [julia-users] function similar to matlab tabulate

2015-04-30 Thread René Donner
Hi, I am not aware of a built-in function, but this should do the trick: a = ["a","a","b","c","c","c","d"] d = Dict() for x in a d[x] = get!(d,x,0) + 1 end for k in sort(collect(keys(d))) println("Value $k with count $(d[k])") end Cheers, Rene Am 30.04.2015 um 20:35 schr

Re: [julia-users] Building sysimg error with multi-core start

2015-04-30 Thread René Donner
Hi, I had to fiddle with the precompilation myself, initially hitting similar issues. Are you starting julia simply with "julia" or do you specify the path to the system image using the "-J" parameter? In case you use "-J" you need to use the exeflags parameter of addprocs to specify this for

Re: [julia-users] idiom for range + offset

2015-04-29 Thread René Donner
I believe range(i,num) is what you are looking for. Am 29.04.2015 um 16:22 schrieb Sebastian Good : > I find myself creating ranges of the form i:i+num-1. That is, the ith thing, > and num more. Whenever I see a +1 or -1 I worry about careless off by one > errors, so I wonder if there is a fu

Re: [julia-users] Finding duplicit elements in an iterable

2015-04-29 Thread René Donner
uh, sorry, the assignment was totally unnecessary of course ;-) d = Dict() for i in 1:length(a) push!( get!(d,a[i],Int[]) ,i) end Am 29.04.2015 um 15:40 schrieb René Donner : > Depending on your needs for efficiency and the exact task, this general > approach might be ok: &

Re: [julia-users] Finding duplicit elements in an iterable

2015-04-29 Thread René Donner
Depending on your needs for efficiency and the exact task, this general approach might be ok: a = String["a", "b", "c", "a", "d", "b"] d = Dict() for i in 1:length(a) d[a[i]] = push!(get!(d,a[i],Int[]),i) end julia> d Dict{Any,Any} with 4 entries: "c" => [3] "b" => [2,6] "a" =>

Re: [julia-users] Configuring tComment for Julia-mode in vim?

2015-04-28 Thread René Donner
I am using autocmd FileType julia set commentstring=#\ %s together with https://github.com/tpope/vim-commentary (don't have experience with tComment) Am 28.04.2015 um 11:14 schrieb Magnus Lie Hetland : > > > I'm using vim for Julia editing, and the Julia mode is great; for some > reason,

Re: [julia-users] zero cost subarray?

2015-04-19 Thread René Donner
planned improvements and optimizations take >> > > place. One of the key ones is a tuple overhaul. >> > > >> > > Fair to say it can never be 'zero' cost since there is different inherent >> > > overhead depending on the type of subarray, e.g

Re: [julia-users] zero cost subarray?

2015-04-17 Thread René Donner
As far as I have measured it sub in 0.4 is still not cheap, as it provides the flexibility to deal with all kinds of strides and offsets, and the view object itself thus has a certain size. See https://github.com/rened/FunctionalData.jl#efficiency for a simple analysis, where the speed is mostl

Re: [julia-users] Path of julia executable?

2015-04-15 Thread René Donner
perfect, thanks! Am 15.04.2015 um 17:02 schrieb Stefan Karpinski : > Sys.get_process_title()

[julia-users] Path of julia executable?

2015-04-15 Thread René Donner
Hi, is there a way to find out the path of the Julia executable inside of Julia, similar to args[0] in C? Thanks, Rene

Re: [julia-users] Julia gets a mention in phys.org

2015-04-13 Thread René Donner
You can find more information on Picture here: http://mrkulk.github.io/www_cvpr15/ Am 13.04.2015 um 18:24 schrieb Seth : > http://phys.org/news/2015-04-probabilistic-lines-code-thousands.html > > Joining Kulkarni on the paper are his adviser, professor of brain and > cognitive sciences Josh Te

Re: [julia-users] Problem with addprocs

2015-04-13 Thread René Donner
Can you try whether using "tunnel = true" helps? http://docs.julialang.org/en/release-0.3/stdlib/parallel/#Base.addprocs When tunnel==false (the default), the workers need to be able to see each other directly, which will not work through firewalls which allow only ssh etc. Am 13.04.2015 um

Re: [julia-users] mapping to colums of a matrix

2015-04-07 Thread René Donner
Unfortunately the documentation is not really great yet, but https://github.com/rened/FunctionalData.jl#computing-map-and-friends-details is a collection of functions that could be used for this, with optional in-place operations and parallel processing. It is basically a generalization of t

Re: [julia-users] savefig error

2015-04-03 Thread René Donner
e syntax worked a few > days ago. Do you know if this is a new feature of matplotlib? > > 2015-04-01 23:57 GMT-06:00 René Donner : > The following works: > > using PyPlot > a = plot(sin(linspace(-3,3))) > savefig("test.png") > > savefig only seems

Re: [julia-users] savefig error

2015-04-01 Thread René Donner
The following works: using PyPlot a = plot(sin(linspace(-3,3))) savefig("test.png") savefig only seems to work on the current figure. The error message you are seeing comes from the fact that that "myimage[:savefig]" tells julia to index "myimage" with ":savefig", and this syntax is just

Re: [julia-users] ERROR: InexactError() and deprecations

2015-03-31 Thread René Donner
Not knowing the entire code, could it be that you are passing values > 255 to UInt8? And 'round' of e.g. 255.1 thus makes the error disappear? julia> UInt8(255.0) 0xff julia> UInt8(255.1) ERROR: InexactError() in call at base.jl:36 julia> UInt8(-0.1) ERROR: InexactError() in call at base.jl:3

Re: [julia-users] Finding mode(s) of density estimate

2015-03-31 Thread René Donner
Perhaps one of these can help: https://github.com/panlanfeng/KernelEstimator.jl https://github.com/JuliaStats/KernelDensity.jl https://github.com/johnmyleswhite/SmoothingKernels.jl Just in case you don't know these resources already, http://pkg.julialang.org and https://github.com/svaksha/

[julia-users] Re: Saving Kernel Density Estimation Function output for later use

2015-03-24 Thread René Donner
You can try the jld* functions of the HDF5.jl package, they can save custom types: https://github.com/timholy/HDF5.jl Am Dienstag, 24. März 2015 13:21:02 UTC+1 schrieb Christopher Fisher: > > I would like to save the output of a kernel density estimate function for > future use. The KernelDensit

Re: [julia-users] fill array

2015-03-18 Thread René Donner
t; Am Mittwoch, 18. März 2015 16:01:11 UTC+1 schrieb pip7...@gmail.com: > One thing I forgot to ask is what if I wan to keep the array as it is > and then add to it ...if I run a = filter(x->x<3, z) ... it overwrites the > array. > Regards > > On Wednesday, 18 March 20

[julia-users] Re: fill array

2015-03-18 Thread René Donner
es the > array. > Regards > > On Wednesday, 18 March 2015 14:04:45 UTC, pip7...@gmail.com wrote: >> >> Thanks everybody - got it! >> Regards >> >> On Wednesday, 18 March 2015 12:04:48 UTC, René Donner wrote: >>> >>> or simply >>> &

[julia-users] Re: fill array

2015-03-18 Thread René Donner
or simply a = filter(x->x<3, z) Am Mittwoch, 18. März 2015 12:46:52 UTC+1 schrieb Konstantin Markov: > > julia> a = [i for i=filter(x->x<3,z)] > 2-element Array{Any,1}: > 1 > 2 > > > On Wednesday, March 18, 2015 at 8:31:57 PM UTC+9, pip7...@gmail.com wrote: >> >> Hi >> I want to fill an arra

Re: [julia-users] Change array of arrays to a one dimensional array

2015-03-18 Thread René Donner
You mean as a literal? Any[[1,2], [4,5,6]] will give you: 2-element Array{Any,1}: [1,2] [4,5,6] Or when you want to create that array of array programmatically: julia> [ones(2) for i in 1:2] 2-element Array{Array{Float64,1},1}: [1.0,1.0] [1.0,1.0] Am Mittwoch, 18. März 2015 11:

[julia-users] Re: fill array

2015-03-18 Thread René Donner
You can achieve this with filter: http://docs.julialang.org/en/release-0.3/stdlib/collections/?highlight=filter#Base.filter Am Mittwoch, 18. März 2015 12:31:57 UTC+1 schrieb pip7...@gmail.com: > > Hi > I want to fill an array based on a condition - eg > > a = [] > z = [1,2,3,4] > > for i = 1:len

Re: [julia-users] Pre-compiling?

2015-03-17 Thread René Donner
This is in the works, but in the meantime you can get try building your own system image: http://docs.julialang.org/en/release-0.3/devdocs/sysimg/?highlight=userimg But this is only handy when the code that gets included there does not change too often, as building this image will take a few mi

[julia-users] Re: Reinterpret immutable type as an Array/Matrix.

2015-03-17 Thread René Donner
I believe this might help: https://groups.google.com/d/msg/julia-users/K1BlJW8k2o0/FRfANpsB_XIJ Am Dienstag, 17. März 2015 16:08:09 UTC+1 schrieb Kristoffer Carlsson: > > Say I have an immutable with only one type. > > immutable Strain > exx::Float64 > eyy::Float64 > ezz::Float64 >

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

2015-03-13 Thread René Donner
That string does represent a filename, doesn't it? Do you obtain that by calling readdir() at some point perhaps? This can now return a Array{Union(UTF8String,ASCIIString),1}, which I believe was not the case in 0.3. (At least I had to adapt my code at some point to deal with this) Am 13.03.2

Re: [julia-users] Parallel for-loops

2015-03-13 Thread René Donner
000 simulations. > > Pieter > > > On Friday, March 13, 2015 at 3:29:48 PM UTC, René Donner wrote: > > Am 13.03.2015 um 16:20 schrieb Pieter Barendrecht : > > > Thanks! I tried both approaches you suggested. Some results using > > SharedArrays (100,000 simul

Re: [julia-users] Parallel for-loops

2015-03-13 Thread René Donner
work on chunks of data / batches of itertations, i.e. dont pmap over millions of things but only a couple dozen. Looking at the code might shed some light. > > On Friday, March 13, 2015 at 8:37:19 AM UTC, René Donner wrote: > Perhaps SharedArrays are what you need here? > http://doc

Re: [julia-users] Parallel for-loops

2015-03-13 Thread René Donner
Perhaps SharedArrays are what you need here? http://docs.julialang.org/en/release-0.3/stdlib/parallel/?highlight=sharedarray#Base.SharedArray Reading from a shared array in workers is fine, but when different workers try to update the same part of that array you will get racy behaviour and most

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 : > julia> 1-0.8 > 0.19996 > > Is this a bug?

[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

[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 ac

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 w

[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 0.4

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

2015-03-11 Thread René Donner
Hi, try: a = IntSet([1,2,1,3]) collect(a) that gives you a 3-element Array{Int64,1}. This also work with ranges, like collect(1:3) Cheers, Rene Am 11.03.2015 um 17:03 schrieb Ali Rezaee : > In Python I would normally to something like this: > > a = set([1,2,1,3]) > a = list(a) > >

Re: [julia-users] Re: using Gadfly and PyPlot at the same time

2015-03-06 Thread René Donner
To get rid of name clashed you could e.g. also say import Gadfly using PyPlot Like this "plot" will refer to PyPlot.plot, and you can use "Gadfly.plot" anytime you need Gadfly's plot. You can find more info here: http://docs.julialang.org/en/release-0.3/manual/modules/#summary-of-module-usage

Re: [julia-users] Re: convert composite type to a vector

2015-03-05 Thread René Donner
Sure, would be good! I generally use this pattern only inside more general, pure functions that, say, loop over an array or list of items, where the data that is being viewed into is guaranteed to exist. I avoid to use these unsafe functions directly / on an adhoc basis, and I never pass the re

Re: [julia-users] Re: convert composite type to a vector

2015-03-05 Thread René Donner
And if you want to reduce memory allocations and your fields are all of the same type: immutable Foo{T} a::T b::T c::T end # this always works also for mutables / varying fieldtypes: typevec(a) = [a.(x) for x in names(a)] # create initial view typevec!(foo::Foo) = pointer_to_array(

Re: [julia-users] Re: Package Dependencies

2015-03-03 Thread René Donner
While not built-in, this might do what you want: https://github.com/rened/DeclarativePackages.jl Am 03.03.2015 um 23:58 schrieb Duane Johnson : > Reviving this thread from almost exactly a year ago. Has the package > situation changed? > > Specifically, I'm wondering if there's a way to take

Re: [julia-users] nonlinear curve fitting

2015-03-03 Thread René Donner
loat64}) > > On Tuesday, March 3, 2015 at 10:41:11 PM UTC+1, René Donner wrote: > Looks like curve_fit has been moved to https://github.com/JuliaOpt/LsqFit.jl > > > Am 03.03.2015 um 22:30 schrieb Andrei Berceanu : > > > i found this post concerning nonlinear

Re: [julia-users] nonlinear curve fitting

2015-03-03 Thread René Donner
Looks like curve_fit has been moved to https://github.com/JuliaOpt/LsqFit.jl Am 03.03.2015 um 22:30 schrieb Andrei Berceanu : > i found this post concerning nonlinear curve fitting in Julia, > http://www.walkingrandomly.com/?p=5181 > but it appears the curve_fit method no longer exists > > doe

Re: [julia-users] See full output in REPL?

2015-03-03 Thread René Donner
In my experience, it is better to specifically indicate that you want to see the entire contents - once you move beyond basic experimentation with the language, watching several hundred megabytes being accidentally piped into your terminal or an IJulia session can make for quite annoying coffee

Re: [julia-users] how to create an empty 2-dimensional array of Int64 in Julia

2015-03-03 Thread René Donner
You can use this: julia> Array(Int64,0,0) 0x0 Array{Int64,2} Am 03.03.2015 um 16:09 schrieb Charles Novaes de Santana : > Dear all, > > Sorry if this question is too silly. But I would like to know how to create > an empty 2-dimensional Array of Int64 with Julia. > > To create a empty Arra

Re: [julia-users] See full output in REPL?

2015-03-03 Thread René Donner
you can use showall([1:100]) Am 03.03.2015 um 14:05 schrieb cormull...@mac.com: > Usually it's good how Julia REPL abbreviates output, using \vdots (vertical > ellipsis) based on window height: > > julia> [1:100] > 100-element Array{Int64,1}: >1 >2 >3 >4 >5 >6 >⋮ >

Re: [julia-users] SharedArray + pmap question

2015-03-02 Thread René Donner
If I run your code in the REPL I see the same behavior. Putting it into a function works: julia> function test() S = SharedArray(Int, (3,)) pmap(i->S[i], 1:3) end test (generic function with 1 method) julia> test() 3-element Array{Any,1}: 0 0 0 The same holds true when

Re: [julia-users] exporting tables (ascii or LaTeX)

2015-03-02 Thread René Donner
I have to tried it myself yet, but did you see https://github.com/scheinerman/LatexPrint.jl? Am 28.02.2015 um 10:52 schrieb Tamas Papp : > Hi, > > I am solving some economic models in Julia. I have vectors that describe > various moments, for some data and then for a bunch of models. I would >

Re: [julia-users] Is there a way to "parallel broadcast" a function?

2015-02-19 Thread René Donner
You could try the table functions from https://github.com/rened/FunctionalData.jl julia> Pkg.update(); Pkg.add("FunctionalData") julia> ptable((x,y)->x+y, 1:2, 1:3) 2x3 Array{Int64,2}: 2 3 4 3 4 5 table does not parallelize, ptable uses all workers, and ltable uses only the local workers.

Re: [julia-users] How to build iteratively a large Julia string

2015-02-17 Thread René Donner
allocated) elapsed time: 0.289836491 seconds (89548756 bytes allocated, 35.00% gc time) Am 17.02.2015 um 18:07 schrieb Jameson Nash : > There is an IOBuffer type that works well as a string builder > On Tue, Feb 17, 2015 at 11:56 AM René Donner wrote: > You could use > > a

Re: [julia-users] How to build iteratively a large Julia string

2015-02-17 Thread René Donner
You could use a = Any[] while ... push!(a, somestring) end join(a) Am 17.02.2015 um 15:28 schrieb Maurice Diamantini : > Hi, > > In Ruby, String is mutable and there is the << operator to accumulate > a string at the end of another one. > > I Julia, String is immutable and so, I use the c

Re: [julia-users] prevent yield in task

2015-02-03 Thread René Donner
I remember seeing a commit by Jeff at least a year ago which made returns from functions sometimes yield() to allow scheduled tasks to have their turn more often, independent of manual calls to yield(). But I cannot find any information relating to that any more - perhaps I am imagining things

Re: [julia-users] poly2mask in Julia?

2015-01-28 Thread René Donner
Perhaps the following is what you need. P should be 2 x nPoints. try e.g. inpolygon([10 20 20 10; 10 10 20 20],1:50,1:40) function inpolygon(P,m::Int,n::Int) j = size(P,2) oddnodes = false M = P[1,:] N = P[2,:] for i in 1:size(P,2) if M[i] < m && M[j] >= m || M[j] <

Re: [julia-users] Execute a function with a timeout / time limit?

2015-01-19 Thread René Donner
t; the schedule method but I have not been able to find an example or doc on it: > > https://github.com/JuliaLang/julia/issues/6283 > > Thanks, > > Robert > > Den lördag 17 januari 2015 kl. 07:39:25 UTC+1 skrev René Donner: > Is there also something like interrupt

Re: [julia-users] Execute a function with a timeout / time limit?

2015-01-16 Thread René Donner
Is there also something like interrupt(task) to selectively kill one of several tasks? I could not find anything in the docs. Thanks! Am 17.01.2015 um 04:24 schrieb Isaiah Norton : > Have you tried using tasks with start_timer and interrupt? > > On Tue, Jan 13, 2015 at 7:42 AM, Robert Feldt

Re: [julia-users] Facebook Open Sources Torch (Deep Learning Library)

2015-01-16 Thread René Donner
Hi Simon, just in case you are looking for a Julia-based deep learning framework, there is Mocha.jl (https://github.com/pluskid/Mocha.jl), which is very well designed and documented, and a pleasure to use. cheers, rene Am 16.01.2015 um 19:27 schrieb Simon Danisch : > Thought this could be

Re: [julia-users] Error building cairo

2015-01-13 Thread René Donner
Hi, another way would be to use the nix package manager: http://nixos.org/nix/ list of available packages: http://nixos.org/nixos/packages.html you don't need to be super user to install it, and everything you install through nix can reside in your home directory as well. it is my goto tool wh

Re: [julia-users] REQUIRES and a specific branch?

2015-01-11 Thread René Donner
Hi, perhaps https://github.com/rened/DeclarativePackages.jl can help you here. Rene Am 09.01.2015 um 21:37 schrieb Seth : > I find myself frequently using features in other packages that haven't been > tagged yet. Is there a way to specify in REQUIRES that, say, the master > branch of the p

Re: [julia-users] string literals split to multilines?

2015-01-06 Thread René Donner
hi, this should work: d = """aaa bbb ccc""" Rene Am 06.01.2015 um 11:15 schrieb Andreas Lobinger : > Hello colleagues, > > is there a counterpart for the string literal split to multiple lines like in > python? > > d = '09ab\ > eff1\ > a2a4' > > Wishing a happy day, >Andreas >

Re: [julia-users] Re: Memory Allocation Question

2015-01-03 Thread René Donner
Hi, @code_warntype is in 0.4 master, I believe it got only introduced a few days ago. rene Am 03.01.2015 um 21:12 schrieb Christoph Ortner : > Dear Tim and Viral (and others), > > The above code snippet is a slightly simplified version of my original code, > supplied with random data. I wr

Re: [julia-users] Re: What does (1,2,(3,4)...) mean?

2015-01-03 Thread René Donner
ic, thanks a lot! Am 03.01.2015 um 19:23 schrieb Ivar Nesje : > See https://github.com/JuliaLang/julia/issues/4869 > > kl. 19:19:26 UTC+1 lørdag 3. januar 2015 skrev René Donner følgende: > Hi, > > I wanted to append the tuple (3,4) to the tuple (1,2), expecting (1,2

[julia-users] What does (1,2,(3,4)...) mean?

2015-01-03 Thread René Donner
Hi, I wanted to append the tuple (3,4) to the tuple (1,2), expecting (1,2,3,4) as output: julia> a = (1,2,(3,4)...) (1,2,(3,4)...) It turns out I have to use tuple(1,2,(3,4)...) == (1,2,3,4). I understand (1,2,3,4) and (1,2,(3,4)), but what does the output "(1,2,(3,4)...)", which has typ

[julia-users] ANN: DeclarativePackages.jl

2015-01-02 Thread René Donner
Hi, DeclarativePackages.jl (jdp for short) provides declarative, per-project package management for Julia. It allows to declaratively specify which Julia packages a project should use, optionally with exact version or commit details. jdp will install the specified packages (if necessary) and st

Re: [julia-users] [ANN, x-post julia-stats] Mocha.jl Deep Learning Library for Julia

2014-11-21 Thread René Donner
Hi, as I am just in the process of wrapping caffe, this looks really exiciting! I will definitely try this out in the coming days. Are there any specific areas where you would like testing / feedback for now? Do you have an approximate feeling how the performance compares to caffe? Cheers, Re

Re: [julia-users] Semi-OT: Finding optimal k in k-means

2014-07-28 Thread René Donner
Hi, perhaps Quick-Shift clustering might be interesting as well [1]. It is easy to implement, fast, and in contrast to k-means / k-medoids (which it generalizes) has the very appealing property that the initial, hierachical data-structure has to be computed only once - you can then investigate

Re: [julia-users] ANN: Lint.jl - a little code lint tool

2014-06-10 Thread René Donner
I don't know how feasible it is, but a (perhaps optional) inclusion of the functionality in https://github.com/astrieanna/TypeCheck.jl would be great! Am 09.06.2014 um 00:46 schrieb Tony Fong : > Thanks. PR created. > > I have added a few more low hanging fruits to the Lint module: > * correct

Re: [julia-users] ANN: Lint.jl - a little code lint tool

2014-06-10 Thread René Donner
I don't know how feasible it is, but a (perhaps optional) inclusion of the functionality in https://github.com/astrieanna/TypeCheck.jl would be great! Am 09.06.2014 um 00:46 schrieb Tony Fong : > Thanks. PR created. > > I have added a few more low hanging fruits to the Lint module: > * correct

Re: [julia-users] How to use the value of a variable to the file numbering?

2014-01-07 Thread René Donner
Hi, you can use string interpolation: for i = 1:10 println("A$i.csv") end cheers, rene Am 07.01.2014 um 14:03 schrieb paul analyst : > How to use the value of a variable to the file numbering? > I need 10 csv files with 10 random arrays ...A1, A2, ... A10 > > for i=1:10 > A=rand(100,100)