[julia-users] [ANN] GLVisualize

2016-11-21 Thread Simon Danisch
I finally tagged a new version of GLVisualize with a lot of new goodies and overall improved stability. For more information please see my blog post: GLVisualize - a modern graphics platform for julia [Lets

[julia-users] Re: How to tell if Val{T} is using a fast route

2016-11-16 Thread Simon Danisch
... And really should be, if you want to use code typed: # module scope ff(x::Type{Val{1}}) = 1 const y = 1 function test() # local scope x = 1 a = ff(Val{x}) c = ff(Val{y}) d = ff(Val{1}) end @code_warntype test() Best, Simon Am Mittwoch, 16. November 2016 16:06:31

[julia-users] Re: ANN: Highlights.jl

2016-11-03 Thread Simon Danisch
That's a great library, very pleasant to use! Thanks! Am Mittwoch, 2. November 2016 21:14:06 UTC+1 schrieb Michael Hatherly: > > I’m pleased to announce the initial 0.1 release of Highlights.jl > — a Julia package for > highlighting source code

[julia-users] Re: Julia types newbie question

2016-10-21 Thread Simon Danisch
There is a speed difference, which you can see beautifully like this: function _sum{T}(::Type{T}, A) r = zero(T) @inbounds for i in eachindex(A) r += T(A[i]) end r end @code_llvm _sum(Int, rand(Int64, 10^6)) -> uses <4,Int64> vectors @code_llvm _sum(Int, rand(Int32,

[julia-users] Re: Julia types newbie question

2016-10-17 Thread Simon Danisch
I'm guessing that is done to prevent overflow. So you need to use your own implementation. Here are the promote rules defining this behavior: https://github.com/JuliaLang/julia/blob/master/base/reduce.jl#L32 So in theory you could also implement your own Int type, that has a different promote

[julia-users] Re: StaticArrays vs FixedSizeArrays

2016-10-07 Thread Simon Danisch
You might enjoy: GeometryTypes.jl Especially the Face type should be convenient: https://github.com/JuliaGeometry/GeometryTypes.jl/blob/master/src/faces.jl Its currently based on FixedSizeArrays, but I want to port it to StaticArrays

[julia-users] Re: ANN: CUDAdrv.jl, and CUDA.jl deprecation

2016-09-30 Thread Simon Danisch
Great work! :) Well, I think GPUArrays should be the right place! If it is the right place depends on how much time and cooperation I get ;) The plan is to integrate all these 3rd party libraries. If you could help me with that, it would already be a great first step to establish that library

Re: [julia-users] Re: [ANN] UnicodeFun

2016-09-28 Thread Simon Danisch
be a sick to write symbolic code > for SymEngine or SymPy in that unicode form, and have it convert to the > appropriate code. > > On Wednesday, September 28, 2016 at 6:43:48 AM UTC-7, Simon Danisch wrote: >> >> That's the short form which works with sub/superscript and will create

Re: [julia-users] Re: [ANN] UnicodeFun

2016-09-28 Thread Simon Danisch
ion, ::Int64, ::Function) at > ./strings/io.jl:37 > in to_fraction(::String, ::String) at /home/pi/.julia/v0.5/ > UnicodeFun/src/sub_super_scripts.jl:172 > > julia> > > > Le 28/09/2016 à 13:40, Simon Danisch a écrit : > > I added the to_fraction function: > > to_frac

[julia-users] Re: [ANN] UnicodeFun

2016-09-28 Thread Simon Danisch
ved with the line break. Am Mittwoch, 28. September 2016 12:05:36 UTC+2 schrieb Simon Danisch: > > Good news everyone! > I've written a small library that offers various transformations of text > to special Unicode characters. > The most prominent one is the latex-string to lat

[julia-users] Re: [ANN] UnicodeFun

2016-09-28 Thread Simon Danisch
The best adhoc solution I could find looks like this: 1̲2̲ ̲/̲ ̲2̲0̲ 200 So not impossible... I'll see how we can integrate this Am Mittwoch, 28. September 2016 12:05:36 UTC+2 schrieb Simon Danisch: > > Good news everyone! > I've written a small library that offers various transf

[julia-users] [ANN] UnicodeFun

2016-09-28 Thread Simon Danisch
Good news everyone! I've written a small library that offers various transformations of text to special Unicode characters. The most prominent one is the latex-string to latex-unicode: "\\itA \\in \\bbR^{nxn}, \\bfv \\in \\bbR^n, \\lambda_i \\in \\bbR: \\itA\\bfv = \\lambda_i\\bfv"==> "퐴 ∈

[julia-users] Re: Get the red out!

2016-09-24 Thread Simon Danisch
How about something like this: function showtypetree(T, level=0) println("\t" ^ level, T) for t in subtypes(T) (t != Any) && showtypetree(t, level+1) end end This is still not type stable, since *_subtype *seems to use untyped sets:

[julia-users] Re: GPU CUDA programming in Julia

2016-09-17 Thread Simon Danisch
>What I'm after is something simple as for exemple what ArrayFire.jl If ArrayFire is the kind of simplicity you want and if you don't need more than that, ArrayFire is your best bet right now! It should be relatively stable. Make sure that you installed the dependencies correctly and if it

[julia-users] Re: New to Julia - Need some basic help

2016-08-19 Thread Simon Danisch
Also, are you looking for *include("Filename.jl")* ? Am Freitag, 19. August 2016 12:09:05 UTC+2 schrieb Pigskin Ablanket: > > Ok, I am trying to familiarize myself with a study published using Julia. > I have Julia up and running, but cant seep to get the actual code open. > > Here is what I

[julia-users] Re: JuliaIO

2016-08-08 Thread Simon Danisch
I replied on github ;) Best, Simon Am Montag, 8. August 2016 19:54:14 UTC+2 schrieb David Anthoff: > > Who is maintaining JuliaIO packages? It would be great if someone with > push rights could follow up on > https://github.com/JuliaIO/GZip.jl/issues/57. > > > > Thanks, > > David > > > >

[julia-users] Re: How to make a variable length tuple with inferred type

2016-08-01 Thread Simon Danisch
How about: julia> @code_warntype ntuple( x -> 0, Val{3}) Variables: #self#::Base.#ntuple f::##1#2 #unused#::Type{Val{3}} Body: begin $(Expr(:static_parameter, 2)) # line 73: # meta: location tuple.jl _ntuple 80 # meta: location tuple.jl _ntuple 80 SSAValue(1) =

[julia-users] Re: GraphViz.jl alternative on windows

2016-06-22 Thread Simon Danisch
There's also https://github.com/JuliaGraphs/GraphVisualize.jl Am Mittwoch, 22. Juni 2016 16:01:10 UTC-4 schrieb David Anthoff: > > Hi, > > > > GraphViz.jl doesn’t seem to work on Windows. Is there an alternative > package for this sort of thing? I know about NetworkViz.jl and >

[julia-users] Re: Packages Distances problem with Distances.Jaccard : very slow

2016-06-13 Thread Simon Danisch
It also seems unnecessary to restrict it to Float64 and Array: function myjaccard2{T}(A::AbstractArray{T,1}, B::AbstractArray{T, 1}) num = zero(T) den = zero(T) for (a,b) in zip(A,B) num += min(a,b) den += max(a,b) end return 1.0 - num/den end Maybe also

[julia-users] Re: ArrayFire.jl - GPU Programming in Julia

2016-06-11 Thread Simon Danisch
That would need the capability of compiling arbitrary Julia functions for the GPU. If you remove the arbitrary (no allocations, no exceptions, no IO) and are confident with trying out prototypes, this already exists for NVidia GPU's: https://github.com/JuliaGPU/CUDAnative.jl If you only have a

[julia-users] Re: Reconstruct a string from a Clang.jl generated looong type

2016-06-06 Thread Simon Danisch
What exactly are you after? There's not much more to it than using tuples, which should be well documented. We wrapped Vulkan with this Clang version: https://github.com/JuliaGPU/VulkanCore.jl/blob/master/gen/api/vk_common_1.0.0.jl#L1367 Best, Simon Am Montag, 6. Juni 2016 01:41:34 UTC+2

[julia-users] Re: Reconstruct a string from a Clang.jl generated looong type

2016-06-06 Thread Simon Danisch
On master, Clang will emit NTuples, which is a bit nicer at least! bytestring(UInt8[a...]) a = map(UInt8, ("abcd"...,)) Am Montag, 6. Juni 2016 01:41:34 UTC+2 schrieb J Luis: > > Hi, > > I have one of those types generated from a C struct with Clang.jl that > turns a stack variable into a

[julia-users] Re: Julia Users Berlin

2016-05-30 Thread Simon Danisch
That's awesome! I'm based in Berlin and just recently discussed with different people that we really need a meetup... So, thanks for doing this! I should be able to attend, looking forward seeing everyone there. Best, Simon Am Montag, 30. Mai 2016 15:16:08 UTC+2 schrieb David Higgins: > > Hi

[julia-users] Re: why does Julia have both map and broadcast?

2016-05-25 Thread Simon Danisch
The main thing we should try is to at least have them share as much of the implementation as possible, so that user defined arrays just have to implement one of them correctly and fast(which is non trivial, so it shouldn't really be done 2 times). I propose something like this: ```

[julia-users] Re: GLVisualize in existing OpenGL context

2016-04-29 Thread Simon Danisch
I prefer issues for these kind of questions ;) I opened one for you: https://github.com/JuliaGL/GLVisualize.jl/issues/94 Best, Simon Am Donnerstag, 28. April 2016 22:45:30 UTC+2 schrieb Bart Janssens: > > Hi, > > For QML.jl, I have created an experimental OpenGL QML type that can be > used as

[julia-users] Re: Options for constructing a 3D surface from a point cloud

2016-04-21 Thread Simon Danisch
Well just for visualization you should checkout glvisualize ... Am Mittwoch, 17. Februar 2016 18:46:57 UTC+1 schrieb Chris: > > If I have a set of 3D points, randomly sampled from some arbitrary > surface, what are my options (in terms of Julia packages) for >

[julia-users] Re: Simple function allocating too much memory (Gini coefficient)

2016-04-18 Thread Simon Danisch
In Julia this: function xxx22xx1B(e99y::Array,ww=ones(22)) return 22.2 end turns into this: xxx22xx1B(e99y::Array) = xxx22xx1B(e99y, ones(22)) function xxx22xx1B(e99y::Array,ww) return 22.2 end So you get 2 functions ;) Am Montag, 18. April 2016 09:38:19 UTC+2 schrieb bernhard: > > Hi

[julia-users] Re: [ANN] VulkanCore

2016-04-12 Thread Simon Danisch
any pressure on the GC. It might also be possible to create low latency threads, which don't get interrupted by the GC. Am Samstag, 9. April 2016 19:32:53 UTC+2 schrieb Simon Danisch: > > Valentin <https://github.com/vchuravy> and I are proud to announce a > Julia wrapper for the

[julia-users] Re: is accessing tuple elements more efficient than accessing elements of a 1d array?

2016-04-12 Thread Simon Danisch
Your benchmark is flawed. Try something like the Benchmarks package, or use this: using FixedSizeArrays Base.(:+){T}(p1::NTuple{2,T}, p2::NTuple{2,T}) = (p1[1]+p2[1], p1[2]+p2[2]) function test(a, b, N) ct = a+b for _ in 1:N ct =

[julia-users] Re: [ANN] FixedSizeDictionaries

2016-04-11 Thread Simon Danisch
etfield/setfield* works currently better with types. Also, it already has the nicer macro sugar ;) Am Montag, 11. April 2016 14:08:59 UTC+2 schrieb Simon Danisch: > > Here is yet another package: FixedSizeDictionaries.jl > <https://github.com/SimonDanisch/FixedSizeDictionaries.jl&g

[julia-users] [ANN] FixedSizeDictionaries

2016-04-11 Thread Simon Danisch
Here is yet another package: FixedSizeDictionaries.jl >From the README: *Library which implements a FixedSize variant of Dictionaries. These can be stack allocated and have O(1) indexing performance without boundcheck. It implements

[julia-users] [ANN] VulkanCore

2016-04-09 Thread Simon Danisch
Valentin and I are proud to announce a Julia wrapper for the Vulkan API : VulkanCore.jl Vulkan can be called the successor of OpenGL, but it's a lot closer to the hardware, which is why

Re: [julia-users] Re: raytracing in julia

2016-04-01 Thread Simon Danisch
rch 29, 2016 at 12:30:14 PM UTC+2, Simon Danisch wrote: > > Oh, contrary to FireRender, FireRay seems to only have a C++ API... > There's also https://github.com/JuliaGeometry/GeometricalPredicates.jl > and https://github.com/JuliaGeometry/TriangleIntersect.jl, though! > > > Am Fr

[julia-users] Re: raytracing in julia

2016-03-29 Thread Simon Danisch
Oh, contrary to FireRender, FireRay seems to only have a C++ API... There's also https://github.com/JuliaGeometry/GeometricalPredicates.jl and https://github.com/JuliaGeometry/TriangleIntersect.jl, though! Am Freitag, 25. März 2016 14:54:01 UTC+1 schrieb jw3126: > > I need to do things like

[julia-users] Re: raytracing in julia

2016-03-25 Thread Simon Danisch
I wrapped FireRender.jl , which uses FireRays to do the hit detection. The C-Interface of FireRender was very nice to wrap and got me started very quickly,

[julia-users] [ANN] new tagged version of GLVisualize

2016-03-24 Thread Simon Danisch
Hi, there is a new version of *GLVisualize* and I also improved the website . improvements include various bug fixes, a new vertex color mesh type and better performance. The website contains 3 more examples

[julia-users] Re: ANN: NetworkViz.jl - Julia module for graph visualization

2016-03-20 Thread Simon Danisch
Ah great! lets continue there! Am Donnerstag, 17. März 2016 14:17:15 UTC+1 schrieb Abhijith Anilkumar: > > Hi, > > I'm happy to announce the first registered version of NetworkViz.jl > , a julia interface > to visualize graphs using ThreeJS.jl

[julia-users] Re: ANN: NetworkViz.jl - Julia module for graph visualization

2016-03-20 Thread Simon Danisch
Why not writing rendering backend agnostic code and switch out backends as the library evolves? You can simply work with lines, points and text types, and decouple things from the visualization code completely. This way you could also use GLVisualize , which should

[julia-users] Re: ANN: NetworkViz.jl - Julia module for graph visualization

2016-03-19 Thread Simon Danisch
See that there is already GraphVisualize.jl and I took a quick stab at the issue with SignalView.jl . Both are 2D right now, but should easily work for 3D as well. Note, that I actually plan to

[julia-users] Re: [ANN] GLVisualize

2016-03-06 Thread Simon Danisch
reitag, 26. Februar 2016 23:11:02 UTC+1 schrieb Simon Danisch: > > Hi > > this is the first release of GLVisualize.jl > <https://github.com/JuliaGL/GLVisualize.jl>, a 2D/3D visualization > library completely written in Julia and OpenGL. > > You can find some crude docum

[julia-users] Re: 3D scatter / meshed surface color map

2016-03-02 Thread Simon Danisch
There is: http://www.glvisualize.com/examples/surfaces/ Which also supports any 2D/3D billboard (2D particles that keep facing the camera): http://www.glvisualize.com/examples/sprites/ If you need axes and labels right away, there is: https://github.com/stevengj/PyPlot.jl which supports 3D

[julia-users] Re: [ANN] GLVisualize

2016-02-29 Thread Simon Danisch
;. While Gadfly is not that slow, it's written in a way that it's really hard to apply the optimizations needed to display large data-set and it's even worse for animations. Am Freitag, 26. Februar 2016 23:11:02 UTC+1 schrieb Simon Danisch: > > Hi > > this is the first release

[julia-users] Real-time user input

2016-02-27 Thread Simon Danisch
You could try GLVisualize... There is the mario example to get you started: http://www.glvisualize.com/examples/interactive/

[julia-users] Re: [ANN] GLVisualize

2016-02-27 Thread Simon Danisch
C+1 schrieb Simon Danisch: > > Hi > > this is the first release of GLVisualize.jl > <https://github.com/JuliaGL/GLVisualize.jl>, a 2D/3D visualization > library completely written in Julia and OpenGL. > > You can find some crude documentation on glvisualize.com > <

[julia-users] [ANN] GLVisualize

2016-02-26 Thread Simon Danisch
me :) It's a pleasure to be a part of the Julia community! I'm looking forward to the great visualizations you'll create! Best, Simon Danisch

[julia-users] Re: Weird Hygiene Issue

2016-02-17 Thread Simon Danisch
Why not: module X export f g(x) = 2x f(x, g=g) = g(x) end module Y using X g(x) = 3x println(f(4, g)) end ? Am Sonntag, 14. Februar 2016 20:49:24 UTC+1 schrieb Julia Tylors: > > Hi fellows, > > > I was coding a macro, and I am having a prefix issue with functions. > > basically the

[julia-users] convention for unspecified argument (R's NULL and FALSE, Common Lisp nil)

2016-02-14 Thread Simon Danisch
Why not typemax(Int)? That's also equivalent to all rows, has the same type and you don't need to treat it in a special way...

[julia-users] Re: how to run julia without the llvm jit

2016-02-10 Thread Simon Danisch
@Jameson, thanks for the interesting read! @Tim, I'd like to hear about anything you come up with :) Am Mittwoch, 10. Februar 2016 04:12:19 UTC+1 schrieb Jameson: > > I've been working on a static (no-JIT) Julia mode and related > ahead-of-time-compilation tools. I put together a blog post

[julia-users] Re: Are there solutions for tuple/fixed-length vector arithmetic?

2016-02-01 Thread Simon Danisch
There is this: https://github.com/SimonDanisch/FixedSizeArrays.jl Best, Simon Am Dienstag, 2. Februar 2016 01:07:11 UTC+1 schrieb Nathan Baum: > > In some code I'm writing I have inner loops which, amongst other things, > translate spherical coordinates into Cartesian. > > I notice that the

[julia-users] Re: Immutable type with a function datatype

2016-01-18 Thread Simon Danisch
Am I missing something, or why isn't there this solution: @enum Metric RIEMANNIAN LORENTZIAN # ... immutable Sphere{Matric} dim::Int end function metric(s::Sphere{RIEMANNIAN}) end function metric(s::Sphere{LORENTZIAN}) end Am Montag, 18. Januar 2016 16:08:38 UTC+1 schrieb Anonymous: > > Is

[julia-users] Re: Resources for GLAbstraction and the PerspectiveCamera method

2016-01-12 Thread Simon Danisch
In the case of GLAbstraction, with it's missing Documentation, it's best to just open an issue there! I did that for you: https://github.com/JuliaGL/GLAbstraction.jl/issues/33 Am Dienstag, 12. Januar 2016 14:06:45 UTC+1 schrieb kleinsplash: > > Hi, > > Is there an API or somewhere I can find

[julia-users] Re: Moore foundation grant.

2015-12-27 Thread Simon Danisch
What is the functionality you fancy the most from ggplot and ggvis? Am Mittwoch, 11. November 2015 02:24:27 UTC+1 schrieb Lampkld: > > Congratulations on the exciting news! > > I have played around with Julia A bit and love the language , But Found > Its Lacking Some robust stats/ml/data

[julia-users] Re: Convert result of get request from Requests.jl to an Image from Images.jl

2015-12-17 Thread Simon Danisch
I just tried the same and concluded, that we should add a Vector{Uint8} option to FileIO. Am Mittwoch, 16. Dezember 2015 23:56:22 UTC+1 schrieb Christof Stocker: > > I am trying to find a way to convert a JPEG that I receive from a GET > request into an Image, but without creating a temporary

[julia-users] Re: Interactive graph visualization in Julia

2015-11-30 Thread Simon Danisch
If you have the physics code ready, this should be really easy to do in GLVisualize. I'm about to merge some important rebuild and writing up docs right now, which is why it's not released, but here is a teaser: http://julialang.org/blog/2015/10/glvisualize/ Best, Simon Am Montag, 30.

[julia-users] Re: Ray tracing for complex geometry

2015-11-24 Thread Simon Danisch
Sorry, that was the method definition, not the actual call! So it's just an optional second argument! Ah yeah, if implementing it from scratch is an option, ray tracing in its simple form is probably the most approachable (although still slow compared to visualizing it with OpenGL). Am

[julia-users] Re: Using Meshes.ji

2015-11-24 Thread Simon Danisch
This is the best GLVisualize can do for you right meow: You get this with: using GLVisualize, FileIO, Colors, GeometryTypes, GLAbstractionwindow, renderloop = glscreen()obj =

[julia-users] Re: ERROR: LoadError: UndefVarError: mesh not defined. using MeshIO

2015-11-23 Thread Simon Danisch
Well, it's load, not mesh... I admit, the Readme is not very helpfull. By the way, the REPL with typeof(), xdump(), println(), methodswith() and auto completion are your friend when it comes to figuring out how a type works. Am Montag, 23. November 2015 15:38:44 UTC+1 schrieb kleinsplash: > My

[julia-users] Re: Ray tracing for complex geometry

2015-11-23 Thread Simon Danisch
I'm still confused about what you want. Google says: "In computer graphics, ray tracing is a technique for generating an Image by tracing the path of light through pixels in an image plane and simulating the effects of its encounters with virtual objects." which is pretty much what I understand

[julia-users] Re: Ray tracing for complex geometry

2015-11-23 Thread Simon Danisch
I'm not sure what you mean by virtual objects. Obj is in the context of 3D objects is usually the wavefront format. If you have an object database with *.obj's in it, the probability is very high, that you don't have pointclouds whatsoever.

[julia-users] Re: Ray tracing for complex geometry

2015-11-23 Thread Simon Danisch
Yeah, now worries! This is pretty much the XY problem , which easily happens to the best of us. Just be sure to include enough context information. You can make a screenshot with glvisisualize with: screenshot(window, path=" screenshot.png") Screenshot of

[julia-users] Re: ERROR: LoadError: UndefVarError: mesh not defined. using MeshIO

2015-11-23 Thread Simon Danisch
This is solved in your other thread, is it? Am Montag, 23. November 2015 15:38:44 UTC+1 schrieb kleinsplash: > > My aim is to load an object file and access its faces, vertices and > normals. > > My current code: > > using FileIO > using GLVisualize > using MeshIO > > obj_file =

[julia-users] Re: Triangular Dispatch, Integerm Range and UniformScaling error

2015-11-22 Thread Simon Danisch
As far as I know, triangular dispatch hasn't hit the shores yet (especially not in 0.4). This sort of works, because I is actually a global variable in Base (I:: UniformScaling{Int64}) Try some other name, and it will tell you that the variable is undefined, as expected. Best, Simon Am

[julia-users] Re: Please help me understand comprehensions for creating an array

2015-10-26 Thread Simon Danisch
This is not wanted but expected behavior, since type inference of non constant globals doesn't work very well (since the type can change unpredictable). Two fixes: put your code in a function, or declare a and Nb as const. This is directly related:

[julia-users] Re: map() vs. comprehensions

2015-10-21 Thread Simon Danisch
It's a well known issue: https://github.com/JuliaLang/julia/issues/1864 Sadly, it's not that easy to fix. There's a temporary fix in form of a package: https://github.com/timholy/FastAnonymous.jl We might get fast anonymous functions in 0.5, though! Am Mittwoch, 21. Oktober 2015 14:55:50 UTC+2

[julia-users] Re: Julia and Object-Oriented Programming

2015-10-18 Thread Simon Danisch
This design has at least 3 issues, since you can't have instances of a module. In general: I personally would value the discussion of why Julia needs more OOP constructs much more, If one can show that there are terrible flaws in Julia's model which are swiftly solvable with OOP. My guess is,

[julia-users] Re: [ANN] JuliaIO and FileIO

2015-10-17 Thread Simon Danisch
So your biggest concern doesn't seem to be a problem: You can just do query("file.ext") and get back the format without loading the file. I see that in the way you want to use it, a hierarchy would be a nice addition. You could just do this: myload(path) = myload(query(path)) myload{T <:

[julia-users] Re: [ANN] JuliaIO and FileIO

2015-10-15 Thread Simon Danisch
tch in the same way, but just inside one module, to better resolve ambiguities >but something seems a little off about how I use/generate objects I'm not really sure what you mean by that. Best, Simon Am Samstag, 4. April 2015 17:41:14 UTC+2 schrieb Simon Danisch: > > Hi there, > >

[julia-users] Re: Combining arrays in an R enlist like manner

2015-10-12 Thread Simon Danisch
you can also try vcat(vec...)! Am Montag, 12. Oktober 2015 23:33:19 UTC+2 schrieb Ben Ward: > > Hi, > > In R, if you have a list, containing two vectors that are - say - numeric, > you can unlist them into one vector: > > > a <- list(c(1,2,3,4,5), c(7,8,9,10,11)) > > > a > > [[1]] > > [1] 1 2 3

[julia-users] Re: Error occurred when I Push! this to Array{Any}

2015-10-08 Thread Simon Danisch
This should work and nowadays overwritting push! should throw an error, so it's unlikely that you did this. What usually helps is to give a minimal reproducable example, e.g. via a github gist. Best, Simon Am Donnerstag, 8. Oktober 2015 12:48:38 UTC+2 schrieb cheng wang: > > Hello everyone, >

[julia-users] Re: Use preallocation, A[:] vs A, and wrapping and passing collections of variables as types

2015-10-07 Thread Simon Danisch
Well that's how assignment usually works. The *[:]* is something else and is redirecting you to setindex!. *x[:] = 42* is the same as *setindex(a, 42, :)*, which is the same as *setindex(a, 42, 1:length(a))* So it's assigning to the indexes of that vector, which means it's reusing it. Maybe

[julia-users] Re: Is there a way to replace f(object, args...) with object.f(args...)?

2015-10-07 Thread Simon Danisch
There are a lot of things "one could do" ;) Can you give some appealing reasons, why someone should invest his/her time into this? Best, Simon Am Mittwoch, 7. Oktober 2015 17:13:33 UTC+2 schrieb cheng wang: > > Hello everyone, > > In some cases, I would like to make a function belongs to an

[julia-users] Re: When are @generated functions useful?

2015-10-05 Thread Simon Danisch
>Short answer: if you don't need them, don't use them. @tim holy is right! This should be the first thing to know about @generated functions. They make quite a few things difficult for the compiler and probably won't exist very long in their current form. But they're great for prototyping

[julia-users] Re: StackOverflow error while attempting to "lift" Nullables

2015-10-05 Thread Simon Danisch
I can't reproduce it on 0.4. But I have an improvements: https://gist.github.com/SimonDanisch/92e4500a0198c81912f5#file-jl Map works perfectly fine with tuples ;) >When I type in anything else into the interpreter in this case f what f? Am Montag, 5. Oktober 2015 15:27:45 UTC+2 schrieb

[julia-users] Re: StackOverflow error while attempting to "lift" Nullables

2015-10-05 Thread Simon Danisch
It works. But using any for x in your new function definition seems very prone to stack overflow errors. What happens if you do: function $fun_name{T}(x::$new_type{T}...) or function $fun_name{T}(x::$new_type...) I'm not sure how well Julia handles your *t::T=x.* For what is this even needed?

[julia-users] Re: [ANN] ShaderToy.jl

2015-09-24 Thread Simon Danisch
racing examples listed in the links. It runs even on on-board GPU's in real time. The algorithms allow only for very limited ray tracing, but work nicely on the GPU. Am Donnerstag, 24. September 2015 01:21:16 UTC+2 schrieb Simon Danisch: > > Hi, > you want to try out GPU accelerated ray tr

[julia-users] Re: Julia code 5x to 30x slower than Matlab code

2015-09-24 Thread Simon Danisch
There is no question that Julia needs more work. This applies to offering speedy primitives and also doing more optimizations. But I think you get one thing wrong. The magic lays in the fact, that in Julia you have the chance to write the vectorized implementation that are offered by languages

[julia-users] Re: Same native code, different performance

2015-09-24 Thread Simon Danisch
I cannot reproduce this on RC2. Probably the inlining fails for f on some julia version? Am Donnerstag, 24. September 2015 18:04:18 UTC+2 schrieb Kristoffer Carlsson: > > Can someone explain these results to me. > > Two functions: > f(x) = @fastmath cos(x)^3 > f_float(x) = @fastmath cos(x)^3.0

[julia-users] Re: [ANN] ShaderToy.jl

2015-09-24 Thread Simon Danisch
at all. Am Donnerstag, 24. September 2015 01:21:16 UTC+2 schrieb Simon Danisch: > > Hi, > you want to try out GPU accelerated ray tracing? You want some quick and > easy start for GPU accelerated fractal rendering? > You can do this quite easily now! > ShaderToy <https://gi

[julia-users] [ANN] ShaderToy.jl

2015-09-23 Thread Simon Danisch
Hi, you want to try out GPU accelerated ray tracing? You want some quick and easy start for GPU accelerated fractal rendering? You can do this quite easily now! ShaderToy allows you to only specify a fragmentshader, which is an OpenGL program which

[julia-users] Re: method_exist inconsistent with dispatch ?

2015-09-16 Thread Simon Danisch
you're passing types to next, and it points out correctly: no method matching next(::*Type*{Number}, ::*Type*{Any}) method_exist on the other hands takes types as its arguments so your query should look like this: *method_exists( next, Tuple{DataType, DataType } )* or *method_exists( next,

[julia-users] Re: Anti-Grain Geometry and other alternatives

2015-09-15 Thread Simon Danisch
@Tim Holy, the wait has been long enough ;) By the way, what graphic card do you have? It's quite possible that it works on windows without a new machine. - given that this is an acceptable temporary solution for you :) Am Dienstag, 15. September 2015 18:01:37 UTC+2 schrieb Tom Breloff: > > Does

[julia-users] Re: Anti-Grain Geometry and other alternatives

2015-09-15 Thread Simon Danisch
I've looked at most techniques and settled for distancefield based techniques for OpenGL. I'm in the middle of putting everything together but right now I've just finished support for different markers, styles (glow || outlined || filled) and full unicode rendering. You can place and rotate

[julia-users] Re: Anti-Grain Geometry and other alternatives

2015-09-15 Thread Simon Danisch
Good question! Best would be to wait a little more. I plan to release a tutorial video, explaining all the new features. Don't expect something too polished, though. It's good to have the primitives working, but turning it into a well-rounded package will still require quite a bit of time. I

[julia-users] Re: I don't understand the behaviour of macros and let.

2015-09-12 Thread Simon Danisch
Well, m is not a global because of the let blog. Because you evaluate that statement, m needs to be in the scope of the macro, which it is only for msg (msg is global). You probably don't want to eval in a macro, and just return an expression instead. That's what macros do, take an expression

[julia-users] Re: [ANN] FixedSizeArrays

2015-09-06 Thread Simon Danisch
Thanks =) It should be tagged, although the last tag does not have the newest commits. I'll tag a new version. Best, Simon Am Samstag, 5. September 2015 23:09:20 UTC+2 schrieb Simon Danisch: > > Hi everyone, > > FixedSizeArrays <https://github.com/SimonDanisch/FixedSizeA

[julia-users] Re: JuliaCon 2015 videos

2015-09-06 Thread Simon Danisch
Thanks for all the hard work and making JuliaCon what it was!! I had a great time there :) Am Donnerstag, 13. August 2015 19:22:09 UTC+2 schrieb Viral Shah: > > Folks, > > I am happy to announce that the videos are almost all ready, and I will > start posting them in batches. I am starting

[julia-users] [ANN] FixedSizeArrays

2015-09-05 Thread Simon Danisch
Hi everyone, FixedSizeArrays offers an abstract interface to turn arbitrary types into arrays of fixed size with most array functionality defined. The types Point, Vec and Mat are already included per default. Advantages are that they're

[julia-users] Re: Declare user-defined type variable but *not* initialize it

2015-09-05 Thread Simon Danisch
I'm not a big fan of* p = Point(); p.x = 1.0*, since it might sneak in undefined reference errors, which seems totally avoidable to me. You can always do this, after all: *x = compute_x()* ** *y = compute_y()* ** *Point(x,y)* If performance is your concern, I'm pretty sure that LLVM is

[julia-users] Re: Define functions in loop

2015-09-02 Thread Simon Danisch
this case is pretty simple: for letter in [:A,:B] @eval begin function $letter(T::test) T.$letter end end end @eval == eval(quote end) == eval( :( ) ) Am Mittwoch, 2. September 2015 11:16:53 UTC+2 schrieb Robert DJ: > > Hi, > > I have a situation

[julia-users] Re: Need help optimizing my implementation of Selection Sort

2015-08-29 Thread Simon Danisch
Here are some code snippets, which apply the knowledge from the performance tip section http://julia.readthedocs.org/en/latest/manual/performance-tips/ https://gist.github.com/SimonDanisch/a36dcc824034c43b5d78#file-selectionsort-jl Spoiler: the fastest version is 15 times faster. The one with

[julia-users] Re: How to best define an EulerAngles type

2015-08-26 Thread Simon Danisch
First of all I would recommend FixedSizeArrays or NTuples for this, as they can be faster in some cases and you can restrict them to 3 dimensions. Then I'd follow Tim Holy's advice. Concerning your problem, you can do this on 0.4: call{T : Number, SEQ}(::Type{EulerAngles{SEQ}, a::Vector{T}} =

[julia-users] 0.4 used to load fast

2015-08-10 Thread Simon Danisch
You should try julia --precompile=yes . I never took the time to search why this was done, though.

[julia-users] Re: 0.4 used to load fast

2015-08-10 Thread Simon Danisch
Ah okay, I suspected this. I wasn't convinced though. I compared the stack traces for precompiled=yes/no for the cases that really annoyed me and it seemed precompiled=no never gave better results. Guess I haven't hit the edge cases yet. But given these findings, I would greatly prefer

[julia-users] Re: John L. Gustafson's UNUMs

2015-07-25 Thread Simon Danisch
How cool! I don't know much about this matter, but this looks very exciting! Julia seems to be a good fit to prototype this! Am Samstag, 25. Juli 2015 15:11:54 UTC+2 schrieb Job van der Zwan: So I came across the concept of UNUMs on the Pony language mailing list

[julia-users] Re: mouse event

2015-07-23 Thread Simon Danisch
2D/3D picking is implemented in GLVisualize.jl... Though, it might not have your type of visualization, especially if its 2D plotting... Am Dienstag, 21. Juli 2015 18:34:31 UTC+2 schrieb Emerson Vitor Castelani: Guys, I need to know if we can create mouse events using pyplot in Julia? And

[julia-users] Re: Indexing Array with empty vector in v.0.4.

2015-07-20 Thread Simon Danisch
This is actually one of the biggest missing features in most programming languages. Giving good interactive feedback and educating people instead of disallowing things just because these noobs can't deal with it anywaysaand because its actually pretty hard to give good feedback :D But I

[julia-users] Re: SOLVED: ERROR: `start` has no method matching start(::Nothing)

2015-07-20 Thread Simon Danisch
This could actually be solved by having something like this in base: start{T}(x::T) = error($T is not iterable. Try implementing start(::$T), done(::$T, state), next(::$T, state)) The basic problem here is, that Julia has weakly enforced interfaces, which often ends in no method errors instead

[julia-users] Re: SOLVED: ERROR: `start` has no method matching start(::Nothing)

2015-07-20 Thread Simon Danisch
@Patrick O'Leary solved was probably exaggerated...But would be a lot better =) The connection between iteration and asigning multiple variables to one return value is easier made than a no method error about a function you might have never heard about. Am Montag, 20. Juli 2015 21:09:00

[julia-users] Re: Escher/Compose/Gadfly for heavy visualization

2015-07-06 Thread Simon Danisch
GLVisualize should be a perfect fit for this kind of task, though it might not install flawlessly on all platforms (I'm working on that). You can definitely give it a try, I fixed quite a few problems in the last days. Combining it with GTK or QT should be relatively straight forward, but

[julia-users] Re: Convert Array{Tuple} to Matrix

2015-07-06 Thread Simon Danisch
You could do also try this, which does not introduce any overhead: reinterpret(Int, tuple_array, (3, 1000)) But it only works with Julia 0.4 and I'm not sure if you would consider it as clean. Am Montag, 6. Juli 2015 16:10:01 UTC-4 schrieb Júlio Hoffimann: Hi, How to convert: 1000-element

  1   2   3   4   >