[julia-users] Swapping two columns (or rows) of an array efficiently

2014-11-29 Thread Ivar Nesje
If you know BLAS, you'll likely be able to use Base.LinAlg.BLAS, that is a 
direct wrapper. Not sure if there is a more convenient way. 

Re: [julia-users] Julia on ARM Radxa Rock Pro Quad Core

2014-11-29 Thread Jameson Nash
`killall -USR1 julia`

On Sun Nov 30 2014 at 2:36:37 AM Airhead Bit  wrote:

> Finished compiling, Lots of warnings, %CPU at 299~310, Used your below
> test and mine is the same.
> How can we find what is spinning all the CPU cycles?
>
>
> 
>
>
> On Saturday, November 29, 2014 9:17:33 PM UTC-7, Viral Shah wrote:
>
>> However, upon building, it looks ok, and peakflops() which was crashing
>> for me before works fine now.
>>
>> julia> Base.LinAlg.BlasInt
>> Int32
>>
>> julia> Base.USE_BLAS64
>> false
>>
>>
>> -viral
>>
>>
>>
>> > On 30-Nov-2014, at 9:31 am, Viral Shah  wrote:
>> >
>> > Interestingly, I get the same error now. I had cleaned out the whole
>> openblas directory before starting the build.
>> >
>> > -viral
>> >
>> >
>> >
>>
> >> On 30-Nov-2014, at 6:14 am, Isaiah Norton  wrote:
>> >>
>> >> You will probably need to do `make -C deps clean-openblas` first (or
>> just remove the openblas-0.2.12 subdirectory).
>> >>
>>
> >> On Sat, Nov 29, 2014 at 7:01 PM, Airhead Bit 
>> wrote:
>> >> git pull
>> >> verified that ARM.inc was updated with USE_BLAS64=0
>> >> Same error message : ErrorException("BLAS and LAPACK are compiled with
>> 32-bit integer support, but Julia expects 64-bit integers. Please build
>> Julia with USE_BLAS64=0.")
>> >> Unit still compiling.
>> >>
>> >>
>> >> On Saturday, November 29, 2014 1:03:32 AM UTC-7, Viral Shah wrote:
>> >> I added USE_BLAS64=0 to ARM.inc. Could you git pull and try again?
>> >>
>> >> -viral
>> >>
>> >>
>> >>
>> >>> On 29-Nov-2014, at 1:01 pm, Airhead Bit  wrote:
>> >>>
>> >>> Yes, followed the directions made a Make.user added the include
>> ARM.inc if I had not I don't think the compile would have completed, no x86
>> stuff on the Radxa box where I compiled it.
>> >>> No, I don't think an ARMv8 would even run ARM7 code, not sure.
>> >>> Radxa Rock Pro is ARM7 hfp with an ARM9 (quad core ARM7) 2GB memory,
>> 8GB Flash, desktop box, nice for working with Android.
>> >>>
>> >>> Should I add USE_BLAS64=0 to the Make.user and re-compile?
>> >>> Is there a way to have make testall load juliadebug test/all?
>> >>>
>> >>>
>> >>>
>> >>> On Friday, November 28, 2014 11:18:39 AM UTC-7, Airhead Bit wrote:
>> >>> Just finished compiling one Error:
>> >>> Warning: error initializing module LinAlg:
>> >>> ErrorException("BLAS and LAPACK are compiled with 32-bit integer
>> support, but Julia expects 64-bit integers. Please build Julia with
>> USE_BLAS64=0.")
>> >>> exports.jl
>> >>>
>> >>> Julia works at the prompt but: TOP shows 400% CPU...
>> >>>
>> >>> root@radxa:~/julia# make testall
>> >>>JULIA test/all
>> >>> Master process (id 1) could not connect within 60.0 seconds.
>> >>> exiting.
>> >>> Master process (id 1) could not connect within 60.0 seconds.
>> >>> exiting.
>> >>> Master process (id 1) could not connect within 60.0 seconds.
>> >>> exiting.
>> >>> Worker 5 terminated.
>> >>> Worker 4 terminated.Worker 2 terminated.
>> >>>
>> >>> Eventually I was left with two Julia process's that each took 198.n%
>> until I killed the terminal
>> >>> I'm going to build a clean system and build adding USE_BLAS64=0 in
>> the Make.user file.
>> >>>
>> >>> Any other ideas for a build?
>> >>> Any ideas on how to tell what is sucking all the CPU?
>> >>>
>> >>>
>> >>
>> >>
>> >
>>
>>


Re: [julia-users] Julia on ARM Radxa Rock Pro Quad Core

2014-11-29 Thread Airhead Bit
Finished compiling, Lots of warnings, %CPU at 299~310, Used your below test 
and mine is the same.
How can we find what is spinning all the CPU cycles?




On Saturday, November 29, 2014 9:17:33 PM UTC-7, Viral Shah wrote:
>
> However, upon building, it looks ok, and peakflops() which was crashing 
> for me before works fine now. 
>
> julia> Base.LinAlg.BlasInt 
> Int32 
>
> julia> Base.USE_BLAS64 
> false 
>
>
> -viral 
>
>
>
> > On 30-Nov-2014, at 9:31 am, Viral Shah > 
> wrote: 
> > 
> > Interestingly, I get the same error now. I had cleaned out the whole 
> openblas directory before starting the build. 
> > 
> > -viral 
> > 
> > 
> > 
> >> On 30-Nov-2014, at 6:14 am, Isaiah Norton  > wrote: 
> >> 
> >> You will probably need to do `make -C deps clean-openblas` first (or 
> just remove the openblas-0.2.12 subdirectory). 
> >> 
> >> On Sat, Nov 29, 2014 at 7:01 PM, Airhead Bit  > wrote: 
> >> git pull 
> >> verified that ARM.inc was updated with USE_BLAS64=0 
> >> Same error message : ErrorException("BLAS and LAPACK are compiled with 
> 32-bit integer support, but Julia expects 64-bit integers. Please build 
> Julia with USE_BLAS64=0.") 
> >> Unit still compiling. 
> >> 
> >> 
> >> On Saturday, November 29, 2014 1:03:32 AM UTC-7, Viral Shah wrote: 
> >> I added USE_BLAS64=0 to ARM.inc. Could you git pull and try again? 
> >> 
> >> -viral 
> >> 
> >> 
> >> 
> >>> On 29-Nov-2014, at 1:01 pm, Airhead Bit  wrote: 
> >>> 
> >>> Yes, followed the directions made a Make.user added the include 
> ARM.inc if I had not I don't think the compile would have completed, no x86 
> stuff on the Radxa box where I compiled it. 
> >>> No, I don't think an ARMv8 would even run ARM7 code, not sure. 
> >>> Radxa Rock Pro is ARM7 hfp with an ARM9 (quad core ARM7) 2GB memory, 
> 8GB Flash, desktop box, nice for working with Android. 
> >>> 
> >>> Should I add USE_BLAS64=0 to the Make.user and re-compile? 
> >>> Is there a way to have make testall load juliadebug test/all? 
> >>> 
> >>> 
> >>> 
> >>> On Friday, November 28, 2014 11:18:39 AM UTC-7, Airhead Bit wrote: 
> >>> Just finished compiling one Error: 
> >>> Warning: error initializing module LinAlg: 
> >>> ErrorException("BLAS and LAPACK are compiled with 32-bit integer 
> support, but Julia expects 64-bit integers. Please build Julia with 
> USE_BLAS64=0.") 
> >>> exports.jl 
> >>> 
> >>> Julia works at the prompt but: TOP shows 400% CPU... 
> >>> 
> >>> root@radxa:~/julia# make testall 
> >>>JULIA test/all 
> >>> Master process (id 1) could not connect within 60.0 seconds. 
> >>> exiting. 
> >>> Master process (id 1) could not connect within 60.0 seconds. 
> >>> exiting. 
> >>> Master process (id 1) could not connect within 60.0 seconds. 
> >>> exiting. 
> >>> Worker 5 terminated. 
> >>> Worker 4 terminated.Worker 2 terminated. 
> >>> 
> >>> Eventually I was left with two Julia process's that each took 198.n% 
> until I killed the terminal 
> >>> I'm going to build a clean system and build adding USE_BLAS64=0 in the 
> Make.user file. 
> >>> 
> >>> Any other ideas for a build? 
> >>> Any ideas on how to tell what is sucking all the CPU? 
> >>> 
> >>> 
> >> 
> >> 
> > 
>
>

[julia-users] removing function completely?

2014-11-29 Thread Daniel Høegh
Just restart the terminal.

Re: [julia-users] Re: Seeking feedback on first project

2014-11-29 Thread Matt Gushee
Hi, John--

On Saturday, November 29, 2014 7:19:07 PM UTC-7, John Myles White wrote:
>
> No, it was a serious question. I wanted to check if my understanding that 
> someone was already trying to wrap HiRedis was right given that you were 
> expressing skepticism about the possiblity of doing so.
>

Oh, well, no offense taken, and none given, I hope. As for the skepticism 
you refer to, I'm only skeptical of *my* ability to do that work; as I 
said, I'm not much of a C programmer. I think you would have to write a 
compatibility layer in C; I can even roughly imagine how to do it, but if I 
wrote that code it would probably dump core all over the planet.

>
> I would like us to have one official Redis library at some point, but I’m 
> always happy to see people giving themselves fun projects to learn Julia.
>

Agreed. Anyway, none of these is official yet, so I guess we'll just see 
what happens.

--
Matt Gushee


[julia-users] removing function completely?

2014-11-29 Thread ivo welch

true beginner's question: after I have defined a function (possibly 
multiple dispatch), how do I remove it again??



[julia-users] perl-like regex matching parenthesis

2014-11-29 Thread ivo welch

in perl, there is a nice package feature that allows parsing text like 
latex macros which have matching parens.

use Text::Balanced qw(extract_multiple extract_bracketed);


does something like this exist (already) in julia ?



Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Hans W Borchers
Thanks, Mike, but in Linux ALT will drag the whole window, not the cursor.

On Saturday, November 29, 2014 4:30:05 PM UTC+1, Mike Innes wrote:

> (PS Hans: You can do block selection in LT by dragging with the alt key)
>
>

Re: [julia-users] Re: Type Casting Weirdness?

2014-11-29 Thread Christoph Ortner
ok - thanks for pointing out that discussion.
   Christoph


On Saturday, 29 November 2014 21:51:55 UTC, Milan Bouchet-Valat wrote:
>
> Le samedi 29 novembre 2014 à 12:46 -0800, Christoph Ortner a écrit : 
> > 
> > 
> > When I want to just write a quick script to test and idea, then I 
> > don't want to check that I've created my indices, array lengths etc as 
> > the correct type. I think for functions such as linspace not 
> > performing an automatic type conversion is a big mistake. 
> > 
> > 
> > I thought that in previous Julia verions   `int32(1.1)`  would throw 
> > an error (maybe I misremember this). Now it just converts it to 1. I 
> > then agree that this is a bit dangerous. It should throw an error 
> > because 1.1 cannot be converted  to int. This would resolve the issue 
> > --- but of course there may be others that I don't appreciate. 
> The future of int32(), int() and the like is not completely clear at the 
> moment, especially with regard to the fact that they currently coerce, 
> i.e. don't fail when exact conversion is not possible. See 
> https://github.com/JuliaLang/julia/issues/1470 
>
>
> Regards 
>
> > 
> >Christoph 
> > 
> > 
> > 
> > 
> > On Saturday, 29 November 2014 13:22:05 UTC, Tamas Papp wrote: 
> > In general, I am more concerned about the following scenario: 
> > type A 
> > makes sense, type B in general, does not, yet a subset of type 
> > B values 
> > can be converted to A in a reasonable way, so an the 
> > implementation 
> > performs this silently and everything seems fine. 
> > 
> > But at the same time, had I known that I left a type B value 
> > in there, I 
> > would be concerned, eg because I am assuming that it is exact 
> > when it 
> > isn't (integers vs floats) is problematic, or that conversion 
> > is 
> > possible only for a subset of the domain, and other values are 
> > possible 
> > but rare enough for my unit tests not to discover them, and 
> > will strike 
> > me on the nose at some future point like a rake carelessly 
> > left in the 
> > grass. 
> > 
> > Best, 
> > 
> > Tamas 
> > 
> > On Sat, Nov 29 2014, Stefan Karpinski  
> > wrote: 
> > 
> > > Our conversions throw errors when the value cannot be 
> > converted exactly these days so it could be done pretty 
> > safely. But yes, this is just because there's no applicable 
> > method of linspace. 
> > > 
> > > 
> > >> On Nov 29, 2014, at 7:07 AM, Tamas Papp  
> > wrote: 
> > >> 
> > >> I think of this as a feature: using a float when only an 
> > integer makes 
> > >> sense is most likely a bug in my code. Automatic conversion 
> > would mask 
> > >> the problem. 
> > >> 
> > >> Best, 
> > >> 
> > >> Tamas 
> > >> 
> > >>> On Sat, Nov 29 2014, ele...@gmail.com wrote: 
> > >>> 
> > >>> One of the primary paradigms of Julia is the use of 
> > multiple dispatch, that 
> > >>> is choosing which method to call based on the types of the 
> > parameters 
> > >>> provided.  To quote from the manual 
> > >>> 
> > 
> http://docs.julialang.org/en/latest/manual/methods/#defining-methods "No 
> > >>> automatic casting or conversion of function arguments is 
> > ever performed: 
> > >>> all conversion in Julia is non-magical and completely 
> > explicit." 
> > >>> 
> > >>> Cheers 
> > >>> Lex 
> > >>> 
> >  On Saturday, November 29, 2014 8:17:26 PM UTC+10, 
> > Christoph Ortner wrote: 
> >  
> >  
> >  In Julia 3.3  `linspace(0, 1, 10) `  works, but 
> >  `linspace(0, 1, 10.)` 
> >  does not. 
> >  
> >  Why is the type not automatically converted to Int when 
> > possible? Is this 
> >  intended or a bug? 
> >  
> > Christoph 
> >  
> >  
> >  
> >  
> >  
> >  
> >  
> >  
>
>

Re: [julia-users] Julia on ARM Radxa Rock Pro Quad Core

2014-11-29 Thread Viral Shah
Yes, the ARM nomenclature is a huge alphabet soup. This could be handy, I 
suppose:

http://en.wikipedia.org/wiki/List_of_ARM_microarchitectures

-viral



> On 30-Nov-2014, at 1:38 am, Airhead Bit  wrote:
> 
> Another Correction:
>  The RK3188 features a quad-core ARM Cortex-A9  - The RK3288 is based on the 
> Quad Core Cortex-A17
> The Radxa Rock Pro is a RK3188 Cortex-A9
> It's like ARM has a dice shaker with letters and number and each letter and 
> number has it's own dice shaker, add to the the convoluted information on the 
> internet your head explodes.
>
> On Saturday, November 29, 2014 12:02:11 PM UTC-7, Airhead Bit wrote:
> Correction: Quad-Core Cortex-A17 is an ARMv7 based product RK3188 - I have no 
> idea where I got ARM9 from
> 
> On Saturday, November 29, 2014 12:31:28 AM UTC-7, Airhead Bit wrote:
> Yes, followed the directions made a Make.user added the include ARM.inc if I 
> had not I don't think the compile would have completed, no x86 stuff on the 
> Radxa box where I compiled it.
> No, I don't think an ARMv8 would even run ARM7 code, not sure.
> Radxa Rock Pro is ARM7 hfp with an ARM9 (quad core ARM7) 2GB memory, 8GB 
> Flash, desktop box, nice for working with Android.
>  
> Should I add USE_BLAS64=0 to the Make.user and re-compile?
> Is there a way to have make testall load juliadebug test/all?
> 
> 
> 
> On Friday, November 28, 2014 11:18:39 AM UTC-7, Airhead Bit wrote:
> Just finished compiling one Error: 
> Warning: error initializing module LinAlg:
> ErrorException("BLAS and LAPACK are compiled with 32-bit integer support, but 
> Julia expects 64-bit integers. Please build Julia with USE_BLAS64=0.")
> exports.jl
> 
> Julia works at the prompt but: TOP shows 400% CPU... 
> 
> root@radxa:~/julia# make testall
> JULIA test/all
> Master process (id 1) could not connect within 60.0 seconds.
> exiting.
> Master process (id 1) could not connect within 60.0 seconds.
> exiting.
> Master process (id 1) could not connect within 60.0 seconds.
> exiting.
> Worker 5 terminated.
> Worker 4 terminated.Worker 2 terminated.
> 
> Eventually I was left with two Julia process's that each took 198.n% until I 
> killed the terminal
> I'm going to build a clean system and build adding USE_BLAS64=0 in the 
> Make.user file.
> 
> Any other ideas for a build? 
> Any ideas on how to tell what is sucking all the CPU?
>  
> 



Re: [julia-users] Julia on ARM Radxa Rock Pro Quad Core

2014-11-29 Thread Viral Shah
However, upon building, it looks ok, and peakflops() which was crashing for me 
before works fine now.

julia> Base.LinAlg.BlasInt
Int32

julia> Base.USE_BLAS64
false


-viral



> On 30-Nov-2014, at 9:31 am, Viral Shah  wrote:
> 
> Interestingly, I get the same error now. I had cleaned out the whole openblas 
> directory before starting the build.
> 
> -viral
> 
> 
> 
>> On 30-Nov-2014, at 6:14 am, Isaiah Norton  wrote:
>> 
>> You will probably need to do `make -C deps clean-openblas` first (or just 
>> remove the openblas-0.2.12 subdirectory).
>> 
>> On Sat, Nov 29, 2014 at 7:01 PM, Airhead Bit  wrote:
>> git pull
>> verified that ARM.inc was updated with USE_BLAS64=0
>> Same error message : ErrorException("BLAS and LAPACK are compiled with 
>> 32-bit integer support, but Julia expects 64-bit integers. Please build 
>> Julia with USE_BLAS64=0.") 
>> Unit still compiling.
>> 
>> 
>> On Saturday, November 29, 2014 1:03:32 AM UTC-7, Viral Shah wrote:
>> I added USE_BLAS64=0 to ARM.inc. Could you git pull and try again? 
>> 
>> -viral 
>> 
>> 
>> 
>>> On 29-Nov-2014, at 1:01 pm, Airhead Bit  wrote: 
>>> 
>>> Yes, followed the directions made a Make.user added the include ARM.inc if 
>>> I had not I don't think the compile would have completed, no x86 stuff on 
>>> the Radxa box where I compiled it. 
>>> No, I don't think an ARMv8 would even run ARM7 code, not sure. 
>>> Radxa Rock Pro is ARM7 hfp with an ARM9 (quad core ARM7) 2GB memory, 8GB 
>>> Flash, desktop box, nice for working with Android. 
>>> 
>>> Should I add USE_BLAS64=0 to the Make.user and re-compile? 
>>> Is there a way to have make testall load juliadebug test/all? 
>>> 
>>> 
>>> 
>>> On Friday, November 28, 2014 11:18:39 AM UTC-7, Airhead Bit wrote: 
>>> Just finished compiling one Error: 
>>> Warning: error initializing module LinAlg: 
>>> ErrorException("BLAS and LAPACK are compiled with 32-bit integer support, 
>>> but Julia expects 64-bit integers. Please build Julia with USE_BLAS64=0.") 
>>> exports.jl 
>>> 
>>> Julia works at the prompt but: TOP shows 400% CPU... 
>>> 
>>> root@radxa:~/julia# make testall 
>>>JULIA test/all 
>>> Master process (id 1) could not connect within 60.0 seconds. 
>>> exiting. 
>>> Master process (id 1) could not connect within 60.0 seconds. 
>>> exiting. 
>>> Master process (id 1) could not connect within 60.0 seconds. 
>>> exiting. 
>>> Worker 5 terminated. 
>>> Worker 4 terminated.Worker 2 terminated. 
>>> 
>>> Eventually I was left with two Julia process's that each took 198.n% until 
>>> I killed the terminal 
>>> I'm going to build a clean system and build adding USE_BLAS64=0 in the 
>>> Make.user file. 
>>> 
>>> Any other ideas for a build? 
>>> Any ideas on how to tell what is sucking all the CPU? 
>>> 
>>> 
>> 
>> 
> 



Re: [julia-users] Julia on ARM Radxa Rock Pro Quad Core

2014-11-29 Thread Viral Shah
Interestingly, I get the same error now. I had cleaned out the whole openblas 
directory before starting the build.

-viral



> On 30-Nov-2014, at 6:14 am, Isaiah Norton  wrote:
> 
> You will probably need to do `make -C deps clean-openblas` first (or just 
> remove the openblas-0.2.12 subdirectory).
> 
> On Sat, Nov 29, 2014 at 7:01 PM, Airhead Bit  wrote:
> git pull
> verified that ARM.inc was updated with USE_BLAS64=0
> Same error message : ErrorException("BLAS and LAPACK are compiled with 32-bit 
> integer support, but Julia expects 64-bit integers. Please build Julia with 
> USE_BLAS64=0.") 
> Unit still compiling.
> 
> 
> On Saturday, November 29, 2014 1:03:32 AM UTC-7, Viral Shah wrote:
> I added USE_BLAS64=0 to ARM.inc. Could you git pull and try again? 
> 
> -viral 
> 
> 
> 
> > On 29-Nov-2014, at 1:01 pm, Airhead Bit  wrote: 
> > 
> > Yes, followed the directions made a Make.user added the include ARM.inc if 
> > I had not I don't think the compile would have completed, no x86 stuff on 
> > the Radxa box where I compiled it. 
> > No, I don't think an ARMv8 would even run ARM7 code, not sure. 
> > Radxa Rock Pro is ARM7 hfp with an ARM9 (quad core ARM7) 2GB memory, 8GB 
> > Flash, desktop box, nice for working with Android. 
> >   
> > Should I add USE_BLAS64=0 to the Make.user and re-compile? 
> > Is there a way to have make testall load juliadebug test/all? 
> > 
> > 
> > 
> > On Friday, November 28, 2014 11:18:39 AM UTC-7, Airhead Bit wrote: 
> > Just finished compiling one Error: 
> > Warning: error initializing module LinAlg: 
> > ErrorException("BLAS and LAPACK are compiled with 32-bit integer support, 
> > but Julia expects 64-bit integers. Please build Julia with USE_BLAS64=0.") 
> > exports.jl 
> > 
> > Julia works at the prompt but: TOP shows 400% CPU... 
> > 
> > root@radxa:~/julia# make testall 
> > JULIA test/all 
> > Master process (id 1) could not connect within 60.0 seconds. 
> > exiting. 
> > Master process (id 1) could not connect within 60.0 seconds. 
> > exiting. 
> > Master process (id 1) could not connect within 60.0 seconds. 
> > exiting. 
> > Worker 5 terminated. 
> > Worker 4 terminated.Worker 2 terminated. 
> > 
> > Eventually I was left with two Julia process's that each took 198.n% until 
> > I killed the terminal 
> > I'm going to build a clean system and build adding USE_BLAS64=0 in the 
> > Make.user file. 
> > 
> > Any other ideas for a build? 
> > Any ideas on how to tell what is sucking all the CPU? 
> >   
> > 
> 
> 



[julia-users] Linter for Julia: any alternatives for Atom or Brackets?

2014-11-29 Thread Pileas
As the title says,

I am wondering whether there is a linter for julia-lang that can be 
installed in Atom Editor or Brackets.

Any suggestion would be welcome.


P.S. Not sure if I should have said welcome or welcomed ...



Re: [julia-users] Mutate C struct represented as Julia immutable

2014-11-29 Thread John Myles White
I think the partially modified copy of an immutable problem has been worked on 
a bit by Keno in the past.

 — John

On Nov 24, 2014, at 3:34 PM, Eric Davies  wrote:

> On Friday, 21 November 2014 09:44:27 UTC-6, Steven G. Johnson wrote:
> 
> On Thursday, November 20, 2014 5:37:22 PM UTC-5, Eric Davies wrote:
> (For context, I'm working on this issue: 
> https://github.com/JuliaOpt/ECOS.jl/issues/12 and dealing with these structs: 
> https://github.com/JuliaOpt/ECOS.jl/blob/master/src/types.jl#L124-L216 )
> 
> I have a C struct used in a 3rd-party C library mirrored as an immutable in 
> Julia. A pointer to the C struct is returned in another C struct, and I get 
> the immutable using pointer_to_array(...)[1]. I want to be able to modify 
> fields of the struct in-place, but immutables disallow this. How do I go 
> about this? 
> 
> Why not just use pointer_to_array(...)[1] = ...new immutable..., or 
> unsafe_store!(pointer-to-immutable, new immutable) to store a new struct 
> (build from the old struct + modifications) in the old location?
> 
> I did not know you could do those things, thanks. In general I feel that set 
> of functions is not well-explained in the documentation.
> 
> I wish there was a way to programmatically create an immutable from another 
> immutable and modified field names/values. I think my solution right now is 
> iterate over all the fields in order and check if they're to be modified, 
> store the resulting modified+unchanged values into a list and splat the list 
> in the constructor. Seems like there could be a better way to do it.  



Re: [julia-users] Julia on ARM Radxa Rock Pro Quad Core

2014-11-29 Thread Airhead Bit
Thanks, I'll try again

On Saturday, November 29, 2014 5:44:18 PM UTC-7, Isaiah wrote:
>
> You will probably need to do `make -C deps clean-openblas` first (or just 
> remove the openblas-0.2.12 subdirectory).
>
> On Sat, Nov 29, 2014 at 7:01 PM, Airhead Bit  > wrote:
>
>> git pull
>> verified that ARM.inc was updated with USE_BLAS64=0
>> Same error message : ErrorException("BLAS and LAPACK are compiled with 
>> 32-bit integer support, but Julia expects 64-bit integers. Please build 
>> Julia with USE_BLAS64=0.") 
>> Unit still compiling.
>>
>>
>> On Saturday, November 29, 2014 1:03:32 AM UTC-7, Viral Shah wrote:
>>>
>>> I added USE_BLAS64=0 to ARM.inc. Could you git pull and try again? 
>>>
>>> -viral 
>>>
>>>
>>>
>>> > On 29-Nov-2014, at 1:01 pm, Airhead Bit  wrote: 
>>> > 
>>> > Yes, followed the directions made a Make.user added the include 
>>> ARM.inc if I had not I don't think the compile would have completed, no x86 
>>> stuff on the Radxa box where I compiled it. 
>>> > No, I don't think an ARMv8 would even run ARM7 code, not sure. 
>>> > Radxa Rock Pro is ARM7 hfp with an ARM9 (quad core ARM7) 2GB memory, 
>>> 8GB Flash, desktop box, nice for working with Android. 
>>> >   
>>> > Should I add USE_BLAS64=0 to the Make.user and re-compile? 
>>> > Is there a way to have make testall load juliadebug test/all? 
>>> > 
>>> > 
>>> > 
>>> > On Friday, November 28, 2014 11:18:39 AM UTC-7, Airhead Bit wrote: 
>>> > Just finished compiling one Error: 
>>> > Warning: error initializing module LinAlg: 
>>> > ErrorException("BLAS and LAPACK are compiled with 32-bit integer 
>>> support, but Julia expects 64-bit integers. Please build Julia with 
>>> USE_BLAS64=0.") 
>>> > exports.jl 
>>> > 
>>> > Julia works at the prompt but: TOP shows 400% CPU... 
>>> > 
>>> > root@radxa:~/julia# make testall 
>>> > JULIA test/all 
>>> > Master process (id 1) could not connect within 60.0 seconds. 
>>> > exiting. 
>>> > Master process (id 1) could not connect within 60.0 seconds. 
>>> > exiting. 
>>> > Master process (id 1) could not connect within 60.0 seconds. 
>>> > exiting. 
>>> > Worker 5 terminated. 
>>> > Worker 4 terminated.Worker 2 terminated. 
>>> > 
>>> > Eventually I was left with two Julia process's that each took 198.n% 
>>> until I killed the terminal 
>>> > I'm going to build a clean system and build adding USE_BLAS64=0 in the 
>>> Make.user file. 
>>> > 
>>> > Any other ideas for a build? 
>>> > Any ideas on how to tell what is sucking all the CPU? 
>>> >   
>>> > 
>>>
>>>
>

[julia-users] Text editor for Julia: SynWrite

2014-11-29 Thread Alex Ed



SynWrite editor supports Julia lexer. You need to call "Options - Addons 
manager - Install", type "Julia" at the dialog, and select "Lexer Julia" 
item to install.
Call J lexer via statusbar clicking (if file ext is not JL) or it's called 
automatical.

Tree with funcs is here (left panel called "Tree").
Multi-carets like in Sublime Text, also here


 


Re: [julia-users] Re: Seeking feedback on first project

2014-11-29 Thread John Myles White
No, it was a serious question. I wanted to check if my understanding that 
someone was already trying to wrap HiRedis was right given that you were 
expressing skepticism about the possiblity of doing so.

I would like us to have one official Redis library at some point, but I’m 
always happy to see people giving themselves fun projects to learn Julia.

 — John

On Nov 29, 2014, at 5:53 PM, Matt Gushee  wrote:

> Hi, John--
> 
> On Saturday, November 29, 2014 6:15:36 PM UTC-7, John Myles White wrote:
> Isn’t this library already a wrapper for Hiredis: 
> https://github.com/markmo/HiRedis.jl ?
> 
> Isn't that a rhetorical question?
> 
> If you're trying to make me feel like I've wasted my time, it's not going to 
> work ;-) Even if my project never becomes the Redis-client-of-choice for 
> Julia, it's proving to be a great learning experience. And it occurs to me, 
> too, that when I get around to performance testing, it might be very 
> interesting to compare the pure Julia version with the C-wrapper version.
> 
> --
> Matt Gushee



Re: [julia-users] Re: Seeking feedback on first project

2014-11-29 Thread Matt Gushee
Hi, John--

On Saturday, November 29, 2014 6:15:36 PM UTC-7, John Myles White wrote:
>
> Isn’t this library already a wrapper for Hiredis: 
> https://github.com/markmo/HiRedis.jl ?
>

Isn't that a rhetorical question?

If you're trying to make me feel like I've wasted my time, it's not going 
to work ;-) Even if my project never becomes the Redis-client-of-choice for 
Julia, it's proving to be a great learning experience. And it occurs to me, 
too, that when I get around to performance testing, it might be very 
interesting to compare the pure Julia version with the C-wrapper version.

--
Matt Gushee


Re: [julia-users] Re: Seeking feedback on first project

2014-11-29 Thread John Myles White
Isn’t this library already a wrapper for Hiredis: 
https://github.com/markmo/HiRedis.jl ?

 — John

On Nov 29, 2014, at 5:14 PM, Matt Gushee  wrote:

> Hi, Avik--
> 
> On Saturday, November 29, 2014 4:13:18 PM UTC-7, Avik Sengupta wrote:
> 
> Thanks, that looks good. There was  another effort at a Redis client 
> https://github.com/msainz/Redis.jl .
> 
> Oh, interesting. It didn't occur to me to search GitHub, but I did verify 
> that there was no Redis client in the official package directory before 
> starting. Anyway, the Redis API & protocol are pretty simple - I think I've 
> spent about 6 hours on the project so far, including a lot of 
> documentation-checking.
>  
> 
> 
> If would be good to see some performance numbers. Is there a significant 
> overhead of using a Julia client? 
> 
> Good question, and I would be interested to know that too. I don't know much 
> about database performance testing - any suggestions about where to start 
> with that?
> 
> BTW, I was considering writing a wrapper to the hiredis C library, but it 
> looked like Julia doesn't provide a good facility for handling the structs 
> that are returned by some of the hiredis functions - and I'm not much of a C 
> programmer, so I figured a pure Julia client would be a much safer way to go.
> 
> --
> Matt Gushee 



[julia-users] Re: Seeking feedback on first project

2014-11-29 Thread Matt Gushee
Hi, Avik--

On Saturday, November 29, 2014 4:13:18 PM UTC-7, Avik Sengupta wrote:
>
>
> Thanks, that looks good. There was  another effort at a Redis client 
> https://github.com/msainz/Redis.jl .
>

Oh, interesting. It didn't occur to me to search GitHub, but I did verify 
that there was no Redis client in the official package directory before 
starting. Anyway, the Redis API & protocol are pretty simple - I think I've 
spent about 6 hours on the project so far, including a lot of 
documentation-checking.
 

>
>
> If would be good to see some performance numbers. Is there a significant 
> overhead of using a Julia client? 
>

Good question, and I would be interested to know that too. I don't know 
much about database performance testing - any suggestions about where to 
start with that?

BTW, I was considering writing a wrapper to the hiredis C library, but it 
looked like Julia doesn't provide a good facility for handling the structs 
that are returned by some of the hiredis functions - and I'm not much of a 
C programmer, so I figured a pure Julia client would be a much safer way to 
go.

--
Matt Gushee 


Re: [julia-users] Different type columns in Matrix

2014-11-29 Thread Kenan KARAGÜL
Hi Jeff,
Thank you very much your responses,
I am sorry I didn't understand your answer because I dont know what does it 
mean f,g and h.
But I want to get this structure and later I have to get by the 3rd column 
decreasing order in this structure. And than I can use 1 st and 2nd columns 
together.
Another concepts composite type i dont understand.

regards
Kenan

29 Kasım 2014 Cumartesi 17:09:27 UTC-5 tarihinde Jeff Waller yazdı:
>
>
>> This 3 column are neccessary for later analysis in my work, first and 
>> second column index and 3rd values. I have to use three columns same time.
>>
>
> Ok right so, whatever the exact expression is, it's going to have the form
>
> f(A[:,1:2])
>
> where f does some indexing function followed sometime later by
>
> g(A[:,3])
>
> where g does some value stuff. 
>
> but you don't have
>
> h(A[:,1:3])
>
> because there's no builtin thing that does both indexing and evaluation 
> simultaneously
> I'm using f g and h just to short-hand describe what's going on, not to 
> imply
> they are actually called f, g, h or even that they're actually formally 
> functions.  So if that's
> the case then really why not use A and B?  Convenience, Encapsulation? 
>  Sure, that's valid
> but I'm suggesting that those two things are even better served by using 
> composites, because
> then you have the type system working for you instead of against you.
>


Re: [julia-users] Julia on ARM Radxa Rock Pro Quad Core

2014-11-29 Thread Isaiah Norton
You will probably need to do `make -C deps clean-openblas` first (or just
remove the openblas-0.2.12 subdirectory).

On Sat, Nov 29, 2014 at 7:01 PM, Airhead Bit  wrote:

> git pull
> verified that ARM.inc was updated with USE_BLAS64=0
> Same error message : ErrorException("BLAS and LAPACK are compiled with
> 32-bit integer support, but Julia expects 64-bit integers. Please build
> Julia with USE_BLAS64=0.")
> Unit still compiling.
>
>
> On Saturday, November 29, 2014 1:03:32 AM UTC-7, Viral Shah wrote:
>>
>> I added USE_BLAS64=0 to ARM.inc. Could you git pull and try again?
>>
>> -viral
>>
>>
>>
>> > On 29-Nov-2014, at 1:01 pm, Airhead Bit  wrote:
>> >
>> > Yes, followed the directions made a Make.user added the include ARM.inc
>> if I had not I don't think the compile would have completed, no x86 stuff
>> on the Radxa box where I compiled it.
>> > No, I don't think an ARMv8 would even run ARM7 code, not sure.
>> > Radxa Rock Pro is ARM7 hfp with an ARM9 (quad core ARM7) 2GB memory,
>> 8GB Flash, desktop box, nice for working with Android.
>> >
>> > Should I add USE_BLAS64=0 to the Make.user and re-compile?
>> > Is there a way to have make testall load juliadebug test/all?
>> >
>> >
>> >
>> > On Friday, November 28, 2014 11:18:39 AM UTC-7, Airhead Bit wrote:
>> > Just finished compiling one Error:
>> > Warning: error initializing module LinAlg:
>> > ErrorException("BLAS and LAPACK are compiled with 32-bit integer
>> support, but Julia expects 64-bit integers. Please build Julia with
>> USE_BLAS64=0.")
>> > exports.jl
>> >
>> > Julia works at the prompt but: TOP shows 400% CPU...
>> >
>> > root@radxa:~/julia# make testall
>> > JULIA test/all
>> > Master process (id 1) could not connect within 60.0 seconds.
>> > exiting.
>> > Master process (id 1) could not connect within 60.0 seconds.
>> > exiting.
>> > Master process (id 1) could not connect within 60.0 seconds.
>> > exiting.
>> > Worker 5 terminated.
>> > Worker 4 terminated.Worker 2 terminated.
>> >
>> > Eventually I was left with two Julia process's that each took 198.n%
>> until I killed the terminal
>> > I'm going to build a clean system and build adding USE_BLAS64=0 in the
>> Make.user file.
>> >
>> > Any other ideas for a build?
>> > Any ideas on how to tell what is sucking all the CPU?
>> >
>> >
>>
>>


[julia-users] spzeros column vs row vector memory footprint

2014-11-29 Thread Zouhair Mahboubi
I have the following code:

NS = 23^3
TSA = Array(Dict, NS)

for from_i in 1:NS
   TSA[from_i] = Dict()
   for a in 1:6
   TSA[from_i][a] = spzeros(Float32, 1, NS)
   end
end

This gobbles up about 4G of memory. If instead, I use TSA[from_i][a] =
spzeros(Float32, NS, 1) it barely makes a dent in my memory usage.

FYI, I’m using dictionaries here because in my application a’s are actually
tuples of symbols, not integers, and it makes things easier.

The only reason I wrote it as a rowvector is because I need to dot it with
a non-sparse vector b, but unfortunately dot does not support
SparseMatrixCSC so I’m using a' * b instead. I can get away with using the
column vector for now by doing b' * a.

I was surprised at the difference in memory footprint, and I’m curious if
someone would care to explain why that is?

Thanks,
-z
​


Re: [julia-users] max_parallel keyword of addprocs?

2014-11-29 Thread Gabriel Mihalache
I'm on 0.3.2 so that explains it. Thank you!

On Saturday, November 29, 2014 3:29:43 AM UTC-5, Amit Murthy wrote:
>
> This is only supported on 0.4. Which version of Julia are you running?
>
> Yes, you can repeat the same host to addprocs as the number of cores.
>
>

Re: [julia-users] Julia on ARM Radxa Rock Pro Quad Core

2014-11-29 Thread Airhead Bit
git pull
verified that ARM.inc was updated with USE_BLAS64=0
Same error message : ErrorException("BLAS and LAPACK are compiled with 
32-bit integer support, but Julia expects 64-bit integers. Please build 
Julia with USE_BLAS64=0.") 
Unit still compiling.


On Saturday, November 29, 2014 1:03:32 AM UTC-7, Viral Shah wrote:
>
> I added USE_BLAS64=0 to ARM.inc. Could you git pull and try again? 
>
> -viral 
>
>
>
> > On 29-Nov-2014, at 1:01 pm, Airhead Bit  > wrote: 
> > 
> > Yes, followed the directions made a Make.user added the include ARM.inc 
> if I had not I don't think the compile would have completed, no x86 stuff 
> on the Radxa box where I compiled it. 
> > No, I don't think an ARMv8 would even run ARM7 code, not sure. 
> > Radxa Rock Pro is ARM7 hfp with an ARM9 (quad core ARM7) 2GB memory, 8GB 
> Flash, desktop box, nice for working with Android. 
> >   
> > Should I add USE_BLAS64=0 to the Make.user and re-compile? 
> > Is there a way to have make testall load juliadebug test/all? 
> > 
> > 
> > 
> > On Friday, November 28, 2014 11:18:39 AM UTC-7, Airhead Bit wrote: 
> > Just finished compiling one Error: 
> > Warning: error initializing module LinAlg: 
> > ErrorException("BLAS and LAPACK are compiled with 32-bit integer 
> support, but Julia expects 64-bit integers. Please build Julia with 
> USE_BLAS64=0.") 
> > exports.jl 
> > 
> > Julia works at the prompt but: TOP shows 400% CPU... 
> > 
> > root@radxa:~/julia# make testall 
> > JULIA test/all 
> > Master process (id 1) could not connect within 60.0 seconds. 
> > exiting. 
> > Master process (id 1) could not connect within 60.0 seconds. 
> > exiting. 
> > Master process (id 1) could not connect within 60.0 seconds. 
> > exiting. 
> > Worker 5 terminated. 
> > Worker 4 terminated.Worker 2 terminated. 
> > 
> > Eventually I was left with two Julia process's that each took 198.n% 
> until I killed the terminal 
> > I'm going to build a clean system and build adding USE_BLAS64=0 in the 
> Make.user file. 
> > 
> > Any other ideas for a build? 
> > Any ideas on how to tell what is sucking all the CPU? 
> >   
> > 
>
>

Re: [julia-users] Floating-point array types

2014-11-29 Thread John Myles White
Nope. The problem is correctness, not speed. You can’t allow type relationships 
beween containers because the relationship can only be safe for either writing 
data or reading data, but never for both.

 — John

On Nov 29, 2014, at 3:55 PM, K Leo  wrote:

> I remember somewhere it mentioned that there is a performance reason not to 
> have things like Array{Float64} <: Array{FloatingPoint}.  Does this mean the 
> parametric types (defined with T) are slower?
> 
> On 2014年11月30日 05:04, Andreas Noack wrote:
>> You are welcome. It is explained better than I'm able to do here 
>> http://julia.readthedocs.org/en/latest/manual/methods/#parametric-methods
>> 
>> 2014-11-29 15:59 GMT-05:00 Petr Krysl > >:
>> 
>>Thanks, I hear you guys.  These are the concepts, and Julia
>>implements them: The two are concrete types, and hence cannot be
>>derived from each other.
>> 
>>But here it is: An array of floating-point numbers is an array of
>>floating-point numbers.
>> 
>>So how would you write the function so that it is Julia-style and
>>works with any floating-point number?
>> 
>>Thanks a lot,
>> 
>>Petr
>> 
>> 
>> 
> 



Re: [julia-users] Floating-point array types

2014-11-29 Thread K Leo
I remember somewhere it mentioned that there is a performance reason not 
to have things like Array{Float64} <: Array{FloatingPoint}.  Does this 
mean the parametric types (defined with T) are slower?


On 2014年11月30日 05:04, Andreas Noack wrote:
You are welcome. It is explained better than I'm able to do here 
http://julia.readthedocs.org/en/latest/manual/methods/#parametric-methods


2014-11-29 15:59 GMT-05:00 Petr Krysl >:


Thanks, I hear you guys.  These are the concepts, and Julia
implements them: The two are concrete types, and hence cannot be
derived from each other.

But here it is: An array of floating-point numbers is an array of
floating-point numbers.

So how would you write the function so that it is Julia-style and
works with any floating-point number?

Thanks a lot,

Petr







Re: [julia-users] Floating-point array types

2014-11-29 Thread Ivar Nesje
A Array{Float64} isn't a subclass of Array{FloatingPoint} because you can't 
write any FloatingPoint value into an Array{Float64} without conversion. A 
function will sometimes need to modify the array, and then you might need both 
methods. 

We can definitely see the point about the current syntax for the most common 
need in a function signature is inconvenient. There are good (but really hard 
to understand) reasons for the current situation. I spent a long time before I 
got it. 

[julia-users] Re: Seeking feedback on first project

2014-11-29 Thread Avik Sengupta
Hi Matt, 

Thanks, that looks good. There was  another effort at a Redis client 
https://github.com/msainz/Redis.jl . At a first glance yours seem to have a 
greater coverage of the redis API. 

If would be good to see some performance numbers. Is there a significant 
overhead of using a Julia client? 

Regards
-
Avik

On Saturday, 29 November 2014 21:35:16 UTC, Matt Gushee wrote:
>
> Hi, Julia people--
>
> First-timer here. I have been aware of Julia for a few months, and finally 
> decided to take the plunge, and it's a great experience so far. Most of my 
> recent programming has been in Scheme and Python, and, well, Scheme is both 
> endlessly fascinating and endlessly frustrating, and I'm kind of bored with 
> Python ;-). It's refreshing to find a language that Just Works [TM]. I 
> don't know how much is attributable to good language design and how much to 
> my own background (probably a bit of both), but it seems very easy to 
> reason about how things work in Julia. So, kudos to the devs.
>
> Anyway, I'm developing a Redis client, and I thought I'd solicit 
> constructive criticism on what I've done so far. I have a rudimentary 
> implementation that somewhat works. I haven't documented anything, but my 
> API is more or less a direct translation of the command set documented at 
> http://redis.io/commands . I've lowercased the names, and MULTIPLE WORD 
> COMMAND becomes multiple_word_command(); there is one case where I changed 
> the name due to a conflict with a Julia keyword ('type' -> 'value_type').
>
> I have started on a test suite, and all tests pass for me, but the 
> coverage is minimal. My next step is to flesh out the test suite so as to 
> test as many functions as possible (some things are not unit-testable AFAIK 
> - e.g. 'DEBUG SEGFAULT' - think I'll skip that ;-) )
>
> The project is at https://github.com/mgushee/Redis.jl. Let me know what 
> you think!
>
> --
> Matt Gushee
>


Re: [julia-users] Help with a SegFault when calling native code.

2014-11-29 Thread Avik Sengupta
Thanks Isaiah, that helps. Your hints have made be debug further into this. 

The bad news however is that the exception is thrown in some hand coded 
assembly that seems to do CPU detection... in some code that looks like 
this (though probably not exactly that) : 
http://hg.openjdk.java.net/hsx/hsx25/hotspot/file/0c94c41dcd70/src/cpu/x86/vm/vm_version_x86.cpp#l95

I presume the truncated backtrace is due to jumping into assembly.. The 
backtrace dissapears in lldb as soon as execution goes into the hand 
generated assembly. 

I've confirmed that raw C code calling this function works correctly. Also, 
this section of the code, and its callers, do not take any parameters, so 
it is unlikely that the Julia to C translation of the parameters are at 
fault.  So yeah, stumped :(


On Saturday, 29 November 2014 17:45:15 UTC, Isaiah wrote:
>
> You can see where the SEGV handler is set up in init.c (see 
> mach_segv_listener).
> It might also be useful to set a break in the "create" function on the JVM 
> C API side, and step through from there.
>
>
>

Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread K Leo
I also found it very resource hungry. I have 7 tabs open.  When the 
cursor is not in it it uses about 20% of CPU (on one core I think).  
When the cursor is in it, it uses about 50% of CPU.  In total it uses 
600MB of memory.  Not sure what is wrong?


On 2014年11月29日 21:32, J Luis wrote:
I once installed Atom but when I realized that it was eating me 200 Mb 
of RAM without even a file loaded I uninstalled it right away. I'm not 
buying  (expensive) laptop RAM to be wasted that way.




Re: [julia-users] Different type columns in Matrix

2014-11-29 Thread Jeff Waller

>
>
> This 3 column are neccessary for later analysis in my work, first and 
> second column index and 3rd values. I have to use three columns same time.
>

Ok right so, whatever the exact expression is, it's going to have the form

f(A[:,1:2])

where f does some indexing function followed sometime later by

g(A[:,3])

where g does some value stuff. 

but you don't have

h(A[:,1:3])

because there's no builtin thing that does both indexing and evaluation 
simultaneously
I'm using f g and h just to short-hand describe what's going on, not to 
imply
they are actually called f, g, h or even that they're actually formally 
functions.  So if that's
the case then really why not use A and B?  Convenience, Encapsulation? 
 Sure, that's valid
but I'm suggesting that those two things are even better served by using 
composites, because
then you have the type system working for you instead of against you.


[julia-users] Seeking feedback on first project

2014-11-29 Thread Matt Gushee
Hi, Julia people--

First-timer here. I have been aware of Julia for a few months, and finally 
decided to take the plunge, and it's a great experience so far. Most of my 
recent programming has been in Scheme and Python, and, well, Scheme is both 
endlessly fascinating and endlessly frustrating, and I'm kind of bored with 
Python ;-). It's refreshing to find a language that Just Works [TM]. I 
don't know how much is attributable to good language design and how much to 
my own background (probably a bit of both), but it seems very easy to 
reason about how things work in Julia. So, kudos to the devs.

Anyway, I'm developing a Redis client, and I thought I'd solicit 
constructive criticism on what I've done so far. I have a rudimentary 
implementation that somewhat works. I haven't documented anything, but my 
API is more or less a direct translation of the command set documented at 
http://redis.io/commands . I've lowercased the names, and MULTIPLE WORD 
COMMAND becomes multiple_word_command(); there is one case where I changed 
the name due to a conflict with a Julia keyword ('type' -> 'value_type').

I have started on a test suite, and all tests pass for me, but the coverage 
is minimal. My next step is to flesh out the test suite so as to test as 
many functions as possible (some things are not unit-testable AFAIK - e.g. 
'DEBUG SEGFAULT' - think I'll skip that ;-) )

The project is at https://github.com/mgushee/Redis.jl. Let me know what you 
think!

--
Matt Gushee


Re: [julia-users] Re: Type Casting Weirdness?

2014-11-29 Thread Milan Bouchet-Valat
Le samedi 29 novembre 2014 à 12:46 -0800, Christoph Ortner a écrit :
> 
> 
> When I want to just write a quick script to test and idea, then I
> don't want to check that I've created my indices, array lengths etc as
> the correct type. I think for functions such as linspace not
> performing an automatic type conversion is a big mistake.
> 
> 
> I thought that in previous Julia verions   `int32(1.1)`  would throw
> an error (maybe I misremember this). Now it just converts it to 1. I
> then agree that this is a bit dangerous. It should throw an error
> because 1.1 cannot be converted  to int. This would resolve the issue
> --- but of course there may be others that I don't appreciate.
The future of int32(), int() and the like is not completely clear at the
moment, especially with regard to the fact that they currently coerce,
i.e. don't fail when exact conversion is not possible. See
https://github.com/JuliaLang/julia/issues/1470


Regards

> 
>Christoph
> 
> 
> 
> 
> On Saturday, 29 November 2014 13:22:05 UTC, Tamas Papp wrote:
> In general, I am more concerned about the following scenario:
> type A 
> makes sense, type B in general, does not, yet a subset of type
> B values 
> can be converted to A in a reasonable way, so an the
> implementation 
> performs this silently and everything seems fine. 
> 
> But at the same time, had I known that I left a type B value
> in there, I 
> would be concerned, eg because I am assuming that it is exact
> when it 
> isn't (integers vs floats) is problematic, or that conversion
> is 
> possible only for a subset of the domain, and other values are
> possible 
> but rare enough for my unit tests not to discover them, and
> will strike 
> me on the nose at some future point like a rake carelessly
> left in the 
> grass. 
> 
> Best, 
> 
> Tamas 
> 
> On Sat, Nov 29 2014, Stefan Karpinski 
> wrote: 
> 
> > Our conversions throw errors when the value cannot be
> converted exactly these days so it could be done pretty
> safely. But yes, this is just because there's no applicable
> method of linspace. 
> > 
> > 
> >> On Nov 29, 2014, at 7:07 AM, Tamas Papp 
> wrote: 
> >> 
> >> I think of this as a feature: using a float when only an
> integer makes 
> >> sense is most likely a bug in my code. Automatic conversion
> would mask 
> >> the problem. 
> >> 
> >> Best, 
> >> 
> >> Tamas 
> >> 
> >>> On Sat, Nov 29 2014, ele...@gmail.com wrote: 
> >>> 
> >>> One of the primary paradigms of Julia is the use of
> multiple dispatch, that 
> >>> is choosing which method to call based on the types of the
> parameters 
> >>> provided.  To quote from the manual 
> >>>
> http://docs.julialang.org/en/latest/manual/methods/#defining-methods 
> "No 
> >>> automatic casting or conversion of function arguments is
> ever performed: 
> >>> all conversion in Julia is non-magical and completely
> explicit." 
> >>> 
> >>> Cheers 
> >>> Lex 
> >>> 
>  On Saturday, November 29, 2014 8:17:26 PM UTC+10,
> Christoph Ortner wrote: 
>  
>  
>  In Julia 3.3  `linspace(0, 1, 10) `  works, but
>  `linspace(0, 1, 10.)` 
>  does not. 
>  
>  Why is the type not automatically converted to Int when
> possible? Is this 
>  intended or a bug? 
>  
> Christoph 
>  
>  
>  
>  
>  
>  
>  
>  



Re: [julia-users] Different type columns in Matrix

2014-11-29 Thread Milan Bouchet-Valat
Le vendredi 28 novembre 2014 à 22:50 -0800, John Myles White a écrit :
> There is no matrix in Julia that satisfies the constraint that one
> column is all integers, another column is all integers and the last is
> all floats, because all matrices in Julia have a homogeneous type.
> 
> There are several possible solutions:
> 
> (1) Use Array{Any} and then enforce your constaints by hand.
> 
> (2) Use Array{Vector} and store the columns as the entries of an array of 
> columsn.
> 
> (3) Allow all columns to be floats.
Why don't you mention the fourth solution, that is use a DataFrame?
Depending one's the objectives, it may be a good solution.


Regards

>  — John
> 
> On Nov 28, 2014, at 10:39 PM, Kenan KARAGÜL  wrote:
> 
> > Hi everyone,
> > Could you help me any one about this subject.
> > 
> > A=rand(2,3)
> > 2x3 Array{Float64,2}:
> >  0.650875  0.0649599  0.320412
> >  0.801777  0.633312   0.271399
> > 
> > a,b,C=findnz(A)
> > ([1,2,1,2,1,2],[1,1,2,2,3,3],[0.650875,0.801777,0.0649599,0.633312,0.320412,0.271399])
> > 
> > I want to get this matrix
> > [a b C] --> [Int64 Int64 Float64]
> > 1  1 0.650875
> > 
> > 2  1 
> > 0.801777
> > 
> > 1  2 
> > 0.0649599
> > 
> > 2  2 
> > 0.633312
> > 
> > 1  3 
> > 0.320412
> > 
> > 2  3 
> > 0.271399
> > but I can get [a b C] -->[Float64 Float64 Float64]
> >  1.0  1.0  0.650875 
> >  2.0  1.0  0.801777 
> >  1.0  2.0  0.0649599
> >  2.0  2.0  0.633312 
> >  1.0  3.0  0.320412 
> >  2.0  3.0  0.271399 
> > 
> > Thank you in advance
> > 



Re: [julia-users] Floating-point array types

2014-11-29 Thread Petr Krysl
Got it!  Thanks.

On Saturday, November 29, 2014 1:23:15 PM UTC-8, Andreas Noack wrote:
>
> almost. g{T<:FloatingPoint}(a::Array{T}) if you want it restricted the 
> elements to subtypes of FloatingPoint.
>
> 2014-11-29 16:19 GMT-05:00 Petr Krysl >:
>
>> You mean like this:
>>
>> function g{T}(a::Array{T})
>>
>>   show(a)
>>
>> end
>>
>> g(A)
>>
>>
>> On Saturday, November 29, 2014 1:04:25 PM UTC-8, Andreas Noack wrote:
>>>
>>> You are welcome. It is explained better than I'm able to do here 
>>> http://julia.readthedocs.org/en/latest/manual/methods/#
>>> parametric-methods
>>>
>>> 2014-11-29 15:59 GMT-05:00 Petr Krysl :
>>>
 Thanks, I hear you guys.  These are the concepts, and Julia implements 
 them: The two are concrete types, and hence cannot be derived from each 
 other.

 But here it is: An array of floating-point numbers is an array of 
 floating-point numbers. 

 So how would you write the function so that it is Julia-style and works 
 with any floating-point number?

 Thanks a lot,

 Petr

>
>
>>>
>

Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Petr Krysl
Wonderful!  That is really nice (hard to discover though).

Thanks,

Petr

On Saturday, November 29, 2014 1:02:13 PM UTC-8, Mike Innes wrote:
>
> The way to find this is to start typing part of the name of the command, 
> e.g.
>
> [:editor "ctrl-3" smart|]
>
> It should fuzzy search through the available commands and give you an 
> autocomplete prompt with the command you want. Then you can just press 
> `tab` to select it and it will enter `:smart-indent-selection` for you.
>
> On 29 November 2014 at 20:50, Petr Krysl 
> > wrote:
>
>> Gee, that's awfully nice of you!
>>
>> So here goes: From the list of commands that I can pick from in the 
>> window on the right, how do I find out what it's called in the user.keymap 
>> file?
>> For instance, one command says "Smart indent line (s)".  What would it be 
>> here to get a key binding?
>>
>> [:editor "ctrl-3" :editor.???]
>>
>> Thanks!
>>
>> Petr
>>
>>>
>>>
>

Re: [julia-users] Floating-point array types

2014-11-29 Thread Andreas Noack
almost. g{T<:FloatingPoint}(a::Array{T}) if you want it restricted the
elements to subtypes of FloatingPoint.

2014-11-29 16:19 GMT-05:00 Petr Krysl :

> You mean like this:
>
> function g{T}(a::Array{T})
>
>   show(a)
>
> end
>
> g(A)
>
>
> On Saturday, November 29, 2014 1:04:25 PM UTC-8, Andreas Noack wrote:
>>
>> You are welcome. It is explained better than I'm able to do here
>> http://julia.readthedocs.org/en/latest/manual/methods/#parametric-methods
>>
>> 2014-11-29 15:59 GMT-05:00 Petr Krysl :
>>
>>> Thanks, I hear you guys.  These are the concepts, and Julia implements
>>> them: The two are concrete types, and hence cannot be derived from each
>>> other.
>>>
>>> But here it is: An array of floating-point numbers is an array of
>>> floating-point numbers.
>>>
>>> So how would you write the function so that it is Julia-style and works
>>> with any floating-point number?
>>>
>>> Thanks a lot,
>>>
>>> Petr
>>>


>>


Re: [julia-users] Floating-point array types

2014-11-29 Thread Petr Krysl
You mean like this:

function g{T}(a::Array{T})

  show(a)

end

g(A)


On Saturday, November 29, 2014 1:04:25 PM UTC-8, Andreas Noack wrote:
>
> You are welcome. It is explained better than I'm able to do here 
> http://julia.readthedocs.org/en/latest/manual/methods/#parametric-methods
>
> 2014-11-29 15:59 GMT-05:00 Petr Krysl >:
>
>> Thanks, I hear you guys.  These are the concepts, and Julia implements 
>> them: The two are concrete types, and hence cannot be derived from each 
>> other.
>>
>> But here it is: An array of floating-point numbers is an array of 
>> floating-point numbers. 
>>
>> So how would you write the function so that it is Julia-style and works 
>> with any floating-point number?
>>
>> Thanks a lot,
>>
>> Petr
>>
>>>
>>>
>

Re: [julia-users] Re: Type Casting Weirdness?

2014-11-29 Thread bw72py19
For me in 0.3.3, `int32(1.1)` does the rounding and gives 1, while 
`convert(Int32, 1.1)` throws the InexactError.  

Even if the linspace methods in base don't do the auto-conversion you're 
looking for, you could always write your own method that just does

linspace(start, stop, convert(Int, n))

and put it in your startup file so it's always there.

On Saturday, November 29, 2014 12:46:37 PM UTC-8, Christoph Ortner wrote:
>
>
> When I want to just write a quick script to test and idea, then I don't 
> want to check that I've created my indices, array lengths etc as the 
> correct type. I think for functions such as linspace not performing an 
> automatic type conversion is a big mistake.
>
> I thought that in previous Julia verions   `int32(1.1)`  would throw an 
> error (maybe I misremember this). Now it just converts it to 1. I then 
> agree that this is a bit dangerous. It should throw an error because 1.1 
> cannot be converted  to int. This would resolve the issue --- but of course 
> there may be others that I don't appreciate.
>
>Christoph
>
>
>
>
> On Saturday, 29 November 2014 13:22:05 UTC, Tamas Papp wrote:
>>
>> In general, I am more concerned about the following scenario: type A 
>> makes sense, type B in general, does not, yet a subset of type B values 
>> can be converted to A in a reasonable way, so an the implementation 
>> performs this silently and everything seems fine. 
>>
>> But at the same time, had I known that I left a type B value in there, I 
>> would be concerned, eg because I am assuming that it is exact when it 
>> isn't (integers vs floats) is problematic, or that conversion is 
>> possible only for a subset of the domain, and other values are possible 
>> but rare enough for my unit tests not to discover them, and will strike 
>> me on the nose at some future point like a rake carelessly left in the 
>> grass. 
>>
>> Best, 
>>
>> Tamas 
>>
>> On Sat, Nov 29 2014, Stefan Karpinski  wrote: 
>>
>> > Our conversions throw errors when the value cannot be converted exactly 
>> these days so it could be done pretty safely. But yes, this is just because 
>> there's no applicable method of linspace. 
>> > 
>> > 
>> >> On Nov 29, 2014, at 7:07 AM, Tamas Papp  wrote: 
>> >> 
>> >> I think of this as a feature: using a float when only an integer makes 
>> >> sense is most likely a bug in my code. Automatic conversion would mask 
>> >> the problem. 
>> >> 
>> >> Best, 
>> >> 
>> >> Tamas 
>> >> 
>> >>> On Sat, Nov 29 2014, ele...@gmail.com wrote: 
>> >>> 
>> >>> One of the primary paradigms of Julia is the use of multiple 
>> dispatch, that 
>> >>> is choosing which method to call based on the types of the parameters 
>> >>> provided.  To quote from the manual 
>> >>> http://docs.julialang.org/en/latest/manual/methods/#defining-methods 
>> "No 
>> >>> automatic casting or conversion of function arguments is ever 
>> performed: 
>> >>> all conversion in Julia is non-magical and completely explicit." 
>> >>> 
>> >>> Cheers 
>> >>> Lex 
>> >>> 
>>  On Saturday, November 29, 2014 8:17:26 PM UTC+10, Christoph Ortner 
>> wrote: 
>>  
>>  
>>  In Julia 3.3  `linspace(0, 1, 10) `  works, but`linspace(0, 1, 
>> 10.)` 
>>  does not. 
>>  
>>  Why is the type not automatically converted to Int when possible? Is 
>> this 
>>  intended or a bug? 
>>  
>> Christoph 
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>  
>>
>

Re: [julia-users] Efficient bytes to BitArray conversion

2014-11-29 Thread Sébastien Besnier
Hi,

Yes, reinterpret is the kind of command I was searching for. However,
reinterpret(Bool, b"abc") returns an Array{Bool,1}
of size 3 ( [true, true, true]) instead of the BitVector of size 24 I would
like.

I've wrote this little function to do the staff, but it's a bit creepy :
create a BitVector and after alter the field "chunk".
function bytesToBitVector(s::Array{Uint8,1})
   n = size(s,1)
   padding = 8-n%8
   chunks = reinterpret(Uint64, [s, repmat(b"\0",padding)])
   t = BitVector(n*8)
   t.chunks = chunks
   t
end

Sébastien


2014-11-29 21:01 GMT+01:00 Mauro :

> are you looking for:
>
> help?> reinterpret
> Base.reinterpret(type, A)
>
>Change the type-interpretation of a block of memory. For example,
>"reinterpret(Float32, uint32(7))" interprets the 4 bytes
>corresponding to "uint32(7)" as a "Float32". For arrays, this
>constructs an array with the same binary data as the given array,
>but with the specified element type.
>
>
>
> On Sat, 2014-11-29 at 15:11, sebastien.fabrice.besn...@gmail.com wrote:
> > Hello,
> >
> > I would like to convert a byte string like b"abe34" into a BitArray. I
> > could use this function, but it will be horribly slow :
> >
> > function bytesToBitarray(s::Array{Uint8,1})
> >t = BitArray(size(s, 1)*8)
> >for i in 1:size(s, 1)
> >for j in 0:7
> >  t[8(i-1) + j + 1] = s[i] & (1< >end
> >end
> >t
> >  end
> >
> >  how can I do this efficiently ?
> >
> > Sébastien
>
>


Re: [julia-users] Floating-point array types

2014-11-29 Thread Andreas Noack
You are welcome. It is explained better than I'm able to do here
http://julia.readthedocs.org/en/latest/manual/methods/#parametric-methods

2014-11-29 15:59 GMT-05:00 Petr Krysl :

> Thanks, I hear you guys.  These are the concepts, and Julia implements
> them: The two are concrete types, and hence cannot be derived from each
> other.
>
> But here it is: An array of floating-point numbers is an array of
> floating-point numbers.
>
> So how would you write the function so that it is Julia-style and works
> with any floating-point number?
>
> Thanks a lot,
>
> Petr
>
>>
>>


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Mike Innes
The way to find this is to start typing part of the name of the command,
e.g.

[:editor "ctrl-3" smart|]

It should fuzzy search through the available commands and give you an
autocomplete prompt with the command you want. Then you can just press
`tab` to select it and it will enter `:smart-indent-selection` for you.

On 29 November 2014 at 20:50, Petr Krysl  wrote:

> Gee, that's awfully nice of you!
>
> So here goes: From the list of commands that I can pick from in the window
> on the right, how do I find out what it's called in the user.keymap file?
> For instance, one command says "Smart indent line (s)".  What would it be
> here to get a key binding?
>
> [:editor "ctrl-3" :editor.???]
>
> Thanks!
>
> Petr
>
>>
>>


Re: [julia-users] Floating-point array types

2014-11-29 Thread Petr Krysl
Thanks, I hear you guys.  These are the concepts, and Julia implements 
them: The two are concrete types, and hence cannot be derived from each 
other.

But here it is: An array of floating-point numbers is an array of 
floating-point numbers. 

So how would you write the function so that it is Julia-style and works 
with any floating-point number?

Thanks a lot,

Petr

>
>

Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Petr Krysl
Gee, that's awfully nice of you!

So here goes: From the list of commands that I can pick from in the window 
on the right, how do I find out what it's called in the user.keymap file?
For instance, one command says "Smart indent line (s)".  What would it be 
here to get a key binding?

[:editor "ctrl-3" :editor.???]

Thanks!

Petr

>
>

Re: [julia-users] Re: Type Casting Weirdness?

2014-11-29 Thread Christoph Ortner

When I want to just write a quick script to test and idea, then I don't 
want to check that I've created my indices, array lengths etc as the 
correct type. I think for functions such as linspace not performing an 
automatic type conversion is a big mistake.

I thought that in previous Julia verions   `int32(1.1)`  would throw an 
error (maybe I misremember this). Now it just converts it to 1. I then 
agree that this is a bit dangerous. It should throw an error because 1.1 
cannot be converted  to int. This would resolve the issue --- but of course 
there may be others that I don't appreciate.

   Christoph




On Saturday, 29 November 2014 13:22:05 UTC, Tamas Papp wrote:
>
> In general, I am more concerned about the following scenario: type A 
> makes sense, type B in general, does not, yet a subset of type B values 
> can be converted to A in a reasonable way, so an the implementation 
> performs this silently and everything seems fine. 
>
> But at the same time, had I known that I left a type B value in there, I 
> would be concerned, eg because I am assuming that it is exact when it 
> isn't (integers vs floats) is problematic, or that conversion is 
> possible only for a subset of the domain, and other values are possible 
> but rare enough for my unit tests not to discover them, and will strike 
> me on the nose at some future point like a rake carelessly left in the 
> grass. 
>
> Best, 
>
> Tamas 
>
> On Sat, Nov 29 2014, Stefan Karpinski > 
> wrote: 
>
> > Our conversions throw errors when the value cannot be converted exactly 
> these days so it could be done pretty safely. But yes, this is just because 
> there's no applicable method of linspace. 
> > 
> > 
> >> On Nov 29, 2014, at 7:07 AM, Tamas Papp > 
> wrote: 
> >> 
> >> I think of this as a feature: using a float when only an integer makes 
> >> sense is most likely a bug in my code. Automatic conversion would mask 
> >> the problem. 
> >> 
> >> Best, 
> >> 
> >> Tamas 
> >> 
> >>> On Sat, Nov 29 2014, ele...@gmail.com  wrote: 
> >>> 
> >>> One of the primary paradigms of Julia is the use of multiple dispatch, 
> that 
> >>> is choosing which method to call based on the types of the parameters 
> >>> provided.  To quote from the manual 
> >>> http://docs.julialang.org/en/latest/manual/methods/#defining-methods 
> "No 
> >>> automatic casting or conversion of function arguments is ever 
> performed: 
> >>> all conversion in Julia is non-magical and completely explicit." 
> >>> 
> >>> Cheers 
> >>> Lex 
> >>> 
>  On Saturday, November 29, 2014 8:17:26 PM UTC+10, Christoph Ortner 
> wrote: 
>  
>  
>  In Julia 3.3  `linspace(0, 1, 10) `  works, but`linspace(0, 1, 
> 10.)` 
>  does not. 
>  
>  Why is the type not automatically converted to Int when possible? Is 
> this 
>  intended or a bug? 
>  
> Christoph 
>  
>  
>  
>  
>  
>  
>  
>  
>


Re: [julia-users] Floating-point array types

2014-11-29 Thread Andreas Noack
Please read the following section of the manual
http://julia.readthedocs.org/en/latest/manual/types/#man-parametric-types.
You can also try to search the julia list for the words that John mentions.
I think that Stefan Karpinski gave a detailed explanation at some point.

2014-11-29 15:38 GMT-05:00 Petr Krysl :

> Newbie-type question:
>
> This is true:
> Float64 <: FloatingPoint
>
> This is false:
> Array{Float64} <: Array{FloatingPoint}
>
> Why?  I'm perhaps not referring here to the actual code to explain why.
> Rather why should this be so?
>
> Let us say I wanted to write a function
>
> function f(a::Array{FloatingPoint})
>   show(a)
> end
>
> And then
>
> #define an array
> A=Float64[1.0 2.0; -3.0 -4.0; 5.0 6.0]
> #this will fail.  Why should it fail?
> f(A)
>
> Petr
>
>


Re: [julia-users] Floating-point array types

2014-11-29 Thread John Myles White
Look up covariance, contravariance and invariance on Wikipedia.

 -- John

> On Nov 29, 2014, at 12:38 PM, Petr Krysl  wrote:
> 
> Newbie-type question:
> 
> This is true:
> Float64 <: FloatingPoint
> 
> This is false:
> Array{Float64} <: Array{FloatingPoint}
> 
> Why?  I'm perhaps not referring here to the actual code to explain why.  
> Rather why should this be so?
> 
> Let us say I wanted to write a function
> 
> function f(a::Array{FloatingPoint})
>   show(a)
> end
> 
> And then
> 
> #define an array
> A=Float64[1.0 2.0; -3.0 -4.0; 5.0 6.0]
> #this will fail.  Why should it fail?
> f(A) 
> 
> Petr
> 


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Mike Innes
Glad you like it! I'm always happy to help if you need to customise
anything in particular about LT.

On 29 November 2014 at 19:05, Petr Krysl  wrote:

> Sorry, I figured it out. Julia was not in the path (which I found out upon
> opening a new window).
>
> All I can say is, wow! LT with Juno is FANTASTIC.  It does all that I
> wanted to play with Julia.  And probably much more!
>
> Thanks a lot!
>
> Petr
>
> PS: it certainly does things differently.  I will have to dig deep for
> instance to figure out how to find out the command names do certain things
> to tweak my key bindings (I use voice recognition to drive my PC, and the
> key bindings are used to execute commands that I say).  So I can see how
> the learning curve can seem pretty steep!
>
> On Saturday, November 29, 2014 10:42:18 AM UTC-8, Mike Innes wrote:
>>
>> The errors there are from installing the plugins (a known issue with LT)
>> – I recommend restarting after doing that. To clarify, the console isn't
>> the input – the file itself is. So you should be able to select `2+2`
>> within one of those .jl files and have `4` come up. Happy to help if you
>> see further problems, but it might be a good idea to open an issue
>>  or start a new
>> thread here 
>> .
>>
>>
>>


[julia-users] Floating-point array types

2014-11-29 Thread Petr Krysl
Newbie-type question:

This is true:
Float64 <: FloatingPoint

This is false:
Array{Float64} <: Array{FloatingPoint}

Why?  I'm perhaps not referring here to the actual code to explain why. 
 Rather why should this be so?

Let us say I wanted to write a function

function f(a::Array{FloatingPoint})
  show(a)
end

And then

#define an array
A=Float64[1.0 2.0; -3.0 -4.0; 5.0 6.0]
#this will fail.  Why should it fail?
f(A) 

Petr



[julia-users] Re: Julia on ARM Radxa Rock Pro Quad Core

2014-11-29 Thread Airhead Bit
Another Correction:
 The RK3188 features a quad-core ARM Cortex-A9 
  - The RK3288 is based on the 
Quad Core Cortex-A17
The Radxa Rock Pro is a RK3188 Cortex-A9
It's like ARM has a dice shaker with letters and number and each letter and 
number has it's own dice shaker, add to the the convoluted information on 
the internet your head explodes.
   
On Saturday, November 29, 2014 12:02:11 PM UTC-7, Airhead Bit wrote:
>
> Correction: Quad-Core Cortex-A17 is an ARMv7 based product RK3188 - I 
> have no idea where I got ARM9 from
>
> On Saturday, November 29, 2014 12:31:28 AM UTC-7, Airhead Bit wrote:
>>
>> Yes, followed the directions made a Make.user added the include ARM.inc 
>> if I had not I don't think the compile would have completed, no x86 stuff 
>> on the Radxa box where I compiled it.
>> No, I don't think an ARMv8 would even run ARM7 code, not sure.
>> Radxa Rock Pro is ARM7 hfp with an ARM9 (quad core ARM7) 2GB memory, 8GB 
>> Flash, desktop box, nice for working with Android.
>>  
>> Should I add USE_BLAS64=0 to the Make.user and re-compile?
>> Is there a way to have make testall load juliadebug test/all?
>>
>>
>>
>> On Friday, November 28, 2014 11:18:39 AM UTC-7, Airhead Bit wrote:
>>>
>>> Just finished compiling one Error: 
>>>
>>> Warning: error initializing module LinAlg:
>>>
>>> ErrorException("BLAS and LAPACK are compiled with 32-bit integer 
>>> support, but Julia expects 64-bit integers. Please build Julia with 
>>> USE_BLAS64=0.")
>>>
>>> exports.jl
>>>
>>>
>>> Julia works at the prompt but: TOP shows 400% CPU... 
>>>
>>>
>>> root@radxa:~/julia# make testall
>>>
>>> JULIA test/all
>>>
>>> Master process (id 1) could not connect within 60.0 seconds.
>>>
>>> exiting.
>>>
>>> Master process (id 1) could not connect within 60.0 seconds.
>>>
>>> exiting.
>>>
>>> Master process (id 1) could not connect within 60.0 seconds.
>>>
>>> exiting.
>>>
>>> Worker 5 terminated.
>>>
>>> Worker 4 terminated.Worker 2 terminated.
>>>
>>>
>>> Eventually I was left with two Julia process's that each took 198.n% 
>>> until I killed the terminal
>>>
>>> I'm going to build a clean system and build adding USE_BLAS64=0 in the 
>>> Make.user file.
>>>
>>>
>>> Any other ideas for a build? 
>>>
>>> Any ideas on how to tell what is sucking all the CPU?
>>>
>>>  
>>>
>>>
>>>

Re: [julia-users] Efficient bytes to BitArray conversion

2014-11-29 Thread Mauro
are you looking for:

help?> reinterpret
Base.reinterpret(type, A)

   Change the type-interpretation of a block of memory. For example,
   "reinterpret(Float32, uint32(7))" interprets the 4 bytes
   corresponding to "uint32(7)" as a "Float32". For arrays, this
   constructs an array with the same binary data as the given array,
   but with the specified element type.



On Sat, 2014-11-29 at 15:11, sebastien.fabrice.besn...@gmail.com wrote:
> Hello,
>
> I would like to convert a byte string like b"abe34" into a BitArray. I 
> could use this function, but it will be horribly slow :
>
> function bytesToBitarray(s::Array{Uint8,1}) 
>t = BitArray(size(s, 1)*8)
>for i in 1:size(s, 1)
>for j in 0:7
>  t[8(i-1) + j + 1] = s[i] & (1end
>t
>  end
>
>  how can I do this efficiently ?
>
> Sébastien



[julia-users] Re: why extra lines around some latex symbols in emacs?

2014-11-29 Thread Tracy Wadleigh
At least one piece of it does seem to be a font issue. I switched from the 
system font (Ubuntu Mono) to DejaVu Sans Mono in emacs, and the problem did 
go away for my source.


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Petr Krysl
Sorry, I figured it out. Julia was not in the path (which I found out upon 
opening a new window).

All I can say is, wow! LT with Juno is FANTASTIC.  It does all that I 
wanted to play with Julia.  And probably much more!

Thanks a lot!

Petr

PS: it certainly does things differently.  I will have to dig deep for 
instance to figure out how to find out the command names do certain things 
to tweak my key bindings (I use voice recognition to drive my PC, and the 
key bindings are used to execute commands that I say).  So I can see how 
the learning curve can seem pretty steep!

On Saturday, November 29, 2014 10:42:18 AM UTC-8, Mike Innes wrote:
>
> The errors there are from installing the plugins (a known issue with LT) – 
> I recommend restarting after doing that. To clarify, the console isn't the 
> input – the file itself is. So you should be able to select `2+2` within 
> one of those .jl files and have `4` come up. Happy to help if you see 
> further problems, but it might be a good idea to open an issue 
>  or start a new 
> thread here .
>
>
>

[julia-users] Re: Julia on ARM Radxa Rock Pro Quad Core

2014-11-29 Thread Airhead Bit
Correction: Quad-Core Cortex-A17 is an ARMv7 based product RK3188 - I have 
no idea where I got ARM9 from

On Saturday, November 29, 2014 12:31:28 AM UTC-7, Airhead Bit wrote:
>
> Yes, followed the directions made a Make.user added the include ARM.inc if 
> I had not I don't think the compile would have completed, no x86 stuff on 
> the Radxa box where I compiled it.
> No, I don't think an ARMv8 would even run ARM7 code, not sure.
> Radxa Rock Pro is ARM7 hfp with an ARM9 (quad core ARM7) 2GB memory, 8GB 
> Flash, desktop box, nice for working with Android.
>  
> Should I add USE_BLAS64=0 to the Make.user and re-compile?
> Is there a way to have make testall load juliadebug test/all?
>
>
>
> On Friday, November 28, 2014 11:18:39 AM UTC-7, Airhead Bit wrote:
>>
>> Just finished compiling one Error: 
>>
>> Warning: error initializing module LinAlg:
>>
>> ErrorException("BLAS and LAPACK are compiled with 32-bit integer support, 
>> but Julia expects 64-bit integers. Please build Julia with USE_BLAS64=0.")
>>
>> exports.jl
>>
>>
>> Julia works at the prompt but: TOP shows 400% CPU... 
>>
>>
>> root@radxa:~/julia# make testall
>>
>> JULIA test/all
>>
>> Master process (id 1) could not connect within 60.0 seconds.
>>
>> exiting.
>>
>> Master process (id 1) could not connect within 60.0 seconds.
>>
>> exiting.
>>
>> Master process (id 1) could not connect within 60.0 seconds.
>>
>> exiting.
>>
>> Worker 5 terminated.
>>
>> Worker 4 terminated.Worker 2 terminated.
>>
>>
>> Eventually I was left with two Julia process's that each took 198.n% 
>> until I killed the terminal
>>
>> I'm going to build a clean system and build adding USE_BLAS64=0 in the 
>> Make.user file.
>>
>>
>> Any other ideas for a build? 
>>
>> Any ideas on how to tell what is sucking all the CPU?
>>
>>  
>>
>>
>>

Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Daniel Carrera
Atom can do this too, in its own way. If you add the "Script" package, you
can select any block of code in Julia (or Python, or whatever) and press
Ctrl+Shift+B to run it. The main difference that I can see is that LT shows
you the answer in a pop-up while Atom shows the answer in a little split
window at the bottom of the screen.

Cheers,
Daniel.

On 29 November 2014 at 19:33, Petr Krysl  wrote:

> Mike,
>
> Thanks for getting back to me.  I installed the Juno plug-in, but
> selecting 2+2 and hitting control-return does nothing. In fact the console
> does not allow for any input to be entered and does not show anything else
> but some errors as shown in the attached.
>
> P
>
> On Saturday, November 29, 2014 10:06:59 AM UTC-8, Mike Innes wrote:
>>
>>
>> Petr: You shouldn't need to connect to Julia explicitly, just `C-Enter`
>> on something you want to evaluate and a client will boot up for you. If
>> you've got the Juno plugin installed, a Julia client will boot up for you
>> at start up which speeds things along. If you want to test this just try
>> `C-N` for a new file and evaluate `2+2` or something simple like that, but
>> opening up an existing file should work just as well. I'm working on a mini
>> tutorial that should soften the learning curve here a bit.
>>
>> On 29 November 2014 at 17:48, Petr Krysl  wrote:
>>
>>> Hi Mike,
>>>
>>> I installed LT and ran it on my toy Julia project. I tried to make the
>>> connection to Julia, but I couldn't find it on the list.  What do I do?
>>>
>>> Thanks,
>>>
>>> Petr
>>>
>>> On Saturday, November 29, 2014 7:30:05 AM UTC-8, Mike Innes wrote:

 One good reason to use Light Table is that it has pretty good support
 for using Julia interactively. Things like eval'ing the current code block
 in the editor, highlighting and linking to lines that cause errors, support
 for eval in modules, inline Gadfly plots etc. See here
  if you're interested. Plus, no one else supports
 highlighting for string interpolation, so far as I know ;)


>>


-- 
When an engineer says that something can't be done, it's a code phrase that
means it's not fun to do.


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Daniel Carrera
On 29 November 2014 at 19:19, Jeff Waller  wrote:
>
> const r_sun = 695500.0KiloMeter; export r_sun
>> const r_jupiter =  69173.0KiloMeter; export r_jupiter
>> const r_saturn  =  57316.0KiloMeter; export r_saturn
>>
>
> 
>
> I have a semi-related question.  Why this way?  Why not read these values
> from a database
> at startup or at least a file of HDF5 or JSON. Do you find yourself
> cutting-and pasting
> constants all over the place?
>


What is the benefit of an HDF5 or JSON file versus just having a module
with the constants I want? The module is loaded in my ~/.juliarc.jl file so
I have it automatically when I start the REPL. To answer your other
question: No, I don't find myself copy-pasting constants a lot. This is
just the first example that came to mind. I do often like to line up my
code vertically because I feel that it helps me catch errors. Here are
other code samples:

Ax = - (1-u)*(x+u) / rho1^3  -  u*(x+u-1) / rho2^3
Ay = - (1-u) * y   / rho1^3  -  u*y   / rho2^3
Az = - (1-u) * z   / rho1^3  -  u*z   / rho2^3

Or

CJ = method == 1 ? CJ_method_1 : CJ_method_2
df = method == 1 ? df_method_1 : df_method_2
Ht = method == 1 ? Ht_method_1 : Ht_method_2


Of course, these examples are a lot less transparent than my first example.
But it doesn't matter. I have always been happier with code where all the
columns line up nicely. Another use of multiple cursors is to select a bit
of text and pressing Ctrl+D to select additional instances of that code.


Cheers,
Daniel.


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Mike Innes
The errors there are from installing the plugins (a known issue with LT) –
I recommend restarting after doing that. To clarify, the console isn't the
input – the file itself is. So you should be able to select `2+2` within
one of those .jl files and have `4` come up. Happy to help if you see
further problems, but it might be a good idea to open an issue
 or start a new thread
here .

On 29 November 2014 at 18:33, Petr Krysl  wrote:

> Mike,
>
> Thanks for getting back to me.  I installed the Juno plug-in, but
> selecting 2+2 and hitting control-return does nothing. In fact the console
> does not allow for any input to be entered and does not show anything else
> but some errors as shown in the attached.
>
> P
>
> On Saturday, November 29, 2014 10:06:59 AM UTC-8, Mike Innes wrote:
>>
>>
>> Petr: You shouldn't need to connect to Julia explicitly, just `C-Enter`
>> on something you want to evaluate and a client will boot up for you. If
>> you've got the Juno plugin installed, a Julia client will boot up for you
>> at start up which speeds things along. If you want to test this just try
>> `C-N` for a new file and evaluate `2+2` or something simple like that, but
>> opening up an existing file should work just as well. I'm working on a mini
>> tutorial that should soften the learning curve here a bit.
>>
>> On 29 November 2014 at 17:48, Petr Krysl  wrote:
>>
>>> Hi Mike,
>>>
>>> I installed LT and ran it on my toy Julia project. I tried to make the
>>> connection to Julia, but I couldn't find it on the list.  What do I do?
>>>
>>> Thanks,
>>>
>>> Petr
>>>
>>> On Saturday, November 29, 2014 7:30:05 AM UTC-8, Mike Innes wrote:

 One good reason to use Light Table is that it has pretty good support
 for using Julia interactively. Things like eval'ing the current code block
 in the editor, highlighting and linking to lines that cause errors, support
 for eval in modules, inline Gadfly plots etc. See here
  if you're interested. Plus, no one else supports
 highlighting for string interpolation, so far as I know ;)


>>


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Petr Krysl
Mike,

Thanks for getting back to me.  I installed the Juno plug-in, but selecting 
2+2 and hitting control-return does nothing. In fact the console does not 
allow for any input to be entered and does not show anything else but some 
errors as shown in the attached.

P

On Saturday, November 29, 2014 10:06:59 AM UTC-8, Mike Innes wrote:
>
>
> Petr: You shouldn't need to connect to Julia explicitly, just `C-Enter` on 
> something you want to evaluate and a client will boot up for you. If you've 
> got the Juno plugin installed, a Julia client will boot up for you at start 
> up which speeds things along. If you want to test this just try `C-N` for a 
> new file and evaluate `2+2` or something simple like that, but opening up 
> an existing file should work just as well. I'm working on a mini tutorial 
> that should soften the learning curve here a bit.
>
> On 29 November 2014 at 17:48, Petr Krysl 
> > wrote:
>
>> Hi Mike,
>>
>> I installed LT and ran it on my toy Julia project. I tried to make the 
>> connection to Julia, but I couldn't find it on the list.  What do I do?
>>
>> Thanks,
>>
>> Petr
>>
>> On Saturday, November 29, 2014 7:30:05 AM UTC-8, Mike Innes wrote:
>>>
>>> One good reason to use Light Table is that it has pretty good support 
>>> for using Julia interactively. Things like eval'ing the current code block 
>>> in the editor, highlighting and linking to lines that cause errors, support 
>>> for eval in modules, inline Gadfly plots etc. See here 
>>>  if you're interested. Plus, no one else supports 
>>> highlighting for string interpolation, so far as I know ;)
>>>
>>>
>

Re: [julia-users] Different type columns in Matrix

2014-11-29 Thread Kenan KARAGÜL
Thank you very much your explanations.

29 Kasım 2014 Cumartesi 01:50:55 UTC-5 tarihinde John Myles White yazdı:
>
> There is no matrix in Julia that satisfies the constraint that one column 
> is all integers, another column is all integers and the last is all floats, 
> because all matrices in Julia have a homogeneous type. 
>
> There are several possible solutions: 
>
> (1) Use Array{Any} and then enforce your constaints by hand. 
>
> (2) Use Array{Vector} and store the columns as the entries of an array of 
> columsn. 
>
> (3) Allow all columns to be floats. 
>
>  — John 
>
> On Nov 28, 2014, at 10:39 PM, Kenan KARAGÜL  > wrote: 
>
> > Hi everyone, 
> > Could you help me any one about this subject. 
> > 
> > A=rand(2,3) 
> > 2x3 Array{Float64,2}: 
> >  0.650875  0.0649599  0.320412 
> >  0.801777  0.633312   0.271399 
> > 
> > a,b,C=findnz(A) 
> > 
> ([1,2,1,2,1,2],[1,1,2,2,3,3],[0.650875,0.801777,0.0649599,0.633312,0.320412,0.271399])
>  
>
> > 
> > I want to get this matrix 
> > [a b C] --> [Int64 Int64 Float64] 
> > 1  1 0.650875 
> > 
> > 2  1 
> > 0.801777 
> > 
> > 1  2 
> > 0.0649599 
> > 
> > 2  2 
> > 0.633312 
> > 
> > 1  3 
> > 0.320412 
> > 
> > 2  3 
> > 0.271399 
> > but I can get [a b C] -->[Float64 Float64 Float64] 
> >  1.0  1.0  0.650875 
> >  2.0  1.0  0.801777 
> >  1.0  2.0  0.0649599 
> >  2.0  2.0  0.633312 
> >  1.0  3.0  0.320412 
> >  2.0  3.0  0.271399 
> > 
> > Thank you in advance 
> > 
>
>

Re: [julia-users] Different type columns in Matrix

2014-11-29 Thread Kenan KARAGÜL
Hi,
This 3 column are neccessary for later analysis in my work, first and 
second column index and 3rd values. I have to use three columns same time.

29 Kasım 2014 Cumartesi 13:01:16 UTC-5 tarihinde Jeff Waller yazdı:
>
> I'd add one more.
>
> Or two arrays or a composite with 2 arrays.
>
> After all whatever is supposed to take advantage of everything being in 
> one array
> is going to have some subtle error when the types change out from  under 
> it moving from
> one column to the next.  Or you will use Any and it will be horribly slow. 
>  Or you will
> never apply the same operation to all columns at once either by design or 
> as a practical
> matter to avoid the problems above in which case why are you using 1 array 
> in the
> first place?
>


Re: [julia-users] why extra lines around some latex symbols in emacs?

2014-11-29 Thread John Myles White
Almost blind speculation, but could this be a font issue?

 — John

On Nov 29, 2014, at 10:17 AM, Tracy Wadleigh  wrote:

> I'm starting to write my code using the same symbols that I would write them 
> on paper, making use of the latex->unicode support in julia-mode. However, 
> some symbols seem to cause my emacs to want to display lines with extra line 
> spacing. For instance, every instance of \nabla yields at least one line of 
> padding above and below the line on which it occurs, and \phi yields two 
> lines (whereas \varphi yields no extra spacing).
> 
> The space isn't in the file itself: `less` and `cat` display the contents 
> without the extra space.
> 
> Does anyone know what's going on here, and if there is a fix?
> 



Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Jeff Waller


const r_sun = 695500.0KiloMeter; export r_sun
> const r_jupiter =  69173.0KiloMeter; export r_jupiter
> const r_saturn  =  57316.0KiloMeter; export r_saturn 
>



I have a semi-related question.  Why this way?  Why not read these values 
from a database
at startup or at least a file of HDF5 or JSON. Do you find yourself 
cutting-and pasting
constants all over the place?  


[julia-users] why extra lines around some latex symbols in emacs?

2014-11-29 Thread Tracy Wadleigh
I'm starting to write my code using the same symbols that I would write 
them on paper, making use of the latex->unicode support in julia-mode. 
However, some symbols seem to cause my emacs to want to display lines with 
extra line spacing. For instance, every instance of \nabla yields at least 
one line of padding above and below the line on which it occurs, and \phi 
yields two lines (whereas \varphi yields no extra spacing).

The space isn't in the file itself: `less` and `cat` display the contents 
without the extra space.

Does anyone know what's going on here, and if there is a fix?



Re: [julia-users] about - website (and kindle docs)

2014-11-29 Thread Isaiah Norton
The information is around, just not very prominently any more.
http://julialang.org/blog/2012/02/why-we-created-julia/

The community has grown quite large since then:
https://github.com/JuliaLang/julia/graphs/contributors

There are PDF and ePub versions of the documentation available - see the
little popup at the bottom-right corner of the screen.

Regarding errors, there are still several open issues about error messages
and backtraces, but the situation has steadily improved and there are
further improvements in the works (via LLVM3.5, the debugger, etc.)

On Thu, Nov 27, 2014 at 10:37 PM, ivo welch  wrote:

>
> I was trying to figure out who is running julia and the website, and
> noticed that there is no "about us" that gives information on who the julia
> people are.  (it says on the front page that julia is mostly under the MIT
> license.)  would it make sense for someone to add this information?
>
> I wanted to suggest to the julia foundation, if such a thing exists, to
> post the documentation on kindle for $9.99.  the library, reader, and
> auto-update feature makes this useful for some readers, esp those who want
> to donate a little to the foundation.
>
> I am hoping that julia will soon mature to the point where I do not have
> to inflict R on my students.  (I am more bothered by R's obscure errors and
> lack of simplicity than by its slow speed.  It's not easy for students even
> to figure out on which lines their problem occurred.  without R mailing
> lists, kind souls, and search engines, R would have died long ago.)
>
> /iaw
>
>


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Mike Innes
Daniel: I think your hunch is probably correct; LT's internal architecture
is very powerful and very flexible, but that comes at a cost of complexity
which (for now at least) isn't hidden from the end user as well as it could
be. It's interesting to hear that perspective on Sublime vs. Atom – I'll
have to take a look at how configuration is handled in both.

Petr: You shouldn't need to connect to Julia explicitly, just `C-Enter` on
something you want to evaluate and a client will boot up for you. If you've
got the Juno plugin installed, a Julia client will boot up for you at start
up which speeds things along. If you want to test this just try `C-N` for a
new file and evaluate `2+2` or something simple like that, but opening up
an existing file should work just as well. I'm working on a mini tutorial
that should soften the learning curve here a bit.

On 29 November 2014 at 17:48, Petr Krysl  wrote:

> Hi Mike,
>
> I installed LT and ran it on my toy Julia project. I tried to make the
> connection to Julia, but I couldn't find it on the list.  What do I do?
>
> Thanks,
>
> Petr
>
> On Saturday, November 29, 2014 7:30:05 AM UTC-8, Mike Innes wrote:
>>
>> One good reason to use Light Table is that it has pretty good support for
>> using Julia interactively. Things like eval'ing the current code block in
>> the editor, highlighting and linking to lines that cause errors, support
>> for eval in modules, inline Gadfly plots etc. See here
>>  if you're interested. Plus, no one else supports
>> highlighting for string interpolation, so far as I know ;)
>>
>>


[julia-users] Swapping two columns (or rows) of an array efficiently

2014-11-29 Thread Ján Dolinský
Hello,

I wonder what is an efficient way to swap to columns (or rows) of an 2D 
array. BLAS has the level1 "swap" function but I don't see it in Julia.

Thanks,
Jan 


Re: [julia-users] Different type columns in Matrix

2014-11-29 Thread Jeff Waller
I'd add one more.

Or two arrays or a composite with 2 arrays.

After all whatever is supposed to take advantage of everything being in one 
array
is going to have some subtle error when the types change out from  under it 
moving from
one column to the next.  Or you will use Any and it will be horribly slow. 
 Or you will
never apply the same operation to all columns at once either by design or 
as a practical
matter to avoid the problems above in which case why are you using 1 array 
in the
first place?


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Petr Krysl
Hi Mike,

I installed LT and ran it on my toy Julia project. I tried to make the 
connection to Julia, but I couldn't find it on the list.  What do I do?

Thanks,

Petr

On Saturday, November 29, 2014 7:30:05 AM UTC-8, Mike Innes wrote:
>
> One good reason to use Light Table is that it has pretty good support for 
> using Julia interactively. Things like eval'ing the current code block in 
> the editor, highlighting and linking to lines that cause errors, support 
> for eval in modules, inline Gadfly plots etc. See here 
>  if you're interested. Plus, no one else supports 
> highlighting for string interpolation, so far as I know ;)
>
>

Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Daniel Carrera
I had a look at LT. It looks like a very powerful editor, but with a steep
learning curve. I had a hard time figuring out how to configure it. Maybe
I'm just too dumb for LT. I liked Sublime a lot. Although everything is
done in config files, the features in the file are very "discoverable".
That is actually one place where Sublime still beats Atom. I would say that
editor features are more discoverable in Atom, but editor settings are more
discoverable in Sublime. And both are more discoverable than LT, though LT
feels like it could be more powerful if I could learn it.

Cheers,
Daniel.

On 29 November 2014 at 16:29, Mike Innes  wrote:

> One good reason to use Light Table is that it has pretty good support for
> using Julia interactively. Things like eval'ing the current code block in
> the editor, highlighting and linking to lines that cause errors, support
> for eval in modules, inline Gadfly plots etc. See here
>  if you're interested. Plus, no one else supports
> highlighting for string interpolation, so far as I know ;)
>
> The downside of LT is that it really lacks the maturity and familiarity
> and Sublime, Atom and friends. If you're used to really powerful text
> editing features you'll have to relearn some tools and forgo others. For
> some the tradeoff here is worthwhile, for some not; personally, going
> without it (and back to reloading modules in the terminal) feels a lot like
> banging rocks together, but YMMV.
>
> It's a shame the Atom developers didn't opt to use CodeMirror – for one
> thing it supports files > 2mb just fine, and for another we could have
> implemented Juno on top of it. But there you go.
>
> Massive disclaimer: I wrote Julia's LT integration so I'm not exactly
> unbiased.
>
> (PS Hans: You can do block selection in LT by dragging with the alt key)
>
> On 29 November 2014 at 14:27, Pileas  wrote:
>
>> Yes Daniel. I agree with you. I use Atom as my main editor and I am quite
>> happy.
>>
>> With each release it becomes better and I am sure that it will approach
>> Sublime's speed once it matures a little bit more. I am sure that people
>> who worked with Sublime Text work in Atom now. And it appears to me that
>> there are no new releases for Sublime (as far as I know).
>>
>> Best,
>> "Pileas"
>>
>> Τη Σάββατο, 29 Νοεμβρίου 2014 4:14:17 π.μ. UTC-5, ο χρήστης Daniel
>> Carrera έγραψε:
>>>
>>> Hi Pileas,
>>>
>>> Ok. So I installed Atom and I have now spent several hours playing with
>>> it. I am impressed, and I like it. I did hit an issue with font sizes which
>>> took a lot of effort to resolve. But moving past that, I think Atom will
>>> replace Sublime Text on my desktop. It has a similar look & feel
>>> (especially for me: multiple cursors and minimap) but I find Atom easier to
>>> configure, and I find it easier to discover new features. Atom already
>>> gives me several features that I do not currently have with Sublime:
>>>
>>> 1) Syntax highlighting for Julia and both modern Fortran and old
>>> Fortran. I actually need both. I use two different codes for my
>>> simulations. One is in F95 and the other is F77. Sublime gives me ZERO
>>> syntax highlighting for F77, which actually when I need it the most because
>>> F77 is quite difficult to read.
>>>
>>> 2) Spell checking, including spell check inside LaTeX files. I'm sure
>>> there is a way to get this in Sublime, but the fact that I do not yet have
>>> it at least indicates that the feature was less discoverable in Sublime
>>> than in Atom.
>>>
>>>
>>> So I'm happy. I am still exploring Atom, but I think it has already
>>> replaced Sublime for me.
>>>
>>> Cheers,
>>> Daniel.
>>>
>>>
>>>
>>> On 28 November 2014 at 17:54, Pileas  wrote:
>>>
 I use Atom. It resembles so much with Sublime (maybe the same people
 work there).

 I tried Light Table. It is faster when it opens (this is a problem that
 Atom has so far: it is a little slow), but I find Atom easier to work with.
 Easy to install packages and themes. Supports many languages syntax
 (Fortran and Julia included).

 I don't know about Bracket.

 Τη Παρασκευή, 28 Νοεμβρίου 2014 11:39:43 π.μ. UTC-5, ο χρήστης Daniel
 Carrera έγραψε:
>
> Hi everyone,
>
> Can anyone here comment or share opinions on the newer text editors --
> Atom, Light Table, Bracket -- that seem to be trying to supplant Sublime
> Text? A lot of the information you find online seems to be geared toward
> web development, but my interest is programming with Julia (and Fortran).
> That's why I asking for opinions on the Julia mailing list.
>
> I currently use Sublime Text, and I am very happy with it. But I am
> curious about the others, since they seem to intentionally copy the most
> important features from Sublime Text. If you have experience with these
> editors and can tell me why you like one better than another, I would love
> to hear it.
>
> Cheers,
> Dani

Re: [julia-users] Help with a SegFault when calling native code.

2014-11-29 Thread Isaiah Norton
You can see where the SEGV handler is set up in init.c (see
mach_segv_listener).
It might also be useful to set a break in the "create" function on the JVM
C API side, and step through from there.

On Sat, Nov 29, 2014 at 6:20 AM, Avik Sengupta 
wrote:

> So I am trying to get JavaCall.jl working with JDK8. It is currently
> supported only on JDK7. Theoretically, everything should be backward
> compatible and work out of the box, but of course, the gap between theory
> and practice ... etc..
>
> While everything works with 1.7, I get a seg fault with 1.8, but strangely
> the process does not exit. The call looks like this:
>
> res = ccall(create, Cint, (Ptr{Ptr{JavaVM}}, Ptr{Ptr{JNIEnv}},
> Ptr{J.JavaVMInitArgs}), ppjvm, ppenv, &vm_args)
>
> This call is of course deeply entertwined with the specifics of the JVM,
> so I'm really looking for help with some ideas to debug this.
>
> So when I make this call in 1.8, I see the following message printed on
> screen:
>
> signal (11): Segmentation fault: 11
> unknown function (ip: 311308980)
>
> However, strangely,  the call still returns a value indicating success.
> And (most) subsequent calls to the JVM also return successfully. In fact,
> the entire JavaCall.jl testsuite runs successfully.  The "unknown function"
> message seems to come out of task.c, but I don't understand where the
> segfault is trapped.
>
> When I run julia within lldb, I don't seem to get much information:
>
> signal (11): Segmentation fault: 11
> unknown function (ip: 314786484)
> Process 86657 stopped
> * thread #1: tid = 0xe2de0, 0x000112c342b4, queue =
> 'com.apple.main-thread', stop reason = signal SIGSEGV
> frame #0: 0x000112c342b4
> -> 0x112c342b4:  movl   (%rsi), %eax
>0x112c342b6:  leaq   0xf8(%rbp), %rsi
>0x112c342bd:  vmovdqu %ymm0, (%rsi)
>0x112c342c1:  vmovdqu %ymm7, 0x20(%rsi)
> (lldb) bt
> * thread #1: tid = 0xe2de0, 0x000112c342b4, queue =
> 'com.apple.main-thread', stop reason = signal SIGSEGV
>   * frame #0: 0x000112c342b4
>
> So what can I do to debug this further?
>
> Thanks
> -
> Avik
>
>


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Daniel Carrera
On 29 November 2014 at 15:27, Pileas  wrote:

> I am sure that people who worked with Sublime Text work in Atom now. And
> it appears to me that there are no new releases for Sublime (as far as I
> know).
>

I am pretty sure that that is not true. Sublime Text is a one-man project.
It is written by Jon Skinner. Atom is made by GitHub, and one of its core
features is supposed to be integration with GitHub. So no, they are not the
same developers.

Development of Sublime has slowed down, but it has not stopped, and the
project is not dead. Jon has been working on other tasks in recent months.
I would also argue that Sublime is pretty mature as it is, so a slow-down
is not too unreasonable. Or maybe Jon is just bored and wants to take a
break.

Cheers,
Daniel.


Re: [julia-users] Re: N in NTuple not enforced

2014-11-29 Thread Andrew Dolgert
Apparently I was wanting something to do. I'll fix it. - Drew



Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Mike Innes
One good reason to use Light Table is that it has pretty good support for
using Julia interactively. Things like eval'ing the current code block in
the editor, highlighting and linking to lines that cause errors, support
for eval in modules, inline Gadfly plots etc. See here 
if you're interested. Plus, no one else supports highlighting for string
interpolation, so far as I know ;)

The downside of LT is that it really lacks the maturity and familiarity and
Sublime, Atom and friends. If you're used to really powerful text editing
features you'll have to relearn some tools and forgo others. For some the
tradeoff here is worthwhile, for some not; personally, going without it
(and back to reloading modules in the terminal) feels a lot like banging
rocks together, but YMMV.

It's a shame the Atom developers didn't opt to use CodeMirror – for one
thing it supports files > 2mb just fine, and for another we could have
implemented Juno on top of it. But there you go.

Massive disclaimer: I wrote Julia's LT integration so I'm not exactly
unbiased.

(PS Hans: You can do block selection in LT by dragging with the alt key)

On 29 November 2014 at 14:27, Pileas  wrote:

> Yes Daniel. I agree with you. I use Atom as my main editor and I am quite
> happy.
>
> With each release it becomes better and I am sure that it will approach
> Sublime's speed once it matures a little bit more. I am sure that people
> who worked with Sublime Text work in Atom now. And it appears to me that
> there are no new releases for Sublime (as far as I know).
>
> Best,
> "Pileas"
>
> Τη Σάββατο, 29 Νοεμβρίου 2014 4:14:17 π.μ. UTC-5, ο χρήστης Daniel Carrera
> έγραψε:
>>
>> Hi Pileas,
>>
>> Ok. So I installed Atom and I have now spent several hours playing with
>> it. I am impressed, and I like it. I did hit an issue with font sizes which
>> took a lot of effort to resolve. But moving past that, I think Atom will
>> replace Sublime Text on my desktop. It has a similar look & feel
>> (especially for me: multiple cursors and minimap) but I find Atom easier to
>> configure, and I find it easier to discover new features. Atom already
>> gives me several features that I do not currently have with Sublime:
>>
>> 1) Syntax highlighting for Julia and both modern Fortran and old Fortran.
>> I actually need both. I use two different codes for my simulations. One is
>> in F95 and the other is F77. Sublime gives me ZERO syntax highlighting for
>> F77, which actually when I need it the most because F77 is quite difficult
>> to read.
>>
>> 2) Spell checking, including spell check inside LaTeX files. I'm sure
>> there is a way to get this in Sublime, but the fact that I do not yet have
>> it at least indicates that the feature was less discoverable in Sublime
>> than in Atom.
>>
>>
>> So I'm happy. I am still exploring Atom, but I think it has already
>> replaced Sublime for me.
>>
>> Cheers,
>> Daniel.
>>
>>
>>
>> On 28 November 2014 at 17:54, Pileas  wrote:
>>
>>> I use Atom. It resembles so much with Sublime (maybe the same people
>>> work there).
>>>
>>> I tried Light Table. It is faster when it opens (this is a problem that
>>> Atom has so far: it is a little slow), but I find Atom easier to work with.
>>> Easy to install packages and themes. Supports many languages syntax
>>> (Fortran and Julia included).
>>>
>>> I don't know about Bracket.
>>>
>>> Τη Παρασκευή, 28 Νοεμβρίου 2014 11:39:43 π.μ. UTC-5, ο χρήστης Daniel
>>> Carrera έγραψε:

 Hi everyone,

 Can anyone here comment or share opinions on the newer text editors --
 Atom, Light Table, Bracket -- that seem to be trying to supplant Sublime
 Text? A lot of the information you find online seems to be geared toward
 web development, but my interest is programming with Julia (and Fortran).
 That's why I asking for opinions on the Julia mailing list.

 I currently use Sublime Text, and I am very happy with it. But I am
 curious about the others, since they seem to intentionally copy the most
 important features from Sublime Text. If you have experience with these
 editors and can tell me why you like one better than another, I would love
 to hear it.

 Cheers,
 Daniel.

>>>
>>
>>
>> --
>> When an engineer says that something can't be done, it's a code phrase
>> that means it's not fun to do.
>>
>


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Pileas
Yes Daniel. I agree with you. I use Atom as my main editor and I am quite 
happy.

With each release it becomes better and I am sure that it will approach 
Sublime's speed once it matures a little bit more. I am sure that people 
who worked with Sublime Text work in Atom now. And it appears to me that 
there are no new releases for Sublime (as far as I know).

Best,
"Pileas"

Τη Σάββατο, 29 Νοεμβρίου 2014 4:14:17 π.μ. UTC-5, ο χρήστης Daniel Carrera 
έγραψε:
>
> Hi Pileas,
>
> Ok. So I installed Atom and I have now spent several hours playing with 
> it. I am impressed, and I like it. I did hit an issue with font sizes which 
> took a lot of effort to resolve. But moving past that, I think Atom will 
> replace Sublime Text on my desktop. It has a similar look & feel 
> (especially for me: multiple cursors and minimap) but I find Atom easier to 
> configure, and I find it easier to discover new features. Atom already 
> gives me several features that I do not currently have with Sublime:
>
> 1) Syntax highlighting for Julia and both modern Fortran and old Fortran. 
> I actually need both. I use two different codes for my simulations. One is 
> in F95 and the other is F77. Sublime gives me ZERO syntax highlighting for 
> F77, which actually when I need it the most because F77 is quite difficult 
> to read.
>
> 2) Spell checking, including spell check inside LaTeX files. I'm sure 
> there is a way to get this in Sublime, but the fact that I do not yet have 
> it at least indicates that the feature was less discoverable in Sublime 
> than in Atom.
>
>
> So I'm happy. I am still exploring Atom, but I think it has already 
> replaced Sublime for me.
>
> Cheers,
> Daniel.
>
>
>
> On 28 November 2014 at 17:54, Pileas > 
> wrote:
>
>> I use Atom. It resembles so much with Sublime (maybe the same people work 
>> there).
>>
>> I tried Light Table. It is faster when it opens (this is a problem that 
>> Atom has so far: it is a little slow), but I find Atom easier to work with. 
>> Easy to install packages and themes. Supports many languages syntax 
>> (Fortran and Julia included).
>>
>> I don't know about Bracket.
>>
>> Τη Παρασκευή, 28 Νοεμβρίου 2014 11:39:43 π.μ. UTC-5, ο χρήστης Daniel 
>> Carrera έγραψε:
>>>
>>> Hi everyone,
>>>
>>> Can anyone here comment or share opinions on the newer text editors -- 
>>> Atom, Light Table, Bracket -- that seem to be trying to supplant Sublime 
>>> Text? A lot of the information you find online seems to be geared toward 
>>> web development, but my interest is programming with Julia (and Fortran). 
>>> That's why I asking for opinions on the Julia mailing list.
>>>
>>> I currently use Sublime Text, and I am very happy with it. But I am 
>>> curious about the others, since they seem to intentionally copy the most 
>>> important features from Sublime Text. If you have experience with these 
>>> editors and can tell me why you like one better than another, I would love 
>>> to hear it.
>>>
>>> Cheers,
>>> Daniel.
>>>
>>
>
>
> -- 
> When an engineer says that something can't be done, it's a code phrase 
> that means it's not fun to do.
>  


Re: [julia-users] Re: N in NTuple not enforced

2014-11-29 Thread Stefan Karpinski
Sound analysis. Care to take a crack at a fix since you've gotten this far? You 
might end up as contributor #300 :-)


> On Nov 29, 2014, at 1:03 AM, Andrew Dolgert  wrote:
> 
> I didn't know about NTuple. It's not a typical TypeConstructor, made with 
> typealias. It's a core type, implemented in jltypes.c, and you've found a 
> bug. Let's look more closely.
> 
> julia> snoop(x)=(println(x, " ", typeof(x)); x)
> julia> type ftest{T}
>  data::f(NTuple{T,Int})
>   end
> NTuple{T,Int64} DataType
> NTuple{T,Int64} DataType
> 
> julia> x=ftest{2}((1,2)) # This is how it normally works.
> (Int64,Int64) (DataType,DataType)
> 
> julia> x=ftest{Float64}((1,2)) # And the goof.
> NTuple{Float64,Int64} DataType
> julia> x.data
> (1,2)
> 
> There is a loop in jl_type_intersect, where it finds the length of the tuple. 
> It initializes to the length of the actual tuple, then looks for a length, 
> and doesn't throw an error if it fails to find one. It's my first time 
> looking there, but, you know, HTH.
> 
> Drew


[julia-users] Efficient bytes to BitArray conversion

2014-11-29 Thread sebastien . fabrice . besnier
Hello,

I would like to convert a byte string like b"abe34" into a BitArray. I 
could use this function, but it will be horribly slow :

function bytesToBitarray(s::Array{Uint8,1}) 
   t = BitArray(size(s, 1)*8)
   for i in 1:size(s, 1)
   for j in 0:7
 t[8(i-1) + j + 1] = s[i] & (1<

[julia-users] Debugging with tasks

2014-11-29 Thread Paweł Biernat
Hi,
I have been using tasks to create iterators but I encountered the following 
difficulty.  Here is a minimal example

julia> f()=error("abc")
f (generic function with 1 method)

julia> f()
ERROR: abc
 in f at none:1

julia> consume(Task(f))
ERROR: abc
 in schedule_and_wait at task.jl:256
 in consume at task.jl:167

When I call f directly I get to know where in f the error was coming from 
(in f at none:1), but when I call f through task I get non such 
information.  Is it possible to get more detailed error information when 
using tasks?

Paweł


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread J Luis
I once installed Atom but when I realized that it was eating me 200 Mb of 
RAM without even a file loaded I uninstalled it right away. I'm not buying  
(expensive) laptop RAM to be wasted that way.

Sábado, 29 de Novembro de 2014 12:59:31 UTC, Hans W Borchers escreveu:
>
> One thing I need quite often is the "block selection mode".
> For instance adding the same characters in front of several lines, or 
> deleting or adding commas in all lines of a data table.
> I know how to do this with TextMate or Kate, but generally have 
> difficulties finding it in a new editor.
> For example how to do this with Atom, Sublime, or Brackets? Thanks.
>
>
> On Saturday, November 29, 2014 10:26:06 AM UTC+1, Daniel Carrera wrote:
>>
>> Kate already has a lot of features, so maybe for you there is no reason 
>> to switch. Personally, for me, the main feature I would miss in Kate is 
>> multiple cursors. With Sublime Text (and Atom, LT, and Brackets) you can 
>> have multiple cursors so you can edit multiple lines of text at the same 
>> time. In my code, I often have several lines of text that look similar. For 
>> example:
>>
>> const r_sun = 695500.0KiloMeter; export r_sun
>> const r_jupiter =  69173.0KiloMeter; export r_jupiter
>> const r_saturn  =  57316.0KiloMeter; export r_saturn 
>> const r_neptune =  24553.0KiloMeter; export r_neptune
>> const r_uranus  =  25266.0KiloMeter; export r_uranus 
>> const r_earth   =   6367.4KiloMeter; export r_earth  
>> const r_venus   =   6051.9KiloMeter; export r_venus  
>> const r_mars=   3388.5KiloMeter; export r_mars   
>> const r_mercury =   2439.7KiloMeter; export r_mercury
>> const r_pluto   =   1184.0KiloMeter; export r_pluto  
>> const r_ceres   =476.0KiloMeter; export r_ceres  
>> const r_vesta   =265.0KiloMeter; export r_vesta  
>>
>>
>> This is the physical radius of various solar system bodies. Suppose I 
>> also want to have the mass of these bodies (m_sun, m_jupiter, etc...). Then 
>> I have to replace "r_" with "m_" and KiloMeter with KiloGram in every line, 
>> and then change the numbers. I find it convenient to put the cursor on the 
>> first line, press Shift+Alt+Down eleven times and have 12 cursors going at 
>> the same time.
>>
>> I know that this is not a critical feature, but it is the feature I would 
>> miss the most if I moved to Kate. So it might be the best answer to your 
>> question.
>>
>> Cheers,
>> Daniel.
>>
>>
>>
>>
>> On 29 November 2014 at 07:38, K Leo  wrote:
>>
>>> Just tried Atom.  It appears very good, but I am not sure what 
>>> advantages it has over Kate which is what I have been using?
>>>
>>> On 2014年11月29日 00:54, Pileas wrote:
>>>
 I use Atom. It resembles so much with Sublime (maybe the same people 
 work there).

 I tried Light Table. It is faster when it opens (this is a problem that 
 Atom has so far: it is a little slow), but I find Atom easier to work 
 with. 
 Easy to install packages and themes. Supports many languages syntax 
 (Fortran and Julia included).

 I don't know about Bracket.

 Τη Παρασκευή, 28 Νοεμβρίου 2014 11:39:43 π.μ. UTC-5, ο χρήστης Daniel 
 Carrera έγραψε:

 Hi everyone,

 Can anyone here comment or share opinions on the newer text
 editors -- Atom, Light Table, Bracket -- that seem to be trying to
 supplant Sublime Text? A lot of the information you find online
 seems to be geared toward web development, but my interest is
 programming with Julia (and Fortran). That's why I asking for
 opinions on the Julia mailing list.

 I currently use Sublime Text, and I am very happy with it. But I
 am curious about the others, since they seem to intentionally copy
 the most important features from Sublime Text. If you have
 experience with these editors and can tell me why you like one
 better than another, I would love to hear it.

 Cheers,
 Daniel.

  
>>>
>>
>>
>> -- 
>> When an engineer says that something can't be done, it's a code phrase 
>> that means it's not fun to do.
>>  
>

Re: [julia-users] Multiple lines statement?

2014-11-29 Thread Stefan Karpinski
You can use parents to force a line continuation as well since an expression 
can't be done while the parents are unclosed.


> On Nov 29, 2014, at 2:05 AM, Tamas Papp  wrote:
> 
> Also, some editors can wrap a single long line of code seamlessly when
> necessary, which achieves the same without linebreaks in the source.
> 
> An example is visual-line-mode in Emacs.
> 
> Best,
> 
> Tamas
> 
> PS.: Except, of course, if the programmer wants to emphasize something
> with a line break at a particular point, eg
> 
> (a + b) /
>  (c + d)
> 
>> On Sat, Nov 29 2014, John Myles White  wrote:
>> 
>> Not to my knowledge, but you can do
>> 
>> 2 +
>> 3
>> 
>> This also has the virtue of being a bit easier to read, since you wouldn’t 
>> think that you were talking about +3, which is a valid expression in 
>> isolation.
>> 
>> — John
>> 
>>> On Nov 28, 2014, at 9:36 PM, Gabriel Mihalache  wrote:
>>> 
>>> Hello! Is there a Julia equivalent to MATLAB's ... ?
>>> E.g.
>>> 
>>> 2 ...
>>> +3
>>> 
>>> evaluates to 5.
>>> 
>>> This is for the purpose of making a .jl file more readable, of course.
>>> 
>>> Thank you!


Re: [julia-users] Re: Type Casting Weirdness?

2014-11-29 Thread Tamas Papp
In general, I am more concerned about the following scenario: type A
makes sense, type B in general, does not, yet a subset of type B values
can be converted to A in a reasonable way, so an the implementation
performs this silently and everything seems fine.

But at the same time, had I known that I left a type B value in there, I
would be concerned, eg because I am assuming that it is exact when it
isn't (integers vs floats) is problematic, or that conversion is
possible only for a subset of the domain, and other values are possible
but rare enough for my unit tests not to discover them, and will strike
me on the nose at some future point like a rake carelessly left in the
grass.

Best,

Tamas

On Sat, Nov 29 2014, Stefan Karpinski  wrote:

> Our conversions throw errors when the value cannot be converted exactly these 
> days so it could be done pretty safely. But yes, this is just because there's 
> no applicable method of linspace.
>
>
>> On Nov 29, 2014, at 7:07 AM, Tamas Papp  wrote:
>>
>> I think of this as a feature: using a float when only an integer makes
>> sense is most likely a bug in my code. Automatic conversion would mask
>> the problem.
>>
>> Best,
>>
>> Tamas
>>
>>> On Sat, Nov 29 2014, ele...@gmail.com wrote:
>>>
>>> One of the primary paradigms of Julia is the use of multiple dispatch, that
>>> is choosing which method to call based on the types of the parameters
>>> provided.  To quote from the manual
>>> http://docs.julialang.org/en/latest/manual/methods/#defining-methods "No
>>> automatic casting or conversion of function arguments is ever performed:
>>> all conversion in Julia is non-magical and completely explicit."
>>>
>>> Cheers
>>> Lex
>>>
 On Saturday, November 29, 2014 8:17:26 PM UTC+10, Christoph Ortner wrote:


 In Julia 3.3  `linspace(0, 1, 10) `  works, but`linspace(0, 1, 10.)`
 does not.

 Why is the type not automatically converted to Int when possible? Is this
 intended or a bug?

Christoph










Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Hans W Borchers
One thing I need quite often is the "block selection mode".
For instance adding the same characters in front of several lines, or 
deleting or adding commas in all lines of a data table.
I know how to do this with TextMate or Kate, but generally have 
difficulties finding it in a new editor.
For example how to do this with Atom, Sublime, or Brackets? Thanks.


On Saturday, November 29, 2014 10:26:06 AM UTC+1, Daniel Carrera wrote:
>
> Kate already has a lot of features, so maybe for you there is no reason to 
> switch. Personally, for me, the main feature I would miss in Kate is 
> multiple cursors. With Sublime Text (and Atom, LT, and Brackets) you can 
> have multiple cursors so you can edit multiple lines of text at the same 
> time. In my code, I often have several lines of text that look similar. For 
> example:
>
> const r_sun = 695500.0KiloMeter; export r_sun
> const r_jupiter =  69173.0KiloMeter; export r_jupiter
> const r_saturn  =  57316.0KiloMeter; export r_saturn 
> const r_neptune =  24553.0KiloMeter; export r_neptune
> const r_uranus  =  25266.0KiloMeter; export r_uranus 
> const r_earth   =   6367.4KiloMeter; export r_earth  
> const r_venus   =   6051.9KiloMeter; export r_venus  
> const r_mars=   3388.5KiloMeter; export r_mars   
> const r_mercury =   2439.7KiloMeter; export r_mercury
> const r_pluto   =   1184.0KiloMeter; export r_pluto  
> const r_ceres   =476.0KiloMeter; export r_ceres  
> const r_vesta   =265.0KiloMeter; export r_vesta  
>
>
> This is the physical radius of various solar system bodies. Suppose I also 
> want to have the mass of these bodies (m_sun, m_jupiter, etc...). Then I 
> have to replace "r_" with "m_" and KiloMeter with KiloGram in every line, 
> and then change the numbers. I find it convenient to put the cursor on the 
> first line, press Shift+Alt+Down eleven times and have 12 cursors going at 
> the same time.
>
> I know that this is not a critical feature, but it is the feature I would 
> miss the most if I moved to Kate. So it might be the best answer to your 
> question.
>
> Cheers,
> Daniel.
>
>
>
>
> On 29 November 2014 at 07:38, K Leo > 
> wrote:
>
>> Just tried Atom.  It appears very good, but I am not sure what advantages 
>> it has over Kate which is what I have been using?
>>
>> On 2014年11月29日 00:54, Pileas wrote:
>>
>>> I use Atom. It resembles so much with Sublime (maybe the same people 
>>> work there).
>>>
>>> I tried Light Table. It is faster when it opens (this is a problem that 
>>> Atom has so far: it is a little slow), but I find Atom easier to work with. 
>>> Easy to install packages and themes. Supports many languages syntax 
>>> (Fortran and Julia included).
>>>
>>> I don't know about Bracket.
>>>
>>> Τη Παρασκευή, 28 Νοεμβρίου 2014 11:39:43 π.μ. UTC-5, ο χρήστης Daniel 
>>> Carrera έγραψε:
>>>
>>> Hi everyone,
>>>
>>> Can anyone here comment or share opinions on the newer text
>>> editors -- Atom, Light Table, Bracket -- that seem to be trying to
>>> supplant Sublime Text? A lot of the information you find online
>>> seems to be geared toward web development, but my interest is
>>> programming with Julia (and Fortran). That's why I asking for
>>> opinions on the Julia mailing list.
>>>
>>> I currently use Sublime Text, and I am very happy with it. But I
>>> am curious about the others, since they seem to intentionally copy
>>> the most important features from Sublime Text. If you have
>>> experience with these editors and can tell me why you like one
>>> better than another, I would love to hear it.
>>>
>>> Cheers,
>>> Daniel.
>>>
>>>  
>>
>
>
> -- 
> When an engineer says that something can't be done, it's a code phrase 
> that means it's not fun to do.
>  


Re: [julia-users] Re: Type Casting Weirdness?

2014-11-29 Thread Stefan Karpinski
Our conversions throw errors when the value cannot be converted exactly these 
days so it could be done pretty safely. But yes, this is just because there's 
no applicable method of linspace.


> On Nov 29, 2014, at 7:07 AM, Tamas Papp  wrote:
> 
> I think of this as a feature: using a float when only an integer makes
> sense is most likely a bug in my code. Automatic conversion would mask
> the problem.
> 
> Best,
> 
> Tamas
> 
>> On Sat, Nov 29 2014, ele...@gmail.com wrote:
>> 
>> One of the primary paradigms of Julia is the use of multiple dispatch, that
>> is choosing which method to call based on the types of the parameters
>> provided.  To quote from the manual
>> http://docs.julialang.org/en/latest/manual/methods/#defining-methods "No
>> automatic casting or conversion of function arguments is ever performed:
>> all conversion in Julia is non-magical and completely explicit."
>> 
>> Cheers
>> Lex
>> 
>>> On Saturday, November 29, 2014 8:17:26 PM UTC+10, Christoph Ortner wrote:
>>> 
>>> 
>>> In Julia 3.3  `linspace(0, 1, 10) `  works, but`linspace(0, 1, 10.)`
>>> does not.
>>> 
>>> Why is the type not automatically converted to Int when possible? Is this
>>> intended or a bug?
>>> 
>>>Christoph
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 


Re: [julia-users] Re: Type Casting Weirdness?

2014-11-29 Thread Tamas Papp
I think of this as a feature: using a float when only an integer makes
sense is most likely a bug in my code. Automatic conversion would mask
the problem.

Best,

Tamas

On Sat, Nov 29 2014, ele...@gmail.com wrote:

> One of the primary paradigms of Julia is the use of multiple dispatch, that
> is choosing which method to call based on the types of the parameters
> provided.  To quote from the manual
> http://docs.julialang.org/en/latest/manual/methods/#defining-methods "No
> automatic casting or conversion of function arguments is ever performed:
> all conversion in Julia is non-magical and completely explicit."
>
> Cheers
> Lex
>
> On Saturday, November 29, 2014 8:17:26 PM UTC+10, Christoph Ortner wrote:
>>
>>
>> In Julia 3.3  `linspace(0, 1, 10) `  works, but`linspace(0, 1, 10.)`
>> does not.
>>
>> Why is the type not automatically converted to Int when possible? Is this
>> intended or a bug?
>>
>> Christoph
>>
>>
>>
>>
>>
>>
>>
>>


[julia-users] Help with a SegFault when calling native code.

2014-11-29 Thread Avik Sengupta
So I am trying to get JavaCall.jl working with JDK8. It is currently 
supported only on JDK7. Theoretically, everything should be backward 
compatible and work out of the box, but of course, the gap between theory 
and practice ... etc.. 

While everything works with 1.7, I get a seg fault with 1.8, but strangely 
the process does not exit. The call looks like this: 

res = ccall(create, Cint, (Ptr{Ptr{JavaVM}}, Ptr{Ptr{JNIEnv}}, 
Ptr{J.JavaVMInitArgs}), ppjvm, ppenv, &vm_args)

This call is of course deeply entertwined with the specifics of the JVM, so 
I'm really looking for help with some ideas to debug this. 

So when I make this call in 1.8, I see the following message printed on 
screen: 

signal (11): Segmentation fault: 11
unknown function (ip: 311308980)

However, strangely,  the call still returns a value indicating success. And 
(most) subsequent calls to the JVM also return successfully. In fact, the 
entire JavaCall.jl testsuite runs successfully.  The "unknown function" 
message seems to come out of task.c, but I don't understand where the 
segfault is trapped. 

When I run julia within lldb, I don't seem to get much information: 

signal (11): Segmentation fault: 11
unknown function (ip: 314786484)
Process 86657 stopped
* thread #1: tid = 0xe2de0, 0x000112c342b4, queue = 
'com.apple.main-thread', stop reason = signal SIGSEGV
frame #0: 0x000112c342b4
-> 0x112c342b4:  movl   (%rsi), %eax
   0x112c342b6:  leaq   0xf8(%rbp), %rsi
   0x112c342bd:  vmovdqu %ymm0, (%rsi)
   0x112c342c1:  vmovdqu %ymm7, 0x20(%rsi)
(lldb) bt
* thread #1: tid = 0xe2de0, 0x000112c342b4, queue = 
'com.apple.main-thread', stop reason = signal SIGSEGV
  * frame #0: 0x000112c342b4

So what can I do to debug this further? 

Thanks
-
Avik



[julia-users] Re: Type Casting Weirdness?

2014-11-29 Thread elextr
One of the primary paradigms of Julia is the use of multiple dispatch, that 
is choosing which method to call based on the types of the parameters 
provided.  To quote from the manual 
http://docs.julialang.org/en/latest/manual/methods/#defining-methods "No 
automatic casting or conversion of function arguments is ever performed: 
all conversion in Julia is non-magical and completely explicit."

Cheers
Lex

On Saturday, November 29, 2014 8:17:26 PM UTC+10, Christoph Ortner wrote:
>
>
> In Julia 3.3  `linspace(0, 1, 10) `  works, but`linspace(0, 1, 10.)`   
> does not.
>
> Why is the type not automatically converted to Int when possible? Is this 
> intended or a bug?
>
> Christoph
>
>
>
>
>
>
>
>

[julia-users] Type Casting Weirdness?

2014-11-29 Thread Christoph Ortner

In Julia 3.3  `linspace(0, 1, 10) `  works, but`linspace(0, 1, 10.)`   
does not.

Why is the type not automatically converted to Int when possible? Is this 
intended or a bug?

Christoph









Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Daniel Carrera
Kate already has a lot of features, so maybe for you there is no reason to
switch. Personally, for me, the main feature I would miss in Kate is
multiple cursors. With Sublime Text (and Atom, LT, and Brackets) you can
have multiple cursors so you can edit multiple lines of text at the same
time. In my code, I often have several lines of text that look similar. For
example:

const r_sun = 695500.0KiloMeter; export r_sun
const r_jupiter =  69173.0KiloMeter; export r_jupiter
const r_saturn  =  57316.0KiloMeter; export r_saturn
const r_neptune =  24553.0KiloMeter; export r_neptune
const r_uranus  =  25266.0KiloMeter; export r_uranus
const r_earth   =   6367.4KiloMeter; export r_earth
const r_venus   =   6051.9KiloMeter; export r_venus
const r_mars=   3388.5KiloMeter; export r_mars
const r_mercury =   2439.7KiloMeter; export r_mercury
const r_pluto   =   1184.0KiloMeter; export r_pluto
const r_ceres   =476.0KiloMeter; export r_ceres
const r_vesta   =265.0KiloMeter; export r_vesta


This is the physical radius of various solar system bodies. Suppose I also
want to have the mass of these bodies (m_sun, m_jupiter, etc...). Then I
have to replace "r_" with "m_" and KiloMeter with KiloGram in every line,
and then change the numbers. I find it convenient to put the cursor on the
first line, press Shift+Alt+Down eleven times and have 12 cursors going at
the same time.

I know that this is not a critical feature, but it is the feature I would
miss the most if I moved to Kate. So it might be the best answer to your
question.

Cheers,
Daniel.




On 29 November 2014 at 07:38, K Leo  wrote:

> Just tried Atom.  It appears very good, but I am not sure what advantages
> it has over Kate which is what I have been using?
>
> On 2014年11月29日 00:54, Pileas wrote:
>
>> I use Atom. It resembles so much with Sublime (maybe the same people work
>> there).
>>
>> I tried Light Table. It is faster when it opens (this is a problem that
>> Atom has so far: it is a little slow), but I find Atom easier to work with.
>> Easy to install packages and themes. Supports many languages syntax
>> (Fortran and Julia included).
>>
>> I don't know about Bracket.
>>
>> Τη Παρασκευή, 28 Νοεμβρίου 2014 11:39:43 π.μ. UTC-5, ο χρήστης Daniel
>> Carrera έγραψε:
>>
>> Hi everyone,
>>
>> Can anyone here comment or share opinions on the newer text
>> editors -- Atom, Light Table, Bracket -- that seem to be trying to
>> supplant Sublime Text? A lot of the information you find online
>> seems to be geared toward web development, but my interest is
>> programming with Julia (and Fortran). That's why I asking for
>> opinions on the Julia mailing list.
>>
>> I currently use Sublime Text, and I am very happy with it. But I
>> am curious about the others, since they seem to intentionally copy
>> the most important features from Sublime Text. If you have
>> experience with these editors and can tell me why you like one
>> better than another, I would love to hear it.
>>
>> Cheers,
>> Daniel.
>>
>>
>


-- 
When an engineer says that something can't be done, it's a code phrase that
means it's not fun to do.


Re: [julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-29 Thread Daniel Carrera
Hi Pileas,

Ok. So I installed Atom and I have now spent several hours playing with it.
I am impressed, and I like it. I did hit an issue with font sizes which
took a lot of effort to resolve. But moving past that, I think Atom will
replace Sublime Text on my desktop. It has a similar look & feel
(especially for me: multiple cursors and minimap) but I find Atom easier to
configure, and I find it easier to discover new features. Atom already
gives me several features that I do not currently have with Sublime:

1) Syntax highlighting for Julia and both modern Fortran and old Fortran. I
actually need both. I use two different codes for my simulations. One is in
F95 and the other is F77. Sublime gives me ZERO syntax highlighting for
F77, which actually when I need it the most because F77 is quite difficult
to read.

2) Spell checking, including spell check inside LaTeX files. I'm sure there
is a way to get this in Sublime, but the fact that I do not yet have it at
least indicates that the feature was less discoverable in Sublime than in
Atom.


So I'm happy. I am still exploring Atom, but I think it has already
replaced Sublime for me.

Cheers,
Daniel.



On 28 November 2014 at 17:54, Pileas  wrote:

> I use Atom. It resembles so much with Sublime (maybe the same people work
> there).
>
> I tried Light Table. It is faster when it opens (this is a problem that
> Atom has so far: it is a little slow), but I find Atom easier to work with.
> Easy to install packages and themes. Supports many languages syntax
> (Fortran and Julia included).
>
> I don't know about Bracket.
>
> Τη Παρασκευή, 28 Νοεμβρίου 2014 11:39:43 π.μ. UTC-5, ο χρήστης Daniel
> Carrera έγραψε:
>>
>> Hi everyone,
>>
>> Can anyone here comment or share opinions on the newer text editors --
>> Atom, Light Table, Bracket -- that seem to be trying to supplant Sublime
>> Text? A lot of the information you find online seems to be geared toward
>> web development, but my interest is programming with Julia (and Fortran).
>> That's why I asking for opinions on the Julia mailing list.
>>
>> I currently use Sublime Text, and I am very happy with it. But I am
>> curious about the others, since they seem to intentionally copy the most
>> important features from Sublime Text. If you have experience with these
>> editors and can tell me why you like one better than another, I would love
>> to hear it.
>>
>> Cheers,
>> Daniel.
>>
>


-- 
When an engineer says that something can't be done, it's a code phrase that
means it's not fun to do.


Re: [julia-users] max_parallel keyword of addprocs?

2014-11-29 Thread Amit Murthy
This is only supported on 0.4. Which version of Julia are you running?

Yes, you can repeat the same host to addprocs as the number of cores.

On Sat, Nov 29, 2014 at 11:48 AM, Gabriel Mihalache 
wrote:

> In the documentation the signature for addprocs doesn't have it but it's
> discussed below.
>
> http://julia.readthedocs.org/en/latest/stdlib/base/?highlight=max_parallel
>
> In practice it's not working, it complained of unknown keyword.
>
> Should I just addprocs each node as many CPUs it has?
>
> Thank you!
>


Re: [julia-users] Julia on ARM Radxa Rock Pro Quad Core

2014-11-29 Thread Viral Shah
I added USE_BLAS64=0 to ARM.inc. Could you git pull and try again?

-viral



> On 29-Nov-2014, at 1:01 pm, Airhead Bit  wrote:
> 
> Yes, followed the directions made a Make.user added the include ARM.inc if I 
> had not I don't think the compile would have completed, no x86 stuff on the 
> Radxa box where I compiled it.
> No, I don't think an ARMv8 would even run ARM7 code, not sure.
> Radxa Rock Pro is ARM7 hfp with an ARM9 (quad core ARM7) 2GB memory, 8GB 
> Flash, desktop box, nice for working with Android.
>  
> Should I add USE_BLAS64=0 to the Make.user and re-compile?
> Is there a way to have make testall load juliadebug test/all?
> 
> 
> 
> On Friday, November 28, 2014 11:18:39 AM UTC-7, Airhead Bit wrote:
> Just finished compiling one Error: 
> Warning: error initializing module LinAlg:
> ErrorException("BLAS and LAPACK are compiled with 32-bit integer support, but 
> Julia expects 64-bit integers. Please build Julia with USE_BLAS64=0.")
> exports.jl
> 
> Julia works at the prompt but: TOP shows 400% CPU... 
> 
> root@radxa:~/julia# make testall
> JULIA test/all
> Master process (id 1) could not connect within 60.0 seconds.
> exiting.
> Master process (id 1) could not connect within 60.0 seconds.
> exiting.
> Master process (id 1) could not connect within 60.0 seconds.
> exiting.
> Worker 5 terminated.
> Worker 4 terminated.Worker 2 terminated.
> 
> Eventually I was left with two Julia process's that each took 198.n% until I 
> killed the terminal
> I'm going to build a clean system and build adding USE_BLAS64=0 in the 
> Make.user file.
> 
> Any other ideas for a build? 
> Any ideas on how to tell what is sucking all the CPU?
>  
>