[julia-users] Re: Parse file with a certain extension

2014-08-18 Thread Avik Sengupta
Does this file contain valid Julia statements? In which case just `include` the file. Say you have a file called config.txt in the current director with the following text: a=1 Then, on the REPL julia include(config.txt) 1 julia a 1 If the statements are not valid Julia, then you'll have

Re: [julia-users] .xlsx (excel)

2014-08-16 Thread Avik Sengupta
Yes, Taro can read a sheet from an xlsx file into a DataFrame. If you need raw access, the code inside Taro is only a few lines, you should be able to munge it to your needs. All the heavy lifting is done by the JAVA library called POI, accessed via JavaCall.jl. Regards - Avik On Friday, 15

[julia-users] Re: Parametric types of parametric types?

2014-07-21 Thread Avik Sengupta
So a type parameter is a placeholder, that takes that takes a value from a (optionally constrained) set when the type is instantiated. Thus to say immutable ECPoint{EC{P}} where EC is a concrete type does not make sense. I get the feeling you want to parameterise ECPoint by instances of EC.

[julia-users] Re: any packages for AI usage

2014-07-17 Thread Avik Sengupta
Svaksha maintains a hand curated list of Julia resources. Note that not all of them are registered in METADATA. https://github.com/svaksha/Julia.jl/blob/master/AI.md Regards - Avik On Thursday, 17 July 2014 11:59:25 UTC+1, Abe Schneider wrote: In my spare time I've been working on a

Re: [julia-users] Re: Read XLS files with Julia

2014-06-26 Thread Avik Sengupta
Thanks Charles, that is good to know. Let me know if you hit any bottlenecks. Regards - Avik On Thursday, 26 June 2014 08:34:31 UTC-5, Charles Santana wrote: Thank you guys, I have just installed Taro.jl. It seems to be perfect for my simple task. Best, Charles On Thu, Jun 26,

[julia-users] Re: Julia advice/idioms for interacting with a REST api?

2014-06-23 Thread Avik Sengupta
There were a few HTTP clients in Julia. Requests is written mostly in pure julia, and is probably the easiest to use. However, as you saw, it doesnt seem to support gzipped responses yet. If you wanted to unzip the responses yourself, take a look at https://github.com/kmsquire/GZip.jl . One

Re: [julia-users] How to read and change the content of web pages to the vector ?

2014-06-05 Thread Avik Sengupta
Second the suggestion for JSoup. Alternatively you could use BeautifulSoup. If you want the data in Julia in process, you can call either of these packages from Julia using JavaCall or PyCall respectively. Regards - Avik On Thursday, 5 June 2014 11:18:48 UTC+1, Yuuki Soho wrote: So, you

[julia-users] Re: KDB+ performance

2014-05-27 Thread Avik Sengupta
While this is an old thread, I'm not sure if a K/Q benchmark is all that relevant to Julia. I've only seen K/Q code written in conjunction with KDB (which is an in memory columnar database). So its not just benchmarking a language. Also given the specialised nature of KDB, I imagine the

[julia-users] Re: What is the ruby equivalent of this?

2014-05-24 Thread Avik Sengupta
julia type Person firstname lastname end julia fullname(x::Person) = $(x.firstname) $(x.lastname) fullname (generic function with 1 method) julia jan=Person(Jan, Janssen) Person(Jan,Janssen) julia print(fullname(jan)) Janssen Jan On Saturday, 24 May 2014 19:10:07

[julia-users] Re: Gadfly.draw() gives GLib-GObject-WARNING's and does not draw correctly

2014-05-21 Thread Avik Sengupta
Hi Florian, Issues like this are usually due to incompatible combinations of Glib/Cairo/Pango etc. So it really depends on what OS you are running this on, and how you installed Cairo and Pango. If you are on OSX, you may get some ideas from https://github.com/JuliaLang/Homebrew.jl/issues/35

[julia-users] Re: How do I zip files?

2014-05-21 Thread Avik Sengupta
https://github.com/fhs/ZipFile.jl On Wednesday, 21 May 2014 14:55:28 UTC+1, RecentConvert wrote: Is there a built-in method for zipping files or must I use an external program? The only hits in the docs were for zipping lists.

Re: [julia-users] Re: Matlab urlread('URL','method',PARAMS), anyone knows the equivalent in Julia?

2014-05-06 Thread Avik Sengupta
I'm presuming you're using this in windows. The download(url) method places the content of the url into a temporary filename. The function should then return the name of the file in which the content has been placed. Unfortunately, the windows verson of the function seems to have a bug where

[julia-users] Re: Memory allocation for vectorized operations

2014-04-29 Thread Avik Sengupta
That overhead seems constant, beyond a single temporary. So I dont suppose there is that much to be worried about, unless you are using many small arrays. julia 800-sizeof(rand(2)) 784 julia 944-sizeof(rand(20)) 784 On Tuesday, 29 April 2014 10:40:10 UTC+1, Carlos Becker wrote: Besides

[julia-users] Re: Multiple dispatch, same argument type, different return type

2014-04-21 Thread Avik Sengupta
Slightly offtopic to the question at hand, there is one implementation of day count conventions here: https://github.com/aviks/Ito.jl/blob/master/src/time/day_count.jl On Sunday, 20 April 2014 09:31:40 UTC+1, MikeEI wrote: I hope not too contrived, just for learning the Julia style: Let's

[julia-users] Re: Matlab function exist()

2014-04-16 Thread Avik Sengupta
There is isdefined , which may be what you need. http://julia.readthedocs.org/en/latest/stdlib/base/?highlight=isdefined#Base.isdefined eg: isdefined(Main, :x) On Wednesday, 16 April 2014 06:40:27 UTC+1, Peter wrote: Is there an equivalent for the Matlab function exist() which checks for

Re: [julia-users] Re: ANN: TestImages

2014-04-03 Thread Avik Sengupta
I just found the same issue with Quandl.jl yesterday. Maybe all packages should just start using Requests.jl at the standard? - Avik On Thursday, 3 April 2014 04:26:46 UTC+1, Jameson wrote: we have a `download` command in base? cool! I have a Window's-only download command in WinRPM that

Re: [julia-users] Re: ANN: TestImages

2014-04-03 Thread Avik Sengupta
Yes, as you found, `download` is indeed exported in windows. The implementation of the function however calls (in base/util.jl) success(`which $checkcmd` | DevNull) This fails since its tries to run the shell command which, which (sic) does not exist in windows. On Thursday, 3 April 2014

[julia-users] Re: Numeric Type Parameter

2014-04-02 Thread Avik Sengupta
Works: ModInt(k) = new(mod(k,n)) Doesn't Work: ModInt(k,n) = new{n}(mod(k,n)) For an inner constructor, the type parameter is placed on the type definition, and so you dont need to specify the type parameter in the function (constructor) definition. So for an inner constructor, you can say

[julia-users] Re: [UCIMLRepo] New package for downloading datasets from UCI ML repositories

2014-04-01 Thread Avik Sengupta
Hi Siddhant, It looks like the python lxml package wraps the libxml2 parser. Julia also has a package that wraps libxm2: https://github.com/lindahua/LightXML.jl. Not sure if the recoverable parsing needed by html is exposed yet, but that should not be too difficult to add, if necessary.

[julia-users] Re: AMD clBLAS bindings to julia - CLBLAS

2014-04-01 Thread Avik Sengupta
Erkin, Would you want to add this to METADATA? Regards - Avik On Tuesday, 1 April 2014 02:30:54 UTC+1, andrew cooke wrote: https://github.com/ekobir/clBLAS.jl i guess On Monday, 31 March 2014 21:19:24 UTC-3, Jiakui Wang wrote: Where is this package? Is it on Github? Thanks On

Re: [julia-users] Any method to save the variables in workspace to file?

2014-04-01 Thread Avik Sengupta
While HDF5 is the best option for cross platform and long term data storage, note that Julia does have a native serialize operation. http://docs.julialang.org/en/latest/stdlib/base/?highlight=serialize#Base.serialize However, as the documentation suggests, this reliably works only within the

[julia-users] Re: Convert to/from integer from/to string (i2osp from PKCS#1)

2014-03-11 Thread Avik Sengupta
Does this work? julia a=abcdefgh abcdefgh julia reinterpret(Int64, a.data) 1-element Array{Int64,1}: 7523094288207667809 On Tuesday, 11 March 2014 16:07:35 UTC+5:30, Robert Feldt wrote: Implementing simple RSA crypto in pure Julia (not for actual sec-sensitive use) but for low-sec

[julia-users] Re: Difference between f1(T1::Type) and f2{T2}(::Type{T2})

2014-02-28 Thread Avik Sengupta
I haven't dug that deep into the internals, but I tend to use the `f1(T1::Type)` where T1 is completely unconstrained, and can be any type in the system. On the other hand, I use the second version when I want to constrain the types that can be possible arguments: `f2{T2:Number}(::Type{T2})`

[julia-users] Re: Default instance of intrinsic type

2014-02-26 Thread Avik Sengupta
Well, there is zero(..) but that is defined only for numeric types julia zero(Int64) 0 julia zero(ASCIIString) ERROR: no method convert(Type{ASCIIString}, Int64) in zero at operators.jl:146 julia zero(Float64) 0.0 On Thursday, 27 February 2014 06:25:39 UTC, Fil Mackay wrote: Is there an

[julia-users] Re: Nightly PPA broken?

2014-02-18 Thread Avik Sengupta
Its been hopefully, fixed, but we'll have to wait for the new build to be generated and uploaded. https://github.com/JuliaLang/julia/issues/5837 While annoying, I think it is to be expected that nightlies will break every now and then. Its actually been quite rare. On Tuesday, 18 February

[julia-users] Re: Installing julia nightly builds on Ubuntu 12.04

2014-02-17 Thread Avik Sengupta
This looks to be the same as this issue: https://github.com/JuliaLang/julia/issues/5837 On Monday, 17 February 2014 09:59:50 UTC, Uwe Fechner wrote: Hello, I installed Julia yesterday on one PC following the instructions on http://julialang.org/downloads/ , and it worked fine. I am trying

[julia-users] Re: Variable not defined: Is this a bug or a feature?

2014-01-18 Thread Avik Sengupta
This is a feature. The variable defined outside the function is a global variable. If you intended to write to that inside the function, use function test_fn() print(test_vec) global test_vec = zeros(5) end Much more details at

[julia-users] Re: Initial try with MCMC

2014-01-17 Thread Avik Sengupta
This has come up a few times recently, but I am not sure why the DataArrays package doesn't get installed (it should due to the dependency resolution). The workaround is to force install of the that package Pkg.add(DataArrays) On Friday, 17 January 2014 17:18:17 UTC, Rob J Goedman wrote: Hi,

[julia-users] Re: Overwritten method with variable - how to get rid of variable?

2014-01-14 Thread Avik Sengupta
Use Base.keys(..) julia a=Dict() Dict{Any,Any}() julia a[x]=y y julia keys(a) KeyIterator{Dict{Any,Any}}({x=y}) julia keys=z Warning: imported binding for keys overwritten in module Main z julia keys(a) ERROR: type: apply: expected Function, got ASCIIString julia Base.keys(a)

<    1   2