[julia-users] Re: can't get pyjulia to work

2016-03-14 Thread Eric Forgy
Btw, I had a quick look at pyjulia. It is very cool and works with 
PyCall.jl to handles conversions etc. My solution is much less grand, but 
would work if the arguments to your calls to Julia are simple and could be 
serialized to JSON.

On Tuesday, March 15, 2016 at 8:34:03 AM UTC+8, Eric Forgy wrote:
>
> I have never used Python, but hearing your scenario, I wonder if a Julia 
> API might be acceptable?
>
> Yesterday, I've submitted a package to METADATA I use quite a lot for my 
> own work with similar scenarios (Pages 
> ). I use it mostly for calling 
> Julia from JavaScript (and vice versa), but it would work for any language 
> that supports HTTP requests and WebSockets.
>
> If it interested, I could help get you set up so you can start 
> experimenting with it.
>
> PS: Until it is merged to METADATA (:pray:), the installation instructions 
> would be
>
> Pkg.clone("https://github.com/EricForgy/Pages.jl.git;)
>
> instead of 
>
> Pkg.add("Pages")
>
> Best regards,
> Eric
>


[julia-users] Re: Transpiling Julia to C – The LLVM CBackend

2016-03-14 Thread Scott Jones
Really cool stuff guys! Kudos all around!
I think this might work well in conjunction with the "julia-lite" branch 
I've been working on (given the lack of "tree-shaking").

On Thursday, March 10, 2016 at 4:43:18 PM UTC-5, Jameson wrote:
>
> We at JuliaComputing have resurrected the LLVM CBackend project and given 
> it support for Julia's IR. This lets us output C89 code as the backend from 
> Julia. For more details, see our latest blog post announcing the open 
> source publication of this work:
>
> http://juliacomputing.com/blog/2016/03/10/j2c-announcement.html
>
> -jameson
>
>
> *Julia Computing carried out this work under contract from the Johns 
> Hopkins University Applied Physics Laboratory (JHU APL) for the Federal 
> Aviation Administration (FAA) to support its Airborne Collision Avoidance 
> System X (ACAS X) program.*
>


Re: [julia-users] Formatting comma thousands separator

2016-03-14 Thread Scott Jones
Thanks Tom!

In order to do this with my package (which uses Tom's nice PR on top of the 
Formatting package), you could do the following:

val = 123456789
fmt_default!(Integer, :commas)
println(u"This is a lot of money: $\%(val)")

(note that $ does not need to be quoted, because I use Swift-style 
interpolation, i.e. "\(expr)" )

If you don't want all Integers to be output with commas, you can also 
simply do:
println(u"Let's output with commas: \%(val, :commas)")

I haven't integrated the Python style formatting into my string literals, I 
think will need to change the syntax I added for LaTex names, from 
u"\{dagger}", to something else, such as:
u"\$dagger$" or u"\", for example, so that I can use \{...} for 
Python-style formatting.

Thinking about commas, I'd really like it to actually be able to handle 
different separators, such as ' or _ (which Julia allows for numeric 
literals), or even, based on locale, to be able to select using , for the 
decimal point and . for the thousands separator, as they do in Europe.

I wrote this package for my own convenience, because I never liked having 
the frequently used character $ to indicate interpolation (I know it also 
causes problems for LaTex users), nor using C style printf macros,
but I hope that it may be useful for other Julia developers (and I'd really 
like input on how to improve it, in the string literal syntax, in the 
formatting features, and in the julia code implementing it as well.

Note: since this is not a registered package (hopefully, one day it can 
be), you'll need to clone it from my repo to use it.

Hope this helps!

On Monday, March 14, 2016 at 8:41:37 AM UTC-4, Tom Breloff wrote:
>
> Also check out https://github.com/ScottPJones/StringUtils.jl, which is an 
> extension of Formatting. 
>
> On Sunday, March 13, 2016, Greg Plowman  > wrote:
>
>> I am trying to find an easy way to format numbers with thousands 
>> separators.
>> It seems the package Formatting can be used for this.
>>
>> However, I can't seem to get the "python-style" format specifier working.
>> Below the FormatSpec is correctly created with the field tsep = true, 
>> but it appears to have no effect when printing using printfmt.
>>
>> julia> fspec = FormatSpec(",d")
>> Formatting.FormatSpec
>>   cls   = i
>>   typ   = d
>>   fill  =
>>   align = >
>>   sign  = -
>>   width = -1
>>   prec  = -1
>>   ipre  = false
>>   zpad  = false
>>   tsep  = true
>>
>> julia> printfmt(fspec, 10^9)
>> 10
>>
>>
>> Similarly for FormatExpr ...
>>
>> fexpr = FormatExpr("{:,d}")
>> printfmt(fexpr, 10^9)
>> 10
>>
>> Am I doing something wrong? Or is this not yet implemented?
>>
>>
>> I do realise I can use sprint1 with println or @printf, but I was 
>> looking to use something more "inline".
>>
>> @printf("x = %s\n", sprintf1("%'i", x))
>>
>>

[julia-users] Priority Order of 2 proposals for Images.jl

2016-03-14 Thread Anchit Navelkar
Hi,

I am Anchit Navelkar, an undergraduate studying Computer Science at IIT 
Kharagpur. I've been interested in Computer Vision since my freshman year 
and worked on many projects in this field. I am interested in submitting a 
proposal for Images.jl for GSoC 2016. 

The ideas page on julialang.org has a project proposal 

 for 
writing high performance multithreaded kernels for image processing, more 
specifically multithreaded versions of imfilter and imfilter_gaussian.


I am also interested in adding functionality to Images.jl like Image 
Stitching, Face Detection, Object Tracking, Feature Descriptors or Drawing 
Functions.


Which project would be higher in the priority list for Images.jl?


Thanks!


[julia-users] Re: can't get pyjulia to work

2016-03-14 Thread Eric Forgy
I have never used Python, but hearing your scenario, I wonder if a Julia 
API might be acceptable?

Yesterday, I've submitted a package to METADATA I use quite a lot for my 
own work with similar scenarios (Pages 
). I use it mostly for calling Julia 
from JavaScript (and vice versa), but it would work for any language that 
supports HTTP requests and WebSockets.

If it interested, I could help get you set up so you can start 
experimenting with it.

PS: Until it is merged to METADATA (:pray:), the installation instructions 
would be

Pkg.clone("https://github.com/EricForgy/Pages.jl.git;)

instead of 

Pkg.add("Pages")

Best regards,
Eric


[julia-users] Re: Julia crashes at startup on Windows

2016-03-14 Thread Eric Forgy
I had something similar happen on one of my machines and the answer was the 
antivirus software thought Julia was a virus. Have a look at the antivirus 
software and make sure that Julia is clear.

Hope this helps.

On Tuesday, March 15, 2016 at 6:39:23 AM UTC+8, danie...@gmail.com wrote:
>
> A colleague was trying to install Julia on his Windows machine.  He 
> downloaded the self-extracting archive, extracted it, and then tried to 
> launch Julia.  It showed a blank console for a few seconds, and then 
> closed.  I had him try the nightly build, and it failed in the same way.
>
> He opened up a console manually and pasted in the julia.exe path, and was 
> able to get this output as Julia crashed:
>
>
> C:\windows\system32>C:\Users\pcuthber\AppData\Local\Julia-0.5.0-dev\bin\julia.exe
> A s s e r t i o n f a i l e d !
> P r o g r a m : C : \ U s e r s \ p c u t h b e r \ A p p D a t a \ L o c 
> a l
> \ J u l i a - 0 . 5 . 0 - d e v \ b i n \ j u l i a . e x e
> F i l e : / h o m e / A d m i n i s t r a t o r / b u i l d b o t / s l a 
> v e
> / p a c k a g e _ w i n 6 _ 2 - x 6 4 / b u i l d / d e p s / s r c c a c 
> h e /
> l i b u v / s r c / u v - c o m m o n . c , L i n e 8 3
> E x p r e s s i o n : 0
>
>
> Any ideas as to what is going on?
>
> Thank you!
>
> Daniel
>


[julia-users] julia4 and julia5 under fedor0

2016-03-14 Thread feza
Hi all how can install both julia 4 and julia 5   on fedora  

I have read

http://julialang.org/downloads/platform.html

I have performed

sudo dnf copr enable nalimilan/julia-nightlies

sudo dnf copr enable nalimilan/julia

and then dnf install julia

this only gets me julia0.5 . Is there a way I can also get julia0.4 and 
have them installed side by side. Where typing julia calls v0.4 and calling 
julia5 calls v0.5

Thanks


[julia-users] fft normalization

2016-03-14 Thread CrocoDuck O'Ducks
Hi there cool people!

I am making some Julia experiments around fft, conv and normalization. Long 
story short, by using signals for which it is simple to calculate 
analytically transforms and convolutions, I just play with normalization 
until I find match of the Julia calculated quantities with the analytical 
ones. Here what I found so far:

   - .fft output needs to be normalized by (1/fs), with fs the sample rate 
   of the input signal (ifft will be then normalized by fs)
   - conv output needs to be normalized by (1/fs) as well

The fft normalization is not surprising (I was used to the same in Matlab). 
What do you think? It seems to be working ok but I also feel like I am 
missing something... Here the playground scripts:


# convplay.jl

#=
  Make some experiment with known convolutions:
=#

using PyPlot

# Sampling Variables:
Fₛ = 96000 # Sample Rate

# Time windows of the signals:
T₁ = -20 # seconds
T₂ = 20 # seconds

# Define two rectangular pulses:
α = 2 # Amplitude
τ₁ = 4 # seconds
τ₂ = 6 # seconds

a = 1 # Amplitude
t₁ = 0 # seconds
t₂ = 4 # seconds

S₁ = ceil(T₁ * Fₛ) # Everything before the first sample is lost.
S₂ = floor(T₂ * Fₛ) # Everything after the last sample is lost.

t = (1 / Fₛ) * (S₁:S₂)

# Initialize and populate the signals:
x₁ = zeros(t)
x₂ = zeros(t)

for s = 1:length(t)

  if t[s] >= τ₁ && t[s] <= τ₂
x₁[s] = α
  end

  if t[s] >= t₁ && t[s] <= t₂
x₂[s] = a
  end

end

# Convolve:
c = (1 / Fₛ) * conv(x₁, x₂) # 4, the correct peak of c, is found with this 
normalization.

# fftplay.jl

#=
  Have some PHUN with fft.
=#

using PyPlot

# Close existing plot windows:
close("all")

# Define Signal stuff:
Fₛ = 96000   # Sample Rate. Hz.
P = 1# Amplitude
t₁ = -0.5# Initial instant of signal time window (with pads). s.
t₂ = 0.5 # Final instant of signal time window (with pads). s.
T = 3e-3 # Width of window containing the actual signal (N pulse). s. 
Centered on 0 s.

# Define Processing Stuff:
Mprime = 10 # https://groups.google.com/forum/#!topic/julia-dev/MdTBxgVoab0
# ^^ fft is more efficient if the signal is operating on has a length that 
can
# be expressed as a product of small prime numbers:
# p1^e1 * p2^e2 * ... ei integer exponents, pi prime numbes, i = 1,2,...
# Small: smaller than ten.

# Define the N pulse signal:
Δt = t₂ - t₁ # Global Signal Window. s.
Δtₛ = floor(Δt * Fₛ) # Same in samples.
t = (1 / Fₛ) * ((1 : Δtₛ) - floor(Δtₛ / 2)) # Time. Keep as range and don't 
waste memory. s.
# Signal ranges in samples:
_ , T₁ = findmin(abs(t - (-T / 2)))
_ , T₂ = findmin(abs(t - (+T / 2)))
# Define Signal:
x = zeros(t)
x[T₁ : T₂] = (-2 * P / T) * t[T₁ : T₂]
# Plot the signal:
figure(1)
plot(t, x)

# Prepare for transform:
nfft = nextprod(primes(Mprime), Δtₛ) # this is pretty much how to optimize 
fourier transform length.
x_pad = [x; zeros(nfft - length(x))]

# We are now ready for fft stuff:
# Set up multithread:
FFTW.set_num_threads(2) # I got two cores.

X = (1 / Fₛ) * fft(x_pad)

# Define Frequency Stuff:
f = linspace(0, Fₛ, nfft + 1) # A snake biting its tail...
f = f[1 : nfft]
# Nyquist Sample:
if mod(nfft, 2) == 0
  nyq = convert(Int, floor(nfft/ 2))
else
  nyq = convert(Int, floor(nfft/ 2) + 1)
end
# Positive frequencies and transforms:
f₊ = f[1 : nyq]
# Multiply for sqrt(2) so that the integral of the square magnitude over 
the positive frequency
# gives the correct total power:
X₊ = sqrt(2) * X[1 : nyq]

figure(2)
semilogx(f₊, abs(X₊))
xlim(xmax = 20e3)
ylim(ymax = 2e-3)

# For real signals the positive frequency trasform can be calculated 
directly:
X₊ᵈ = (sqrt(2) / Fₛ) * rfft(x_pad)
# This will contain the very last frequency sample (Nyquist frequency) as 
well:
f₊ᵈ = [f₊; Fₛ/2]

# Check if any differences:
isdif_transf = isequal(X₊, X₊ᵈ[1 : nyq])

# Try to reconstruct the original signal:
x₁ = Fₛ * ifft(X) # This has an unexpected very small imaginary part.
# A good way to get rid of the imaginary part appears to be irfft, that 
works assuming
# exact Hermitian symmetry. So, use only the positive frequency transform, 
However, you must
# include all the info (so, up to Nyquist frequency included):
x₂ = Fₛ * irfft(X[1 : (nyq + 1)], length(x))
# Similarly:
x₃ = (Fₛ / sqrt(2)) * irfft(X₊ᵈ, length(x))

# Check if any differences:
isdif_sig_1 = isequal(x, x₂)
isdif_sig_2 = isequal(x, x₃)

# It is to be expected that all the isdif variables will be false.
# Update the figures with the new plots:
figure(1)
plot(t, x₂)
plot(t, x₃)
xlabel(L"$t$ s", fontsize = 20)
ylabel(L"$x\left(t\right)$", fontsize = 20)
xlim(xmin = -T - T/3, xmax = T + T/3)
ylim(ymin = -P - P/4, ymax = P + P/4)
grid(b = true)

figure(2)
plot(f₊, abs(X₊ᵈ[1 : nyq]))
xlabel(L"$f$ Hz", fontsize = 20)
ylabel(L"\left|X\left(f\right)\right|", fontsize = 20)
grid(b = true)




[julia-users] Re: Realtime Audio Processing with PortAudio.jl

2016-03-14 Thread CrocoDuck O'Ducks
Brilliantly cool! Thanks for notifying the update! I will test it very 
soon. I guess it would be possible to use this technique also to synthesize 
something. Like "white noise until CTRL + C is pressed", so to speak..

On Sunday, 13 March 2016 19:54:48 UTC, Sebastian Kraft wrote:
>
> In the last days I added some code to allow realtime and asynchronous IO. 
> I think it is still quite hackish, but absolutely have no clue how to pass 
> something like a callback object in Julia. 
>
> The thing is I want to open a stream and pass it an initialized 
> "processor" object which is then doing the realtime processing in the 
> background until the stream is closed. My current solution looks like shown 
> in this example:
>
> https://github.com/seebk/PortAudio.jl/blob/master/examples/async_processing.jl
>
> Maybe the whole concept of async IO as I have planned it is not possible 
> in Julia?
>
> Any ideas how this could be done more in a smart (Julia style) way?
>
> Sebastian
>
> Am Montag, 22. Februar 2016 09:51:04 UTC+1 schrieb CrocoDuck O'Ducks:
>>
>> Cool! I will stay updated. Thanks!
>>
>> On Monday, 22 February 2016 07:50:39 UTC, Sebastian Kraft wrote:
>>>
>>> Please only stick to the examples given in the Readme.md file. Single 
>>> buffer IO is not working properly, yet. 
>>> My current plan is to extend open() so you can pass a callback function 
>>> which does the processing asynchronously. However, it does not seem to work 
>>> when C code is called in an @async block... Have to investigate that 
>>> further in the next days...
>>>
>>> Am Sonntag, 21. Februar 2016 16:44:50 UTC+1 schrieb CrocoDuck O'Ducks:

 Hi there!

 I got into PortAudio.jl  
 recently (see this 
  
 thread). I would like to code realtime digital filters. By that I mean 
 that 
 I would like to acquire data from sound-card input(s) and, while the 
 acquisition goes on, filter the acquired samples and write the result to 
 the sound-card output(s). Latency does not need to be low. I have mostly 
 loudspeaker pre-hemphasis applications for acoustic measurements in mind 
 for that, that means I will time align what I need later on... I think the 
 PortAudio module should make me able to do that... but I have not figured 
 out how. Here what I have (very naively) tried:

 iostream = open(devID, (max_input_channels, max_output_channels), 
 sample_rate, buf_size)

 # Use a loop. Ctrl + C to exit the loop.

 doloop = true

 try
   while doloop

 ibuffer = read(iostream, buf_size) # Collect Input
 obuffer = some_filtering_of(ibuffer) # Do some processing
 write(iostream, obuffer) # Write it to output

   end
 catch excp

   if isa(excp, InterruptException) # Ctrl + C generates an 
 InterruptException
 doloop = false
   end

 end

 Of course, there are many problems with that (it is not collecting 
 consecutive buffers, for example). I guess it can help you understanding 
 what I have in mind though.

>>>

[julia-users] Re: can't get pyjulia to work

2016-03-14 Thread Diego Javier Zea
*I'm also having troubles with pyjulia...  Is there a way to solve this 
problem? Best*

diego@SIRRAH:~$ julia
   _
   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?help" for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.4.1 (2015-11-08 10:33 UTC)
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org release
|__/   |  x86_64-linux-gnu

julia> Pkg.installed("PyCall")
v"1.4.0"

julia> 
diego@SIRRAH:~$ python
Python 2.7.9 (default, Apr  2 2015, 15:33:21) 
[GCC 4.9.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import julia
>>> j = julia.Julia()
*ERROR: UndefVarError: dlpath not defined*
 in process_options at ./client.jl:257
 in _start at ./client.jl:378
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/diego/.local/lib/python2.7/site-packages/julia/core.py", line 
244, in __init__
raise *JuliaError('error starting up the Julia process')*
julia.core.JuliaError: error starting up the Julia process



[julia-users] GSOC2016: Iterative solvers

2016-03-14 Thread Kevin Keys
Hello, 

I would like to work on the GSOC 2016 project with iterative solvers 
.
 
I am a doctoral candidate trained in scientific computing, mathematical 
optimization, and genomic technology. I am familiar with IterativeSolvers.jl 
 since I use it in my 
dissertation codebase. Please do not hesitate to email me (klkeys [at] g 
[dot] ucla [dot] edu) if you are interested!

--Kevin


Re: [julia-users] QML (Qt5) binding for Julia (GSOC?)

2016-03-14 Thread Mike Innes
That would be great! There are guidelines from Google on mentorship which
are a better authority, but roughly speaking you'd be looking at a few
hours a week; time for a video call + answering questions over email and
such. This will vary depending on the student, so student ability and
mentor expertise and/or time commitment are things we'll weigh against each
other when looking at proposals.

On Mon, 14 Mar 2016 at 19:02 Uwe Fechner  wrote:

>
>
> On Monday, March 14, 2016 at 8:01:01 PM UTC+1, Uwe Fechner wrote:
>
>> Hello,
>>
>> perhaps I could become mentor of such a project?
>> At least I know a little bit of Julia and a little bit of QML.
>>
>> I am currently implementing optimizations and simulations
>> in Julia, and a QML GUI would be nice.
>>
>> What would be needed to offer such a project?
>>
> How much workload would be expected for a mentor?
>>
>
>>
>> Regards:
>>
>> Uwe Fechner, TU Delft
>>
>> On Monday, March 14, 2016 at 2:23:32 PM UTC+1, Maurice Diamantini wrote:
>>>
>>>
>>>
>>> Le lundi 14 mars 2016 13:24:13 UTC+1, Uwe Fechner a écrit :
>>>
>>>
 What Julia is missing is mainly an easy to use GUI toolkit, and QML
 could play that role.

>>>
>>> That's exactly why I think a QML binding would be easier to do than a
>>> Qt5 one, and sufficient for most use case from Julia : no need to be able
>>> to use yet another string type et socket or http or..., just application
>>> GUI with callback to Julia methods.
>>>
>>>
 Implementing a Julia - QML binding sound not so difficult as there is
 already a C binding.

 I do not understand the following sentence:
 "Being able to build Qt interface directly from Julia without the need
 of  the anaconda
 would be a great advantage for Julia users."

>>>
>>> Because I know there already exists a Python binding Qt4 (or there will
>>> be some day for Qt5) but it require about 1.2 G bytes in the 
>>> `pkgs/v0.4/Conda`
>>> of the Julia directory.
>>>
>>>
>>> If you would write a QML wrapper for the C binding, the C/ C++ code from
 the C wrapper
 would still need to be compiled included in the package in some way
 (binutils). So there
 would still be a dependency on C/C++ code (pre-compiled or not), that
 is always a little
 bit difficult to install and to maintain.

>>>
>>> Yes, but this extension should be more robust because less sensible to
>>> the Qt core changes...
>>>
>>>  -- Maurice
>>>
>>>


Re: [julia-users] QML (Qt5) binding for Julia (GSOC?)

2016-03-14 Thread Uwe Fechner


On Monday, March 14, 2016 at 8:01:01 PM UTC+1, Uwe Fechner wrote:
>
> Hello,
>
> perhaps I could become mentor of such a project?
> At least I know a little bit of Julia and a little bit of QML.
>
> I am currently implementing optimizations and simulations
> in Julia, and a QML GUI would be nice.
>
> What would be needed to offer such a project?
> How much workload would be expected for a mentor?
>
> Regards:
>
> Uwe Fechner, TU Delft
>
> On Monday, March 14, 2016 at 2:23:32 PM UTC+1, Maurice Diamantini wrote:
>>
>>
>>
>> Le lundi 14 mars 2016 13:24:13 UTC+1, Uwe Fechner a écrit :
>>  
>>
>>> What Julia is missing is mainly an easy to use GUI toolkit, and QML 
>>> could play that role.
>>>
>>
>> That's exactly why I think a QML binding would be easier to do than a Qt5 
>> one, and sufficient for most use case from Julia : no need to be able to 
>> use yet another string type et socket or http or..., just application GUI 
>> with callback to Julia methods.
>>  
>>
>>> Implementing a Julia - QML binding sound not so difficult as there is 
>>> already a C binding.
>>>
>>> I do not understand the following sentence:
>>> "Being able to build Qt interface directly from Julia without the need 
>>> of  the anaconda 
>>> would be a great advantage for Julia users."
>>>
>>
>> Because I know there already exists a Python binding Qt4 (or there will 
>> be some day for Qt5) but it require about 1.2 G bytes in the 
>> `pkgs/v0.4/Conda` 
>> of the Julia directory.
>>
>>
>> If you would write a QML wrapper for the C binding, the C/ C++ code from 
>>> the C wrapper
>>> would still need to be compiled included in the package in some way 
>>> (binutils). So there
>>> would still be a dependency on C/C++ code (pre-compiled or not), that is 
>>> always a little
>>> bit difficult to install and to maintain.
>>>
>>
>> Yes, but this extension should be more robust because less sensible to 
>> the Qt core changes...
>>
>>  -- Maurice
>>
>>

Re: [julia-users] QML (Qt5) binding for Julia (GSOC?)

2016-03-14 Thread Uwe Fechner
Hello,

perhaps I could become mentor of such a project?
At least I know a little bit of Julia and a little bit of QML.

I am currently implementing optimizations and simulations
in Julia, and a QML GUI would be nice.

What would be needed to offer such a project?
Who much workload would be expected for a mentor?

Regards:

Uwe Fechner, TU Delft

On Monday, March 14, 2016 at 2:23:32 PM UTC+1, Maurice Diamantini wrote:
>
>
>
> Le lundi 14 mars 2016 13:24:13 UTC+1, Uwe Fechner a écrit :
>  
>
>> What Julia is missing is mainly an easy to use GUI toolkit, and QML could 
>> play that role.
>>
>
> That's exactly why I think a QML binding would be easier to do than a Qt5 
> one, and sufficient for most use case from Julia : no need to be able to 
> use yet another string type et socket or http or..., just application GUI 
> with callback to Julia methods.
>  
>
>> Implementing a Julia - QML binding sound not so difficult as there is 
>> already a C binding.
>>
>> I do not understand the following sentence:
>> "Being able to build Qt interface directly from Julia without the need of 
>>  the anaconda 
>> would be a great advantage for Julia users."
>>
>
> Because I know there already exists a Python binding Qt4 (or there will be 
> some day for Qt5) but it require about 1.2 G bytes in the `pkgs/v0.4/Conda` 
> of the Julia directory.
>
>
> If you would write a QML wrapper for the C binding, the C/ C++ code from 
>> the C wrapper
>> would still need to be compiled included in the package in some way 
>> (binutils). So there
>> would still be a dependency on C/C++ code (pre-compiled or not), that is 
>> always a little
>> bit difficult to install and to maintain.
>>
>
> Yes, but this extension should be more robust because less sensible to the 
> Qt core changes...
>
>  -- Maurice
>
>

[julia-users] Re: Custom ranges

2016-03-14 Thread Lutfullah Tomak
filter(x->mod(x,7)!=0,0:100)

On Monday, March 14, 2016 at 8:57:20 PM UTC+2, Lutfullah Tomak wrote:
>
> Hi,
> I think you can do what you want with filter but it returns whole 
> collection
> filter(x>mod(x,7)!=0,0:100)
>
> On Monday, March 14, 2016 at 8:49:06 PM UTC+2, Jesse Jaanila wrote:
>>
>> Hi
>>
>> How could I build range (UnitRange) that doesn't include elements given 
>> some condition? Like
>> if i'd like to build a range that doesn't contain elements that are 
>> divisible by 7 ( x mod 7 == 0).
>> Is this possible for ranges or do I have to use some other type (it 
>> should be iterable)?
>>
>

[julia-users] Re: Custom ranges

2016-03-14 Thread Lutfullah Tomak
Hi,
I think you can do what you want with filter but it returns whole collection
filter(x>mod(x,7)!=0,0:100)

On Monday, March 14, 2016 at 8:49:06 PM UTC+2, Jesse Jaanila wrote:
>
> Hi
>
> How could I build range (UnitRange) that doesn't include elements given 
> some condition? Like
> if i'd like to build a range that doesn't contain elements that are 
> divisible by 7 ( x mod 7 == 0).
> Is this possible for ranges or do I have to use some other type (it should 
> be iterable)?
>


[julia-users] Intrested in working for julia in GSoC 2016 .

2016-03-14 Thread utkarsh gautam
Hey everyone .!
This is utkarsh . I am interested in contributing for julia in GSoC 2016 .
Particularly I am interested in writing wrappers for sympy ,along with 
writing functions
which solve computational problems .
I don't have much experience in julia ,but I've started learning on my own .
Any kind of guidance would be really appreciable .
Thanks  



Re: [julia-users] Testing functions that return random values?

2016-03-14 Thread Milan Bouchet-Valat
Le lundi 14 mars 2016 à 04:48 -0700, RAJ Rohit Jalem a écrit :
> Thank you for helping.
> 
>    Can you explain me in the context of writing a test for this
> function: https://github.com/JuliaStats/StatsBase.jl/blob/master/src/
> sampling.jl#L77-L81
> 
>    Can it be possible to write tests for this using the Base.Test
> package?  How do I use srand() implementation for writing a test to
> this?
> 
>    Sorry for a lot of questions.  Was trying to get my head around
> Base.Test!
Like this:
using StatsBase, Base.Test
srand(1)
@test samplepair(2) == (1, 2)

To find out that the call returns (1, 2), you need to call this first:
srand(1)
samplepair(2)


Regards

> regards,
> Raj
> 
> 
> 
> 
> 
> > Le lundi 14 mars 2016 à 04:19 -0700, RAJ Rohit Jalem a écrit : 
> > > How do I test functions that return random values. 
> > > 
> > > For example, this function here: https://coveralls.io/builds/5402
> > 764/ 
> > > source?filename=src%2Fsampling.jl#L77 
> > > 
> > > Can it be done with the Base.Test package?  If yes, then how? 
> > Use srand() before calling them to ensure you always get the same 
> > "random" value. For example, srand(1) will work. 
> > 
> > 
> > Regards 


Re: [julia-users] QML (Qt5) binding for Julia (GSOC?)

2016-03-14 Thread Maurice Diamantini


Le lundi 14 mars 2016 13:24:13 UTC+1, Uwe Fechner a écrit :
 

> What Julia is missing is mainly an easy to use GUI toolkit, and QML could 
> play that role.
>

That's exactly why I think a QML binding would be easier to do than a Qt5 
one, and sufficient for most use case from Julia : no need to be able to 
use yet another string type et socket or http or..., just application GUI 
with callback to Julia methods.
 

> Implementing a Julia - QML binding sound not so difficult as there is 
> already a C binding.
>
> I do not understand the following sentence:
> "Being able to build Qt interface directly from Julia without the need of 
>  the anaconda 
> would be a great advantage for Julia users."
>

Because I know there already exists a Python binding Qt4 (or there will be 
some day for Qt5) but it require about 1.2 G bytes in the `pkgs/v0.4/Conda` 
of the Julia directory.


If you would write a QML wrapper for the C binding, the C/ C++ code from 
> the C wrapper
> would still need to be compiled included in the package in some way 
> (binutils). So there
> would still be a dependency on C/C++ code (pre-compiled or not), that is 
> always a little
> bit difficult to install and to maintain.
>

Yes, but this extension should be more robust because less sensible to the 
Qt core changes...

 -- Maurice



Re: [julia-users] QML (Qt5) binding for Julia (GSOC?)

2016-03-14 Thread Mike Innes
Sure, but adding a project idea doesn't commit you to being a mentor or
anything. The ideas page is where students are going to take project
suggestions from, so that's the best place if you want people to see it and
potentially take it on.

On Mon, 14 Mar 2016 at 13:05 Maurice Diamantini <
maurice.diamant...@gmail.com> wrote:

> Le lundi 14 mars 2016 13:45:13 UTC+1, Mike Innes a écrit :
>
> Ah ok, so you're not actually going for this project as a student?
>>
>
> No.
>
> In that case, how about suggesting the project on the ideas page
>> 
>> ?
>>
>
> Because I'm not going to be a mentor neither!
> I just wanted to suggest a binding QML as a potential GSOC.
>
> -- Maurice
>


[julia-users] Re: QML (Qt5) binding for Julia (GSOC?)

2016-03-14 Thread Andreas Lobinger
Hello colleagues,

On Friday, March 11, 2016 at 4:35:27 PM UTC+1, Maurice Diamantini wrote:
>
> So I wonder if there is some interest for a QML binding which would allows 
> Julia code to display simple QML file (with callback to Julia methods!). 
> ...That seems to be a true Julia GSOC candidate project (i.e. which could 
> not be affected to another language...
>

just as a different flavour... It's not the first time people agree to have 
Qt5/QML or similar support for Julia would be great. However we still miss 
a working solution.

So maybe a better GSOC project would be to work on Clang and Cxx and 
similar to simplify FFI for julia?



 


Re: [julia-users] QML (Qt5) binding for Julia (GSOC?)

2016-03-14 Thread Maurice Diamantini
Le lundi 14 mars 2016 13:45:13 UTC+1, Mike Innes a écrit :

Ah ok, so you're not actually going for this project as a student? 
>

No.

In that case, how about suggesting the project on the ideas page 
> 
> ?
>

Because I'm not going to be a mentor neither!
I just wanted to suggest a binding QML as a potential GSOC.

-- Maurice


Re: [julia-users] QML (Qt5) binding for Julia (GSOC?)

2016-03-14 Thread Tom Breloff
On Mon, Mar 14, 2016 at 8:24 AM, Uwe Fechner 
wrote:

> Well, I am not an expert on QML, but as far as I understand, QML is mainly
> for writing GUIs, whereas
> the QT library contains a lot of functions for a lot of other tasks.
>
> What Julia is missing is mainly an easy to use GUI toolkit, and QML could
> play that role.
>
> Implementing a Julia - QML binding sound not so difficult as there is
> already a C binding.
>
> I do not understand the following sentence:
> "Being able to build Qt interface directly from Julia without the need of
>  the anaconda
> would be a great advantage for Julia users."
>

I'm just guessing here... you can currently get access to Qt functionality
through PyQt (the python interface), which is currently wrapped through the
package https://github.com/jverzani/PySide.jl.  There is also some
functionality exposed through https://github.com/tbreloff/Qwt.jl, but I'd
stay away from that unless you have a good reason.  These options require
python, which in turn might depend on installing a big anaconda
distribution. (again... just guessing why this was said).  A C/C++ wrapped
solution might be slightly lighter-weight and faster.


>
> If you would write a QML wrapper for the C binding, the C/ C++ code from
> the C wrapper
> would still need to be compiled included in the package in some way
> (binutils). So there
> would still be a dependency on C/C++ code (pre-compiled or not), that is
> always a little
> bit difficult to install and to maintain.
>
> Sounds like a great project!
>
> Uwe
>
>
>
> On Monday, March 14, 2016 at 11:04:02 AM UTC+1, Maurice Diamantini wrote:
>>
>> My interest in QML/Qt5 is limited as a user which is looking for a
>> reliable multi-platform toolbox for building gui applications (with
>> native menu, open and save box...).
>>
>> There is the old designes Tk-8.6 which works everywere. But Julia
>> seams only to install Tk8.5.
>>
>> Gtk is not (yet) really multi-platform although it claims to.
>> It is very promising... for years, much like the D language before
>> Go and Julia appear.
>> Also there is no much example on the github page.
>>
>> So Qt5 would be the best solution (true multi-platform GUI, full feature
>> and very good documentation).
>> But Qt5 is a C++ code and even with the Cxx.jl package, I guess there
>> is much time before someone (Tom ;-) has time to build such an interface.
>> Also The library should be maintained.
>>
>> In the meantime, I thought a QML binding would be easier to do (not by
>> me :) and above all easier to maintained because most features are
>> available in QML and there has no need  (I think) to have its Julia
>> associated method.
>>
>> Can someone who know QML confirm that?
>> Also what feature are provided by Qt5 which are not available with QML?
>>
>> Regard,
>> -- Maurice
>>
>> Le 13 mars 2016 à 18:33, Mike Innes  a écrit :
>>
>> > Hey Maurice,
>> >
>> > Glad to see your interest in this project! I don't know a lot about
>> this area personally, but you might be able to learn more about the
>> approaches and issues involved by looking at Gtk.jl, which is a fairly
>> complete effort in a similar area. Other than that, a simple protoype might
>> help us to evaluate the idea.
>> >
>> > I'd be interested in your take on the relative pros and cons of
>> wrapping Qt5 wholesale vs. taking the QML approach you've described.
>> >
>> > Cheers,
>> > Mike
>> >
>> > On Fri, 11 Mar 2016 at 15:35 Maurice Diamantini 
>> wrote:
>> > While trying to find some Qt5 binding for Julia, I only found the Qt5
>> startup projet from Tom Breloff https://github.com/tbreloff/Qt5.jl which
>> is intended to bind the full feature from Qt5. This is a huge task and will
>> take some time.
>> >
>> > So I wonder if there is some interest for a QML binding which would
>> allows Julia code to display simple QML file (with callback to Julia
>> methods!).
>> >
>> > I just found a git repository about two QML library which could serve
>> as a basis  and as an example:
>> >
>> >
>> > • https://github.com/seanchas116/libqmlbind A C library for
>> creating QML bindings for other languages easily
>> > • https://github.com/seanchas116/ruby-qml a Ruby binding for
>> QML which uses libqmlbind
>> >
>> > Being able to build Qt interface directly from Julia without the need
>> of  the anaconda would be a great advantage for Julia users.
>> >
>> > That seems to be a true Julia GSOC candidate project (i.e. which could
>> not be affected to another language...)
>> >
>> > Regard,
>> >
>> > -- Maurice
>> >
>> >
>>
>>


Re: [julia-users] Testing functions that return random values?

2016-03-14 Thread Tamas Papp
Hi Raj,

For example

--8<---cut here---start->8---
using StatsBase
using Base.Test

let seed = 9, n = 7
srand(seed)
@test StatsBase.samplepair(n) == (5,7)
end
--8<---cut here---end--->8---

ie you would call the function with a particular seed, then hardcode
that into the test. Note that this is very fragile: if the algorithm
changes, the random values would change too. For testing draws from
distributions etc, other methods exist (eg comparing a goodness of fit
statistic), but they have drawbacks too.

Best,

Tamas

On Mon, Mar 14 2016, RAJ Rohit Jalem wrote:

> Thank you for helping.
>
>Can you explain me in the context of writing a test for this function: 
> https://github.com/JuliaStats/StatsBase.jl/blob/master/src/sampling.jl#L77-L81
>
>Can it be possible to write tests for this using the Base.Test package?  
> How do I use srand() implementation for writing a test to this?
>
>Sorry for a lot of questions.  Was trying to get my head around 
> Base.Test!
>
> regards,
> Raj
>
>
>
>
>
> On Monday, March 14, 2016 at 5:07:29 PM UTC+5:30, Milan Bouchet-Valat wrote:
>>
>> Le lundi 14 mars 2016 à 04:19 -0700, RAJ Rohit Jalem a écrit : 
>> > How do I test functions that return random values. 
>> > 
>> > For example, this function here: https://coveralls.io/builds/5402764/ 
>> > source?filename=src%2Fsampling.jl#L77 
>> > 
>> > Can it be done with the Base.Test package?  If yes, then how? 
>> Use srand() before calling them to ensure you always get the same 
>> "random" value. For example, srand(1) will work. 
>>
>>
>> Regards 
>>



Re: [julia-users] QML (Qt5) binding for Julia (GSOC?)

2016-03-14 Thread Mike Innes
Ah ok, so you're not actually going for this project as a student? In that
case, how about suggesting the project on the ideas page

?

On Mon, 14 Mar 2016 at 12:24 Uwe Fechner  wrote:

> Well, I am not an expert on QML, but as far as I understand, QML is mainly
> for writing GUIs, whereas
> the QT library contains a lot of functions for a lot of other tasks.
>
> What Julia is missing is mainly an easy to use GUI toolkit, and QML could
> play that role.
>
> Implementing a Julia - QML binding sound not so difficult as there is
> already a C binding.
>
> I do not understand the following sentence:
>
> "Being able to build Qt interface directly from Julia without the need of
>  the anaconda
> would be a great advantage for Julia users."
>
> If you would write a QML wrapper for the C binding, the C/ C++ code from
> the C wrapper
> would still need to be compiled included in the package in some way
> (binutils). So there
> would still be a dependency on C/C++ code (pre-compiled or not), that is
> always a little
> bit difficult to install and to maintain.
>
> Sounds like a great project!
>
>
> Uwe
>
>
>
>
> On Monday, March 14, 2016 at 11:04:02 AM UTC+1, Maurice Diamantini wrote:
>
>> My interest in QML/Qt5 is limited as a user which is looking for a
>> reliable multi-platform toolbox for building gui applications (with
>> native menu, open and save box...).
>>
>> There is the old designes Tk-8.6 which works everywere. But Julia
>> seams only to install Tk8.5.
>>
>> Gtk is not (yet) really multi-platform although it claims to.
>> It is very promising... for years, much like the D language before
>> Go and Julia appear.
>> Also there is no much example on the github page.
>>
>> So Qt5 would be the best solution (true multi-platform GUI, full feature
>> and very good documentation).
>> But Qt5 is a C++ code and even with the Cxx.jl package, I guess there
>> is much time before someone (Tom ;-) has time to build such an interface.
>> Also The library should be maintained.
>>
>> In the meantime, I thought a QML binding would be easier to do (not by
>> me :) and above all easier to maintained because most features are
>> available in QML and there has no need  (I think) to have its Julia
>> associated method.
>>
>> Can someone who know QML confirm that?
>> Also what feature are provided by Qt5 which are not available with QML?
>>
>> Regard,
>> -- Maurice
>>
>> Le 13 mars 2016 à 18:33, Mike Innes  a écrit :
>>
>> > Hey Maurice,
>> >
>> > Glad to see your interest in this project! I don't know a lot about
>> this area personally, but you might be able to learn more about the
>> approaches and issues involved by looking at Gtk.jl, which is a fairly
>> complete effort in a similar area. Other than that, a simple protoype might
>> help us to evaluate the idea.
>> >
>> > I'd be interested in your take on the relative pros and cons of
>> wrapping Qt5 wholesale vs. taking the QML approach you've described.
>> >
>> > Cheers,
>> > Mike
>> >
>>
> > On Fri, 11 Mar 2016 at 15:35 Maurice Diamantini 
>> wrote:
>> > While trying to find some Qt5 binding for Julia, I only found the Qt5
>> startup projet from Tom Breloff https://github.com/tbreloff/Qt5.jl which
>> is intended to bind the full feature from Qt5. This is a huge task and will
>> take some time.
>> >
>> > So I wonder if there is some interest for a QML binding which would
>> allows Julia code to display simple QML file (with callback to Julia
>> methods!).
>> >
>> > I just found a git repository about two QML library which could serve
>> as a basis  and as an example:
>> >
>> >
>> > • https://github.com/seanchas116/libqmlbind A C library for
>> creating QML bindings for other languages easily
>> > • https://github.com/seanchas116/ruby-qml a Ruby binding for
>> QML which uses libqmlbind
>> >
>> > Being able to build Qt interface directly from Julia without the need
>> of  the anaconda would be a great advantage for Julia users.
>> >
>> > That seems to be a true Julia GSOC candidate project (i.e. which could
>> not be affected to another language...)
>> >
>> > Regard,
>> >
>> > -- Maurice
>> >
>> >
>>
>>


Re: [julia-users] Formatting comma thousands separator

2016-03-14 Thread Tom Breloff
Also check out https://github.com/ScottPJones/StringUtils.jl, which is an
extension of Formatting.

On Sunday, March 13, 2016, Greg Plowman  wrote:

> I am trying to find an easy way to format numbers with thousands
> separators.
> It seems the package Formatting can be used for this.
>
> However, I can't seem to get the "python-style" format specifier working.
> Below the FormatSpec is correctly created with the field tsep = true, but
> it appears to have no effect when printing using printfmt.
>
> julia> fspec = FormatSpec(",d")
> Formatting.FormatSpec
>   cls   = i
>   typ   = d
>   fill  =
>   align = >
>   sign  = -
>   width = -1
>   prec  = -1
>   ipre  = false
>   zpad  = false
>   tsep  = true
>
> julia> printfmt(fspec, 10^9)
> 10
>
>
> Similarly for FormatExpr ...
>
> fexpr = FormatExpr("{:,d}")
> printfmt(fexpr, 10^9)
> 10
>
> Am I doing something wrong? Or is this not yet implemented?
>
>
> I do realise I can use sprint1 with println or @printf, but I was looking
> to use something more "inline".
>
> @printf("x = %s\n", sprintf1("%'i", x))
>
>


Re: [julia-users] QML (Qt5) binding for Julia (GSOC?)

2016-03-14 Thread Uwe Fechner
Well, I am not an expert on QML, but as far as I understand, QML is mainly 
for writing GUIs, whereas
the QT library contains a lot of functions for a lot of other tasks.

What Julia is missing is mainly an easy to use GUI toolkit, and QML could 
play that role.

Implementing a Julia - QML binding sound not so difficult as there is 
already a C binding.

I do not understand the following sentence:
"Being able to build Qt interface directly from Julia without the need of 
 the anaconda 
would be a great advantage for Julia users."

If you would write a QML wrapper for the C binding, the C/ C++ code from 
the C wrapper
would still need to be compiled included in the package in some way 
(binutils). So there
would still be a dependency on C/C++ code (pre-compiled or not), that is 
always a little
bit difficult to install and to maintain.

Sounds like a great project!

Uwe



On Monday, March 14, 2016 at 11:04:02 AM UTC+1, Maurice Diamantini wrote:
>
> My interest in QML/Qt5 is limited as a user which is looking for a 
> reliable multi-platform toolbox for building gui applications (with 
> native menu, open and save box...). 
>
> There is the old designes Tk-8.6 which works everywere. But Julia 
> seams only to install Tk8.5. 
>
> Gtk is not (yet) really multi-platform although it claims to. 
> It is very promising... for years, much like the D language before 
> Go and Julia appear. 
> Also there is no much example on the github page. 
>
> So Qt5 would be the best solution (true multi-platform GUI, full feature 
> and very good documentation). 
> But Qt5 is a C++ code and even with the Cxx.jl package, I guess there 
> is much time before someone (Tom ;-) has time to build such an interface. 
> Also The library should be maintained. 
>
> In the meantime, I thought a QML binding would be easier to do (not by 
> me :) and above all easier to maintained because most features are 
> available in QML and there has no need  (I think) to have its Julia 
> associated method. 
>
> Can someone who know QML confirm that? 
> Also what feature are provided by Qt5 which are not available with QML? 
>
> Regard, 
> -- Maurice 
>
> Le 13 mars 2016 à 18:33, Mike Innes  a 
> écrit : 
>
> > Hey Maurice, 
> > 
> > Glad to see your interest in this project! I don't know a lot about this 
> area personally, but you might be able to learn more about the approaches 
> and issues involved by looking at Gtk.jl, which is a fairly complete effort 
> in a similar area. Other than that, a simple protoype might help us to 
> evaluate the idea. 
> > 
> > I'd be interested in your take on the relative pros and cons of wrapping 
> Qt5 wholesale vs. taking the QML approach you've described. 
> > 
> > Cheers, 
> > Mike 
> > 
> > On Fri, 11 Mar 2016 at 15:35 Maurice Diamantini  > wrote: 
> > While trying to find some Qt5 binding for Julia, I only found the Qt5 
> startup projet from Tom Breloff https://github.com/tbreloff/Qt5.jl which 
> is intended to bind the full feature from Qt5. This is a huge task and will 
> take some time. 
> > 
> > So I wonder if there is some interest for a QML binding which would 
> allows Julia code to display simple QML file (with callback to Julia 
> methods!). 
> > 
> > I just found a git repository about two QML library which could serve as 
> a basis  and as an example: 
> > 
> > 
> > • https://github.com/seanchas116/libqmlbind A C library for 
> creating QML bindings for other languages easily 
> > • https://github.com/seanchas116/ruby-qml a Ruby binding for 
> QML which uses libqmlbind 
> > 
> > Being able to build Qt interface directly from Julia without the need of 
>  the anaconda would be a great advantage for Julia users. 
> > 
> > That seems to be a true Julia GSOC candidate project (i.e. which could 
> not be affected to another language...) 
> > 
> > Regard, 
> > 
> > -- Maurice 
> > 
> > 
>
>

Re: [julia-users] Testing functions that return random values?

2016-03-14 Thread RAJ Rohit Jalem
Thank you for helping.

   Can you explain me in the context of writing a test for this function: 
https://github.com/JuliaStats/StatsBase.jl/blob/master/src/sampling.jl#L77-L81

   Can it be possible to write tests for this using the Base.Test package?  
How do I use srand() implementation for writing a test to this?

   Sorry for a lot of questions.  Was trying to get my head around 
Base.Test!

regards,
Raj





On Monday, March 14, 2016 at 5:07:29 PM UTC+5:30, Milan Bouchet-Valat wrote:
>
> Le lundi 14 mars 2016 à 04:19 -0700, RAJ Rohit Jalem a écrit : 
> > How do I test functions that return random values. 
> > 
> > For example, this function here: https://coveralls.io/builds/5402764/ 
> > source?filename=src%2Fsampling.jl#L77 
> > 
> > Can it be done with the Base.Test package?  If yes, then how? 
> Use srand() before calling them to ensure you always get the same 
> "random" value. For example, srand(1) will work. 
>
>
> Regards 
>


Re: [julia-users] Testing functions that return random values?

2016-03-14 Thread Milan Bouchet-Valat
Le lundi 14 mars 2016 à 04:19 -0700, RAJ Rohit Jalem a écrit :
> How do I test functions that return random values.
> 
> For example, this function here: https://coveralls.io/builds/5402764/
> source?filename=src%2Fsampling.jl#L77
> 
> Can it be done with the Base.Test package?  If yes, then how?
Use srand() before calling them to ensure you always get the same
"random" value. For example, srand(1) will work.


Regards


[julia-users] Testing functions that return random values?

2016-03-14 Thread RAJ Rohit Jalem
How do I test functions that return random values.

For example, this function here: 
https://coveralls.io/builds/5402764/source?filename=src%2Fsampling.jl#L77

Can it be done with the Base.Test package?  If yes, then how?


[julia-users] Re: Realtime Audio Processing with PortAudio.jl

2016-03-14 Thread Daniel Casimiro
I use callback functions with CoreAudio to play WAV files on Mac OS X. My 
implementation in WAV.jl is not sophisticated, but it works reasonably well. 

Re: [julia-users] QML (Qt5) binding for Julia (GSOC?)

2016-03-14 Thread Diamantini Maurice
My interest in QML/Qt5 is limited as a user which is looking for a 
reliable multi-platform toolbox for building gui applications (with 
native menu, open and save box...).

There is the old designes Tk-8.6 which works everywere. But Julia 
seams only to install Tk8.5.

Gtk is not (yet) really multi-platform although it claims to.
It is very promising... for years, much like the D language before
Go and Julia appear.
Also there is no much example on the github page.

So Qt5 would be the best solution (true multi-platform GUI, full feature
and very good documentation).
But Qt5 is a C++ code and even with the Cxx.jl package, I guess there 
is much time before someone (Tom ;-) has time to build such an interface.
Also The library should be maintained.

In the meantime, I thought a QML binding would be easier to do (not by 
me :) and above all easier to maintained because most features are 
available in QML and there has no need  (I think) to have its Julia 
associated method.

Can someone who know QML confirm that?
Also what feature are provided by Qt5 which are not available with QML?

Regard,
-- Maurice

Le 13 mars 2016 à 18:33, Mike Innes  a écrit :

> Hey Maurice,
> 
> Glad to see your interest in this project! I don't know a lot about this area 
> personally, but you might be able to learn more about the approaches and 
> issues involved by looking at Gtk.jl, which is a fairly complete effort in a 
> similar area. Other than that, a simple protoype might help us to evaluate 
> the idea.
> 
> I'd be interested in your take on the relative pros and cons of wrapping Qt5 
> wholesale vs. taking the QML approach you've described.
> 
> Cheers,
> Mike
> 
> On Fri, 11 Mar 2016 at 15:35 Maurice Diamantini 
>  wrote:
> While trying to find some Qt5 binding for Julia, I only found the Qt5 startup 
> projet from Tom Breloff https://github.com/tbreloff/Qt5.jl which is intended 
> to bind the full feature from Qt5. This is a huge task and will take some 
> time.
> 
> So I wonder if there is some interest for a QML binding which would allows 
> Julia code to display simple QML file (with callback to Julia methods!).
> 
> I just found a git repository about two QML library which could serve as a 
> basis  and as an example:
> 
> 
>   • https://github.com/seanchas116/libqmlbind A C library for creating 
> QML bindings for other languages easily
>   • https://github.com/seanchas116/ruby-qml a Ruby binding for QML which 
> uses libqmlbind
> 
> Being able to build Qt interface directly from Julia without the need of  the 
> anaconda would be a great advantage for Julia users.
> 
> That seems to be a true Julia GSOC candidate project (i.e. which could not be 
> affected to another language...)
> 
> Regard,
> 
> -- Maurice
> 
> 



Re: [julia-users] Re: Status of Plots.jl?

2016-03-14 Thread Andreas Lobinger
Hello colleague,

On Sunday, March 13, 2016 at 5:32:46 PM UTC+1, Josef Heinen wrote:
>
> GR supports the wxWidgets and Qt4 toolkits. Last week I added support for 
> Cairo graphics, which can be used as a drawing library for GTK+. So, 
> support for the GTK+ toolkit is on my radar ..
>

now i start to get confused. GR claims to be a implementation of a GKS with 
OpenGL. Well, Cairo is another implementation of a GKS and surprisingly is 
also providing a EGL/OpenGL backend (which is not optimized) along others. 
Can you give some background, why you would include Cairo into GR?

 


Re: [julia-users] Accessing a field in an immutable from an offset of the first field

2016-03-14 Thread Kristoffer Carlsson
I don't think I am doing "strange things with pairs of NTuples". The 
reality right now is, if I don't exactly match my 128 bit registers I don't 
get any packed instructions at all. Therefore I pack the data into as many 
128 bits chunks I can while keeping what is being left over in a normal 
NTuple. This gives me packed instructions for everything except the things 
that don't fit.

No matter what LLVM should be able to do, I am writing my code for the 
current reality and this is the only way I have tried that sort of works. 
Of course if the reality changes and I could just throw everything in a big 
tuple and LLVM handles it nicely, then that is better and I will gladly 
restructure the code.


On Monday, March 14, 2016 at 5:58:08 AM UTC+1, Jameson wrote:
>
> LLVM should be able to handle it with some help from Julia codegen 
> annotating sizes and alignments correctly (and dereferenceable). I think 
> the main reason odd sizes may fail is that we force llvm to pessimize their 
> load/stores (dealing with potential misaligned load/stores quite bluntly, 
> instead of actually legalizing them). It's also perhaps non-obvious in your 
> above example, but the calling convention is also changing as you hit 
> various increasing size and alignment classes. Doing strange things with 
> pairs of NTuples may make that worse, not better.
>
> On Sun, Mar 13, 2016 at 7:30 PM Kristoffer Carlsson  > wrote:
>
>> What LLVM should be able to do and what LLVM actually do seem to not 
>> always agree:
>>
>> julia> a = VecElement(2.0f0)
>>
>> julia> @code_native VecRegister((a,a)) + VecRegister((a,a))
>> .text
>> Filename: VecRegister.jl
>> Source line: 0
>> pushq   %rbp
>> movq%rsp, %rbp
>> Source line: 7
>> vmovq   (%rdi), %xmm0   # xmm0 = mem[0],zero
>> vmovq   (%rsi), %xmm1   # xmm1 = mem[0],zero
>> Source line: 8
>> vaddps  %xmm1, %xmm0, %xmm0
>> popq%rbp
>> retq
>>
>> julia> @code_native VecRegister((a,a,a)) + VecRegister((a,a,a))
>> .text
>> Filename: VecRegister.jl
>> Source line: 0
>> pushq   %rbp
>> movq%rsp, %rbp
>> Source line: 7
>> vmovss  (%rsi), %xmm0   # xmm0 = mem[0],zero,zero,zero
>> vmovss  4(%rsi), %xmm1  # xmm1 = mem[0],zero,zero,zero
>> Source line: 8
>> vaddss  (%rdx), %xmm0, %xmm0
>> vaddss  4(%rdx), %xmm1, %xmm1
>> Source line: 7
>> vmovss  8(%rsi), %xmm2  # xmm2 = mem[0],zero,zero,zero
>> Source line: 8
>> vaddss  8(%rdx), %xmm2, %xmm2
>> vmovss  %xmm2, 8(%rdi)
>> vmovss  %xmm1, 4(%rdi)
>> vmovss  %xmm0, (%rdi)
>> movq%rdi, %rax
>> popq%rbp
>> retq
>>
>> julia> @code_native VecRegister((a,a,a,a)) + VecRegister((a,a,a,a))
>> .text
>> Filename: VecRegister.jl
>> Source line: 0
>> pushq   %rbp
>> movq%rsp, %rbp
>> Source line: 7
>> vmovaps (%rdx), %xmm0
>> Source line: 8
>> vaddps  (%rsi), %xmm0, %xmm0
>> vmovaps %xmm0, (%rdi)
>> movq%rdi, %rax
>> popq%rbp
>> retq
>>
>> And same comment goes regarding using partial registers. It would be more 
>> efficient if they actually worked... I'm sure you can get it working with 
>> llvmcall but I try to experiment with what I can do in only julia and this 
>> is the best I've come up with so far.
>>
>>
>> On Monday, March 14, 2016 at 12:17:40 AM UTC+1, Erik Schnetter wrote:
>>
>>> On Sun, Mar 13, 2016 at 5:48 PM, Kristoffer Carlsson 
>>>
>>  wrote: 
>>> > Erik, I believe the reason for all the moves is a recent regression: 
>>> > https://github.com/JuliaLang/julia/issues/15274#issuecomment-196015327 
>>> > 
>>> > James, the reason I need values in type parameters is because NTuples 
>>> are 
>>> > parameterized on a value and the immutable is wrapping an NTuple. The 
>>> reason 
>>> > I need to wrap an NTuple is because operations on NTuples of 
>>> VecElements 
>>> > (still in Arch's PR) generates packed instructions. The reason I need 
>>> two 
>>> > NTuples in the immutable is to put the "rest data", that is, the data 
>>> that 
>>> > does not fit in a SIMD register in a separate tuple and I do scalar 
>>> > instructions on that tuple. 
>>>
>>> There is no need to split SIMD vectors like this. LLVM supports SIMD 
>>> vectors of any length, and will then split it onto registers as 
>>> necessary. 
>>>
>>> In particular, LLVM should be able to use a partial vector register, 
>>> which is more efficient than using several scalar registers. 
>>>
>>> -erik 
>>>
>>> > Here is the type definition and the getindex a few lines down: 
>>> > 
>>> https://github.com/KristofferC/SIMDVectors.jl/blob/master/src/SIMDVector.jl 
>>> > 
>>> > On Sunday, March 13, 2016 at 10:01:09 PM UTC+1, Jameson wrote: 
>>> >> 
>>> >> > On the other hand, if you are sure that the memory layout is as you 
>>> >> expect, you can always go the C way: Get a pointer to `Foo`, 
>>> >> unsafe-cast that pointer to `Foo2`, and access the elements via 
>>> 

[julia-users] 2nd Julia Meetup Belgium

2016-03-14 Thread Ben Lauwens
You are cordially invited to attend the 2nd Julia Meetup in Belgium on 
Wednesday 13th of April 2016 at the Royal Military Academy in Brussels.
Programme:
1300 Welcome at the conference complex
1330 Tutorial sessions:
- Julia for novices
- Advanced Julia
1500 Coffee break
1530 Presentations by Julia package developers and/or users
1700 Reception
The entrance is free but registration by e-mail (ben.lauw...@rma.ac.be 
)
 
is mandatory to access the premises. License plate information is needed if 
you want to use the parking facilities.
Proposals for presentations are welcome and can be sent by e-mail before 
the 5th of April 2016. We are looking for talks about innovative packages 
or interesting use cases.
Location: Royal Military Academy, Hobbemastraat 8, 1000 Brussel
Kind regards

Ben


[julia-users] JuliaCon sponsorships

2016-03-14 Thread Viral Shah
Hello,

JuliaCon sponsorship details are now in place at http://juliacon.org.

Platinum tier is $15,000 and gets you 3 free tickets and a 15 min speaking slot.
Gold tier is $5,000 and gets you 2 free tickets and a 10 min speaking slot.
Silver tier is $2,000 and gets you 1 free ticket and a 5 min speaking slot.

We have an exciting line up of speakers this year. Please contact me or the 
JuliaCon committee for sponsorship. We are happy to speak with folks at your 
organization for sponsorship and provide data on Julia and previous JuliaCons 
as required. Please do spread the word.

We have also received sponsorship by individuals in the past and expect the 
same this year as well.

-viral