[julia-users] undefined reference error

2016-05-09 Thread Boylan, Ross
julia 0.4:

module TT
type Stuff
a::Int
b::Int
end
v = Array(Stuff, 3)
end

Produces
 julia> TT.v[1].a = 5
 ERROR: UndefRefError: access to undefined reference  problem
  in getindex at array.jl:282

!julia> TT.v
 3-element Array{TT.Stuff,1}:
  #undef
  #undef
  #undef

Could anyone help me to understand what's going on, and what I can do about it? 
 I know Array() produces uninitialized elements, but I don't understand why I 
can't write values into them.

In contrast, replacing the entire object works:
julia> TT.v[1] = TT.Stuff(4, 78)
 TT.Stuff(4,78)

!julia> TT.v[1]
 TT.Stuff(4,78)

Thanks.
Ross Boylan


Re: [julia-users] Re: static compilation

2016-05-09 Thread Ján Adamčák
Hello guys, 

Thank you for your comments, though we were more optimistic...


Dňa piatok, 6. mája 2016 16:27:28 UTC+2 Ján Adamčák napísal(-a):
>
> Sorry, my fault. 
>
> During last week I created build_sysimg2.jl from julia 0.4.5 
> build_sysimg.jl and when I run it, at line 86 (build_sysimg2.jl)
>
> run(`$julia -C $cpu_target --output-o sysimg_all.o --sysimage 
> $sysimg_path.$(Libdl.dlext) --startup-file=no --compile=all --eval nothing`)
>
> I got this error:
>
> fatal: error thrown and no exception handler available.
> ErrorException("Task cannot be serialized")
> jl_unprotect_stack at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_throw at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll 
> (unknown line)
> jl_error at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll 
> (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_compress_ast at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_save_system_image_to_stream at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_create_system_image at 
> C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll (unknown line)
> jl_atexit_hook at C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\libjulia.dll 
> (unknown line)
> unknown function (ip: 004028B5)
> unknown function (ip: 0040140C)
> unknown function (ip: 0040153B)
> BaseThreadInitThunk at C:\WINDOWS\system32\KERNEL32.DLL (unknown line)
> RtlUserThreadStart at C:\WINDOWS\SYSTEM32\ntdll.dll (unknown line)
> ERROR: LoadError: failed process: 
> Process(`'C:\Users\Adam\AppData\Local\Julia-0.4.5\bin\julia' -C native 
> --output-o sysimg_all.o --sysimage my_img.dll --startup-file=no 
> --compile=all --eval nothing`, ProcessExited(1)) [1]
>  in run at process.jl:531
> while loading 
> c:\Users\Adam\AppData\Local\Julia-0.4.5\share\julia\build_sysimg2.jl, in 
> expression starting on line 191
>
>  Before this error, julia wrote some warnings:
>
> WARNING: could not attach metadata for @simd loop.
>
> Same error I got on Ubuntu 16.04...
>  
>
>
> Dňa piatok, 6. mája 2016 15:48:19 UTC+2 Jeff Bezanson napísal(-a):
>>
>> That command line in build_sysimg.jl:77 looks strange. Actually I 
>> can't find that line anywhere; our build_sysimg and BuildExecutable.jl 
>> now have something slightly different. 
>>
>> On Fri, May 6, 2016 at 9:25 AM, Tom Breloff  wrote: 
>> > Also, I think there's even fewer people that are experts on the Windows 
>> > build process.  I think the communit

Re: [julia-users] Failing to update variable in while loop (Newbie)

2016-05-09 Thread Yichao Yu
On Mon, May 9, 2016 at 9:33 PM, David Enocksson  wrote:
> I have an issue in my program and I think it has to do with a nested while
> loop, related to the following situation:
>
> a = 1:1:10
> iter1 = 0
> iter2 = 0
>
> while iter1 < 10
>
>iter1 = iter1 + 1
>
>   while iter2 < 1
>
>  iter2 = iter2 + 1
>
>  print(a[iter1])

It should print a[1] a bunch of times here and never run the inner
loop again since the loop condition is false.

>
>   end
>
> end
>
>
> The problem is that a[iter1] is not updating. I want the result to be
>
>
> 1
>
> 2
>
> 3
>
> 4
>
> 5
>
> 6
>
> 7
>
> 8
>
> 9
>
>
> Any help would be very much appreciated.


[julia-users] Re: Newbie Question: Command Line Woes

2016-05-09 Thread Cedric St-Jean
hello.jl defines the hello() function, but you need to call it to get some 
output. For instance,

function hello()
   println("Hello World")
 return
end

hello()
hello()

will print "Hello World" twice.

On Monday, May 9, 2016 at 10:59:05 PM UTC-4, rich2...@gmail.com wrote:
>
> Newbie question: Why don't I get any output from the following programs 
> when I run them from the command line on my Macbook pro (OS 10.11.4) or two 
> different versions of Linux. Everything works as expected when the programs 
> are run in the REPL. 
>
> On the Mac I use the following in my PATH. 
>
> /Applications/Julia-0.4.5.app/Contents/Resources/julia/bin
>
> Command line: julia hello.jl
> function hello()
> println("Hello World")
> return
> end
>
> Command line: julia five.jl
> function five()
> return 5
> end
>
> The scripts run fine with no apparent errors or warnings. They just don't 
> produce any output. 
>
> Thanks,
> Rich
>


[julia-users] Newbie Question: Command Line Woes

2016-05-09 Thread rich2 . 7182
Newbie question: Why don't I get any output from the following programs 
when I run them from the command line on my Macbook pro (OS 10.11.4) or two 
different versions of Linux. Everything works as expected when the programs 
are run in the REPL. 

On the Mac I use the following in my PATH. 

/Applications/Julia-0.4.5.app/Contents/Resources/julia/bin

Command line: julia hello.jl
function hello()
println("Hello World")
return
end

Command line: julia five.jl
function five()
return 5
end

The scripts run fine with no apparent errors or warnings. They just don't 
produce any output. 

Thanks,
Rich


[julia-users] Failing to update variable in while loop (Newbie)

2016-05-09 Thread David Enocksson
I have an issue in my program and I think it has to do with a nested while 
loop, related to the following situation:

a = 1:1:10
iter1 = 0
iter2 = 0

while iter1 < 10

   iter1 = iter1 + 1

  while iter2 < 1

 iter2 = iter2 + 1

 print(a[iter1])

  end

end


The problem is that a[iter1] is not updating. I want the result to be


1

2

3

4

5

6

7

8

9


Any help would be very much appreciated.


[julia-users] Re: IJulia- Failed to precompile IJulia to C:\Users\....\.julia\lib\v0.4\IJulia.ji in error at error.jl:21

2016-05-09 Thread Steven G. Johnson
Were you editing the src/IJulia.jl file for debugging purposes or 
something?  What does `Pkg.status()` say?


[julia-users] IJulia- Failed to precompile IJulia to C:\Users\....\.julia\lib\v0.4\IJulia.ji in error at error.jl:21

2016-05-09 Thread ÜÖ



IJulia does not start at Julia. It gives the following error.  I am using 
 0.4.3 on Windows 10,  x86_64-w64-mingw32. Thank you for your kind help. 

julia> using IJulia
INFO: Precompiling module IJulia...
ERROR: LoadError: syntax: extra token "set_verbose" after end of expression
 in include at boot.jl:261
 in include_from_node1 at loading.jl:304
 [inlined code] from none:2
 in anonymous at no file:0
 in process_options at client.jl:257
 in _start at client.jl:378
while loading C:\Users\uozden\.julia\v0.4\IJulia\src\IJulia.jl, in 
expression starting on line 7
ERROR: Failed to precompile IJulia to 
C:\Users\uozden\.julia\lib\v0.4\IJulia.ji
 in error at error.jl:21

julia> 




[julia-users] Slicing arrays with slicedim

2016-05-09 Thread Davide Lasagna
Hi, 

on v0.4.5, why is slicedim not dropping singleton dimensions as slice does?

Example:

julia> A = randn(3, 4)

3x4 Array{Float64,2}:

  2.31181   -1.7222-0.654665  -0.836633 

 -0.236305   0.389242   0.613524  -0.0398548

  0.670851  -0.53761   -1.608110.117274 

julia> slice(A, 1, :)

4-element SubArray{Float64,1,Array{Float64,2},Tuple{Int64,Colon},2}:

  2.31181 

 -1.7222  

 -0.654665

 -0.836633

julia> slicedim(A, 1, 1)

1x4 Array{Float64,2}:

 2.31181  -1.7222  -0.654665  -0.836633



Thanks







Re: [julia-users] Hopefully simple plotting question (for my 9 yr old son's science project!)

2016-05-09 Thread Scott Jones


On Monday, May 9, 2016 at 11:09:27 AM UTC-4, Tom Breloff wrote:
>
> I haven't ever needed to plot
>
>
> Wh---whaaat?? ;)
>

Yeah, seriously!  Give me Emacs (or something with good Emacs 
bindings+extensibility), a C/C++ compiler (now Julia), and a debugger, and 
I'm a happy man. ;-)
I think all the plotting stuff is beautiful, but until now, for my 
low-level performance work (lots of bit twiddling), never needed it.  Now 
that I do have a need for it,
glad to see there is such a nice package available for Julia (Thanks Tom! 
Also thanks to everybody else making the plotting packages / backends!)

Thanks so much, that's exactly what he needed to finish his science project!
I just have to make sure that he's collected more data today, he only had 2 
8-year olds, and both got 0's, kind of skews the results!
His hypothesis, was that the young kids wouldn't do so well, but that 
neither would the old people (like his science teacher and me ;-) ), 
however, everybody over 13 so far as gotten a perfect score!

-Scott


[julia-users] Re: Best way to get indices and values at sorting (rows/columns of) a matrix?

2016-05-09 Thread Hakuna M.
Am Montag, 9. Mai 2016 19:03:18 UTC+2 schrieb Steven G. Johnson:
>
>
>
> No, I think sortperm(A, dim) would need to return an array of single-index 
> indices (i.e. to be used with A[i]).  I posted a sample implementation for 
> 2d arrays in the issue linked above, which should suffice for your use.
>

Ah, ok that could be usefull as well. For current task I need the indices 
without offset for later usage. It could depend on the number of output 
parameters like Matlab.


[julia-users] Re: Best way to get indices and values at sorting (rows/columns of) a matrix?

2016-05-09 Thread Steven G. Johnson


On Monday, May 9, 2016 at 9:53:29 AM UTC-4, Hakuna M. wrote:
>
> would be nearly the same as:
> mapslices(sortperm, A, dim);
> or?
>

No, I think sortperm(A, dim) would need to return an array of single-index 
indices (i.e. to be used with A[i]).  I posted a sample implementation for 
2d arrays in the issue linked above, which should suffice for your use.




Re: [julia-users] Julia SQL

2016-05-09 Thread Alex Mellnik
To expand on what Jacob said, you can read a DataFrame into an in-memory 
SQLite table and then run SQL commands on that.  However, unless you really 
need to use SQL there's probably a way to do the same operation faster (and 
with less code) using native DataFrame operations.  If you can provide some 
examples we're happy to help translate them.  -A

On Sunday, May 8, 2016 at 9:01:07 AM UTC-7, Jacob Quinn wrote:
>
> Also checkout the SQLite.jl package. It provides methods for reading CSV 
> files into an SQLite table and then running SQLite SQL commands on those 
> tables. You can then export the SQLite to a CSV or Data.Table/DataFrame.
>
> -Jacob
> On May 8, 2016 4:32 AM, "Tero Frondelius"  > wrote:
>
>> Maybe this thread is relevant:
>> https://groups.google.com/forum/m/#!topic/julia-users/QjxiCO-Lv-0
>
>

[julia-users] Re: Macro as decorators

2016-05-09 Thread Andras Niedermayer
It's possible to have a macro in Julia that emulates Python decorators. But 
it's a separate question whether you really want to do it, there might be 
more efficient/elegant ways to achieve the same in Julia for a specific use 
case.

Here's a macro that emulates Python decorators and an example how to use it:

julia> macro decorator(dec, func)
 name = func.args[1].args[1]
 hiddenname = gensym()
 func.args[1].args[1] = hiddenname
 quote
   $func
   const $(esc(name)) = $dec($hiddenname)
 end
   end
julia> foo(f) = x->2*f(x+10)
julia> @decorator foo function bar(x)
 return x+1
   end
julia> bar(0)
22

This is the same as in Python
In [2]: def foo(f):
   ...: return lambda x: 2*f(x+10)
   ...: 


In [3]: @foo
   ...: def bar(x):
   ...: return x+1
   ...: 


In [4]: bar(0)
Out[4]: 22

Of course, one can also use this for something useful :-), like:
julia> logger(f) = x-> (println("input: $x"); result = f(x); println("output: 
$result"); result)
logger (generic function with 1 method)


julia> @decorator logger baz(x)=x+1
(anonymous function)


julia> baz(3)
input: 3
output: 4
4




On Monday, May 9, 2016 at 3:42:22 PM UTC+2, Ford Ox wrote:
>
> Is it possible to write macro that will work as python decorator? 



Re: [julia-users] Hopefully simple plotting question (for my 9 yr old son's science project!)

2016-05-09 Thread Tom Breloff
>
> I haven't ever needed to plot


Wh---whaaat?? ;)

This is pretty straightforward:


​
​
​
Note: you might need to checkout master or dev of Plots (I'm on dev)... I
can't ever remember when I implemented anything.

On Mon, May 9, 2016 at 10:24 AM, Scott Jones 
wrote:

> My son Alex is building on what he did last year for his science project,
> where he used Julia to help do the calculations on the data he'd collected
> (basically, he's lazy [in a good way], he'd rather work with his dad to
> learn how to program something rather than do all all the basic arithmetic
> to calculate things like the averages for his plots, and Julia made it
> trivial).
> This year, in math class, he's learned about calculating also the median,
> mode(s), and the ranges, and he'd like to be able to plot the results
> directly in Julia (last year, since I didn't know how, he ended up doing
> the plotting by hand).
>
> He's written a program (with a little help from me) that inputs the data
> from a CSV file (thanks, Jacob Quinn, for the CSV.jl package!) that he's
> entered with Excel.
> The data is simply a value, integer 0 - 7 (for the number of digits
> remembered correctly after seeing a card with 7 digits for 30 seconds, and
> reciting the alphabet).
>
> The program first makes of sorted vector of the unique ages in the data
> set, and then creates a Vector of Vector of Int, each element having all of
> the results for that age.
> Then it uses that to create 4 vectors, mean_by_age, median_by_age,
> low_range, and high_range.
>
> What we want to do, is to plot the ages on the X axis, with the results on
> the Y axis, as a line segment from the low_range to the high_range (with
> the top and bottom marked off with small horizontal lines),
> and also have plotted mean_by_age, and median_by_age with different
> colored lines with different markers (maybe diamonds and squares).
> He might also want to display the mode(s) for each age (might be nice to
> have those done as circles of different radius depending on how many
> samples at that mode value)
>
> I haven't ever needed to plot, so I haven't been able to help him very
> much, so far I'll I've been able to do is just call `plot(ages,
> mean_by_age, linewidth=3)` and `plot(ages, median_by_age, linewidth= 3)` do
> display two of the things he wants.
>
> Any help will be greatly appreciated!
>
> Thanks,
> Scott (proud father of a beginning Julia ;-) )
>
>
>


Re: [julia-users] Hopefully simple plotting question (for my 9 yr old son's science project!)

2016-05-09 Thread Miguel Bazdresch
>  a line segment from the low_range to the high_range (with the top and
bottom marked off with small horizontal lines),

Gaston has support for plotting with error bars, which is exactly this type
of plot. Current documentation is here:
https://bitbucket.org/mbaz/gaston/downloads/gastondoc-0.5.5.pdf See also
the gaston_demo() for examples of many types of plots.

If you decide to use it, be sure to checkout the Master branch -- there's
lots of bug fixes not in the current release (there's a few last features I
need to complete before I put a new release out).

-- mb

On Mon, May 9, 2016 at 10:24 AM, Scott Jones 
wrote:

> My son Alex is building on what he did last year for his science project,
> where he used Julia to help do the calculations on the data he'd collected
> (basically, he's lazy [in a good way], he'd rather work with his dad to
> learn how to program something rather than do all all the basic arithmetic
> to calculate things like the averages for his plots, and Julia made it
> trivial).
> This year, in math class, he's learned about calculating also the median,
> mode(s), and the ranges, and he'd like to be able to plot the results
> directly in Julia (last year, since I didn't know how, he ended up doing
> the plotting by hand).
>
> He's written a program (with a little help from me) that inputs the data
> from a CSV file (thanks, Jacob Quinn, for the CSV.jl package!) that he's
> entered with Excel.
> The data is simply a value, integer 0 - 7 (for the number of digits
> remembered correctly after seeing a card with 7 digits for 30 seconds, and
> reciting the alphabet).
>
> The program first makes of sorted vector of the unique ages in the data
> set, and then creates a Vector of Vector of Int, each element having all of
> the results for that age.
> Then it uses that to create 4 vectors, mean_by_age, median_by_age,
> low_range, and high_range.
>
> What we want to do, is to plot the ages on the X axis, with the results on
> the Y axis, as a line segment from the low_range to the high_range (with
> the top and bottom marked off with small horizontal lines),
> and also have plotted mean_by_age, and median_by_age with different
> colored lines with different markers (maybe diamonds and squares).
> He might also want to display the mode(s) for each age (might be nice to
> have those done as circles of different radius depending on how many
> samples at that mode value)
>
> I haven't ever needed to plot, so I haven't been able to help him very
> much, so far I'll I've been able to do is just call `plot(ages,
> mean_by_age, linewidth=3)` and `plot(ages, median_by_age, linewidth= 3)` do
> display two of the things he wants.
>
> Any help will be greatly appreciated!
>
> Thanks,
> Scott (proud father of a beginning Julia ;-) )
>
>
>


[julia-users] Hopefully simple plotting question (for my 9 yr old son's science project!)

2016-05-09 Thread Scott Jones
My son Alex is building on what he did last year for his science project, 
where he used Julia to help do the calculations on the data he'd collected 
(basically, he's lazy [in a good way], he'd rather work with his dad to 
learn how to program something rather than do all all the basic arithmetic 
to calculate things like the averages for his plots, and Julia made it 
trivial).
This year, in math class, he's learned about calculating also the median, 
mode(s), and the ranges, and he'd like to be able to plot the results 
directly in Julia (last year, since I didn't know how, he ended up doing 
the plotting by hand).

He's written a program (with a little help from me) that inputs the data 
from a CSV file (thanks, Jacob Quinn, for the CSV.jl package!) that he's 
entered with Excel.
The data is simply a value, integer 0 - 7 (for the number of digits 
remembered correctly after seeing a card with 7 digits for 30 seconds, and 
reciting the alphabet).

The program first makes of sorted vector of the unique ages in the data 
set, and then creates a Vector of Vector of Int, each element having all of 
the results for that age.
Then it uses that to create 4 vectors, mean_by_age, median_by_age, 
low_range, and high_range.

What we want to do, is to plot the ages on the X axis, with the results on 
the Y axis, as a line segment from the low_range to the high_range (with 
the top and bottom marked off with small horizontal lines),
and also have plotted mean_by_age, and median_by_age with different colored 
lines with different markers (maybe diamonds and squares).
He might also want to display the mode(s) for each age (might be nice to 
have those done as circles of different radius depending on how many 
samples at that mode value)

I haven't ever needed to plot, so I haven't been able to help him very 
much, so far I'll I've been able to do is just call `plot(ages, 
mean_by_age, linewidth=3)` and `plot(ages, median_by_age, linewidth= 3)` do 
display two of the things he wants.

Any help will be greatly appreciated!

Thanks,
Scott (proud father of a beginning Julia ;-) )




Re: [julia-users] Macro as decorators

2016-05-09 Thread Kevin Squire
Possibly.

Do you have a specific example in mind?  That will probably get you a less
ambivalent answer. :-)

Cheers,
   Kevin

On Monday, May 9, 2016, Ford Ox  wrote:

> Is it possible to write macro that will work as python decorator?


[julia-users] Re: Best way to get indices and values at sorting (rows/columns of) a matrix?

2016-05-09 Thread Hakuna M.


Am Montag, 9. Mai 2016 15:26:48 UTC+2 schrieb Steven G. Johnson:
>
> Actually, see https://github.com/JuliaLang/julia/issues/16273
>
Thanks for your answer. Sry, about my strange postings, there was an error, 
you have seen the other two postings below?.

sortperm(A, dim) 
would be nearly the same as:
mapslices(sortperm, A, dim);
or?
But then I still need the values of the sorted matrix.
How can I get these? (maybe sortperm!)




[julia-users] Macro as decorators

2016-05-09 Thread Ford Ox
Is it possible to write macro that will work as python decorator? 

[julia-users] Re: Best way to get indices and values at sorting (rows/columns of) a matrix?

2016-05-09 Thread Steven G. Johnson
Actually, see https://github.com/JuliaLang/julia/issues/16273


[julia-users] Re: Best way to get indices and values at sorting (rows/columns of) a matrix?

2016-05-09 Thread Steven G. Johnson
See https://github.com/JuliaLang/julia/issues/9258


[julia-users] Re: Best way to get indices and values at sorting (rows/columns of) a matrix?

2016-05-09 Thread Hakuna M.
but I don't like the storage allocation of 'offset'. Is there a better way 
to do it? 
I would like to avoid for-loops.

Is there a way to access the current index of mapslices (ciom) ? And do 
something like this:

mapslices(x - > m[ x[:, ciom ], ciom], i, 1);

or do i need to do a for?

for ciom=1:c;  v[:,ciom] =m [ i[:, ciom ], ciom] ; end


other ideas?


[julia-users] Re: Best way to get indices and values at sorting (rows/columns of) a matrix?

2016-05-09 Thread Hakuna M.
currently I'm using:
i = mapslices(sortperm, m, 1);
offset=repmat( (0:(c-1))'.*r ,r, 1); #'
v = m[offset+i];



[julia-users] Re: Best way to get indices and values at sorting (rows/columns of) a matrix?

2016-05-09 Thread Hakuna M.
currently I'm using:

i = mapslices(sortperm, m, 1);
offset=repmat( (0:(c-1))'.*r ,r, 1);
v = m[offset+i];



[julia-users] Re: Best way to get indices and values at sorting (rows/columns of) a matrix?

2016-05-09 Thread Hakuna M.
Am Montag, 9. Mai 2016 14:59:30 UTC+2 schrieb Hakuna M.:
>
> Hi there, I'm new to Julia but have some experience with Matlab.
>
> To sort each column of a matrix M ( r rows, c columns) I can write in 
> Matlab:
> test
>


currently I'm using:

*** 

but I don't like the storage allocation of 'offset'. Is there a better way 
to do it? 
I would like to avoid for-loops.

Is there a way to access the current index of mapslices (ciom) ? And do 
something like this:

mapslices(x - > m[ x[:, ciom ], ciom], i, 1);

or do i need to do a for?

for ciom=1:c;  v[:,ciom] =m [ i[:, ciom ], ciom] ; end


other ideas? 


[julia-users] Re: Best way to get indices and values at sorting (rows/columns of) a matrix?

2016-05-09 Thread Hakuna M.

>
> Hi there, I'm new to Julia but have some experience with Matlab.
>
> To sort each column of a matrix M ( r rows, c columns) I can write in 
> Matlab:
>
> sry, there is an error with posting, I cant post the full text:

[v i] = sort (M)
return values are the sorted matrix v and the rowindex i of each value.
Example:
m =  3 2
 1 4
 6 5

[v i] = sort(m)

v =  1 2
 3 4
 6 5

i =  2 1
 1 2
 3 3

What is the best way to get the same results (sorted matrix, and indices) 
in Julia?



[julia-users] Best way to get indices and values at sorting (rows/columns of) a matrix?

2016-05-09 Thread Hakuna M.
Hi there, I'm new to Julia but have some experience with Matlab.

To sort each column of a matrix M ( r rows, c columns) I can write in 
Matlab:
test


Re: [julia-users] How to display the value of a variable in the title of a plot?

2016-05-09 Thread chobbes158
Steven - Sorry. I just saw your last reply. 

Thanks for the hints. `close("all")` works absolutely superbly. But Qt 
backend is far beyond my universe. 

Thanks again! 

On Friday, May 6, 2016 at 6:17:12 PM UTC+1, Steven G. Johnson wrote:
>
>
>
> On Friday, May 6, 2016 at 12:55:45 PM UTC-4, chobb...@gmail.com wrote:
>>
>> Tom and Steven,
>>
>> Thanks the hints!!
>>
>> Still, how could I show all current figures by command? That is something 
>> like 'shg' in Matlab. 
>>
>
> I don't think Matplotlib supports this; the only things I could find were 
> specific to the Qt backend:
>
>
> http://stackoverflow.com/questions/8202228/make-matplotlib-plotting-window-pop-up-as-the-active-one
> https://github.com/matplotlib/matplotlib/issues/596
>  
>
>> Also, is there a command to close all current figures, i.e. a counterpart 
>> of 'clf' in Matlab?
>>>
>>>
> close("all") in PyPlot (from the Matplotlib docs). 
>
> In general, if you are using PyPlot and want to know how to do something, 
> just google the matplotlib documentation, and then translate the syntax 
> back to Julia.
>


[julia-users] Re: Set PATH in windows 10

2016-05-09 Thread Duane Wilson
Hi Tony,

If you want to set a PATH environment variable in windows you need to do 
the following:

1) Go to Control Panel, System
2) Click advanced system settings
3) On the advanced tab click Environment Variables
4) Click edit on the PATH variable
5) Add a new folder path that points to the .\bin in the folder where you 
installed Julia.



On Friday, May 6, 2016 at 2:19:59 AM UTC-3, Yu Tony wrote:

> Hello everyone!
> I'm a beginner in programming; i have trouble finding the bin folder and 
> setting PATH environment variales for Julia;
> Can anyone please tell me where to find the bin folder and what is the 
> directory to set the PATH environment variable to ?
>
> Thankyou for your help,
> Tony
>


[julia-users] Re: Pkg.publish problem

2016-05-09 Thread Robert DJ
It works -- and so is publish. Thanks!

On Monday, May 9, 2016 at 9:45:52 AM UTC+2, Kristoffer Carlsson wrote:
>
> You can delete the tag and recreate it or force push to update the tag. 
> This thread seems to have a lot of good information: 
> http://stackoverflow.com/questions/19298600/tag-already-exists-in-the-remote-error-after-recreating-the-git-tag



Re: [julia-users] Set PATH in windows 10

2016-05-09 Thread Michele Zaffalon
When Julia installs, it creates a link in the Start menu. If you right
click on the Julia icon, you should be able to figure out the path to the
Julia executable, julia.exe. That path should be ending with
...\bin\julia.exe.


On Fri, May 6, 2016 at 6:56 AM, Yu Tony  wrote:

> Hello everyone!
> I'm a beginner in programming; i have trouble finding the bin folder and
> setting PATH environment variales for Julia;
> Can anyone please tell me where to find the bin folder and what is the
> directory to set the PATH environment variable to ?
>
> Thankyou for your help,
> Tony
>


Re: [julia-users] Oracle ODBC

2016-05-09 Thread Stefan Karpinski
You have to install ODBC drivers yourself – the Julia package just provides
an interface to them.

On Mon, May 9, 2016 at 5:27 AM, John Kim  wrote:

> Hello
>
> I'm new to Julia and would like to start using it for various projects.
> One such project requires me to access an Oracle database.  when using the
> ODBC package, the listdrivers() command only shows PostgreSQL and MySQL
> drivers installed by default.  Are Oracle drivers available for Julia?
>


[julia-users] Oracle ODBC

2016-05-09 Thread John Kim
Hello

I'm new to Julia and would like to start using it for various projects. 
 One such project requires me to access an Oracle database.  when using the 
ODBC package, the listdrivers() command only shows PostgreSQL and MySQL 
drivers installed by default.  Are Oracle drivers available for Julia?  


[julia-users] Displaying lambdas, zetas, and the rest of the unicode staff in the formulas

2016-05-09 Thread Андрей Логунов
When testing some of the functionality involving lambdas I encountered a 
problem with displaying a math symbol for lambda, like in A*V[:,1] - 
λ[1]*V[:,1], and later on discovered a disheartening news that the whole 
thing doesn't work for me, including s = "\u2200 x \u2203 y" .  What I get 
is just question marks (?) in return. I'm using a 0.4.5 version and Windows 
8.1. And my default code table is cyrillic. I guess there is a solution to 
this which I do not know. 
Thanks in advsnce.


[julia-users] Displaying lambdas, zetas, and the rest of the unicode staff in the formulas

2016-05-09 Thread Андрей Логунов

When testing some of the functionality involving lambdas I encountered a 
problem with displaying a math symbol for lambda, like in A*V[:,1] - 
λ[1]*V[:,1], and later on discovered a disheartening news that the whole 
thing doesn't work for me, including s = "\u2200 x \u2203 y" .  What I get 
is just question marks (?) in return. I'm using a 0.4.5 version and Windows 
8.1. And my default code table is cyrillic. I guess there is a solution to 
this which I do not know. 
Thanks in advsnce.


[julia-users] Pkg.publish problem

2016-05-09 Thread Kristoffer Carlsson
You can delete the tag and recreate it or force push to update the tag. This 
thread seems to have a lot of good information: 
http://stackoverflow.com/questions/19298600/tag-already-exists-in-the-remote-error-after-recreating-the-git-tag