[julia-users] Re: Arrayfire and Julia

2015-09-28 Thread Zahirul ALAM
Thanks Viral and everyone else. I will play with this later this week. :) On Friday, 18 September 2015 04:14:25 UTC-4, Viral Shah wrote: > > We at Julia Computing have done some exploratory work on ArrayFire.jl, > which is now available here. This is not a supported package at the moment, > but

[julia-users] escher examples

2015-09-28 Thread Yakir Gagnon
I'm about to delve into the Escher and Reactive docs, but are there a bunch of *simple* examples for how to use the widgets etc (other than https://shashi.github.io/Escher.jl/widgets-api.html)? Something like "here's a .jl file that has a button that runs some function"... Thanks!!!

[julia-users] ANN: Julia v0.4.0-rc3 released

2015-09-28 Thread Tony Kelman
The third release candidate of Julia 0.4.0 is available for download from the usual place . Please test extensively, report issues to the issue tracker for base Julia problems, and report issues with packages to their

[julia-users] How to create an array of a given type?

2015-09-28 Thread Dongning Guo
I'd like to create an array of a certain type. The basic code looks as follows: Type T x::Float64 y::Float64 end b = Array{T}(3) Basically I wish b[1], b[2], b[3] to be of the same type T. I'm using Julia within the Atom editor. The last line of code causes Julia to hang and produces

Re: [julia-users] Re: Hyper-Dual numbers

2015-09-28 Thread Rob Goedman
Hi Nitin, Thanks for the note and references. The recent upgrade of ForwardDiff.jl certainly shows the value of these methods. Did you (re-)implement MultiComplexNumbers from the 2nd reference, or used one of the two (Fortran and Matlab) prototype modules? Did you use it from within Julia? Do

[julia-users] Re: Passing data through Optim

2015-09-28 Thread Christopher Fisher
Thanks for your willingness to investigate the matter more closely. I cannot post the exact code I am using (besides its rather long). However, I posted a toy example that follows the same basic operations. Essentially, my code involves an outer function (SubLoop) that loops through a data set

RE: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread David Anthoff
+1 to having a String type that I can just use and it works if I don’t care about any of the encoding subtleties. From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On Behalf Of Stefan Karpinski Sent: Monday, September 28, 2015 8:28 AM To: Julia Users

[julia-users] fixing aspect ratio in Compose.jl

2015-09-28 Thread Michael Borregaard
Hi, does anyone know how to fix the aspect ratio in a compose canvas? Gadfly can do it with ```coords.Cartesian(fixed = true)```, which uses Compose, but how to do it for that? thanks, M

Re: [julia-users] Number of loops not known at compile time

2015-09-28 Thread Tim Holy
If I were doing this, I'd make u a Vector of NTuples, pass it in as an argument, and use N in @generating the body of the function. You can use Cartesian macros in the body of a generated function (many examples in base). --Tim On Monday, September 28, 2015 11:33:46 AM Giuseppe Ragusa wrote: >

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Daniel Carrera
Sounds interesting. I am very naive when it comes to strings. What re the advantages of the planned String type that can hold arbitrary data? What are the problems with UTF8? Cheers, Daniel. On 28 September 2015 at 17:27, Stefan Karpinski wrote: > There's another reason:

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Stefan Karpinski
Not super interested in getting into it right now. Will make a PR when it's more ready. On Mon, Sep 28, 2015 at 4:15 PM, Daniel Carrera wrote: > Sounds interesting. I am very naive when it comes to strings. What re the > advantages of the planned String type that can hold

Re: [julia-users] Re: When to use !

2015-09-28 Thread Tom Breloff
So it seems like there's not an enthusiastic agreement, but that the slightly better answer is `immerse()` rather than `immerse!()`? I suppose I'll make some api changes to remove similar `!` instances, and the next tag will be a minor version. Thanks. On Mon, Sep 28, 2015 at 12:40 PM, Steven

Re: [julia-users] Number of loops not known at compile time

2015-09-28 Thread Erik Schnetter
Guiseppe In addition to using recursion, you can also use a macro to generate the code. However, this functionality is available in the "Cartesian" module which is part of Base Julia. You are probably looking for "@nloops". -erik On Mon, Sep 28, 2015 at 11:24 AM, Giuseppe Ragusa

Re: [julia-users] Number of loops not known at compile time

2015-09-28 Thread Giuseppe Ragusa
@erik thank you. I know of Base.Cartesian, but I was not able to make it work for my use case. @steven yes, that is what i was afraid of (I was trying to shy away from recursion). On Monday, September 28, 2015 at 8:23:48 PM UTC+2, Erik Schnetter wrote: > > Guiseppe > > In addition to using

[julia-users] Re: When to use !

2015-09-28 Thread Steven G. Johnson
On Monday, September 28, 2015 at 12:34:01 PM UTC-4, Tom Breloff wrote: > > A question regarding the use of `!` came up a few days ago ( > https://github.com/tbreloff/Plots.jl/issues/30#issuecomment-142995667), > and I wanted to quickly poll the users to get opinions. > > When a module maintains

[julia-users] Re: When to use !

2015-09-28 Thread Sisyphuss
vote for "without !" On Monday, September 28, 2015 at 6:40:36 PM UTC+2, Steven G. Johnson wrote: > > > > On Monday, September 28, 2015 at 12:34:01 PM UTC-4, Tom Breloff wrote: >> >> A question regarding the use of `!` came up a few days ago ( >>

[julia-users] Re: Optimal Control using Dynamic Programming

2015-09-28 Thread Maxim Egorov
If you formulate the problem as a Markov decision process, you can use POMDPs.jl which supports value iteration . The POMDPs.jl framework requires a functional problem definition, and some examples can be

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Stefan Karpinski
That's the idea. On Mon, Sep 28, 2015 at 1:06 PM, David Anthoff wrote: > +1 to having a String type that I can just use and it works if I don’t > care about any of the encoding subtleties. > > > > *From:* julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] >

[julia-users] When to use !

2015-09-28 Thread Tom Breloff
A question regarding the use of `!` came up a few days ago (https://github.com/tbreloff/Plots.jl/issues/30#issuecomment-142995667), and I wanted to quickly poll the users to get opinions. When a module maintains some sort of global state, and a method mutates that global state, is it

[julia-users] Re: Number of loops not known at compile time

2015-09-28 Thread Steven G. Johnson
On Monday, September 28, 2015 at 11:24:40 AM UTC-4, Giuseppe Ragusa wrote: > > I am having problems (serious problems!) to deal with algorithms that boil > down do nested for loops but whose number of loops is not known at compile > time. As an example consider this: > In this sort of

[julia-users] How do I fix this package error?

2015-09-28 Thread Matthias Redies
I've got a problem with the package Tk. It seems to be a dependency for ImageView. I tried to do Pkg.build("Tk"), but it didn't help. This is the result of Pkg.test("Tk") julia> Pkg.test("Tk") INFO: Computing test dependencies for Tk... INFO: No packages to install, update or remove INFO:

Re: [julia-users] Number of loops not known at compile time

2015-09-28 Thread jonathan . bieler
If I understand correctly, the trick is to encode the dimension into the type of the arguments (using parametric types), then the @generated macro allows you to "write" a function just when the type of the arguments is known, so you can create the right numbers of loops on the fly.

Re: [julia-users] How do I pass an event handle via ccall?

2015-09-28 Thread Isaiah Norton
> > What is the difference between an event and a callback function? I > think I understand how a callback works. I thought an event caused a > callback, but that doesn't look like what's happening here. A callback is a function that is passed to some other routine, and called from that

[julia-users] Number of loops not known at compile time

2015-09-28 Thread Giuseppe Ragusa
I am having problems (serious problems!) to deal with algorithms that boil down do nested for loops but whose number of loops is not known at compile time. As an example consider this: ``` function tmp() r = 3 n = 100 λ = zeros(r) u = rand(n, r) counter = 0 Y =

[julia-users] Re: Two Modules with same type name

2015-09-28 Thread Kristoffer Carlsson
Maybe this: https://github.com/simonster/Reexport.jl is useful?

[julia-users] Re: Passing data through Optim

2015-09-28 Thread Christopher Fisher
Thanks. That worked, but it did not result in the performance increase I suspected. On Monday, September 28, 2015 at 8:53:25 AM UTC-4, Kristoffer Carlsson wrote: > > Use closures: > > function f(a,b,c) > # Closure: > f_closure(a) = a+b+c > > #pass f_closure to optimum and it has

[julia-users] Re: Passing data through Optim

2015-09-28 Thread Kristoffer Carlsson
>From only that comment alone it is hard to give any further advice. What overhead are you seeing? Posting runnable code is the best way to get help.

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Stefan Karpinski
There's another reason: I am planning to use `String` as the name of a standard string type in a future version of Julia (hopefully 0.5). This string type will be UTF-8-like but can hold arbitrary data, which will distinguish if from the UTF8String type, which will enforce valid UTF-8 encoding.

Re: [julia-users] How to use variables in subsets of DataFrames ?

2015-09-28 Thread Rob J. Goedman
Fred, Would below example work for you? julia> dft = readtable("/Users/rob/Desktop/test.csv", separator = '\t') 8x5 DataFrames.DataFrame | Row | title1 | title2 | title3 | title4 | title5 | |-|||||| | 1 | 10 | 20 | 30 | 40 | 50 |

[julia-users] Re: Two Modules with same type name

2015-09-28 Thread Christoph Ortner
perfect, thank you both. I will try this approach for now. Christoph On Monday, 28 September 2015 16:35:45 UTC+1, Kristoffer Carlsson wrote: > > Maybe this: https://github.com/simonster/Reexport.jl is useful?

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Steven G. Johnson
On Monday, September 28, 2015 at 9:55:27 AM UTC-4, Steven G. Johnson wrote: > > The indices passed to strings in Julia are byte offsets, > (Technically, they are codeunit offsets. In UTF-8, the codeunit is a byte; in UTF-16, the codeunit is a 16-bit word.)

[julia-users] Re: Two Modules with same type name

2015-09-28 Thread Christoph Ortner
I hadn't thought in terms of 1); it does not fit perfectly, but is the most attractive approach so far. So now I have 3 modules, AbstractM, MA, MB. Is there a way for the user to call using MA and all functions exported by AbstractM will automatically be exported from MA as well? Thanks,

Re: [julia-users] Nesting Macros passing Expressions

2015-09-28 Thread Tomas Lycken
What is correct form in this case? The exact same problem again: you need to *quote* the returned expression from the macro, to make sure that the code is run when the macro is called, and not when it’s defined. This will work as intended: macro tst(i::Int) quote tst3(i) end

Re: [julia-users] Re: UTF16String or UTF8String?

2015-09-28 Thread Jameson Nash
I find it interesting to note that the wikipedia article points out that if size compression is the goal (and there is enough text for it to matter), then SCSU (or other attempts at creating a unicode-specific compression scheme) is inferior to using a general purpose compression algorithm. Since

Re: [julia-users] Implementing printf() and sprintf() in Julia.

2015-09-28 Thread Daniel Carrera
I just created a pull request. I hope I got it right. This is the first time I use the pull-request feature at Github. https://github.com/JuliaLang/Formatting.jl/pull/15 Daniel. On 28 September 2015 at 07:03, Kevin Squire wrote: > How about submitting a patch to

[julia-users] Two Modules with same type name

2015-09-28 Thread Christoph Ortner
I want to have two modules, say MA, MB both of which define a type T module MA type T end end module MB type T end end Both are different implementations of the same concept, hence the same name. Both are exported. Most of the time, I will use either MA or MB, but not both.

Re: [julia-users] How do I pass an event handle via ccall?

2015-09-28 Thread Chris Stook
> > Thank you. > I have reviewed the suggested material. I'm probably in way over my head with this, but I'd like to learn, so I'm going to ask what is probably a novice question. What is the difference between an event and a callback function? I think I understand how a callback works. I

Re: [julia-users] Nesting Macros passing Expressions

2015-09-28 Thread Yichao Yu
On Mon, Sep 28, 2015 at 2:45 AM, Tomas Lycken wrote: > What is correct form in this case? > > The exact same problem again: you need to quote the returned expression from > the macro, to make sure that the code is run when the macro is called, and > not when it’s defined.

Re: [julia-users] How do I pass an event handle via ccall?

2015-09-28 Thread Yichao Yu
On Mon, Sep 28, 2015 at 7:33 AM, Chris Stook wrote: >> Thank you. > > > I have reviewed the suggested material. I'm probably in way over my head > with this, but I'd like to learn, so I'm going to ask what is probably a > novice question. > > What is the difference between

[julia-users] Re: Julia convert BitArray to Integer array

2015-09-28 Thread wildart
Try `reinterpret(UInt8, x.chunks)` On Monday, September 28, 2015 at 1:01:47 AM UTC-4, Sweta Yamini wrote: > > > > Hi, > > I am new to Julia. I have an N X N BitArray that I want to pack to Uint8 > of size N X ceil(N/8) > > I tried to reinterpret the array as > > packed = reinterpret(Uint8,

Re: [julia-users] Inset plots with Gadfly?

2015-09-28 Thread Stephan Buchert
Thanks for the quick reply. I think, this will work. Am Montag, 28. September 2015 13:43:53 UTC+2 schrieb Tom Breloff: > > I don't think it's directly built in, but here's how you would do it: > ("p1.o[2]" and "p2.o[2]" are the Gadfly.Plot objects that are returned > from Gadfly.plot commands:

[julia-users] Inset plots with Gadfly?

2015-09-28 Thread Stephan Buchert
I'm trying out the different options to plot in Julia. Gadfly seems to lack the option to draw a plot at a specified location/size on the page, like for example as an inset in another plot? Would it be possible to add an interface for doing this? I have been staring at the code for

[julia-users] Re: Two Modules with same type name

2015-09-28 Thread Christoph Ortner
Tomas Lycken: I do this actually, but didn't mention it to not make the question overly complicated. How does it solve my problem? My question was about co-existence of MA.T and MB.T . Thanks, Christoph

[julia-users] RFC: ROOT.jl, wrappers for the ROOT library from CERN

2015-09-28 Thread Joosep Pata
Hello, I’ve compiled a set of wrappers for the ROOT libraries used at CERN for storing the data from the Large Hadron Collider. https://github.com/jpata/ROOT.jl https://github.com/JuliaLang/METADATA.jl/pull/3550 These are a stop-gap until they can be ported to Keno’s Cxx.jl, but they are

[julia-users] How to use variables in subsets of DataFrames ?

2015-09-28 Thread Fred
Hi ! I would like to know how is it possible to use variables in subsets of DataFrames ? I would like to use a syntax like df[:,:titles[1]] and df[:,:titles[1:3]] Thanks for your help ! julia> using DataFrames julia> df = readtable("test.csv", separator = '\t') 8x5 DataFrame | Row | title1

Re: [julia-users] Re: UTF16String or UTF8String?

2015-09-28 Thread Scott Jones
On Monday, September 28, 2015 at 3:32:55 AM UTC-4, Jameson wrote: > > I find it interesting to note that the wikipedia article points out that > if size compression is the goal (and there is enough text for it to > matter), then SCSU (or other attempts at creating a unicode-specific >

RE: [julia-users] Re: How do I fix this package error?

2015-09-28 Thread David Anthoff
You certainly got the German part right. From: julia-users@googlegroups.com [mailto:julia-users@googlegroups.com] On Behalf Of Tony Kelman Sent: Monday, September 28, 2015 3:36 PM To: julia-users Subject: [julia-users] Re: How do I fix this package error? I

Re: [julia-users] Re: When to use !

2015-09-28 Thread Scott Jones
I'd also stick with the convention that ! means modification of one or more of the arguments (typically first argument), and definitely not have it for anything where there is some external state modification that is just an implementation detail. (if somethings purpose is to set global state,

[julia-users] Re: How do I fix this package error?

2015-09-28 Thread Tony Kelman
I don't speak German, but the error looks to be: 1. schwerwiegender Fehler: X11/Xlib.h: Datei oder Verzeichnis nicht gefunden 2. Kompilierung beendet. Which I think is telling you it can't find the X11 headers. There should be a development package you can install for that,

Re: [julia-users] Re: How do I fix this package error?

2015-09-28 Thread Matthias Redies
Am Dienstag, 29. September 2015 00:39:47 UTC+2 schrieb David Anthoff: > > You certainly got the German part right. > > > > *From:* julia...@googlegroups.com [mailto: > julia...@googlegroups.com ] *On Behalf Of *Tony Kelman > *Sent:* Monday, September 28, 2015 3:36 PM > *To:* julia-users

[julia-users] Proposed change to HttpServer.handle signature

2015-09-28 Thread jock . lawrie
Hi all, There has been some discussion here about changing the signature of HttpHandler.handle from f(req, res) to f(req). The purpose is to make the functionality of an application clearer. That is, an application is a function that

[julia-users] Julia release candidates downloading with Ubuntu PPA

2015-09-28 Thread Scott Jones
Because we needed to use some of the functionality which had been in 0.4, we'd been using the nightly builds from 'ppa:staticfloat/julianightlies', but now we need to switch that to picking up the 0.4.0 release candidates until 0.4 becomes the release (because some packages like PEGParser.jl are

[julia-users] Plasma Actuator Simulation

2015-09-28 Thread Marius
Hi everybody, I wrote a simulation code for Plasma Actuator. This is based on my previous code written in Python and uses Suzen model combined with Navier-Stokes equations. It's about 5 times faster than Python but still simulation takes days to finish. I am new to Julia and I tried to follow

[julia-users] Re: Julia release candidates downloading with Ubuntu PPA

2015-09-28 Thread Jeffrey Sarnoff
I use linuxmint which works well with ubuntu pkgs. I have had success downloading the generic linux binaries and (as root) stuffing the contents into /usr/local. On Monday, September 28, 2015 at 9:57:13 PM UTC-4, Scott Jones wrote: > > Because we needed to use some of the functionality which

[julia-users] Re: Hyper-Dual numbers

2015-09-28 Thread Nitin Arora
There is another method to calculate any order derivatives, very similar to this one, known as Multi-complex differentiation. This method can calculate derivatives up-to any order.

[julia-users] Re: Two Modules with same type name

2015-09-28 Thread Tomas Lycken
Oh, I think I might have misread your question a little. Sorry 'bout that. It's difficult to suggest a perfect solution without knowing more about your actual use case, but I would probably go with one of these two approaches: 1) If the two types are basically different implementations of the

[julia-users] Passing data through Optim

2015-09-28 Thread Christopher Fisher
I was wondering if there is a way to pass data through the optim function using the nelder_mead algorithm. As far as I can tell, the only way to fit a model to data is to declare the data as a global variable. I suspect this results in poor performance.

[julia-users] Re: Passing data through Optim

2015-09-28 Thread Kristoffer Carlsson
Use closures: function f(a,b,c) # Closure: f_closure(a) = a+b+c #pass f_closure to optimum and it has access to b,c println(f_closure(a)) end julia> f(3,5,6) 14 On Monday, September 28, 2015 at 2:46:45 PM UTC+2, Christopher Fisher wrote: > > I was wondering if there is a

[julia-users] Re: Plasma Actuator Simulation

2015-09-28 Thread John Gibson
Marius: I think you'd be better off in learning to write fast Julia code if you presented an straightforward implementation of a classic PDE problem and asked for help in optimizing that. Maybe 2D heat equation would be a good place to start. The code you've presented is not really intelligible

Re: [julia-users] Re: Plasma Actuator Simulation

2015-09-28 Thread Stefan Karpinski
I don't know anything about plasma physics, but this entire code is in global scope and uses a bunch of non-const global arrays. This is the very first thing the performance tips warn against: http://julia.readthedocs.org/en/latest/manual/performance-tips/ Refactor your code into functions that

[julia-users] Re: Plasma Actuator Simulation

2015-09-28 Thread Michael Prentiss
In my experience it is helpful to have a Fortran version to compare speeds against when learning Julia. This would be easy w.r.t. your problem. It is easy to right functional Julia code that is very slow, but looks okay. The best way for me was to have have a basis of comparison. On Monday,

[julia-users] Re: Plasma Actuator Simulation

2015-09-28 Thread Luke Stagner
Ok...wow...I am not surprised it is slow. Well here is what you could try. 1. Wrap everything into a function. Julia has difficulty with globals. 2. You are defining pointless functions in a loop. You can easily change the code to exclude them 3. In your loops you are accessing arrays in row

Re: [julia-users] Q-less QR?

2015-09-28 Thread Jiahao Chen
Unfortunately Q-less QR on sparse matrices is not possible at this moment because the C API to SPQR does not provide this functionality. You'd need to access the C++ API of SPQR to do this calculation. On Mon, Sep 21, 2015, 15:57 Dominique Orban wrote: > Is it

Re: [julia-users] Why is String deprecated in favour of AbstractString?

2015-09-28 Thread Steven G. Johnson
On Sunday, September 27, 2015 at 6:31:33 AM UTC-4, Tim Holy wrote: > > I think the only advantage of ASCIIString is that str[8:12] is performant, > because you know the byte offset directly from the index. That's not true > for > UTF8String. The indices passed to strings in Julia are byte