[julia-users] Re: Inconsistent results from linrange

2014-07-02 Thread Ivar Nesje
It is not a shocker to me. The problem is that Floating point numbers represent binary fractions, and there is no way for linrange() to actually get equidistant values you are looking for. It has to do approximations, and thus it will sometimes miss closest possible value. That means equality c

[julia-users] Syntax highlighting in the REPL?

2014-07-02 Thread Aerlinger
It's great having colored answer output in the REPL, but I was wondering if there are any plans to add colored syntax highlighting for keywords/identifiers as well. Not a critical issue, but would improve readability.

Re: [julia-users] get step size of linspace

2014-07-02 Thread Andrei Berceanu
Its the `colon` function I was looking for, ty! On Tuesday, July 1, 2014 6:27:55 PM UTC+2, Sam L wrote: > > Vector{Float64} is an just array of floats in memory, and there's no way > of knowing without checking that they're sorted in increasing or decreasing > order and equally spaced. In order

Re: [julia-users] Re: Package list for the latest version

2014-07-02 Thread Samuel Colvin
Surely we need to get rid of the current packages page: http://docs.julialang.org/en/latest/packages/packagelist/ It's still pretty high up google and people are surely going to it and coming away disappointed that a package doesn't exist when actually it does. It wasn't until I found this thre

Re: [julia-users] Re: Package list for the latest version

2014-07-02 Thread Ivar Nesje
It is gone from the git repository (#7204 ), but it seems like readthedocs still keeps a cached version around. The link is probably still in lots of places, so it we should probably leave a `packagelist.rst` file around with a link to the correct s

[julia-users] Re: Inconsistent results from linrange

2014-07-02 Thread Peter Simon
Thanks. I had mistakenly thought that linrange would retain the exact value of its end points, as does linspace. My actual application is to reproduce the functionality of Matlab's optional histc output: [n,bin] = histc(x, edges) Here, (using Matlab notation), bin is an integer-valued vecto

[julia-users] equivalent to numpy's fftfreq

2014-07-02 Thread Andrei Berceanu
I have written the following function to provide the same functionality as numpy's fftfreq (http://docs.scipy.org/doc/numpy/reference/generated/numpy.fft.fftfreq.html) ``` function fftfreq(n::Int64, d::Float64) N = fld(n-1,2) p1 = [0:N] p2 = [-fld(n,2):-1] return [p1, p2]/(d*n) end ```

[julia-users] Decreasing range, should it work?

2014-07-02 Thread Jay Kickliter
Are they meant to work? I could only find one meaning of them not working (issue 5778 ). Here's an example: julia> for i = 1:10 println(i) end 1 2 3 4 5 6 7 8 9 10 julia> for i = 10:1 println(i) e

[julia-users] Re: Inconsistent results from linrange

2014-07-02 Thread Matt Bauman
Unfortunately, it is not always possible to construct a range such that the exact value of the endpoints is retained. Matlab cheats here, and changes the step size to ensure that the endpoints are retained. A Julian range, however, must always have one unique step. For more information, see t

[julia-users] Re: Inconsistent results from linrange

2014-07-02 Thread Ivar Nesje
Hmm... Everything with floating point ranges is inherently difficult, because we want to give users the full accuracy (not cheat like Matlab does). In order for the slicing behaviour to be exactly right, it seems to me that we would need to store a start and a step increment, so that the calcu

[julia-users] Re: Decreasing range, should it work?

2014-07-02 Thread Jay Kickliter
I just realized that it works if I rewrite the range as 10:-1:1. It seems to me that either big:small should work with a default step size of -1, or the documentation needs a note. On Wednesday, July 2, 2014 7:32:10 AM UTC-6, Jay Kickliter wrote: > > Are they meant to work? I could only find on

[julia-users] Re: Decreasing range, should it work?

2014-07-02 Thread Ivar Nesje
They work, but you will have to set the step to -1 for i = 10:-1:1 println(i) end kl. 15:32:10 UTC+2 onsdag 2. juli 2014 skrev Jay Kickliter følgende: > > Are they meant to work? I could only find one meaning of them not working > (issue 5778 ).

[julia-users] Re: Decreasing range, should it work?

2014-07-02 Thread Jay Kickliter
Thanks, I just missed your reply. On Wednesday, July 2, 2014 7:52:47 AM UTC-6, Ivar Nesje wrote: > > They work, but you will have to set the step to -1 > > for i = 10:-1:1 >println(i) > end > > kl. 15:32:10 UTC+2 onsdag 2. juli 2014 skrev Jay Kickliter følgende: >> >> Are they meant to work? I

[julia-users] Re: Inconsistent results from linrange

2014-07-02 Thread Matt Bauman
That's a great solution. I think the only other alternative would be to return an array instead of a range, which would be unfortunate. On Wednesday, July 2, 2014 9:50:34 AM UTC-4, Ivar Nesje wrote: > > Hmm... Everything with floating point ranges is inherently difficult, > because we want to g

[julia-users] Re: Decreasing range, should it work?

2014-07-02 Thread Ivar Nesje
It is documented , but it is not obvious (to me) where you would look for that peace of information. Maybe here ? Ivar kl. 15:54:21 UTC

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

2014-07-02 Thread Andrei Berceanu
Great work, congratulations for the package. I have a short question. Once I get an array of Curve2 type, how can I get a graphical representation of it? I mean, in Winston/Gaston/PyPlot/whatever. On Sunday, June 29, 2014 12:34:28 AM UTC+2, Tomas Lycken wrote: > > Huzzah! > > We’ve just released

Re: [julia-users] Re: Decreasing range, should it work?

2014-07-02 Thread Stefan Karpinski
Why would one assume that the default step size is -1 when the start is bigger than the stop? The documentation for ranges clearly says that the default step size is 1 unconditionally, not that it is sign(stop-start). That would, by the way, be a very dangerous behavior. Perhaps a sidebar on the co

Re: [julia-users] metaprogramming nested functions

2014-07-02 Thread Bryan A. Knowles
What of we had a macro version of parse? Eg, ```julia function foo() foo2(x) = println(x) foo2(1) @parse("foo2(2)") end ```

Re: [julia-users] metaprogramming nested functions

2014-07-02 Thread John Myles White
What would that macro do? Right now, I’d guess that it would just take its input out of quotes. — John On Jul 2, 2014, at 7:41 AM, Bryan A. Knowles wrote: > What of we had a macro version of parse? Eg, > ```julia > function foo() > foo2(x) = println(x) > foo2(1) >

[julia-users] Re: build from source modifying Make.user on hpc cluster

2014-07-02 Thread Ollie Laslett
I have been having a very similar issue, whilst trying to build julia in my home directory on a cluster. I also had problems building openblas, which was solved by using OPENBLAS_DYNAMIC_ARCH=0. I also have the same errors when running code: /lib64/libz.so.1: no version information available O

[julia-users] Using Distance Package for knn Weight Matrix

2014-07-02 Thread Donald Lacombe
Greetings! I am a new Julia user and have the following issue. I am writing code to calculate a knn spatial weight matrix to estimate a spatial econometric model. Using the MATLAB code from Jim LeSage's Econometrics Toolbox, I converted that code into Julia as follows: xc = rand(8); yc = rand

Re: [julia-users] Re: build from source modifying Make.user on hpc cluster

2014-07-02 Thread Florian Oswald
it seems you are close. all tests should pass, so there's something wrong. try to follow those steps: https://github.com/JuliaLang/julia/issues/7240 or those https://github.com/JuliaLang/julia/issues/7482 On 2 July 2014 15:30, Ollie Laslett wrote: > I have been having a very similar issue,

[julia-users] Re: Potential bug in Task/iterators?

2014-07-02 Thread Sebastian Nowozin
Hi, I filed this as an issue with code to reproduce a different behaviour (hanging) at https://github.com/JuliaLang/julia/issues/7498 Best, Sebastian On Tuesday, 1 July 2014 20:05:48 UTC+1, Sebastian Nowozin wrote: > > > Hi everyone, > > I followed the pattern proposed at > http://slendermean

Re: [julia-users] equivalent to numpy's fftfreq

2014-07-02 Thread João Felipe Santos
Hi Andrei, you can use fftfreq in DSP.jl. The syntax is exactly the same as for your function: http://dspjl.readthedocs.org/en/latest/util.html#fftfreq. Best -- João Felipe Santos On Wed, Jul 2, 2014 at 9:28 AM, Andrei Berceanu wrote: > I have written the following function to provide the sa

[julia-users] compilation of Julia code to shared libraries

2014-07-02 Thread Alexander Braumann
Hi, I am mainly using R and wanted to know if it was already possible (or when it is expected to be possible) to compile Julia code to shared libraries which can be loaded and used within R? I found a rather short discussion about this here: http://stackoverflow.com/questions/9965747/linking-r

Re: [julia-users] compilation of Julia code to shared libraries

2014-07-02 Thread Tom Short
As more background, see here: https://groups.google.com/forum/#!topic/julia-dev/qdnggTuIp9s On Wed, Jul 2, 2014 at 11:05 AM, Alexander Braumann wrote: > Hi, > > I am mainly using R and wanted to know if it was already possible (or when > it is expected to be possible) to compile Julia code to

[julia-users] Re: Potential bug in Task/iterators?

2014-07-02 Thread Sebastian Nowozin
Hi, on a related note, you can discard the "ERROR: i not defined" error because it turned out to be an error in a predicate, unrelated to Task and the iterator. (I am surprised it did not provide line numbers for this but maybe it was inlined/optimized.) The Task/iterators now work from the R

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-02 Thread andy hayden
Using a single BitArray increases performance by 10x! I've pushed that to github. It also feels a much neater solution. I still can't work out how to strip out the dictionary in solve.. On Tuesday, 1 July 2014 17:28:06 UTC-7, andy hayden wrote: > > It could be what quinnj's port does > https://

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-02 Thread Iain Dunning
I'll submit the PR On Wed, Jul 2, 2014 at 12:44 PM, andy hayden wrote: > Using a single BitArray increases performance by 10x! I've pushed that to > github. It also feels a much neater solution. > > I still can't work out how to strip out the dictionary in solve.. > > On Tuesday, 1 July 2014 17

Re: [julia-users] Re: Decreasing range, should it work?

2014-07-02 Thread Jay Kickliter
I assume that when I wake up at 5 AM to finish some DSP code. Really, it was just a stupid mistake. From a non-programmer's perspective (me), it seemed like it should have work. If you think that would be dangerous, I'll take your word for it. On Wednesday, July 2, 2014 8:26:10 AM UTC-6, Stefan

Re: [julia-users] Re: Capture the output of Julia's console

2014-07-02 Thread Laszlo Hars
> Does it mean that the problem is in somewhere else, or it will work with the next nightly? Nope, with the current nightly prerelease Julia version console display still does not appear in STDOUT. Redefinition of Base.display() to print() does not help, either, so the problem is still open. Any

Re: [julia-users] equivalent to numpy's fftfreq

2014-07-02 Thread Andrei Berceanu
Ok, tnx :) But now `fftshift`, which before used to work, gives: > fftshift(DSP.fftfreq(10)) type: circshift: in typeassert, expected Frequencies, got Array{Float64,1} in circshift at abstractarray.jl:417 in fftshift at dsp.jl:145 On Wednesday, July 2, 2014 5:01:01 PM UTC+2, João Felipe Sant

Re: [julia-users] more questions about sorted associative array

2014-07-02 Thread Kevin Squire
Hi Steve, I'm sorry that you haven't gotten faster responses. I think the main issue is that not many people have worked on data structures in Julia, so there aren't too many people who feel qualified to respond. You might get a faster response if you split up your questions among multiple email

Re: [julia-users] Julia dispatches to less specific method

2014-07-02 Thread Mauro
Bill, can you file a bug report for this? https://github.com/JuliaLang/julia/issues?milestone=7&state=open On Tue, 2014-07-01 at 09:59, mauro...@runbox.com wrote: > Yes, this seems odd. I think it's a bug. First, this also works: > > function scale!{T<:Number}(A::Tridiagonal{T}, x::T) >

[julia-users] Re: Using Distance Package for knn Weight Matrix

2014-07-02 Thread Ivar Nesje
The warnings are (probably) harmless, and is because NumericExtensions extends some functions that was added to Julia after 0.2 was released. Currently we have some problems with packages that does not properly work with the 0.2 version of Julia. The 0.3 version is not far from being released,

Re: [julia-users] equivalent to numpy's fftfreq

2014-07-02 Thread João Felipe Santos
Oh, we will need a different implementation to support arrays as well as the Frequencies abstract array. Thanks for reporting this issue, by the way! -- João Felipe Santos On Wed, Jul 2, 2014 at 1:38 PM, Andrei Berceanu wrote: > Ok, tnx :) > But now `fftshift`, which before used to work, gives

[julia-users] Re: Using Distance Package for knn Weight Matrix

2014-07-02 Thread Johan Sigfrids
I don't know exactly how the Distance functions are to be used but if you do methods(pairwise) you see that it is only define if x and y are two dimensional. On Wednesday, July 2, 2014 5:22:58 PM UTC+3, Donald Lacombe wrote: > > Greetings! > > I am a new Julia user and have the following issue.

[julia-users] Why is string concatenation done with * not +

2014-07-02 Thread Samuel Colvin
There's no method +(s1::String, s2::String) instead string concatenation has to be done with a="hello "*"world This is pretty unusual and unintuitive, so I'm guessing there a really good reason for it?

[julia-users] Re: Using Distance Package for knn Weight Matrix

2014-07-02 Thread Patrick O'Leary
On Wednesday, July 2, 2014 9:22:58 AM UTC-5, Donald Lacombe wrote: > > R = pairwise(Euclidean(),xc,yc) but received the following message: > Given your usage, I believe you need to concatenate your xc and yc matrices such that each column is a point in your plane, and call the two-argument form

[julia-users] Re: Why is string concatenation done with * not +

2014-07-02 Thread Patrick O'Leary
On Wednesday, July 2, 2014 2:17:25 PM UTC-5, Samuel Colvin wrote: > > There's no method +(s1::String, s2::String) instead string concatenation > has to be done with > > a="hello "*"world > > This is pretty unusual and unintuitive, so I'm guessing there a really > good reason for it? > There's

Re: [julia-users] Re: Why is string concatenation done with * not +

2014-07-02 Thread Spencer Russell
It's a bit tricky to track down the relevant discussions, but this one seems like one of the most to-the-point: https://groups.google.com/forum/#!msg/julia-dev/4K6S7tWnuEs/RF6x-f59IaoJ peace, s On Wed, Jul 2, 2014 at 3:40 PM, Patrick O'Leary wrote: > On Wednesday, July 2, 2014 2:17:25 PM UTC-

[julia-users] Re: Why is string concatenation done with * not +

2014-07-02 Thread Ivar Nesje
Not everybody is convinced there is a good reason. See some discussion about it in https://github.com/JuliaLang/julia/issues/1771 kl. 21:17:25 UTC+2 onsdag 2. juli 2014 skrev Samuel Colvin følgende: > > There's no method +(s1::String, s2::String) instead string concatenation > has to be done wit

Re: [julia-users] Re: Why is string concatenation done with * not +

2014-07-02 Thread John Myles White
String concatenation is not commutative. Addition is generally used for commutative operations. So if you're a mathematician, using addition for string concatentation seems very wrong. -- John On Jul 2, 2014, at 12:45 PM, Ivar Nesje wrote: > Not everybody is convinced there is a good reason.

Re: [julia-users] Re: Why is string concatenation done with * not +

2014-07-02 Thread Samuel Colvin
humm, I'm tempted to say multiplication is generally (if not always) commutative too. Anyway, some very interesting discussions, surely the point is that there should be a concise explanation about string concatenation in the docs somewhere, something like: "you can do "hello"*"world" which is

Re: [julia-users] Re: Why is string concatenation done with * not +

2014-07-02 Thread John Myles White
Matrix multiplication is almost never commutative. -- John On Jul 2, 2014, at 1:16 PM, Samuel Colvin wrote: > humm, I'm tempted to say multiplication is generally (if not always) > commutative too. > > Anyway, some very interesting discussions, surely the point is that there > should be a c

[julia-users] Re: Using Distance Package for knn Weight Matrix

2014-07-02 Thread Donald Lacombe
Greetings, part 2... After doing some tests, I found that this code works just fine: julia> using Distance Warning: could not import Base.foldl into NumericExtensions Warning: could not import Base.foldr into NumericExtensions Warning: could not import Base.sum! into NumericExtensions Warning

Re: [julia-users] Re: Lowering the (mostly social/psychological) barriers to sharing packages?

2014-07-02 Thread Iain Dunning
Great suggestions/discussion everyone. I think without a stronger vote of confidence in the idea there isn't much reason to proceed. Re: svaksha's list, it is good, and I'd be curious how much traffic it gets. Its kinda chaotic though and has some errors, mainly because its pretty hard to be an

[julia-users] Re: Using Distance Package for knn Weight Matrix

2014-07-02 Thread Donald Lacombe
After thinking about this issue, another couple of question came to mind. When I create a row vector, say xc = randn(1,5), the results indicate that the vector is e.g. xc = rand(1,5) 1x5 Array{Float64,2}: 0.989421 0.718148 0.499914 0.13024 0.939856 The type is {Float64,2}. Questions:

[julia-users] Re: Using Distance Package for knn Weight Matrix

2014-07-02 Thread Patrick O'Leary
The second parameter to the Array type is the number of dimensions of the array. "Row vectors" are implemented with 2-dimensional arrays (a.k.a., "matrices"), since Vectors (a.k.a. Array{T, 1} for all types T) are interpreted as columns. Since pairwise() generates all of the distances simultane

[julia-users] Re: more questions about sorted associative array

2014-07-02 Thread vavasis
Dear Kevin, Thanks for the responses! I will look into using the 'state' for the iterator that can be later dereferenced. Indeed, one has to be careful that the iterator could point to a data item that has been changed or deleted. In C++, for each container operation there is a specification

[julia-users] Re: Using Distance Package for knn Weight Matrix

2014-07-02 Thread Donald Lacombe
Patrick, Thank you for the reply! I will try your suggestion and hopefully get a better grasp of these issues. Thank you all gain for all of the help. It cannot be stressed enough that the friendly and truly helpful comments will help the Julia community grow. Don On Wednesday, July 2, 2014 5

[julia-users] Re: Using Distance Package for knn Weight Matrix

2014-07-02 Thread Donald Lacombe
Actually, another issue with the type information. Instead of using random coordinates, I used actual latitude and longitude coordinates from a CSV file like so: data = readcsv("ct_coord.csv"); temp = [xc';yc'] 2x8 Array{Any,2}: -73.3712 -72.1065 -73.2453 -71.9876 … -72.7328 -72.5231

Re: [julia-users] Re: Lowering the (mostly social/psychological) barriers to sharing packages?

2014-07-02 Thread Hans W Borchers
What about building something similar as the "task views" in R? (I don't know what a better term there could be for it, perhaps "theme parks"?) Task views as Github projects could be expanded by the community easily. The list of task views could be pointed to in the main menu of Julia's home pa

Re: [julia-users] Re: Lowering the (mostly social/psychological) barriers to sharing packages?

2014-07-02 Thread Sam L
+1 for "Theme Parks" On Wednesday, July 2, 2014 5:12:10 PM UTC-7, Hans W Borchers wrote: > > What about building something similar as the "task views" in R? (I don't > know what a better term there could be for it, perhaps "theme parks"?) > > Task views as Github projects could be expanded by the

Re: [julia-users] Re: Decreasing range, should it work?

2014-07-02 Thread Stefan Karpinski
It changes the meaning of a:b in a capricious way based on their values, which, while often appealing for the immediate situation – and thus rampant in dynamic languages – is almost always terrible for writing predictable, reliable code. On Wed, Jul 2, 2014 at 1:07 PM, Jay Kickliter wrote: > I

[julia-users] Re: Using Distance Package for knn Weight Matrix

2014-07-02 Thread Tony Kelman
If you know all of the data in the csv file is numerical, you can provide a result type to readcsv, say readcsv("ct_coord.csv", Float64). See help(readdlm) for additional options for things like removing header rows, etc. If the data is of mixed types, then you may find readtable in the DataFra

[julia-users] Tagging a package

2014-07-02 Thread Ben Ward
Hi, I'm trying to update a package for the first time with the new package manager commands like tag and so on: *julia> **Pkg.publish()* *INFO: Validating METADATA* *INFO: Pushing Phylogenetics permanent tags: v0.0.2* Permission denied (publickey). fatal: Could not read from remote repositor

[julia-users] How do I declare a baremodule in a macro?

2014-07-02 Thread Eric Davies
Hi all, I'm working on a multipass configuration file package and I'm having difficulty executing my ideas (I'm not great at the metaprogramming stuff yet). I want to create a baremodule in a macro and have it available to the scope containing the macro. I want to be able to pass the name of th

Re: [julia-users] Re: more questions about sorted associative array

2014-07-02 Thread Tim Holy
On Wednesday, July 02, 2014 02:59:02 PM vava...@uwaterloo.ca wrote: > So my question to the forum is whether my tree code > can detect whether the user has put an @inbounds declaration in his/her > code when it invokes my routines. Not yet. This is a very desirable feature, but it hasn't really

Re: [julia-users] How do I declare a baremodule in a macro?

2014-07-02 Thread Jameson Nash
macro modcreate(name) Expr(:module, false, esc(name::Symbol), Expr(:begin)) end On Thu, Jul 3, 2014 at 12:00 AM, Eric Davies wrote: > Hi all, > > I'm working on a multipass configuration file package and I'm having > difficulty executing my ideas (I'm not great at the metaprogramming stuff

[julia-users] Re: Using Distance Package for knn Weight Matrix

2014-07-02 Thread Patrick O'Leary
(/me removes Julia hat, replaces with navigation hat) That distance measurement probably isn't going to do quite what you want it to do, particularly over such a large area. It's an okay approximation in CONUS, but biased--1 degree latitude isn't the same distance as 1 degree longitude. For poi