Re: [julia-users] Re: PyPlot: LineCollection help needed

2016-06-14 Thread David P. Sanders
Great stuff, Tom!

[julia-users] Re: Require a package not in METADATA

2016-06-14 Thread Tony Kelman
Not in the current incarnation of Pkg, no. This functionality is planned for future revamps of the package manager though. On Tuesday, June 14, 2016 at 2:40:03 PM UTC-7, Chris Rackauckas wrote: > > Is there a way to add a package to REQUIRES that's not in METADATA? >

[julia-users] Abstract type and parametric type in multiple dispatch

2016-06-14 Thread Po Choi
julia> abstract Human julia> immutable Man <: Human x::ASCIIString end julia> julia> john = Man("John") Man("John") julia> function yo(h::Human) println("yo ", h.x) end yo (generic function with 1 method) julia> yo(john) yo John julia> function yo{T <:

Re: [julia-users] I can enter the same keyword argument twice, and the second over-rules the first.

2016-06-14 Thread colintbowers
I see your point, but the counter argument is that it makes it fairly easy to introduce a bug into your code, ie typing out a couple of keyword arguments, mind still on the previous entry, and you accidentally type in the same name twice - I know it can happen, because it is exactly how I

Re: [julia-users] I can enter the same keyword argument twice, and the second over-rules the first.

2016-06-14 Thread colintbowers
Thanks, I think I'll file an issue later today. It may be deliberate behaviour, but maybe not... On Sunday, 12 June 2016 19:05:39 UTC+10, Milan Bouchet-Valat wrote: > > Le samedi 11 juin 2016 à 19:46 -0700, colint...@gmail.com a > écrit : > > I can enter the same keyword argument twice, and

[julia-users] Re: @parallel while?

2016-06-14 Thread digxx
Maybe just to clarify: I suppose it is possible to spawn a while process on each worker separately. The problem is that when one worker finds a solution the other workers should stop too.

[julia-users] @parallel while?

2016-06-14 Thread digxx
Is there sth like @parallel while loop? Or is that even possible?

Re: [julia-users] Plots/pyplot

2016-06-14 Thread digxx
I see. Ok Thank you Am Mittwoch, 15. Juni 2016 00:16:54 UTC+2 schrieb Tom Breloff: > > For the first one, you'll need to wrap that tuple: `plot(rand(10), > xaxis=((0,5),))` Lesson... axis is expecting a tuple of args, so if you > give it one it'll try to do something with each arg. > > For

Re: [julia-users] Plots/pyplot

2016-06-14 Thread Tom Breloff
For the first one, you'll need to wrap that tuple: `plot(rand(10), xaxis=((0,5),))` Lesson... axis is expecting a tuple of args, so if you give it one it'll try to do something with each arg. For the second one, it's updating the tick marks, because that's what it assumes a list of numbers

[julia-users] Plots/pyplot

2016-06-14 Thread digxx
HEy, Sorry for the maybe stupid question but apparently I'm not capable of setting the range when plotting with plots so e.g. x=0:0.1:1 y=2*x plots(x,y,xaxis=(0,0.5) this does not work. and this deletes my xaxis labeling? plots(x,y,xasis=0:0.5) Anyway I just want to set range without

[julia-users] Require a package not in METADATA

2016-06-14 Thread Chris Rackauckas
Is there a way to add a package to REQUIRES that's not in METADATA?

Re: [julia-users] Problems with MySQL sample code

2016-06-14 Thread Jacob Quinn
Yep, it's just like I said above, in the "mysql_execute(con" command/line, you'll even notice the code highlighting in your email shows that "John" is highlighted as a value instead of a text. That's because the double quote right before John is ending the string that starts with "INSERT...".

Re: [julia-users] Problems with MySQL sample code

2016-06-14 Thread Stefan Karpinski
Can you file an issue here: https://github.com/JuliaDB/MySQL.jl/issues On Tue, Jun 14, 2016 at 3:53 PM, Ingemar Skarpås wrote: > Well - it is this sample code- direct from Github for MySQL.jl -only > modification i adrress username et c in the con=mysql_connect(). And the >

[julia-users] Re: How to install 0.4.5 on Ubuntu?

2016-06-14 Thread Nils Gudat
What (might have) helped in the end was to remove the nightlies PPA - I had added both PPAs for release version and nightly, so maybe that was my mistake.

Re: [julia-users] Problems with MySQL sample code

2016-06-14 Thread Ingemar Skarpås
Well - it is this sample code- direct from Github for MySQL.jl -only modification i adrress username et c in the con=mysql_connect(). And the same works for the MySQL test suite. And the code works up until row 14 in this case. I my code I have a few more comments I've added but teh executable

Re: [julia-users] Re: PyPlot: LineCollection help needed

2016-06-14 Thread Tom Breloff
David: Thanks so much for saving me a ton of headache figuring this out for Plots. Just pushed to dev: ``` using Plots y = cumsum(randn(500)) plot(y, line_z = y, w = 3) ``` ​ On Sat, Jun 11, 2016 at 4:13 PM, Christoph Ortner < christophortn...@gmail.com> wrote: > thanks, David, this will be

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

2016-06-14 Thread Kristoffer Carlsson
Ok, I merged it. Enjoy. On Tuesday, June 14, 2016 at 8:53:26 PM UTC+2, jean-pierre both wrote: > > Hi, > > The fix is really great, thank you for the analysis and the fix. > Thanks you > > Le lundi 13 juin 2016 20:19:26 UTC+2, Kristoffer Carlsson a écrit : >> >> Please try

Re: [julia-users] Re: Can I somehow get Julia without standard library?

2016-06-14 Thread Stefan Karpinski
> > Of course I can use high level wrappers around the existing library > functions, but this will cause a significant negative impact on the > performance, that is why I want to implement this functionality on top of > the lowest level. Why would having the standard library present make what

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

2016-06-14 Thread jean-pierre both
Hi, The fix is really great, thank you for the analysis and the fix. Thanks you Le lundi 13 juin 2016 20:19:26 UTC+2, Kristoffer Carlsson a écrit : > > Please try https://github.com/JuliaStats/Distances.jl/pull/44 > > On Monday, June 13, 2016 at 8:14:01 PM UTC+2, Mauro wrote: >> >> > function

Re: [julia-users] Re: Can I somehow get Julia without standard library?

2016-06-14 Thread Dmitry
I want to change the behaviour and implementation of some language features. In other words, I need my own little standard library that most accurately meets my needs. Of course I can use high level wrappers around the existing library functions, but this will cause a significant negative

Re: [julia-users] Re: why the numerical result is different (RK45 julia and matlab)?

2016-06-14 Thread Daniel Carrera
Can you post your new code and your new results? Is the difference consistent with the tolerance level? Naively, I would expect the difference between the two implementations to be around sqrt(N)*AbsTol -- this is what you'd expect if at each step each implementation has an unbiased random error

Re: [julia-users] Problems with MySQL sample code

2016-06-14 Thread Jacob Quinn
My guess is that you have an SQL query that is something like: query("select * from table where name = "John" and dept = 7") The problem then is that the double quotation mark right before John is actually *ending* the double quote that started your query string. What you want is to escape the

Re: [julia-users] Abstract version of rng=1:end ?

2016-06-14 Thread Tim Holy
See https://github.com/JuliaLang/julia/pull/15750. What holds that up is the fact that people sometimes want to do math on `end`, e.g., b = a[1:round(Int,sqrt(end))] works just fine. --Tim On Monday, June 13, 2016 8:40:39 AM CDT Dan wrote: > A reason such 'extended' ranges might be good,

[julia-users] Re: A naive question regarding the definition of a type with arguments of varying types

2016-06-14 Thread Kuan Xu
Thanks very much!! That's exactly what I need. On Monday, June 13, 2016 at 10:19:44 PM UTC+1, Kristoffer Carlsson wrote: > > Perhaps: > > type RealorComplex{T1 <: Number, T2<:Real} > v::Vector{T1} > w::Vector{Complex{T2}} > function RealorComplex(v, w) > @assert T1 <:

Re: [julia-users] Problems with MySQL sample code

2016-06-14 Thread Stefan Karpinski
On Tue, Jun 14, 2016 at 11:50 AM, Ingemar Skarpås wrote: > LoadError:UdefVarError: @John_str not defined This bit indicates that you've written something like this: John"...". This is translated to a macro call to a macro named @John_str.

Re: [julia-users] Indexing ranges out of an array

2016-06-14 Thread Stefan Karpinski
There's nothing predefined that does this, but it's easy to roll your own: preallocate and output array of the correct size (a pretty straightforward computation) and then use a for loop to copy the elements over; wrap this in a function and then use as desired. On Tue, Jun 14, 2016 at 11:37 AM,

[julia-users] Problems with MySQL sample code

2016-06-14 Thread Ingemar Skarpås
Last week I started to evaluate Julia to see if it fits my purposes (I made some test a year and half ago also) , so I have tested a few things written some tests of my own, and modified some sample code. So bare with me if this is an easy one... I have Julia 0.4.5, with MySQL 0.2.2+ on W7U

Re: [julia-users] Re: why the numerical result is different (RK45 julia and matlab)?

2016-06-14 Thread jmarcellopereira
Hi Daniel I did the test and the difference decreased. interesting, I had not noticed. Em domingo, 12 de junho de 2016 09:53:40 UTC-3, Daniel Carrera escreveu: > > I don't know what you are trying to say, but did you try running the two > programs with the same relative and absolute tolerances?

[julia-users] Re: Problem with Homebrew after Pkg.update()

2016-06-14 Thread Tony Kelman
Go into your Pkg.dir("Homebrew") and run `git diff`. The fact that you've checked out master and then changed something is making the package "dirty" which is preventing it from getting updates. Find out what change you made, revert it if possible, then run Pkg.free("Homebrew") to get back from

[julia-users] Indexing ranges out of an array

2016-06-14 Thread Jesse Jaanila
I would like to know whats a juliatic way of indexing or slicing evenly spaced ranges out of an array: If I want to take out every n:th element out of Julia array, I would do something like a = [1,2,3,4,5,6]; everySecond = a[2:2:end]; What I would like to achieve is a slice of specified size

Re: [julia-users] Re: Can I somehow get Julia without standard library?

2016-06-14 Thread Scott Jones
I think I've shown that it isn't too difficult (I started my Julia-lite branch originally just a couple months after learning Julia), it's mostly some tedious work, and most people are concentrating on other (very important) stuff. I pushed to make this because I was interested in having things

Re: [julia-users] Re: Can I somehow get Julia without standard library?

2016-06-14 Thread Chris Rackauckas
I agree that more should be backed out to packages. Even as a math person who would probably never Julia without linear algebra, I think that some of the linear algebra should move out to a JuliaMath package, and then part of the standard startup script should be to "using LinAlg". That way if

[julia-users] Re: Standard wrapper for global variable optimization hack?

2016-06-14 Thread Arch Robison
Thanks Kristoffer for the suggestion of Ref. It indeed is the kind of wrapper I was looking for. Thanks Eric for catching my typo. Yes, it should be `const w = wrapper(0.0)`, with the w instead of x.

Re: [julia-users] Re: Can I somehow get Julia without standard library?

2016-06-14 Thread Scott Jones
You should try out my "lite" branch of Julia, I got it back in sync with master yesterday, made sure it still passed the unit tests, etc. https://github.com/ScottPJones/julia/tree/spj/lite I don't think it's so black and white as Avik and Stefan have made it seem. My lite branch takes less than

Re: [julia-users] Re: Can I somehow get Julia without standard library?

2016-06-14 Thread Stefan Karpinski
Tamas is dead on – see the intro of https://www.youtube.com/watch?v=dK3zRXhrFZY for an explanation. Being able to define even the most basis types in Julia itself is one of the most powerful features of the language. Let's back up a little here. What are you trying to accomplish? On Tue, Jun 14,

[julia-users] Re: how can I create an incidence matrix

2016-06-14 Thread Robert Schwarz
I think that this would give you the adjacency matrix. In LightGraphs.jl , there is a method incidence_matrix that might be useful. On Tuesday, June 14, 2016 at 8:46:08 AM UTC+2, Ford O. wrote: > > Are you sure you know what is incidence matrix?

[julia-users] Re: Can I somehow get Julia without standard library?

2016-06-14 Thread Dmitry
So. I stepped deeper into the Julia standard library and found some interesting things. I mean intrinsic functions. If I understand correctly this is the glue between the language core and the library. Is there any documentation about intrinsics? понедельник, 6 июня 2016 г., 17:42:02 UTC+4

Re: [julia-users] Re: Can I somehow get Julia without standard library?

2016-06-14 Thread Tamas Papp
Look at it this way: Julia is so powerful that many language features can be implemented natively, instead of using primitives. On Tue, Jun 14 2016, Dmitry wrote: > That's what I was afraid of. It comes that Julia is very strongly tied to > its library. I was hoping that it would be like with

[julia-users] MethodError closest candidate is same as "no matching method" method

2016-06-14 Thread Toivo Henningsson
Could it be that you happened to reload Nemo after using/importing it? This kind of thing can happen when there are two live instances of the same module and your code happens to combine types/functions from both.

Re: [julia-users] Re: Can I somehow get Julia without standard library?

2016-06-14 Thread Dmitry
That's what I was afraid of. It comes that Julia is very strongly tied to its library. I was hoping that it would be like with most other languages, for example C++. I mean C++ know about basic types and how to work with them (and much more) even without the standard library. понедельник, 6

Re: [julia-users] Standard wrapper for global variable optimization hack?

2016-06-14 Thread Kristoffer Carlsson
I still think Ref is the way to go. const a = Ref{Float64}(0.0) inc_ref() = a[] += 1 @code_llvm inc_ref() define double @julia_inc_ref_50012() #0 { top: %0 = load double, double* inttoptr (i64 140310118277680 to double*), align 16 %1 = fadd double %0, 1.00e+00 store double %1,

Re: [julia-users] Standard wrapper for global variable optimization hack?

2016-06-14 Thread Kristoffer Carlsson
I feel my suggestion with Ref went a bit unnoticed.. const a = Ref(0.0) inc_ref() = a[] += 1 @code_llvm inc_ref() define i64 @julia_inc_ref_50057() #0 { top: %0 = load i64, i64* inttoptr (i64 140258091307984 to i64*), align 16 %1 = add i64 %0, 1 store i64 %1, i64* inttoptr (i64

[julia-users] Re: Standard wrapper for global variable optimization hack?

2016-06-14 Thread Kristoffer Carlsson
I feel my suggestion with Ref was under appreciated. const a = Ref{Int}(0) inc_ref() = a[] += 1 julia> @code_llvm inc_ref() define double @julia_inc_ref_50012() #0 { top: %0 = load double, double* inttoptr (i64 140198715724432 to double*), align 16 %1 = fadd double %0, 1.00e+00

Re: [julia-users] Changing the year in two digit year using DateTime

2016-06-14 Thread Tamas Papp
Try something like function dateYY(d) y = Dates.year(d) if 70 <= y <= 99 d+Dates.Year(1900) elseif 0 <= y <= 20 d+Dates.Year(2000) else error(@sprintf("don't know what to do with year %d", y)) end end eg dateYY(DateTime("96/15/03", "yy/dd/mm"))

[julia-users] Re: Changing the year in two digit year using DateTime

2016-06-14 Thread Eric Forgy
How's this? julia> v1 = ["96/15/03", "15/15/03"] 2-element Array{ASCIIString,1}: "96/15/03" "15/15/03" julia> dt = DateTime(v1,"yy/dd/mm") 2-element Array{DateTime,1}: 0096-03-15T00:00:00 0015-03-15T00:00:00 julia> [Dates.year(d) > 16 ? d+Dates.Year(1900) : d+Dates.Year(2000) for d in dt]

[julia-users] Changing the year in two digit year using DateTime

2016-06-14 Thread akrun
Hi, If I have a vector of dates v1 = ["96/15/03", "15/15/03"] Using DateTime, it gives DateTime(v1, "yy/dd/mm") #2-element Array{DateTime,1}: #0096-03-15T00:00:00 #0015-03-15T00:00:00 How do I get 1996-03-15T00:00:00 and 2015-03-15T00:00:00 Thanks

[julia-users] Re: how can I create an incidence matrix

2016-06-14 Thread Ford O.
Are you sure you know what is incidence matrix? wiki You don't need any dictionaries to implement it. Just use simple Array(). matrix = fill(false, row_size, col_size) from_node = scan_input() to_node = scan_input() matrix[from_node, to_node] =

Re: [julia-users] how can I create an incidence matrix

2016-06-14 Thread Tamas Papp
Check out ModelMatrix in Dataframes.jl. On Mon, Jun 13 2016, Gerson Jr. wrote: > Hi > I would like to create an incidence matrix. > I have a file with 3 columns, like: > > id x y > A 22 2 > B 4 21 > C 21 360 > D 26 2 > E 22 58 > F 2 347 > > And I want a matrix like (without col and