[julia-users] confusion about Date comprehension types

2014-07-24 Thread cnbiz850
I tested 2 ways of constructing date array. But I got two different types of the arrays from the two ways. How can I make them the same? What is the proper Date type? At least, I hope not to use the Any type. -- julia dats = [date(2014, 7, ii) for ii=1:4] 4-element

[julia-users] what is the easiest way to convert array type?

2014-07-24 Thread cnbiz850
I have an Array{Any,1}, but I want to convert to Array{String,1}. The only way I know is through comprehension. julia dt 3-element Array{Any,1}: 2010/1/4T15:00:00 2010/1/5T15:00:00 2010/1/6T15:00:00 julia dts = [convert(String, dt[i]) for i=1:length(dt)] 3-element Array{String,1}:

Re: [julia-users] Re: what is the easiest way to convert array type?

2014-07-24 Thread cnbiz850
Thanks. Didn't know about that syntax. Now with it, I might prefer the following as Array{String,1} is exactly what I want. julia dts1 = convert(Array{String,1},dt) 3-element Array{String,1}: 2010/1/4T15:00:00 2010/1/5T15:00:00 2010/1/6T15:00:00 On 2014年07月25日 10:40, Miles Lubin wrote:

[julia-users] string array concatenates with a string not working?

2014-07-24 Thread cnbiz850
julia VA 3-element Array{ASCIIString,1}: A B C julia VA * T ERROR: `*` has no method matching *(::Array{ASCIIString,1}, ::ASCIIString)

Re: [julia-users] string array concatenates with a string not working?

2014-07-24 Thread cnbiz850
Just found it works on DataArray: julia da = DataArray([A, B, C]) 3-element DataArray{ASCIIString,1}: A B C julia da * T 3-element DataArray{Any,1}: AT BT CT On 2014年07月25日 11:57, cnbiz850 wrote: That sounds confusing. You just mentioned that Vector{String} is semantically equivalent

[julia-users] how to insert at index?

2014-07-15 Thread cnbiz850
I did the following on a DataFrame, but got error. What should I do instead? julia df = insert!(df, 25, dfa) ERROR: `insert!` has no method matching insert!(::DataFrame, ::Int64, ::DataFrame)

Re: [julia-users] DataFrames.jl problem

2014-06-24 Thread cnbiz850
using the latest build and most updated packages, I don't have that problem. | | |_| | | | (_| | | Version 0.3.0-prerelease+3863 (2014-06-24 04:00 UTC) _/ |\__'_|_|_|\__'_| | Commit c300f5f* (0 days old master) |__/ | x86_64-linux-gnu julia using DataFrames julia

Re: [julia-users] Re: juliabloggers.com is now live!

2014-06-17 Thread cnbiz850
I use g2reader (http://www.g2reader.com) and can't subscribe to this. Don't know why. It complains about: Entered url doesn't contain valid feed or doesn't link to feed. It is also possible feed contains no items. On 06/17/2014 08:38 PM, Randy Zwitch wrote: My apologies, I think the link got

Re: [julia-users] Re: juliabloggers.com is now live!

2014-06-16 Thread cnbiz850
Is there something wrong with the feed? http://www.juliabloggers.com/feed/ juliabloggers.com Entered url doesn't contain valid feed or doesn't link to feed. It is also possible feed contains no items. On 06/16/2014 08:52 PM, Randy Zwitch wrote: Nothing shady about it at all and a good

[julia-users] What to do with julia's core dumped

2014-06-15 Thread cnbiz850
$ julia _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation: http://docs.julialang.org _ _ _| |_ __ _ | Type help() to list help topics | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.3.0-prerelease+3680

[julia-users] Re: What to do with julia's core dumped

2014-06-15 Thread cnbiz850
The core dump has to do with removing sys.so. When I restored it, julia did not core dump, instead, it printed out errors in my code. On 06/16/2014 07:18 AM, cnbiz850 wrote: $ julia _ _ _ _(_)_ | A fresh approach to technical computing

Re: [julia-users] what is the deal with !

2014-06-14 Thread cnbiz850
/#introduction http://docs.julialang.org/en/latest/stdlib/base/#introduction -Jacob On Thu, Jun 12, 2014 at 9:53 PM, cnbiz850 cnbi...@gmail.com javascript: mailto:cnbi...@gmail.com javascript: wrote: Can't find a description. I guess that when

[julia-users] DataFrames delete row very slow

2014-06-12 Thread cnbiz850
I use the following to delete a row: function deleterow(df::DataFrame, row::Int) return df[[1:row-1, row+1:end], :] end The time it takes to delete 1000 rows in a 22,000-row df is about 16 seconds. Are there more efficient ways to do it?

Re: [julia-users] Re: DataFrames delete row very slow

2014-06-12 Thread cnbiz850
Thanks very much Matt. It takes no time now. On 06/12/2014 10:35 PM, Matt Bauman wrote: You're making 1000 slightly different copies of your huge dataframe by doing it one-by-one. Can you do all 1000 removals at once? Even if you're finding the rows to remove iteratively, simply store a

[julia-users] what is the deal with !

2014-06-12 Thread cnbiz850
Can't find a description. I guess that when it is used after a function name it makes the modified array argument passed back to the caller. Is that right, or is that all it is used for?

Re: [julia-users] what is the deal with !

2014-06-12 Thread cnbiz850
notes section, but if you have suggestions of other places it should be mentioned, I'm sure it wouldn't hurt! http://docs.julialang.org/en/latest/stdlib/base/#introduction -Jacob On Thu, Jun 12, 2014 at 9:53 PM, cnbiz850 cnbiz...@gmail.com mailto:cnbiz...@gmail.com wrote: Can't find

Re: [julia-users] Trying to install 0.3 prerelease on Ubuntu but keep geting 0.2.1

2014-06-09 Thread cnbiz850
On 06/10/2014 06:30 AM, J Luis wrote: Hi, I'm trying to install 0.3 via PPA (just updated to Ubuntu 14.01 to see if worked better as I had other issues with 13.10) but all I get is 0.2.1. I am on Xubuntu 14.04 and it works fine.

[julia-users] how to print out part of a row in DataFrame?

2014-06-09 Thread cnbiz850
I only got the following formatted display but not my values. To me this is really not desired, does everyone prefer this? Can I get a printout of the values just as I print out a row of an array? julia println(df[jj, 1:20]) 1x20 DataFrame |---|--||-| | Col # | Name |

Re: [julia-users] Re: how to print out part of a row in DataFrame?

2014-06-09 Thread cnbiz850
Thanks John for the update. Do I need to do a clone to get the new change? I think there are two issues here. One is to display df, a row of it, or part of a row, like julia df julia df[3, 1:20] The other is to print out (to the terminal or to a file). On the first issue, I hope

Re: [julia-users] PSA: new ~/.julia_history format

2014-06-08 Thread cnbiz850
Since I deleted .julia_history2 yesterday, I don't have the history errors now. Don't know if that was the culprit. On 06/08/2014 08:02 AM, Stefan Karpinski wrote: Please do let me know of it continues to be broken for you. On Jun 7, 2014, at 6:41 PM, cnbiz850 cnbiz...@gmail.com wrote

Re: [julia-users] PSA: new ~/.julia_history format

2014-06-07 Thread cnbiz850
Lately, every time I start up julia I got the following error. And every time I have to delete ~/.julia_history. Why? -- $ julia _ _ _ _(_)_ | A fresh approach to technical computing (_) | (_) (_)| Documentation:

Re: [julia-users] PSA: new ~/.julia_history format

2014-06-07 Thread cnbiz850
, including example contents from a produced ~/.julia_history file. On Sat, Jun 7, 2014 at 6:28 PM, cnbiz850 cnbiz...@gmail.com mailto:cnbiz...@gmail.com wrote: Lately, every time I start up julia I got the following error. And every time I have to delete ~/.julia_history. Why

Re: [julia-users] Re: how to use the iterator without loops?

2014-06-05 Thread cnbiz850
Thanks again for the help. Yes, I do know the number of dimensions before the iterations start, but it is high, as high as 50, and is different under different situations. So I try to simplify code for that. The cartesian package is interesting and I will study it. Besides that, is there

Re: [julia-users] packaging parameters for functions revisited

2014-05-30 Thread cnbiz850
Thanks very much for the summary. It is very interesting that assignFromArray is much faster than indexedArray. Can anyone explain why? On 05/30/2014 05:42 PM, Jon Norberg wrote: There have been several posts about this, so I tried to compile what I could find to compare speed and pretty

[julia-users] 2 sessions freeze up machine

2014-05-30 Thread cnbiz850
I ran 2 julia programs each with a single CPU at the same time on a machine with 8 CPU's. After sometime (while the programs are running), the machine freezes - no mouse or keyboard responses. It happened a few time this morning. This seems just happened to the newly built versions. It was

Re: [julia-users] 2 sessions freeze up machine

2014-05-30 Thread cnbiz850
with the shared libraries that julia started to use recently. On 05/31/2014 11:43 AM, Isaiah Norton wrote: It will be helpful to know what you are running. Linear algebra operations via OpenBLAS can use multiple threads. On Fri, May 30, 2014 at 11:38 PM, cnbiz850 cnbiz...@gmail.com

[julia-users] performance of multiple julia sessions degrade

2014-05-13 Thread cnbiz850
I ran 2 functions in 2 separate julia sessions, each using a single CPU. I found the processes' speed reduced to nearly half. Would anyone explain/confirm?

Re: [julia-users] performance of multiple julia sessions degrade

2014-05-13 Thread cnbiz850
what happened? Please share your hardware information, as well as the code you were running. On Tue, May 13, 2014 at 8:48 PM, cnbiz850 cnbiz...@gmail.com mailto:cnbiz...@gmail.com wrote: I ran 2 functions in 2 separate julia sessions, each using a single CPU. I found the processes

[julia-users] array element assignment very expensive in profile

2014-05-12 Thread cnbiz850
Profile shows the two lines in the function being very expensive. Is there anything inappropriate? Any way to improve? function NoUpdate(data::Data) data.cum[data.i] = data.cum[data.i-1] data.i += 1 end type Data cum::Array{Float32,1} i::Int32 ... end

Re: [julia-users] array element assignment very expensive in profile

2014-05-12 Thread cnbiz850
down to be minimal? if you provide more context, it's more likely someone could help you. Cheers, Kevin On Monday, May 12, 2014, cnbiz850 cnbiz...@gmail.com mailto:cnbiz...@gmail.com wrote: Profile shows the two lines in the function being very expensive. Is there anything inappropriate

Re: [julia-users] array element assignment very expensive in profile

2014-05-12 Thread cnbiz850
cnbiz850 wrote: Profile shows the two lines in the function being very expensive. Is there anything inappropriate? Any way to improve? function NoUpdate(data::Data) data.cum[data.i] = data.cum[data.i-1] data.i += 1 end type Data cum::Array{Float32,1} i::Int32 ... end

Re: [julia-users] readcsv returns Array{T, 1}

2014-05-11 Thread cnbiz850
I hope this is related. Why isn't part of a row of Array{T, 2} of Array{T, 1}? Consider vec1 in the following example. df = readcsv(fname) vec1 = df[3, 1:4]

Re: [julia-users] possible to forgo new in constructor

2014-05-10 Thread cnbiz850
Thanks. This is a lot better in my mind because it gets rid of the trouble associated with matching the orders of the fields, which can be a big problem with many fields. I wonder what you mean by constructing incomplete objects gratuitously is a bad idea. On 05/11/2014 05:43 AM, Stefan

[julia-users] question on performance

2014-05-10 Thread cnbiz850
I tried to use comprehension in loops but found it somehow slower. In the following example, the loop in first code is slower than in the second. Would anyone please explain why? === function ffcombs() [Int8[i1,i2] for i1 in II, i2 in II] end combs = ffcombs() ii = zeros(Int8,2) for

Re: [julia-users] getting readtable to work

2014-05-09 Thread cnbiz850
With Julia 0.3, readtable works. On 05/10/2014 12:38 AM, Dustin Lee wrote: I'm getting the following when trying to create a dataframe. I'd appreciate some tips on how to troubleshoot this. julia Julia Version 0.2.1 Commit e44b593905 (2014-01-30 13:47 UTC) Platform Info: System: Linux

[julia-users] possible to forgo new in constructor

2014-05-09 Thread cnbiz850
As in the following example, new(aa,bb) is very redundant from coding point of view. Since all fields are already declared and listed in the type definition, is it possible not to list them again with the new statement? The new statement can be very troublesome when the type has many fields.

Re: [julia-users] possible to forgo new in constructor

2014-05-09 Thread cnbiz850
type AA aa::Int bb::Float64 end is valid (and common). On Fri, May 9, 2014 at 2:32 PM, cnbiz850 cnbiz...@gmail.com mailto:cnbiz...@gmail.com wrote: As in the following example, new(aa,bb) is very redundant from coding point of view. Since all fields are already declared

[julia-users] invalid redefinition of constant MyType

2014-05-08 Thread cnbiz850
I defined a composite type MyType. But when I modified it and tried to rerun a code that uses it, I got error: invalid redefinition of constant MyType. How can I avoid that?

[julia-users] difference between inside and outside constructors

2014-05-08 Thread cnbiz850
Would anyone explain the differences between the following two ways of defining a composite type? = type AA aa bb function AA() aa=1 bb=2 new(aa,bb) end end type BB aa bb end function BB() aa=1 bb=2 return BB(aa,bb) end

Re: [julia-users] Question about 'dot' notation (and max/maximum)

2014-05-05 Thread cnbiz850
My question is if x + A does not make sense in any way other than x .+ A, then why introduce .+ at all since + means intuitively .+ and is simpler? On 05/02/2014 09:55 PM, Hans W Borchers wrote: julia 5 + x WARNING: x::Number + A::Array is deprecated, use x .+ A instead.

Re: [julia-users] Rename column names in a DataFrames

2014-05-04 Thread cnbiz850
DataFrames is a package I have been battling with recently. I must admit that getting a good knowledge about it is not easy, surely I hope that is different for other people. But after going through a lot of digging - searching the web, asking questions either here or at the issues with the

Re: [julia-users] What editor/environment do you use when developing in Julia?

2014-05-04 Thread cnbiz850
On Linux, gedit is great. The julia plugin works really well, with auto-completion. On 05/05/2014 02:10 AM, Aerlinger wrote: I'm using vim for the most part but was hoping to get a feel on what other people are using or if there are good alternatives out there. I've tried Julia Studio but it

[julia-users] Julia Tutorials

2014-05-01 Thread cnbiz850
Just found this page with tutorials on a few packages. The one I found quite helpful, even though a little old, is on DataFrames, much more helpful than DataFrames's original documentation. https://github.com/JuliaLang/julia-tutorial

Re: [julia-users] Julia Tutorials

2014-05-01 Thread cnbiz850
, at 11:04 PM, cnbiz850 cnbiz...@gmail.com wrote: Just found this page with tutorials on a few packages. The one I found quite helpful, even though a little old, is on DataFrames, much more helpful than DataFrames's original documentation. https://github.com/JuliaLang/julia-tutorial

Re: [julia-users] Bug or feature? Array{Number} squared gives Array{Any}

2014-04-30 Thread cnbiz850
I got a sense that Any is widely misused and mishandled in Julia. It requires some cleanup. Anyone agree? On 04/30/2014 07:41 PM, Ariel Keselman wrote: see simplified behavior below: https://lh4.googleusercontent.com/-buanLj1oJlU/U2DhZ4Fo2XI/HS4/xC8WkdiahEM/s1600/Capture1.PNG

[julia-users] question about DataFrames package

2014-04-30 Thread cnbiz850
My question is what is a symbol as in the following warning message? = julia df = DataFrame(A = 1:10, B = 2:2:20) 10x2 DataFrame |---||| | Row # | A | B | | 1 | 1 | 2 | | 2 | 2 | 4 | | 3 | 3 | 6 | | 4 | 4 | 8 | | 5 | 5 | 10 | | 6 | 6 | 12 |

[julia-users] Anyone created MIME type for julia files?

2014-04-28 Thread cnbiz850
Care to share?

Re: [julia-users] Re: Help me optimize Stochastic Gradient Descent of Least Squares Error

2014-04-27 Thread cnbiz850
That is a great tip, thanks. I am having similar issues. I had the program in a file and run it with include(prog.jl) at the julia prompt. It used to take 12 seconds per 1 loops. Now Putting it into a function and also changed some variables to const, I got it down to 3 seconds per

[julia-users] help with combined for statement

2014-04-24 Thread cnbiz850
for ff[1] in factors, ff[2] in factors, ff[3] in factors, ff[4] in factors, ff[5] in factors, ff[6] in factors, ff[7] in factors, ff[8] in factors, ff[9] in factors To simplify the above, I tried the following but it didn't work: for ff[1:9] in factors Is there a similar simple way to

Re: [julia-users] julia nightlies current version

2014-04-23 Thread cnbiz850
I think you are running Xubuntu Raring, which reached end of life, and so they stopped building nightly for that OS. I am on Trusty and am getting the nightly for Saucy. On 04/23/2014 06:26 PM, Földes László wrote: Is the Julia nightlies update every day as it used to do around

[julia-users] help with using multiple cores

2014-04-19 Thread cnbiz850
Copied the following test code from the online documentation. When tried to run it, I got the errors. Any guidance please? == a = randn(1000) @parallel (+) for i=1:10 f(a[randi(end)]) end == $ julia -p 4 _ _ _(_)_ | A fresh approach to technical computing

[julia-users] Re: help with using multiple cores

2014-04-19 Thread cnbiz850
, cnbiz850 wrote: Copied the following test code from the online documentation. When tried to run it, I got the errors. Any guidance please? == a = randn(1000) @parallel (+) for i=1:10 f(a[randi(end)]) end == $ julia -p 4 _ _ _(_)_ | A fresh approach to technical

[julia-users] Re: help with using multiple cores

2014-04-19 Thread cnbiz850
, cnbiz850 wrote: Sorry, the error messages must have to do with the undefined f. It works with the folowing. So I guess simply adding @parallel (+) on a for loop can then realize using multiple cores? === nheads = @parallel (+) for i=1:2 int(randbool()) end === On 04/19/2014

[julia-users] line continuation

2014-04-16 Thread cnbiz850
Searched but didn't find an answer. Does Julia allow statement to continue on the next line?

Re: [julia-users] line continuation

2014-04-16 Thread cnbiz850
: If the expression is incomplete, continuation is automatic. There is no explicit continuation syntax. On Apr 16, 2014, at 6:01 PM, cnbiz850 cnbiz...@gmail.com wrote: Searched but didn't find an answer. Does Julia allow statement to continue on the next line?

Re: [julia-users] julia installation on Ubuntu

2014-04-15 Thread cnbiz850
Sounds like you have some broken packages in Ubuntu. I would open Synaptic to resolve the broken packages first. On 04/16/2014 06:17 AM, Stéphane Laurent wrote: Hi, I have just tried to install Julia but typing julia as a command line does not run anything (command not found). I have

[julia-users] easy way to print elegantly

2014-04-07 Thread cnbiz850
julia println(aa, , bb) 1.5231071779744345 33.97688693695 Is there a simple way to print 1.52 33.97 perhaps without the C format?

Re: [julia-users] easy way to print elegantly

2014-04-07 Thread cnbiz850
, cnbiz850 cnbiz...@gmail.com mailto:cnbiz...@gmail.com wrote: julia println(aa, , bb) 1.5231071779744345 33.97688693695 Is there a simple way to print 1.52 33.97 perhaps without the C format?

[julia-users] how to determine a variable is a number

2014-03-23 Thread cnbiz850
typeof(var) gives something too specific, like Int16, Float32, etc. Is there a convenient way to determine if var is a number or something else (string)? I tried isreal(var), but it gives an error in case var is not a number.

[julia-users] Re: how to determine a variable is a number

2014-03-23 Thread cnbiz850
OK, just found this. typeof(var) : Number On 03/24/2014 09:20 AM, cnbiz850 wrote: typeof(var) gives something too specific, like Int16, Float32, etc. Is there a convenient way to determine if var is a number or something else (string)? I tried isreal(var), but it gives an error in case var

Re: [julia-users] Re: how to determine a variable is a number

2014-03-23 Thread cnbiz850
Use to determine something read in from a file. On 03/24/2014 09:30 AM, Collin Glass wrote: Hmm.. What's your use case? I mean you could just whip up a quick function isnum that returns true if typeof is any of the collection of formats. On Sunday, March 23, 2014 9:20:51 PM UTC-4, K leo

Re: [julia-users] Simple speed test

2014-03-22 Thread cnbiz850
On Ubuntu Trusty 64bits with i7 laptop, my result as follows. Notice the difference from Jason's julia @elapsed begin x = 0 for n = 1:1 x += 1 end x end 4.576735929 julia function g()

Re: [julia-users] Re: Not fun

2014-03-21 Thread cnbiz850
Well, from this perspective, it makes sense why those strings should not be mutable. But from other perspectives, making strings immutable contradicts with how natural languages are used. For instance, after I said I am a professor, I want to say I am a scientist, or perhaps I change my

Re: [julia-users] Re: [First post] What IDE everyone uses?

2014-03-19 Thread cnbiz850
That doesn't seem to work. I got the the follow: julia-studio-julia-0.3-compatibility/bin$ ./julia-studio.sh ./julia-studio.sh: 35: exec: ./JuliaStudio: not found On 03/19/2014 10:56 PM, Uwe Fechner wrote: Hi, Julia Studio for Julia 0.3beta is available here:

[julia-users] [First post] What IDE everyone uses?

2014-03-16 Thread cnbiz850
Hi everyone, I am new to Julia. JuliaStudio is broken for me with the new 0.3 nightly. But I discovered gedit is great with Julia. It even has code completion. Any other good environment?