[julia-users] how to move Julia packages from Ubuntu to OSX?

2015-06-12 Thread K leo
I just installed Julia on a MacBook Pro running OSX 10.0.3 (I am new to OSX). Installed Julia in the Applications folder. But for the packages that I have been using on Ubuntu, I copied the whole directory ~/.julia from Ubuntu to the Mac. Then I did a Pkg.build() in Julia. Things seem OK

[julia-users] how to check if a type has a certain field

2015-05-12 Thread K leo
type Tech cl::Array{Float64,1} function Tech() this = new() this.cl=[1:4] this end end tech = Tech() How can I check if tech.asf is not a valid field?

[julia-users] Re: help with include_string

2015-05-12 Thread K leo
I hope to be able to easily plot some variables or formula based on a combination of variables. Typing in the ones at run time seems very convenient. On Wednesday, May 13, 2015, Yichao Yu yyc1...@gmail.com wrote: On Tue, May 12, 2015 at 5:21 PM, K leo cnbiz...@gmail.com javascript:; wrote

[julia-users] Re: help with include_string

2015-05-12 Thread K leo
In this test case yes, but my intention is to input that string (tech.cl in this test case) at run time, so in the real case, no. On Tuesday, May 12, 2015, Yichao Yu yyc1...@gmail.com wrote: Can't you just use `y1 = tech.cl` here?

[julia-users] Re: help with include_string

2015-05-11 Thread K leo
(2015-04-30 23:40 UTC) _/ |\__'_|_|_|\__'_| | Official http://julialang.org release |__/ | x86_64-linux-gnu On Sunday, May 10, 2015, K leo cnbiz...@gmail.com wrote: I try read in a variable at run time and use include_string to assign it to another variable, but I got errors

[julia-users] Re: help with include_string

2015-05-11 Thread K leo
:50 PM, K leo cnbiz...@gmail.com javascript:_e(%7B%7D,'cvml','cnbiz...@gmail.com'); wrote: Is is broken, or is there something I did wrong? _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org

[julia-users] Re: help with include_string

2015-05-11 Thread K leo
I guess I found the problem, but don't know a solution. The following test code (same as the previous one except that I put them in a function) now produces the same problem as my real code. type Tech cl::Array{Float64,1} cm::Array{Float64,1} function Tech() this = new()

[julia-users] help with include_string

2015-05-09 Thread K leo
I try read in a variable at run time and use include_string to assign it to another variable, but I got errors. Originally, the following code works: y1 = tech.cl But when I try to include from input with this code: println(Input the variable) tt=\n

[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

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

2015-01-15 Thread K leo
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? _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation:

Re: [julia-users] Later methods definition replaces the previous one?

2015-01-12 Thread K leo
I noticed that too, and initially it costed me quite some effort in finding out what went wrong. Is it possible for julia to warn at run time that there are multiple method definitions? On Tuesday, January 13, 2015, Petr Krysl krysl.p...@gmail.com wrote: I have two nested modules, both of them

[julia-users] Re: how to input array or convert string to array?

2015-01-11 Thread K leo
Seems an easy way is to input 1:10, read it in with realine, then split the string and reconstruct the array. Anyone would suggest more intelligent ways? On Monday, January 12, 2015, K leo cnbiz...@gmail.com wrote: Is there a way to input at STDIN an array? Suppose, I type in [1:10] at STDIN

[julia-users] Re: how to input array or convert string to array?

2015-01-11 Thread K leo
That is awesome, thank Peter. On Monday, January 12, 2015, Peter Simon psimon0...@gmail.com wrote: julia t = include_string([1:10]) 10-element Array{Int64,1}: 1 2 3 4 5 6 7 8 9 10 On Sunday, January 11, 2015 at 8:49:43 PM UTC-8, K leo wrote: Is there a way

[julia-users] how to input array or convert string to array?

2015-01-11 Thread K leo
Is there a way to input at STDIN an array? Suppose, I type in [1:10] at STDIN I would like the program to assign A=[1:10]. Or, I know realine can take it as a string [1:10], so is there a way to convert the string to an array? Somewhat similar to converting a string to an Int?

Re: [julia-users] Speeding up Floating Point Operations in Julia

2015-01-06 Thread K leo
Might be slightly off-topic, but closely related. Does anyone find the logic to run a code first just to compile it and then do the real run afterwards somewhat flawed, or am I missing anything? Suppose I have a code that takes a day to finish after being compiled. So the first run (since it is

[julia-users] Is there a null IOStream?

2014-12-07 Thread K Leo
At times I don't want to output anything, so I pass a null IOStream to a function that requires an IOStream. How to do that?

Re: [julia-users] Re: Is there a null IOStream?

2014-12-07 Thread K Leo
redirection right now: | julia run(`echo Hello` | DevNull) julia print(DevNull, Hello) ERROR: type DevNullStream has no field status in isopen at stream.jl:286 in check_open at stream.jl:293 in write at stream.jl:730 in print at ascii.jl:93 | On Sunday, December 7, 2014 7:24:53 PM UTC-5, K leo

Re: [julia-users] Missing newline in file output?

2014-12-07 Thread K Leo
in my case it works perfectly. _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type help() for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.3.3

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

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

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

2014-11-28 Thread K Leo
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

Re: [julia-users] Re: Is Dict{ASCIIString, Any} not a superset of Dict{ASCIIString, Float64}?

2014-11-26 Thread K Leo
I ran into similar mental difficulty regarding whether type Any is a superset of any other types. I did not find anything to read, but simply accepted the fact through painstaking experiments. I think the word Any here is confusing. The English definition of it means that it ought to

Re: [julia-users] Re: Is Dict{ASCIIString, Any} not a superset of Dict{ASCIIString, Float64}?

2014-11-26 Thread K Leo
a prerequisites section that lists all of the concepts that readers are assumed to already understand. -- John On Nov 26, 2014, at 7:27 PM, K Leo cnbi...@gmail.com javascript: wrote: I ran into similar mental difficulty regarding whether type Any is a superset of any other

Re: [julia-users] [Offtopic:] Why you did choose the name Julia?

2014-11-25 Thread K Leo
results = search(Julia) for result in results if contains(result, program) println(result) end end On 2014年11月25日 15:40, Francesco Bonazzi wrote: The problem with the name Julia is that you find a lot of other stuff unrelated to programming when you look on Google.

[julia-users] how to do array (or collection) of functions

2014-11-24 Thread K Leo
I have a bunch of functions with same signature. I would like to invoke them one by one at run time. What is the best way of doing this? Can I put them all in an array or some other collection and loop through it at the run time?

Re: [julia-users] [Offtopic:] Why you did choose the name Julia?

2014-11-24 Thread K Leo
Very likely Julia was a significant person in that someone's mind. Perhaps we should find out who she was. On 2014年11月25日 06:28, Isaiah Norton wrote: Alan Edelman told me specifically that it was not named after the fractal, and in fact that Julia doesn't refer to anything in

Re: [julia-users] How Julia do math operations

2014-11-04 Thread K Leo
julia 2*10.97 + 23.9985 45.9385005 julia 2*10.97 + 23.9985 == 45.9385005 true Amazing. I never expected this. Is floating point comparison going to be guaranteed? On 2014年11月05日 08:48, Stefan Karpinski wrote: Some systems round their answers as John said but it's easy to

Re: [julia-users] How Julia do math operations

2014-11-04 Thread K Leo
AM, K Leo cnbiz...@gmail.com mailto:cnbiz...@gmail.com wrote: julia 2*10.97 + 23.9985 45.9385005 julia 2*10.97 + 23.9985 == 45.9385005 true Amazing. I never expected this. Is floating point comparison going to be guaranteed? What's shocking about

Re: [julia-users] Multiple Plots with Winston

2014-11-04 Thread K Leo
pw=plot() oplot(x1, copy(z1), r) oplot(x1, copy(z2), g) display(pw) On 2014年11月05日 13:34, yaoismyh...@gmail.com wrote: Just getting into plotting data in Julia today. Gravitating towards Winston because of the similarity of its syntax to that of Matplotlib. Anyhow, I did have a question about

[julia-users] DataFrames io error

2014-11-03 Thread K Leo
I have a small program that uses DataFrames to read in a file, does some simple computation and then plots some variables using Winston. I run it with the following: julia include(PlotBasics.jl) PlotBasics (generic function with 1 method) julia PlotBasics() It runs fine the first time, but

Re: [julia-users] type confusions in list comprehensions (and how to work around it?)

2014-11-03 Thread K Leo
I found that I often have to force this conversion, which is not too difficult. The question why comprehension has to build with type Any? On 2014年11月04日 07:06, Miguel Bazdresch wrote: How could I force the type of gxs1 to be of an array of Float64? The simplest way is: gxs1 =

[julia-users] is for iteration very expensive?

2014-10-17 Thread K Leo
I have a sparse array (roughly 1/5 filled say). If I simply loop through it, it is about 10 times slower than if I loop through only the nonzero elements. Compare the following codes, the first is 10 times slower, even with the multiplications. = for i=1:length(A) if

Re: [julia-users] Re: is for iteration very expensive?

2014-10-17 Thread K Leo
. oktober 2014 skrev K leo følgende: I have a sparse array (roughly 1/5 filled say). If I simply loop through it, it is about 10 times slower than if I loop through only the nonzero elements. Compare the following codes, the first is 10 times slower, even

Re: [julia-users] Re: is for iteration very expensive?

2014-10-17 Thread K Leo
Actually, when taking my second approach, my entire code (not just this demo part) is 10 times faster. Of course, this part in within the most inner loop. On 2014年10月17日 14:35, K Leo wrote: My codes are actually within a function. They are not in global scope. On 2014年10月17日 14:32, Ivar

[julia-users] Re: is for iteration very expensive?

2014-10-17 Thread K Leo
(A)[1] for i=1:length(iA) val += (A[iA[i]] - s) * (x + y) end = On 2014年10月17日 14:21, K Leo wrote: I have a sparse array (roughly 1/5 filled say). If I simply loop through it, it is about 10 times slower than if I loop through only the nonzero elements. Compare the following codes

Re: [julia-users] Re: is for iteration very expensive?

2014-10-17 Thread K Leo
Many thanks Mauro for the explanation and guide. If I use the efficient iteration, is there a way to get the index of the nonzero element, i.e. the i of A[i] when A[i] is nonzero? On 2014年10月17日 15:03, Mauro wrote: However, if you just need to iterate over the non-zero values, it can be done

Re: [julia-users] Re: is for iteration very expensive?

2014-10-17 Thread K Leo
Just checked the sparse matrix section of the Julia manual. My question is whether what you explained only applies to actually declared sparse matrix? In my case, the A is not declared as a sparse matrix even though it has a lot of zeros in it - issparse(A) returns false. On 2014年10月17日

[julia-users] randperm very expensive, any alternative?

2014-10-16 Thread K Leo
I need to permute the indexes of an array, so I found function randperm very convenient. But it turns out very slow. The following test shows time increased 60 times. Is there an alternative to permute an array? - tic() f=0. A=[1:100] for i=1:1000 f += A[20] end toc()

Re: [julia-users] randperm very expensive, any alternative?

2014-10-16 Thread K Leo
, an array access, and a sum take about 70 times longer than an array access and a sum by themselves. Seems reasonable to me... Kevin On Thursday, October 16, 2014, K Leo cnbiz...@gmail.com mailto:cnbiz...@gmail.com wrote: I need to permute the indexes of an array, so I found function

[julia-users] cp problem

2014-10-13 Thread K Leo
It does not remove the target file first, but simply writes content on top of it and keeps the remaining contents. Look at the following example on Xubuntu 14.04: $ more test1.txt asdasfd sfasf asdad sdsdg gsdg $ more test2.txt dfs sdfs sdffsdfsgs sdgsgsdgds gsdgs sdgs sdgsdsdh $ julia

[julia-users] error of std function

2014-10-09 Thread K Leo
_ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type help() for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.3.1 (2014-09-21 21:30 UTC) _/

Re: [julia-users] Re: error of std function

2014-10-09 Thread K Leo
package is recommended. On 2014年10月10日 06:49, Patrick O'Leary wrote: On Thursday, October 9, 2014 5:42:40 PM UTC-5, K leo wrote: julia std(A, 10) A only has elements along the first dimension. What behavior do you expect here?

Re: [julia-users] Re: error of std function

2014-10-09 Thread K Leo
to read along the tenth dimension of the array. You're trying to split the array into groups of ten elements, it sounds like. [std(A[10(n-1)+1:10n]) for n in 1:length(A)./10] On Thursday, October 9, 2014 5:56:01 PM UTC-5, K leo wrote: I am hoping to get the std's of every 10

Re: [julia-users] PPA for Ubuntu 14.04 (Trusty Tahr)

2014-10-08 Thread K Leo
On Xubuntu 14.04 64, it seems to work fine: _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type help() for help. | | | | | | |/ _` | | | | |_| | | | (_| | |

[julia-users] how to check if an variable is defined?

2014-09-24 Thread K Leo
Hope to avoid the following: julia s ERROR: s not defined I guess this may be simple, but I don't know where to find.

[julia-users] congratulations to Indian dost

2014-09-24 Thread K Leo
for the wonderful achievement with Mangalyaan! With a budget less than a Hollywood movie, I bet they must have largely used (and supported?) open sources - Julia included?

Re: [julia-users] Re: issues with println to file

2014-09-23 Thread K Leo
example code. It seems like you are printing Float32 and Float16 values, and they intentionally print differently from the normal Float64 values. Ivar kl. 07:42:01 UTC+2 tirsdag 23. september 2014 skrev K leo følgende: A number like these messes up DataFrames, which considers

Re: [julia-users] Re: issues with println to file

2014-09-23 Thread K Leo
Removed the binary update and compiled julia from the 0.3.0+6 source. Things become usual. On 2014年09月23日 18:55, K Leo wrote: Sorry for double posting. There is nothing special with the print statement. It has been simply: println(file, A, ,, B, ,, C) And with that I usually got

[julia-users] issues with println to file

2014-09-22 Thread K Leo
Just updated to reportedly 0.3.1 but displayed as 0.4.0-dev+543. println to file now get something like the following. Is this intended? How can I get normal decimals? 162038.8f0,float16(160.2),0.26118204f0 _ _ _ _(_)_ | A fresh approach to technical computing

[julia-users] Re: issues with println to file

2014-09-22 Thread K Leo
A number like these messes up DataFrames, which considers it as a string which then can not be easily converted to a float. Any advice on what to do? On 2014年09月23日 09:31, K Leo wrote: Just updated to reportedly 0.3.1 but displayed as 0.4.0-dev+543. println to file now get something like

[julia-users] issue with hist

2014-09-12 Thread K Leo
Sometimes hist does not output the right number of elements. Why is this? e, h = hist(c, 10) println(e, , h) -8.0:2.0:4.0 [1,6,76,805,193,2]

[julia-users] how to use union!(s, iterable)

2014-09-04 Thread K Leo
Say I have a 2-dimensional array B, I suppose it is an iterable, but how do I construct s?

[julia-users] strange influence on speed

2014-08-26 Thread K Leo
julia cl 485-element Array{Float64,1}: 4555.0 4601.0 4693.0 4678.0 ⋮ 5821.0 5854.0 5828.0 julia lagcl = [0, cl[1:end-1]] 485-element Array{Float64,1}: 0.0 4555.0 4601.0 4693.0 ⋮ 5842.0 5821.0 5854.0 Then thinking to make the types of elements to be the same, I changed

Re: [julia-users] Re: strange influence on speed

2014-08-26 Thread K Leo
, August 26, 2014 3:14:54 PM UTC+2, K leo wrote: julia cl 485-element Array{Float64,1}: 4555.0 4601.0 4693.0 4678.0 ⋮ 5821.0 5854.0 5828.0 julia lagcl = [0, cl[1:end-1]] 485-element Array{Float64,1}: 0.0 4555.0

[julia-users] problem with array of arrays

2014-08-24 Thread K Leo
What is wrong with the following? julia A 4-element Array{Array{Int64,1},1}: [-1,2,4] [-1,2,7] [-1,2,8] [1,-2,10] julia findin(A, A[3]) 0-element Array{Int64,1}

Re: [julia-users] suggestion for good algorithms?

2014-08-22 Thread K Leo
Thanks for the response, but sorry, can you clarify what that formula means? On 2014年08月23日 09:24, Tony Fong wrote: Er, there is an almost-close-form solution no? Start with (n(odd))C(n/2+-2.5) Tony

Re: [julia-users] Announcing Julia 0.3.0 final

2014-08-21 Thread K Leo
It is great now that we have 0.3 released. Thank you all very much! A question on future updates. In the past months, I have been using julia nightlies PPA to get the most updated builds. Generally, it has been working well for me. The nightlies have not caused big problems for my

[julia-users] why sum(abs(A)) is very slow

2014-08-21 Thread K Leo
A is a 1-dimensional array. I used to compute sum(abs(A)). But when I changed to the following, the speed increased nearly 10 fold. Why is that? sumA=0 for i=1:length(A) sumA = sumA + abs(A[i]) end

[julia-users] Package built errors

2014-08-15 Thread K Leo
What to do with the following? I am on Xubuntu 14.04 64bits. == _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type help() for help.

Re: [julia-users] Re: question about array comparison

2014-08-07 Thread K Leo
= 1:size(x,1)]) 1-element Array{Int64,1}: 1 Den torsdagen den 7:e augusti 2014 kl. 06:09:23 UTC+2 skrev K leo: julia x 4x4 Array{Int64,2}: 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16 julia in(x[1,:], x

[julia-users] question about array comparison

2014-08-06 Thread K Leo
julia x 4x4 Array{Int64,2}: 1 5 9 13 2 6 10 14 3 7 11 15 4 8 12 16 julia in(x[1,:], x) false julia x[1,:] 1x4 Array{Int64,2}: 1 5 9 13 How can I check if x[1,:] is in x easily? And with the row index in x?

[julia-users] Re: random machine freeze

2014-07-31 Thread K Leo
Sorry, but really don't know what is going on. Today I had two sessions of julia each running a program (single processing), then the machine froze with no mouse and keyboard. This type of thing happened a few times in the past though not every time I run 2 julia sessions. I don't know how

Re: [julia-users] Re: random machine freeze

2014-07-31 Thread K Leo
are running out of RAM and your system is thrashing http://en.wikipedia.org/wiki/Thrashing_%28computer_science%29. On Thursday, July 31, 2014 3:06:31 AM UTC-4, K leo wrote: Sorry, but really don't know what is going on. Today I had two sessions of julia each running a program (single

<    1   2