[julia-users] Re: Error: zeros(UTF8String, 5)

2015-01-18 Thread David van Leeuwen
On Friday, January 16, 2015 at 2:44:51 PM UTC+1, Steven G. Johnson wrote:



 On Friday, January 16, 2015 at 6:59:19 AM UTC-5, K leo wrote:

 I want the array to be initialized with every element being .  Can't 
 say about 0.3.4, but it definitely worked under 0.3.3.  Are there any other 
 easy ways for what I want?


 If anything, this should be ones(UTF8String, n).   Since * is the 
 string-concatenation operator, then and  is the identity element for 
 concatenation, then one(UTF8String) should give .


This makes sense, but what was the original argument to choose * as string 
concatenation, and not, for instance, +, like in some other languages?

---david 


[julia-users] Re: Error: zeros(UTF8String, 5)

2015-01-18 Thread Ivar Nesje
And why isn't this most frequently asked question covered in our FAQ? 

http://docs.julialang.org/en/latest/manual/faq/

Re: [julia-users] Re: Error: zeros(UTF8String, 5)

2015-01-18 Thread Kevin Squire
If you have plenty of time, try scanning these conversations for an answer:

https://groups.google.com/forum/#!msg/julia-dev/4K6S7tWnuEs/RF6x-f59IaoJ
https://groups.google.com/forum/#!topic/julia-users/nQg_d_n0t1Q
https://github.com/JuliaLang/julia/issues/1771
https://github.com/JuliaLang/julia/issues/2301

If you're up for it, an update to the FAQ section of the docs
http://julia.readthedocs.org/en/latest/manual/faq/ with this information
would probably be welcome!

Cheers,
   Kevin

On Sun, Jan 18, 2015 at 7:01 AM, David van Leeuwen 
david.vanleeu...@gmail.com wrote:

 On Friday, January 16, 2015 at 2:44:51 PM UTC+1, Steven G. Johnson wrote:



 On Friday, January 16, 2015 at 6:59:19 AM UTC-5, K leo wrote:

 I want the array to be initialized with every element being .  Can't
 say about 0.3.4, but it definitely worked under 0.3.3.  Are there any other
 easy ways for what I want?


 If anything, this should be ones(UTF8String, n).   Since * is the
 string-concatenation operator, then and  is the identity element for
 concatenation, then one(UTF8String) should give .


 This makes sense, but what was the original argument to choose * as string
 concatenation, and not, for instance, +, like in some other languages?

 ---david



[julia-users] Re: Error: zeros(UTF8String, 5)

2015-01-16 Thread K leo
I want the array to be initialized with every element being .  Can't say
about 0.3.4, but it definitely worked under 0.3.3.  Are there any other
easy ways for what I want?


On Friday, January 16, 2015, Milan Bouchet-Valat nalimi...@club.fr wrote:

 Le vendredi 16 janvier 2015 à 14:29 +0800, K leo a écrit :
  julia A=zeros(UTF8String, 5)
  ERROR: `zero` has no method matching zero(::Type{UTF8String})
   in zeros at array.jl:169
 
 
  This used to work, but with the new update it doesn't.  Any idea?
 Doesn't work on 0.3.4 either. But what would you expect zero(UTF8String)
 to return? A string isn't a number. More broadly, why do you need this
 feature?


 Regards

 
_   _ _(_)_ |  A fresh approach to technical computing
(_) | (_) (_)|  Documentation: http://docs.julialang.org
 _ _   _| |_  __ _   |  Type help() for help.
| | | | | | |/ _` |  |
| | |_| | | | (_| |  |  Version 0.3.5 (2015-01-08 22:33 UTC)
   _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org release
  |__/   |  x86_64-linux-gnu
 
 




[julia-users] Re: Error: zeros(UTF8String, 5)

2015-01-16 Thread Daniel Høegh
You can do it with an array comprehension like: [ for i=1:5]

[julia-users] Re: Error: zeros(UTF8String, 5)

2015-01-16 Thread Steven G. Johnson


On Friday, January 16, 2015 at 6:59:19 AM UTC-5, K leo wrote:

 I want the array to be initialized with every element being .  Can't say 
 about 0.3.4, but it definitely worked under 0.3.3.  Are there any other 
 easy ways for what I want?


If anything, this should be ones(UTF8String, n).   Since * is the 
string-concatenation operator, then and  is the identity element for 
concatenation, then one(UTF8String) should give .


Re: [julia-users] Re: Error: zeros(UTF8String, 5)

2015-01-16 Thread Milan Bouchet-Valat
Le vendredi 16 janvier 2015 à 19:59 +0800, K leo a écrit :
 I want the array to be initialized with every element being .  Can't
 say about 0.3.4, but it definitely worked under 0.3.3.  Are there any
 other easy ways for what I want?
As Ivar said, this was probably defined in some package, not in base
Julia:
   _
   _   _ _(_)_ |  A fresh approach to technical computing
  (_) | (_) (_)|  Documentation: http://docs.julialang.org
   _ _   _| |_  __ _   |  Type help() for help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.3.3
 _/ |\__'_|_|_|\__'_|  |  
|__/   |  x86_64-redhat-linux

julia A=zeros(UTF8String, 5)
ERROR: `zero` has no method matching zero(::Type{UTF8String})
 in zeros at ./array.jl:169


Regards

 On Friday, January 16, 2015, Milan Bouchet-Valat nalimi...@club.fr
 wrote:
 Le vendredi 16 janvier 2015 à 14:29 +0800, K leo a écrit :
  julia A=zeros(UTF8String, 5)
  ERROR: `zero` has no method matching
 zero(::Type{UTF8String})
   in zeros at array.jl:169
 
 
  This used to work, but with the new update it doesn't.  Any
 idea?
 Doesn't work on 0.3.4 either. But what would you expect
 zero(UTF8String)
 to return? A string isn't a number. More broadly, why do you
 need this
 feature?
 
 
 Regards
 
 
_   _ _(_)_ |  A fresh approach to technical
 computing
(_) | (_) (_)|  Documentation:
 http://docs.julialang.org
 _ _   _| |_  __ _   |  Type help() for help.
| | | | | | |/ _` |  |
| | |_| | | | (_| |  |  Version 0.3.5 (2015-01-08 22:33
 UTC)
   _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org
 release
  |__/   |  x86_64-linux-gnu
 
 
 



Re: [julia-users] Re: Error: zeros(UTF8String, 5)

2015-01-16 Thread Kevin Squire
I believe DataFrames.jl used to define this, at least.

Cheers,
   Kevin

On Fri, Jan 16, 2015 at 5:54 AM, Milan Bouchet-Valat nalimi...@club.fr
wrote:

 Le vendredi 16 janvier 2015 à 19:59 +0800, K leo a écrit :
  I want the array to be initialized with every element being .  Can't
  say about 0.3.4, but it definitely worked under 0.3.3.  Are there any
  other easy ways for what I want?
 As Ivar said, this was probably defined in some package, not in base
 Julia:
_
_   _ _(_)_ |  A fresh approach to technical computing
   (_) | (_) (_)|  Documentation: http://docs.julialang.org
_ _   _| |_  __ _   |  Type help() for help.
   | | | | | | |/ _` |  |
   | | |_| | | | (_| |  |  Version 0.3.3
  _/ |\__'_|_|_|\__'_|  |
 |__/   |  x86_64-redhat-linux

 julia A=zeros(UTF8String, 5)
 ERROR: `zero` has no method matching zero(::Type{UTF8String})
  in zeros at ./array.jl:169


 Regards

  On Friday, January 16, 2015, Milan Bouchet-Valat nalimi...@club.fr
  wrote:
  Le vendredi 16 janvier 2015 à 14:29 +0800, K leo a écrit :
   julia A=zeros(UTF8String, 5)
   ERROR: `zero` has no method matching
  zero(::Type{UTF8String})
in zeros at array.jl:169
  
  
   This used to work, but with the new update it doesn't.  Any
  idea?
  Doesn't work on 0.3.4 either. But what would you expect
  zero(UTF8String)
  to return? A string isn't a number. More broadly, why do you
  need this
  feature?
 
 
  Regards
 
  
 _   _ _(_)_ |  A fresh approach to technical
  computing
 (_) | (_) (_)|  Documentation:
  http://docs.julialang.org
  _ _   _| |_  __ _   |  Type help() for help.
 | | | | | | |/ _` |  |
 | | |_| | | | (_| |  |  Version 0.3.5 (2015-01-08 22:33
  UTC)
_/ |\__'_|_|_|\__'_|  |  Official http://julialang.org
  release
   |__/   |  x86_64-linux-gnu