[julia-users] Re: Create EPS files with Gadfly

2016-10-19 Thread Avik Sengupta
The list of available backends to Gadfly are available 
here: http://gadflyjl.org/stable/man/backends.html

There is no EPS backend, only a PS backend, which you may be able to 
convert to eps??

Regards
-
Avik


On Wednesday, 19 October 2016 21:20:13 UTC+1, Christopher Fisher wrote:
>
> Is it possible to create .eps files in Gadfly?
>
> Thanks,
>
> Chris 
>


Re: [julia-users] Re: Julia-i18n logo proposal

2016-10-04 Thread Avik Sengupta
>Or just remove the J and put the three characters from the other scripts?

+1. I like this. 


On Tuesday, 4 October 2016 08:58:10 UTC+1, Waldir Pimenta wrote:
>
> That's an interesting idea. And Arabic tends to be associated with the 
> color green (well, Islam moreso 
> , but the correlation is 
> pretty high nevertheless), so we'd also get a nice pairing of 
> character-color as with the Chinese one :)
>
> Looking forward to hear what other folks think.
>
> On Tuesday, October 4, 2016 at 5:49:06 AM UTC+1, David P. Sanders wrote:
>>
>> Or just remove the J and put the three characters from the other scripts? 
>
>

[julia-users] Re: Changing Repositories Without Deleting METADATA

2016-10-03 Thread Avik Sengupta
I haven't used Github Desktop, but if it does not like multiple remotes, I 
would drop it, pronto. I say that because early on, I felt I "got" git only 
after I figured out how to use multiple remotes. I feel multiple remotes 
are fundamental to the design of git, being a "distributed" source control 
system. 

On Monday, 3 October 2016 05:31:18 UTC+1, Tony Kelman wrote:
>
> The conclusion I'd take out of that is not to use GitHub Desktop. It tries 
> to hide too many important things like this from you. As far as git GUIs 
> go, try SourceTree, it has a much more direct mapping between command line 
> operations and GUI buttons.



[julia-users] Re: Changing Repositories Without Deleting METADATA

2016-10-02 Thread Avik Sengupta
I usually do this directly in git, and not via Pkg commands. I go into the 
package directory, and add my fork as an additonal remote. So..

cd /home/chris/v0.5/Sundials
git remote add  chris https://github.com/ChrisRackauckas/Sundials.jl.git 

git checkout -b cool-feature
julia #Develop cool feature, test from Julia
git push chris cool-feature

I'll then create a pull request from Github's ui. 

On Sunday, 2 October 2016 18:01:28 UTC+1, Chris Rackauckas wrote:
>
> Does anyone have a good way to change repositories? A common example for 
> me is, Sundials is in JuliaDiffEq, so I fork it to my Github account for an 
> extended PR, but to work on it I need to remove my current Sundials install 
> and clone from my own repository. However, METADATA does not like this at 
> all:
>
> julia> Pkg.rm("Sundials") # Remove the JuliaDiffEq/Sundials version
> WARNING: unknown DataFrames commit 84523937, metadata may be ahead of 
> package cache
> INFO: No packages to install, update or remove
> INFO: Package database updated
>
> julia> Pkg.clone("https://github.com/ChrisRackauckas/Sundials.jl.git 
> ")
>  
> # Install from my Github
> INFO: Cloning Sundials from 
> https://github.com/ChrisRackauckas/Sundials.jl.git
> ERROR: Sundials already exists
>  in clone(::String, ::SubString{String}) at .\pkg\entry.jl:193
>  in clone(::String) at .\pkg\entry.jl:221
>  in 
> (::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#clone,Tuple{String}})() 
> at .\pkg\dir.jl:31
>  in 
> cd(::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#clone,Tuple{String}}, 
> ::String) at .\file.jl:58
>  in #cd#1(::Array{Any,1}, ::Function, ::Function, ::String, 
> ::Vararg{Any,N}) at .\pkg\dir.jl:31
>  in clone(::String) at .\pkg\pkg.jl:151
>
> In the past I would just delete METADATA and let it re-create itself, and 
> that will fix it, but then you have to re-install packages which can be a 
> mess. Since this is becoming much more common for me, I need a better way 
> to handle this. Does anyone have a better workflow?
>


[julia-users] Re: Benchmarking Julia

2016-09-27 Thread Avik Sengupta
Not sure if it's registered in metadata. if not, you can get it by 
Pkg.clone("https://github.com/JuliaCI/BaseBenchmarks.jl;)

On Tuesday, 27 September 2016 11:31:47 UTC+1, cormu...@mac.com wrote:
>
> Thanks! How do I get hold of it:
>
> julia> Pkg.add("BaseBenchmarks")
> ERROR: unknown package BaseBenchmarks
>  in macro expansion at ./pkg/entry.jl:53 [inlined]
>  in (::Base.Pkg.Entry.##2#5{String,Base.Pkg.Types.VersionSet})() at 
> ./task.jl:360
>  in sync_end() at ./task.jl:311
>  in macro expansion at ./task.jl:327 [inlined]
>


[julia-users] Re: Benchmarking Julia

2016-09-27 Thread Avik Sengupta
The canonical way to do this is 
BaseBennchmarks: https://github.com/JuliaCI/BaseBenchmarks.jl

This is the the suite of benchmarks used to track Julia's own performance 
as it is developed. 

Regards
-
Avik

On Tuesday, 27 September 2016 09:44:30 UTC+1, cormu...@mac.com wrote:
>
> I've become convinced that upgrading my Mac to the latest OS (Sierra) has 
> slowed down Julia in some areas. (One test showed a fourfold speed 
> reduction compared with the same test running on the last release.) But to 
> get some real-world numbers and eliminate some obvious explanations I'm 
> looking for something simple to install that measures general Julia 
> performance on a particular processor, compared only with itself (not 
> compared with Octave or C, for example). 
>
> Is there a ready-made suite of benchmarks that can be easily run on 0.4.7 
> and 0.5 that gives a score I can use to compare with other computers 
> running Julia?
>
>

[julia-users] Re: Problems with Memoize in Julia 0.5.0

2016-09-24 Thread Avik Sengupta
>I would file an issue with Memoize.jl; I'm not sure why the package is 
limited to memoizing only a single method definition, but this seems like 
it would need to be fixed upstream.

https://github.com/simonster/Memoize.jl/issues/5

This is probably due to the new functions changes in 0.5. 

Regards
-
Avik

On Friday, 23 September 2016 19:47:35 UTC+1, Steven G. Johnson wrote:
>
>
>
> On Friday, September 23, 2016 at 9:08:29 AM UTC-4, Ed Scheinerman wrote:
>>
>> Hello,
>>
>> I use memoization frequently and have run into two problems with the move 
>> to Julia 0.5.0. 
>>
>> The first is not too serious and I hope can be fixed readily.  The first 
>> time I memoize a function, a warning is generated like this:
>>
>
> This kind of warning is fairly innocuous and happens when we upgrade Julia 
> versions, due to language changes; it takes a while for packages to catch 
> up with a new release.
>
> In this case, it looks like it was already fixed (
> https://github.com/simonster/Memoize.jl/pull/7), but maybe a new version 
> needs to be tagged.
>
>  
>
>> More significantly, if I want multiple dispatch on a function name, the 
>> second instance creates a problem and the definition is rejected. Here I 
>> define a factorial function that always returns a BigInt. The first 
>> function definition succeeds but the second one fails:
>>
>
> I would file an issue with Memoize.jl; I'm not sure why the package is 
> limited to memoizing only a single method definition, but this seems like 
> it would need to be fixed upstream.
>
> (Note, by the way, that you could define @memoize Factorial(n::Integer) = 
> factorial(big(n)), and it will be far more efficient because it will call 
> an optimized GMP factorial function.)
>


[julia-users] Re: Broken PyPlot... need to revert to a previous version asap.

2016-08-18 Thread Avik Sengupta
Pkg.pin(packageName, version) should force a package at a particular 
version. Unfortunately, depending on how package dependencies have been set 
up, older versions of the package might still be happy to work with newer 
versions of the dependencies, and that might trigger the bug you are 
seeing. PyCall however has only a handful of dependencies, so it should not 
be to difficult to do this manually, recursively for all its dependencies. 

Regards
-
Avik

On Thursday, 18 August 2016 09:47:27 UTC+1, Ferran Mazzanti wrote:
>
> Dear all,
>
> looks like lots of messing around with versions had rendered PyPlot 
> unusable in 0.4.6 under OSX (at least).
> Now I need to do some work that requires its use so I need to have it up 
> and working. Could anybody please let me know
> if it is possible to revert to a previous working version, and how this is 
> done? I know it used to work with 0.4.6 as I had it
> installed, but once I did an update and things stopped working since then.
>
> Thanks for your help,
>
> Ferran.
>


[julia-users] Re: web scraping with Julia

2016-08-01 Thread Avik Sengupta
This may be a good opportunity to introduce our CSS Selector library in 
Julia, Cascadia.jl : https://github.com/Algocircle/Cascadia.jl

The code is based on the Cascadia GO library by Andy Balhom. 

Cascadia.jl uses the Gumbo.jl html parser, and allows querying of the 
resulting parse tree with CSS selectors. That allows you go extract data 
out of html documents with relative ease. There is an example in the 
package that scrapes one page on StackOverflow. 

Regards
-
Avik

On Monday, 1 August 2016 09:46:43 UTC+1, STAR0SS wrote:
>
> I used HTTPClient to get the page and Gumbo to parse it some time ago 
> (near v0.3)
>
> https://github.com/porterjamesj/Gumbo.jl
>
> I was doing things like that, it's probably not the most elegant
> way of doing it, but it was working fine:
>
> function get_hrefs(body::HTMLElement)
> links = String[]
> for elem in preorder(body)
> if typeof(elem) == HTMLElement{:a}
> try
> push!(links,getattr(elem, "href"))
> catch
> end
> end
> end
> return links
> end
>


[julia-users] Re: Type error check before code starts running?

2016-07-12 Thread Avik Sengupta
You may want to check out Lint.jl https://github.com/tonyhffong/Lint.jl

On Wednesday, 13 July 2016 00:09:36 UTC+1, Zhong Pan wrote:
>
> One big problem of dynamically typed languages is type mismatch errors 
> only pop up at run time. When I say "type mismatch" I refer to the case 
> when the compiler/interpreter cannot reasonably guess a conversion, 
> therefore e.g. assigning an integer value to a double variable does not 
> count.
>
> It'll be nice to allow quick coding leaving out type annotations for fast 
> prototyping; later on to reach production, the programmer can improve 
> reliability and reduce run-time errors by annotating types as much as 
> possible.
>
> Is there an option or separate tool that can perform a best-effort type 
> check on the source code *before *it starts running? I heard that type 
> mismatch may be caught by JIT compiler early if all parameters of a 
> function have been type annotated; however JIT compilation happens at run 
> time in user's perspective. I think it's desirable to be able to catch 
> problems even before running anything. And the option / tool does not (and 
> will not be able to) catch all type mismatch problems; but it should be 
> able to flag clear violations.
>
> Thanks,
> -Zhong
>
>

[julia-users] Re: Fixing JavaCall for 0.5: generating methods which call ccall

2016-06-29 Thread Avik Sengupta
I'd like to bump this and see if anyone has any ideas. I do not see what 
could change. 

To provide some background, if it would help, 

The code referenced by Eric runs at load time, to generate a set of methods 
(called _jcall) for different types of inputs. For each such input type, a 
method definition is created within a quote block, and then that quote 
block is eval-ed to actually define the method. 

The reason separate functions are defined, rather than doing this by 
dynamic dispatch, is that a key part of the method is a ccall. The argument 
types to the ccall needs to be determined at compile time, and hence in 
this case we define a separate method for each input type, rather than use 
dynamic dispatch. This code works correctly in 0.4 (and 0.3), but fails 
with an UndefRefError in 0.5. 

Any ideas? 

Thanks!
-
Avik
 

On Friday, 24 June 2016 19:50:01 UTC+1, Eric Davies wrote:
>
> I have an intuition that this should be possible because the ccall depends 
> on the input types, but I can't figure out how to make it work. I've tried 
> a few things and they all seem to result in an UndefVarError or 
> UndefRefError.
>
> I want to turn this:
> for (x, y, z) in [ (:jboolean, :(jnifunc.CallBooleanMethodA), :(jnifunc.
> CallStaticBooleanMethodA)),
>   (:jchar, :(jnifunc.CallCharMethodA), :(jnifunc.
> CallStaticCharMethodA)),
>   (:jbyte, :(jnifunc.CallByteMethodA), :(jnifunc.
> CallStaticByteMethodA)),
>   (:jshort, :(jnifunc.CallShortMethodA), :(jnifunc.
> CallStaticShortMethodA)),
>   (:jint, :(jnifunc.CallIntMethodA), :(jnifunc.
> CallStaticIntMethodA)),
>   (:jlong, :(jnifunc.CallLongMethodA), :(jnifunc.
> CallStaticLongMethodA)),
>   (:jfloat, :(jnifunc.CallFloatMethodA), :(jnifunc.
> CallStaticFloatMethodA)),
>   (:jdouble, :(jnifunc.CallDoubleMethodA), :(jnifunc.
> CallStaticDoubleMethodA)),
>   (:Void, :(jnifunc.CallVoidMethodA), :(jnifunc.
> CallStaticVoidMethodA)) ]
> m = quote
> function _jcall(obj,  jmethodId::Ptr{Void}, callmethod::Ptr{Void}, 
> rettype::Type{$(x)}, argtypes::Tuple, args... )
> if callmethod == C_NULL #!
> callmethod = ifelse( typeof(obj)<:JavaObject, $y , $z )
> end
> @assert callmethod != C_NULL
> @assert jmethodId != C_NULL
> if(isnull(obj)); error("Attempt to call method on Java NULL"); 
> end
> savedArgs, convertedArgs = convert_args(argtypes, args...)
> result = ccall(callmethod, $x , (Ptr{JNIEnv}, Ptr{Void}, Ptr{
> Void}, Ptr{Void}), penv, obj.ptr, jmethodId, convertedArgs)
> if result==C_NULL; geterror(); end
> if result == nothing; return; end
> return convert_result(rettype, result)
> end
> end
> eval(m)
> end
>
> Into something that works on 0.5. Code located here: 
> https://github.com/invenia/JavaCall.jl/blob/compat-0.5/src/core.jl#L196
>
> I've learned tricks to deal with the 0.4 function eval pattern, but they 
> don't seem to work with ccall, which is a special feature that requires 
> some arguments to be static and known at compile time.
>
> Anyone have any tips?
>
> Thanks,
> Eric
>


[julia-users] [ANN] Taro v0.3.0

2016-06-15 Thread Avik Sengupta
I'd like to announce a major new release for Taro - the Julia utility belt 
for working with document formats. 

Taro now features a new API to read and write excel files. Earlier, you 
could only dump the contents of a sheet into a dataframe. Now you can read 
and write data cell by cell. This also allows you to read in an excel 
template, and fill in certain cells from the results of a Julia 
computation. 

Since v0.2, Taro has had the ability to generate PDF files from xsl-fo. 
This allows you to dynamically create professional looking PDF reports from 
within Julia. 

Finally, the package now has some nice looking documentation, thanks to 
Documenter and mkdocs.

More here : http://aviks.github.io/Taro.jl/




[julia-users] Re: Can I somehow get Julia without standard library?

2016-06-06 Thread Avik Sengupta
Julia is pretty useless without its standard library. 

On Monday, 6 June 2016 14:42:02 UTC+1, Dmitry wrote:
>
> I tried to remove ".jl" library files from Julia installation directory, 
> but it did not help. Then I tried to remove "libjulia.dll" but it does not 
> want to run without this file.
>


[julia-users] Re: How to produce the ≉ symbol?

2016-06-03 Thread Avik Sengupta
The canonical list of completions is in the latex_symbols.jl file within 
the julia source

https://github.com/JuliaLang/julia/blob/master/base/latex_symbols.jl#L546

On Friday, 3 June 2016 10:45:16 UTC+1, Pablo Zubieta wrote:
>
> Use `\napprox`
>


Re: [julia-users] Plagiarism detection for Julia?

2016-05-18 Thread Avik Sengupta
>any Julia grammar would be welcome! 

There is a partial antlr grammar for julia within the Eclipse plugin. Note 
that it neither complete nor endorsed. 

https://github.com/JuliaComputing/JuliaDT/blob/master/plugins/com.juliacomputing.jldt.eclipse.parser/src/main/antlr4/org/julia/lang/parser/Julia.g4



On Wednesday, 18 May 2016 15:08:46 UTC+1, Isaiah wrote:
>
> Otherwise, I might develop an extension for JPlag 
>> 
>>
>
> In case you are not aware, there is a pure-Julia version (as opposed to 
> scheme) of the parser, that is easier to use for tooling purposes:
>
> https://github.com/JuliaLang/JuliaParser.jl
>
> On Wed, May 18, 2016 at 9:05 AM, Thibaut Cuvelier  > wrote:
>
>> Dear all, 
>>
>> Using Julia for the assignments in an mathematical optimisation, I'd like 
>> to check for plagiarism in what the students hand in. The university has 
>> already invested in a software package for text (such as reports), but it 
>> does not work well with source code. 
>>
>> Has anyone developed software to detect plagiarism in Julia code? 
>> Otherwise, I might develop an extension for JPlag 
>> (there doesn't seem to be open 
>> source plagiarism detection programs…); any Julia grammar would be welcome! 
>>
>> Thanks for your help! 
>> Thibaut Cuvelier
>>
>
>

[julia-users] Re: [ANN] Book: Julia High Performance

2016-05-17 Thread Avik Sengupta
>BTW, when Julia upgrades to v0.5, v0.6,..., v1.0, is this book still valid?

Well, I am hoping that the book gets thinner and thinner :)

But seriously, some things are going to be universal.. the tooling, type 
stability, contiguous array dimensions etc. There are core characteristics 
of the language, or in some cases, core characteristics of modern 
CPU/memory design. 

Things which are more in the nature of performance "gotchas" will reduce as 
the language evolves. So in the book, I already mention that the section on 
anonymous functions will be redundant in 0.5. 

Overall, I feel that the book will certainly be fully relevant in the 0.5 
timeframe, and will continue to be useful beyond. In the long term, I am 
open to updating it with further editions, but that depends a lot on the 
publisher. 

Regards
-
Avik

On Wednesday, 11 May 2016 22:42:34 UTC+1, Sisyphuss wrote:
>
> I notice the book cost 31.18 euros. Has the discounted period been past?
>
> BTW, when Julia upgrades to v0.5, v0.6,..., v1.0, is this book still valid?
>
>
>
> On Tuesday, May 3, 2016 at 1:17:57 AM UTC+2, Avik Sengupta wrote:
>>
>> Just wanted to let you know about the new book discussing the design and 
>> development of high performance julia code. It discusses the tools you can 
>> use to analyse the performance of your code, and ways to make it go faster, 
>> using the full power of Julia's compiler.  Hope this is useful for some. 
>>
>> https://www.packtpub.com/application-development/julia-high-performance
>>
>> Regards
>> -
>> Avik
>>
>> (Incidentally, all the ebooks from the publisher are being discounted for 
>> the next day or so)
>>
>

[julia-users] [ANN] JavaCall version 0.3.5

2016-05-02 Thread Avik Sengupta
I tagged a new version of JavaCall a few days ago, v0.3.5. I would 
recommend upgrading to it immediately. In particular, this version is 
required to use dfdx/Spark.jl.

This version solves a long standing segfault (thanks to @adambrewster), as 
well as enable support for accessing fields of classes and instances. 

I wanted to particularly mention this version since it will be the last one 
that supports Julia v0.3.5. The next version will be julia 0.4 only. Please 
shout if this is likely to be of any concern. 

Regards
-
Avik


[julia-users] [ANN] Book: Julia High Performance

2016-05-02 Thread Avik Sengupta
Just wanted to let you know about the new book discussing the design and 
development of high performance julia code. It discusses the tools you can 
use to analyse the performance of your code, and ways to make it go faster, 
using the full power of Julia's compiler.  Hope this is useful for some. 

https://www.packtpub.com/application-development/julia-high-performance

Regards
-
Avik

(Incidentally, all the ebooks from the publisher are being discounted for 
the next day or so)


Re: [julia-users] Time handling: Micro/Nanosecond precision and time string formatting like Unix

2016-05-02 Thread Avik Sengupta

On Friday, 29 April 2016 15:28:34 UTC+1, Stefan Karpinski wrote:
>
> There was talk of adding a Time type to the standard library to complement 
> DateTime and Date.
>
>
There is a PR for this: https://github.com/JuliaLang/julia/pull/12274 


Re: [julia-users] Re: [ANN] CmplxRoots.jl: Fast Complex Polynomial Root Finder

2016-04-28 Thread Avik Sengupta
Of course, if you started with a LGPL library, then this much be LGPL. 

Just for some context, a majority of Julia packages, including the core 
language are under MIT license. So there is a certain preference for that, 
but other licenses are certainly not precluded. There is a lot of GPL/LGPL 
code within the Julia ecosystem. 

Regards
-
Avik

On Thursday, 28 April 2016 08:54:53 UTC+1, Mosè Giordano wrote:
>
> 2016-04-27 15:10 GMT+02:00 Mosè Giordano  >: 
> > Hi Kristoffer, 
> > 
> > 2016-04-27 14:32 GMT+02:00 Kristoffer Carlsson  >: 
> >> This looks interesting. 
> > 
> > Thank you! 
> > 
> >> It is in my opinion a bit unfortunate that you chose 
> >> to use the GPL license for this since it means that it will not be 
> usable by 
> >> most packages in Julia which are under MIT license. 
> > 
> > Actually I used LGPL, not GPL, because the original Fortran library I 
> > translated to Julia is released with that license, and, as far as I 
> > know, you can you an LGPL program into a MIT one. 
> ^^^ 
>
> Oops, while writing the email I skipped the verb: in place of the 
> second wrong "you" read "use".  To avoid further confusion, a MIT 
> program can link to an LPGL one, provided that certain conditions are 
> met (but no license change is required), see section 4 of LGPLv3 text. 
>
> Cheers, 
> Mosè 
>


[julia-users] Re: Fbls - a simple but flexible Julia DB

2016-04-28 Thread Avik Sengupta
1) In general, the typical paradigm in Julia for these kinds of things is 
lazy checking, and runtime errors if applicable. If you want stricter 
checking, have you seen: https://github.com/mauro3/Traits.jl

2) Which version of Julia do you intend to support? The way tuple types are 
denoted has changed in 0.5 I believe. 

3) Is this what you want: 

function foo{T
> Hi Juliets,
> Just started working on my first major Julia project and thought I'd share 
> some of the results so far:
>
> https://github.com/fblscode/Fbls.jl
>
> A few issues that I'm still struggling with:
>
> 1) I would like to add support for using arrays, dicts and other kinds of 
> sequences as field values. The problem I'm having is figuring out if a 
> value is iterable / associable. I'm aware of the informal protocols, but 
> using method_exists to check for them on concrete values isn't working. 
>
> 2) The Fbls event type specifies the types of the arguments it expects as 
> a Tuple{...}. Is there any way to steal the tuple parametric magic to avoid 
> having to leak information about using Tuples? What I'm looking for a way 
> to specify a type as having an arbitrary number of type parameters and 
> being able to them to generate tuple types.
>
> 3) Is there any way to specify parametric function types? The Function 
> type takes no type parameters, and I can't find anything else.
>
> 4) The whole experience was so Lisp like that I found myself reaching for 
> special vars, without success. Is there anything comparable lurking in 
> there somewhere?
>
> Any help appreciated...
>
> Peace
>


[julia-users] Re: implications of using the precompiled "generic linux binary" vs building julia myself?

2016-04-24 Thread Avik Sengupta
What do you want to do with the lib folder? The generic linux binaries are 
built so that you can unzip them and run julia from them. Unzip them in 
your home folder, or on a shared folder. There should be no need to copy 
them anywhere. 

Regards
-
Avik

On Sunday, 24 April 2016 02:23:13 UTC+1, K leo wrote:
>
> I also would like to know about what to do with the lib folder.  Can 
> someone explain?  There is no README with Linux generic version.
>
> On Thursday, July 23, 2015 at 7:52:36 AM UTC+5:30, David Kao wrote:
>>
>> What did you do with the generic build?
>>
>> I can take the bin/julia and run it, but I am confused as to what to do 
>> with the rest of the folders, especially all the files under lib/julia . Do 
>> I have to copy it somewhere? The other folders seem easy to get, such as 
>> man being man pages, etc ... Thanks!
>>
>>

[julia-users] Re: Registering / renaming CppWrapper

2016-03-18 Thread Avik Sengupta
Yes go for it. It'll be better for the repository to end in .jl. As to the 
name, let's see if there are any creative suggestions on this thread, but 
it's ultimately your decision. 

Regards
-
Avik

On Friday, 18 March 2016 08:52:53 UTC, Bart Janssens wrote:
>
> Hi,
>
> I'd like to register the CppWrapper package:
> https://github.com/barche/CppWrapper
>
> At the very least, I'll have to rename the github repo to CppWrapper.jl, 
> but while I'm at it I'd like to ask if there are any suggestions for a 
> better name? The package is meant to "wrap" a C++ library in a set of Julia 
> functions and types. Unlike Cxx.jl, there is no direct way to call C++ 
> functions, but a C++ file has to be written and compiled into a shared 
> library that can then be loaded using CppWrapper.
>
> Cheers,
>
> Bart
>


[julia-users] Re: a excellent Julia IDE, JuliaDT

2016-03-09 Thread Avik Sengupta
Fair enough. Eclipse is, in many ways, a "buy into the ecosystem" 
proposition. For many that do, that is the simplest way to work. But if you 
don't, Juno/Atom is great, and Mike's been hard at work making it better. 

Regards
-
Avik

On Tuesday, 8 March 2016 20:22:45 UTC, J Luis wrote:
>
> Ok, thanks ... but will wait for a simpler thing to use.
>
> terça-feira, 8 de Março de 2016 às 19:32:28 UTC, Avik Sengupta escreveu:
>>
>> Use the "Eclipse IDE for Java Developers". That should give you the least 
>> amount of cruft. 
>>
>> Regards
>> -
>> Avik
>>
>> On Tuesday, 8 March 2016 19:00:22 UTC, J Luis wrote:
>>>
>>> A quick previous question. Which Eclipse version from the (many) 
>>> available options should we install  (Java is completely out of my 
>>> interest)?
>>>
>>> http://www.eclipse.org/downloads/
>>>
>>> Thanks
>>>
>>> terça-feira, 8 de Março de 2016 às 13:56:39 UTC, Liye zhang escreveu:
>>>>
>>>> If you are trying to find an IDE for Julia which is as convenient as 
>>>> PyDev for python, or RStudio for R, you can test JuliaDT. Thanks for 
>>>> the authors' excellent work!
>>>>
>>>> https://github.com/JuliaComputing/JuliaDT/releases/tag/v0.0.1 
>>>>
>>>> More about this software,
>>>> http://juliacomputing.com/blog/2016/02/06/Eclipse-JuliaDT.html
>>>>
>>>

[julia-users] Re: Best practice for editing official packages?

2015-11-26 Thread Avik Sengupta
The best practices are documented 
here: http://docs.julialang.org/en/release-0.4/manual/packages/#code-changes

In summary, it is best to use your third approach. Pkg.submit() will fork 
the github repo into your account. And Pkg.free() will get you back to the 
released state of the package, which makes it safe to do the changes in 
place, within .julia. 

Regards
-
Avik

On Thursday, 26 November 2015 07:04:51 UTC, Eric Forgy wrote:
>
> I'm still learning the ropes.
>
> When I "Pkg.add" a Julia package, it produces a git repo in .julia. If I 
> wanted to revise one of the packages, is it unadvised to modify it directly 
> in the .julia repo if I ultimately intend to submit a PR?
>
> My first instinct was to clone the package somewhere other than .julia and 
> then "Pkg.clone" from there, but that seems a bit roundabout. Hence my 
> question.
>
> I tried the following which doesn't seem optimal:
>
>1. Fork the package on GitHub
>2. "git clone" the package somewhere other than .julia
>3. Pkg.clone from my local cloned repo (had problems with this because 
>the package was already in .julia so deleted it first)
>4. Modify the package, commit and then Pkg.checkout
>5. Repeat step 3. until revision does what I want it to do
>   - Steps 3. and 4. got me a LONG list of commits, so I introduced 
>   myself to "git rebase" with disastrous results.
>   6. Tried deleting the package from .julia so I could start over 
>again with "Pkg.add", but Pkg seemed to have gotten confused from my 
>shenanigans and says the package could not be found.
>7. Delete the Julia installation. Delete .julia and start again.
>
> Disaster :)
>
> My next attempt will be along these lines:
>
>1. Fork the package on GitHub
>2. Pkg.clone from my forked repo
>3. Modify the package directly from the .julia folder (hoping this 
>will avoid a ton of commits)
>4. When everything works, commit and push to my forked repo on GitHub
>5. Submit a PR from GitHub
>
> How does that sound? Any better suggestions?
>
> Just before submitting this question, a possibly better solution dawned on 
> me. Since I have already "Pkg.add"ed the package, a git repo is already in 
> .julia so I might try:
>
>1. Fork the package on GitHub
>2. Modify the package already inside .julia
>3. Add my fork as a remote repo
>4. When everything works, commit and push to my forked remote repo on 
>GitHub
>5. Submit a PR from GitHub
>
> How does that sound? What do others do?
>
> Note: The package I'm trying to modify is pure Julia so does not require 
> any compiler.
>


Re: [julia-users] Creating a stable version of Julia + Packages for a semester long course?

2015-11-16 Thread Avik Sengupta
It is now possible to run Juliabox locally, but it's not a trivial 
setup: https://github.com/JuliaLang/JuliaBox/blob/master/docs/INSTALL.MD

On Monday, 16 November 2015 09:14:57 UTC, Sheehan Olver wrote:
>
>
> You can do this locally?   I tried using JuliaBox in my classes last year, 
> but it was a bit of disaster, as it was unreliable.
>
>
>
>
> On 16 Nov 2015, at 7:53 PM, Sisyphuss  
> wrote:
>
> Run a JuliaBox server?
>
> On Monday, November 16, 2015 at 9:05:38 AM UTC+1, Sheehan Olver wrote:
>>
>> Another requirement is that the packages are shared across users, to save 
>> disk space.  Gadfly + PyPlot + IJulia (with Conda.jl version of Jupyter) 
>> takes over 750MB.   Does .julia need to be writable?  If not, I guess both 
>> options are still possible.
>>
>> On Monday, November 16, 2015 at 2:05:45 PM UTC+11, Sheehan Olver wrote:
>>>
>>>
>>> I'm trying to figure out the "best" way to create a stable version of 
>>> Julia + Gadfly + PyPlot + IJulia (+ other packages?) for a semester long 
>>> course.  I don't want to have the students run Pkg.add(...)/Pkg.update(), 
>>> as packages have a tendency to occasionally break on updates, and it's a 
>>> headache dealing with this during the lecture.
>>>
>>> Two possible solutions I can think of of are:
>>>
>>> 1)  Prebake a .julia folder that contains all the necessary resources, 
>>> with a script to reset in case the students break it with Pkg.update().
>>> 2)  Use system image
>>>
>>> http://docs.julialang.org/en/release-0.4/devdocs/sysimg/
>>>
>>> that includes all the necessary packages.   It's not really clear how to 
>>> do this from the documentation, though.   I'm also not sure how that would 
>>> interact with Pkg.update() though, so probably instructions to delete 
>>> .julia would also need to be given.
>>>
>>>
>>> Any other options I'm missing?  If 2 is recommended, any tutorial how to 
>>> do this?
>>>
>>
>

[julia-users] Re: Creating a stable version of Julia + Packages for a semester long course?

2015-11-16 Thread Avik Sengupta
.julia does not need to be writable for running Julia code. It needs to be 
writable for package operations (add, update etc). I run a shared .julia on 
a multiuser linux machine, it works well. The only issue is that doing 
Pkg.update() is a bit of a pain, but we only do that very rarely. 

Regards
-
Avik

On Monday, 16 November 2015 08:05:38 UTC, Sheehan Olver wrote:
>
> Another requirement is that the packages are shared across users, to save 
> disk space.  Gadfly + PyPlot + IJulia (with Conda.jl version of Jupyter) 
> takes over 750MB.   Does .julia need to be writable?  If not, I guess both 
> options are still possible.
>
> On Monday, November 16, 2015 at 2:05:45 PM UTC+11, Sheehan Olver wrote:
>>
>>
>> I'm trying to figure out the "best" way to create a stable version of 
>> Julia + Gadfly + PyPlot + IJulia (+ other packages?) for a semester long 
>> course.  I don't want to have the students run Pkg.add(...)/Pkg.update(), 
>> as packages have a tendency to occasionally break on updates, and it's a 
>> headache dealing with this during the lecture.
>>
>> Two possible solutions I can think of of are:
>>
>> 1)  Prebake a .julia folder that contains all the necessary resources, 
>> with a script to reset in case the students break it with Pkg.update().
>> 2)  Use system image
>>
>> http://docs.julialang.org/en/release-0.4/devdocs/sysimg/
>>
>> that includes all the necessary packages.   It's not really clear how to 
>> do this from the documentation, though.   I'm also not sure how that would 
>> interact with Pkg.update() though, so probably instructions to delete 
>> .julia would also need to be given.
>>
>>
>> Any other options I'm missing?  If 2 is recommended, any tutorial how to 
>> do this?
>>
>

Re: [julia-users] using a JSON REST API from Julia

2015-11-15 Thread Avik Sengupta
Below is some recent code to access a REST API. This is possibly the 
simplest way to do this, using Dict's as inputs and outputs. 

https://github.com/aviks/Mandrill.jl/blob/2dbce6dc6b91a56a350b29a02d072b9b90416771/src/Mandrill.jl#L39

Regards
-
Avik

On Saturday, 14 November 2015 14:42:31 UTC, Jacob Quinn wrote:
>
> You got it. Requests.jl is the current standard, unless you felt more 
> comfortable calling a python library with PyCall. Requests.jl has gotten a 
> lot of love lately from Jon Malmaud and is 0.4 ready.
>
> -Jacob
>
>
> On Sat, Nov 14, 2015 at 7:10 AM, Christof Stocker  > wrote:
>
>> What is the current best practice to handle JSON and to use a REST API 
>> from Julia?
>>
>> From preliminary search I would assume JuliaLang/JSON.jl and 
>> JuliaWeb/Requests.jl, but I am unsure
>>
>> Doe anyone have any suggestions what to look at?
>>
>
>

[julia-users] Re: Why does setting ENV["TZ"] in the REPL behave differently?

2015-11-02 Thread Avik Sengupta
I'm not sure why this behaves differently. The now() function calls down to 
time_now() in libc, and while we do a setenv() when changing ENV, clearly 
that change is not reaching down to the relevant parts of libc. 

In terms of workaround, if you wanted UTC time, then `now(Base.Dates.UTC)` 
will give you that. For other timezone conversions, you may want to look at 
the TimeZones package.  (https://github.com/quinnj/TimeZones.jl)

On Sunday, 1 November 2015 16:10:52 UTC, Josef Sachs wrote:
>
> Works as expected with `julia -e`, but the environment variable 
> does not seem to be respected when set in the REPL.  Can someone 
> explain the reason, and possibly provide a workaround? 
>
> $ TZ=UTC julia -e 'println(now())' 
> 2015-11-01T16:02:37 
> $ julia -e 'println(now())' 
> 2015-11-01T11:02:42 
> $ julia -e 'ENV["TZ"] = "UTC"; println(now())' 
> 2015-11-01T16:03:07 
> $ julia 
>_ 
>_   _ _(_)_ |  A fresh approach to technical computing 
>   (_) | (_) (_)|  Documentation: http://docs.julialang.org 
>_ _   _| |_  __ _   |  Type "?help" for help. 
>   | | | | | | |/ _` |  | 
>   | | |_| | | | (_| |  |  Version 0.4.1-pre+22 (2015-11-01 00:06 UTC) 
>  _/ |\__'_|_|_|\__'_|  |  Commit 669222e (0 days old release-0.4) 
> |__/   |  x86_64-linux-gnu 
>
> julia> ENV["TZ"] = "UTC"; println(now()) 
> 2015-11-01T11:03:28 
>


[julia-users] Re: WinRPM Download failure

2015-10-26 Thread Avik Sengupta
Yes, this has been tagged. However, in this update, the source URL's have 
changed, but they wont take effect till Julia is restarted (if WinRPM has 
been loaded in that session prior to the update). 

Regards
-
Avik

On Monday, 26 October 2015 20:38:49 UTC, Tony Kelman wrote:
>
> Pretty sure I tagged that change as soon as I noticed the 13.1 downloads 
> stopped working. You likely need to Pkg.update(), be sure you don't have 
> local modifications preventing the winrpm package from updating, then 
> restart julia and do Pkg.build()



[julia-users] Re: Any serious quant finance package for Julia?

2015-09-11 Thread Avik Sengupta
My hope has been that Ito would become the consolidated financial math 
package, with functionality similar to Quantlib. Unfortunately, while I 
laid down the base, I haven't made as much progress as I would have liked 
(primarily for lack of time), but I do hope to rectify that in the near 
future. Needless to say, contributions welcome. 


On Friday, 11 September 2015 07:05:39 UTC+1, Ferenc Szalma wrote:
>
> Are there any quant finance packages for Julia? I see some rudimentary 
> calendar and day-counting in Ito.js for example but not much for even a 
> simple yield2price or price2yield or any bond objects in Julia packages on 
> GitHub. What is the best approach, using C++ function/object from Quantlib, 
> to finance in Julia?
>


[julia-users] Re: How to efficiently count the number of lines in a file

2015-08-19 Thread Avik Sengupta
You can't get much better than unix command line tools for this sort of 
thing. Any reason you can't use `wc` directly? I'd do this using 
run(`wc`...) from within Julia. 

Regards
-
Avik

On Wednesday, 19 August 2015 11:10:40 UTC+1, Daniel Carrera wrote:

 Hello,

 I need to count the number of lines in a large number of UNIX text files, 
 most of which are fairly large. I need help coming up with an efficient 
 implementation of a line-count program. A naive implementation like 
 length(readlines(foo.txt)) is very slow (notice how this loads the whole 
 file into memory just to count newlines). I imagine that it should be 
 possible to count the number of newline characters quickly, like what the 
 wc command does, but I can't figure out how. Does anyone have any ideas?

 Thanks for the help.

 Daniel.



[julia-users] Re: How are numbers converted to strings?

2015-08-01 Thread Avik Sengupta
Thanks Felipe. I must say that since that post was written, Jacob Quinn has 
ported the Grisu algorithm to Julia. That is the code I referenced in my 
previous email.  We no longer need the C double-conversion library. 

On Saturday, 1 August 2015 08:56:01 UTC+1, Felipe Jiménez wrote:

 And since Avik didn't toot his own horn, let me recommend this short nice 
 read:
 http://www.sengupta.net/musings/blog/2012/07/24/grisu/



[julia-users] Re: How are numbers converted to strings?

2015-08-01 Thread Avik Sengupta
For floats, the entry point 
is https://github.com/JuliaLang/julia/blob/master/base/grisu.jl#L119 . You 
should follow the code from there, with most of the code in files 
within https://github.com/JuliaLang/julia/tree/master/base/grisu/ . As you 
can see its quite a lot of code; this is not a simple problem.  

For integers, the conversion is 
in https://github.com/JuliaLang/julia/blob/master/base/intfuncs.jl#L249

Regards
-
Avik

On Saturday, 1 August 2015 06:05:59 UTC+1, holocro...@gmail.com wrote:

 How are numbers converted to strings in Julia? Specifically, where in the 
 Julia source is this conversion performed? 

 I ask because my x86 assembly implementation of 64-bit integer to string 
 conversion is on average about 1.5x slower than Julia. Either Julia is 
 doing something very smart, or my assembly is doing something very dumb, or 
 perhaps both.

 Thanks!



[julia-users] Re: from my ip, julia-dev has been stuck all day, displays Loading... overlaid lower right

2015-07-23 Thread Avik Sengupta
Same here. 

On Thursday, 23 July 2015 20:45:30 UTC+1, Jeffrey Sarnoff wrote:

 ?



[julia-users] Re: from my ip, julia-dev has been stuck all day, displays Loading... overlaid lower right

2015-07-23 Thread Avik Sengupta
Ah, well, we seem to be having issues with case sensitivity in many 
different places!

There is Julia and julia, as tags, but i find it hard to believe that 
is new. (This has stopped working for me from 21 July). An admin probably 
needs to prune the tags. 

Regards
-
Avik

On Thursday, 23 July 2015 23:02:58 UTC+1, Jeffrey Sarnoff wrote:

 I posted a request for help with google, and they responded :

 Apparently some action on julia-dev introduced a duplicate tag, a second 
 tag that differs only in that it is [un]capitalized while the original tag 
 is not.
 Removing all occurances of the mispresented tag should resolve this 
 problem.  [here are the links:] 
 my post with response 
 https://productforums.google.com/forum/#!topic/apps/CeCURqUKQ-8;context-place=topicsearchin/apps/category$3Agoogle-groups-for-business%7Csort:relevance%7Cspell:false
 the posts that the response references 
 https://productforums.google.com/forum/#!msg/apps/4pfJ6fdnAwM/RPTkQWSCgkkJ



 On Thursday, July 23, 2015 at 5:19:08 PM UTC-4, Avik Sengupta wrote:

 Same here. 

 On Thursday, 23 July 2015 20:45:30 UTC+1, Jeffrey Sarnoff wrote:

 ?



[julia-users] Re: HTTPClient - Problem with SSL CA cert

2015-07-23 Thread Avik Sengupta
HTTPClient.jl uses curl. I think you may have to install the ca-certs for 
curl explicitly. Which OS are you using? How did you install curl (if at 
all)

These links might help: 

http://stackoverflow.com/questions/27987091/ssl-ca-cert-path-access-rights
http://stackoverflow.com/questions/6400300/https-and-ssl3-get-server-certificatecertificate-verify-failed-ca-is-ok

On Thursday, 23 July 2015 15:30:43 UTC+1, Andrew B. Martin wrote:

 Hello,

 I've been trying to get HTTPClient.jl working on a Windows 7 computer, and 
 have run into an issue that I can't make much sense of, and don't know 
 where to start looking to fix it.

 When I call HTTPClient.jl through the AWS.jl library I get the following 
 stacktrace:


 Error executing request : Problem with the SSL CA cert (path? access 
 rights?)
 in exec_as_multi at C:\Users\Andrew 
 Martin.julia\v0.3\HTTPClient\src\HTTPC.jl:702
in get at C:\Users\Andrew Martin.julia\v0.3\HTTPClient\src\HTTPC.jl:371
   in do_request at C:\Users\Andrew Martin\.julia\v0.3\AWS\src\S3.jl:564
   in get_object at C:\Users\Andrew 
 Martin\.julia\v0.3\AWS\src\S3.jl:392

 My AWS credentials are properly passed to AWS (it works fine on Mac and 
 Linux). 

 What could be causing the problem?



[julia-users] Re: How to overwrite output text in REPL

2015-07-22 Thread Avik Sengupta
The answer will exist somewhere in the source of the ProgressMeter package, 
I think. 

https://github.com/timholy/ProgressMeter.jl

Regards
-
Avik

On Wednesday, 22 July 2015 11:23:47 UTC+1, Felipe Jiménez wrote:

 Q: Is there an easy way to overwrite output text in the REPL?
 For instance if I want to show a progress indicator that reads 5% done, 
 10% done, 15% done... but everything on the same place.
 Hope the question is appropriate -- I don't see the answer in the manual
 Thank you!



[julia-users] Re: NetCDF Pkg fails when the time is of type 'long'

2015-07-21 Thread Avik Sengupta
You should probably raise an issue on the NetCDF.jl 
repository: https://github.com/meggart/NetCDF.jl/issues

On Tuesday, 21 July 2015 04:56:10 UTC+1, RBhupi wrote:

 I havent done much with Julia yet so cant provide more info at this time.

 ncinfo and ncread fails when the time axis is of type 'long'.

 --Terminal---
 julia t=NetCDF.ncread(/home/bhupendra/temp/temp-test/test.nc, time)
 ERROR: NetCDF type currently not supported, please file an issue on 
 https://github.com/meggart/NetCDF.jl
  in readvar at /home/bhupendra/.julia/v0.3/NetCDF/src/NetCDF.jl:126
  in readvar at /home/bhupendra/.julia/v0.3/NetCDF/src/NetCDF.jl:107
  in ncread at /home/bhupendra/.julia/v0.3/NetCDF/src/NetCDF.jl:379
 

 --Terminal
 julia NetCDF.ncinfo(/home/bhupendra/temp/temp-test/test.nc)

 # NetCDF File #

 /home/bhupendra/temp/temp-test/test.nc

 # Dimensions #

Name   Length
 ---
latitude  256
time 4716
   longitude  256

 # Variables #

 NameType  Dimensions
 ---
 latitude   FLOAT  latitude, 
 timeError showing value of type NcFile:
 ERROR: key not found: 10
  in getindex at dict.jl:617
  in show at /home/bhupendra/.julia/v0.3/NetCDF/src/NetCDF.jl:505
  in anonymous at show.jl:1159
  in with_output_limit at ./show.jl:1136
  in showlimited at show.jl:1158
  in writemime at replutil.jl:2
  in display at REPL.jl:117
  in display at REPL.jl:120
  in display at multimedia.jl:149
  in print_response at REPL.jl:139
  in print_response at REPL.jl:124
  in anonymous at REPL.jl:586
  in run_interface at ./LineEdit.jl:1379
  in run_frontend at ./REPL.jl:818
:_Documentation = 
 http://www.unidata.ucar.edu/software/netcdf/docs/cxx4/index.html; ; in 
 run_repl at ./REPL.jl:169
  in _start at ./client.jl:400
 julia 

 ---


 *ncdump -h output looks like this *ncdump -h 
 /home/bhupendra/temp/temp-test/test.nc
 netcdf test {
 dimensions:
 latitude = 256 ;
 longitude = 256 ;
 time = UNLIMITED ; // (4716 currently)
 variables:
 float latitude(latitude) ;
 latitude:units = degrees_north ;
 float longitude(longitude) ;
 longitude:units = degrees_east ;
 int64 time(time) ;
 time:units = seconds since 1970-01-01 00:00:00 UTC ;
 float rain(time, latitude, longitude) ;
 rain:units = mm/hr ;
 rain:_FillValue = -999.f ;
 rain:_compression = Zlib with HDF-5 ;

 // global attributes:
 :_libNCIO = developed by Bhupendra Raut (www.baraut.info) at 
 Monash Weather and Climate Group. ;
 :_Documentation = 
 http://www.unidata.ucar.edu/software/netcdf/docs/cxx4/index.html; ;
 :_created = Wed May 13 16:26:12 2015\n ;

 Cheers,
 RB



[julia-users] Re: PyCall and urllib2

2015-07-19 Thread Avik Sengupta
Sometimes PyCall cannot infer that an object is callable, since so many in 
python are (beyond simple functions). In such situations, the workaround is 
to use the pycall function in julia directly. See the invocations 
below... 

*julia **urllib2.Request(http://google.com;)*

*ERROR: type: apply: expected Function, got PyObject*


*julia **urllib2.urlopen(http://google.com;)*

*PyObject addinfourl at 4660350848 whose fp = socket._fileobject object 
at 0x1168f1ed0*


*julia **req = pycall(urllib2.Request, PyAny, http://google.com;)*

*PyObject urllib2.Request instance at 0x115c74d40*


*julia **f=urllib2.urlopen(req)*

*PyObject addinfourl at 4660402584 whose fp = socket._fileobject object 
at 0x1168f76d0*


*julia **f[:read](100)*

*!doctype htmlhtml itemscope=\\ 
itemtype=\http://schema.org/WebPage\; lang=\en-GB\headmeta cont*

On Sunday, 19 July 2015 03:15:28 UTC+1, Dejan Miljkovic wrote:

 What would be the right way to execute urllib2 call in julia

 using PyCall
 @pyimport urllib2 as urllib2
 request = urllib2.Request(url, json_payload, {'Content-Type': 
 'application/json'})

 type: apply: expected Function, got PyObject
 while loading In[29], in expression starting on line 1



 Thanks,

 Dejan



Re: [julia-users] Re: PyCall and urllib2

2015-07-19 Thread Avik Sengupta


On Sunday, 19 July 2015 15:55:38 UTC+1, Stefan Karpinski wrote:

 Would it make sense to define a fallback call method for PyObject values 
 that tries to apply the PyObject as a python function?


Dunno. Sounds logical, but someone with more knowledge of Python internals 
than me will have to say if there are any unintended consequences for that. 


[julia-users] [ANN] JDBC.jl

2015-07-17 Thread Avik Sengupta
I am pleased to announce the availability of JDBC.jl. Available via your 
favourite package repository: Pkg.add(JDBC) or 
at https://github.com/aviks/JDBC.jl . It has a dependency on JavaCall.jl, 
and you will need to install Java where you want to use it. 

Currently this supports plain SQL (insert/update/select/DDL), prepared 
statements and stored procedures.  The interface mimics the Java JDBC API. 
The primary data access method is to iterate over the Resultset. An 
optional readtable method can convert a ResultSet into a Julia Dataframe. 

Blob types are not supported yet, nor are more esoteric features such as 
scrollable cursors or Rowsets. However the power of JavaCall means that you 
can easily drop down and directly call Java methods that are not yet 
wrapped. Issues or PR's about missing functionality is welcome. 

Finally, there are tons of different databases that have JDBC drivers. I 
cannot feasibly test them all myself. So please let me know any reports of 
success or failure with different databases. 

Regards
-
Avik


 


[julia-users] Re: Which Packages Should be Registered?

2015-07-14 Thread Avik Sengupta
This is probably entirely a matter of opinion, so here's my own.. 

There are many reason's to NOT register a package, but not a fundamental 
numerical ... component is not one of them. I think it is perfectly fine 
to register a domain specific library. So if that is your only concern, 
please do register it. 

Technically, at the moment, you will need to register a package (and tag a 
version) if any other package depends on it. However this restriction is 
likely to go away in the future. 

A general rule I follow is that you should register a package if you think 
anyone other than people you email directly can/should use your package. 
This means two things. One, it allows people to find your package, makes is 
discoverable. Two, it means that your package must have reasonable 
documentation/tests for third parties to use it successfully. 

Regards
-
Avik

On Tuesday, 14 July 2015 09:11:38 UTC+1, Christoph Ortner wrote:

 For a long time I had a question which seems closely related to this 
 thread: https://groups.google.com/forum/#!topic/julia-users/621ta_jPdkA, 
  so it seems as good a time as any to bring it up :

 I think the Julia package management is really wonderful, but what this 
 question relates to is what types of packages should be actually be 
 registered, and which should be just accessible using `clone`. More 
 specifically:

 I am in the process of developing a library of Julia codes for my own 
 group's research for now (molecular simulation), but with mid to long-term 
 aim to make this a library that can be used for real scientific work by 
 end-users (primarily materials modelling).  But it is not a fundamental 
 numerical simulation component like optimisation, linear algebra, ODE 
 solvers, visualisation, ApproxFun.jl, etc, on which libraries like my own 
 might depend. 

 My own point of view was so far that such a library such not be a 
 registered Julia package, to avoid the package repository getting unwieldy. 
 But I would be interested in hearing other opinions.

 Thanks,
Christoph



[julia-users] Re: Azure: Which VM?

2015-07-14 Thread Avik Sengupta
I've installed Julia on both windows and ubuntu servers on Azure. 

Ubuntu and RHEL/Fedora have good support for Julia only because Elliot and 
Milan have put in significant effort in supporting them. ie, the reason for 
shortlisting these OSs is that people have done the work, rather than any 
technical shortcomings in either Julia or the OS. The Generic linux 
binaries work reasonably well on other modern OSs, but if you, have issues 
on an esoteric distribution, you are less likely to get answers on this 
list. 

On windows,  there is some pain to be had, but it is surmountable if you 
are an experienced windows sysadmin. There is a large amount of pain in 
building Julia on windows, but if you are only downloading and running the 
binary install for 0.3, all that pain has been absorbed by 
Jameson/Tony/Elliot et al.

Some Julia package also have native dependencies. Most have good windows 
support, but you may want to check for the packages you may want to use. 
ZMQ in particular is well supported on windows. 

So in summary, use windows if you are experienced running Windows servers 
in production. Otherwise, use ubuntu.

Regards
-
Avik 

On Tuesday, 14 July 2015 10:07:16 UTC+1, Eric Forgy wrote:

 I am about to do some experiments running Julia from an Azure VM. The 
 first decision to make is Which VM? Azure has a Quick Create option for 
 creating VM's and the options are:

- Windows Server
- Ubuntu Server
- OpenLogic
- Oracle Linux
- CoreOS
- SUSE Linux Enterprise Server

 I presume Azure has a good reason to shortlist these VM's (and shortlist 
 them in that order) so unless there is a good reason to deviate, I'll 
 probably choose one of the above.

 If I look at the Julia downloads http://julialang.org/downloads/ page, 
 I see the following selections:

- Windows
- Mac OS X
- Ubuntu
- Fedora/RHEL/CentOS/SL
- Generic Linux

 I presume you guys have a good reason to shortlist these OSs (but not sure 
 if the order is significant). I am agnostic about which OS to use, but I 
 prefer to use one that has the best Julia support and will cause the least 
 headaches, which presumably might be related to the OS most Julia 
 developers are using.

 If I could, I would probably prefer to run Julia on a Windows VM, but I 
 get the impression Windows has the fewest Julia developers working on it 
 (see Stephen's comment here 
 https://groups.google.com/forum/#!msg/julia-users/zgoqVYyPaIk/lfRmeROpI7YJ) 
 so I predict there to be some pain points. Is that impression misguided? 
 Any thoughts?

 If not Windows, comparing the above two lists, I'd be inclined to consider 
 using Ubuntu.

 My use case is ultimately going to be distributed computing in the cloud 
 (Azure) driven by a web app (ASP.NET MVC) with communication via REST 
 and/or ZMQ.

 In a nutshell:

1. I have a slight preference for a Windows VM, but could be dissuaded 
if there is some pain to be expected. Is there?
2. If not Windows, it seems Ubuntu VM is the next likely candidate 
with apparently solid support in the Julia community. Is that true?
3. Any other recommendation better than the above two?

 Any thoughts would be appreciated. Thanks!



Re: [julia-users] Calling Julia from Java

2015-07-14 Thread Avik Sengupta
Yes to everything Isaiah said. 

If you cannot use JNI at all, then doing a network wrapper is your only 
option. The simplest way is to 
use https://github.com/tanmaykm/JuliaWebAPI.jl/ 

If your concern is merely writing C glue code, but you are happy to use JNI 
to call Julia functions directly, then that is a good possibility. JavaCall 
currently focusses on calling Java from C, but the JNI API is the same both 
ways. Which means you can use the code in JavaCall to make things easier. 
In particular, JavaCall will give you the representation of JNIEnv on the 
Julia side, and conversion functions from basic Java types to Julia types. 
Which means that once you call into the Julia function, you can then access 
java parameters and return Julia values back to java. All in all, it should 
simple to do all that ... I haven't done it yet since I don't need that 
functionality myself. 

Regards
-
Avik

On Tuesday, 14 July 2015 14:24:29 UTC+1, Isaiah wrote:

 You may need to roll your own as I haven't heard of any existing 
 solutions. Two possible approaches:

 - expose Julia functionality via RPC / network / etc. using ZMQ or similar.

 - call the Julia embedding API directly (JNA is likely sufficient -- no 
 intermediate C):
   http://julia.readthedocs.org/en/latest/manual/embedding/
   You might be able to do some bootstrap or marshalling with JavaCall:
   https://github.com/aviks/JavaCall.jl

   node-julia is probably the largest example of the embedding API in-use:
   https://github.com/waTeim/node-julia

 On Tue, Jul 14, 2015 at 5:35 AM, Peilun Li peilun...@gmail.com 
 javascript: wrote:

 Hi,

 I'm trying to call Julia functions from Java. Limited by the project, it 
 is not a good idea to use Java JNI to call a C function that calls Julia.

 Is there any relatively direct way to call Julia from Java?  I need to 
 not only call Julia functions from Java, but also pass input data and 
 retrieve output answers.

 Thanks,
 Peilun




Re: [julia-users] Re: Help to eliminate Calendar.jl dependence

2015-07-13 Thread Avik Sengupta
now() - now(Dates.UTC) does not actually return the correct current local 
offset, since the two now() invocations happen a few milliseconds apart, 
and thus do not denote the exact same time. Hence their difference then is 
not the exact local difference. So unfortunately, as a hack, it does not 
quite seem to work. 

For example, with GMT-1, on a mac:

*julia **now() - now(Dates.UTC)*

*3599430 milliseconds*


*julia **Dates.Second(div(Dates.value(now() - now(Dates.UTC)),1000))*

*3599 seconds*

On Friday, 10 July 2015 17:49:45 UTC+1, Jacob Quinn wrote:


 On Fri, Jul 10, 2015 at 8:11 AM, Tom Breloff t...@breloff.com 
 javascript: wrote:

 as


 Tom,

 Yes, the method I proposed won't work retroactively since the method for 
 getting the current local offset from GMT is `now() - now(Dates.UTC)`. If 
 you were to run that every second crossing over the daylight savings 
 moment, you'd see that it correctly adjusts for daylight savings, but it's 
 only going to give you the *current* offset from GMT. Something more 
 elaborate will require tapping into the tzinfo database (which TimeZones.jl 
 will do).

 -Jacob



[julia-users] Re: How to add data/json to HTTP POST with Requests.jl

2015-07-12 Thread Avik Sengupta
I think the issue is you have  the second argument (grant_type=client_
credentials) as the data for the post, and then the json=... argument 
also as data for the post. 

The API for post() is that it either takes the data as the second argument 
to the function, or as a keyword argument data or a keyword argument 
json . It has to be only one of those options. 

Regards
-
Avik

On Sunday, 12 July 2015 23:41:26 UTC+1, Martin Michel wrote:


 Hi there, 
 I have very little experience with Julia and want to try whether it fits 
 my needs. I want to connect to a Neo4j database and send a Cypher statement 
 with Julia, see 
 http://neo4j.com/docs/stable/cypher-intro-applications.html .
 The authorization works fine, but I could not manage to add the *json 
 *keyword 
 (or *data*).
 using Requests, HttpCommon, Codecs

 db_key = neo4j
 db_secret = mypasswd

 # create authentication 
 function enc_credentials(db_key::String, db_secret::String)
 bearer_token_credentials = 
 $(encodeURI(db_key)):$(encodeURI(db_secret))
 return(base64(bearer_token_credentials))
 end
 response = post(URI(http://localhost:7474/db/data/transaction/commit;),
 grant_type=client_credentials;
 headers = {Authorization = Basic 
 $(enc_credentials(db_key,db_secret)), Content-Type = 
 application/json}, 
 json = {statements=[{statement=CREATE (p:Person 
 {name:{name},born:{born}}) RETURN p,parameters={name=Keanu Reeves
 ,born=1964}}]})

 println(response)

 This results in
 ERROR: unrecognized keyword argument json



Re: [julia-users] Unable to reach Azure VM through --machinefile or addprocs, but fine through ssh command

2015-07-09 Thread Avik Sengupta
I believe azure VM's by default are firewalled off. Have you opened the TCP 
ports that Julia uses to communicate? 

On Thursday, 9 July 2015 17:33:45 UTC+1, András Kalmár Nagy wrote:

 I tried tunnel=true... I can now see julia worker processes being spawned 
 on the remote machine, which is a good thing, but after a while, nothing 
 happens and they die. On the local side, I get this error:

 ERROR: connect: connection timed out (ETIMEDOUT)
  in wait at ./task.jl:284
  in wait at ./task.jl:194
  in stream_wait at stream.jl:263
  in wait_connected at stream.jl:301
  in Worker at multi.jl:113
  in anonymous at task.jl:905

 I'm still trying some things. Does julia use ~/.ssh/config?

 On Thursday, July 9, 2015 at 4:30:03 PM UTC+2, Amit Murthy wrote:

 keyword option tunnel=true could help

 On Thu, Jul 9, 2015 at 7:53 PM, András Kalmár Nagy 
 kalmar.na...@gmail.com wrote:

 Hi everyone!

 I configured an Azure instance for passwordless SSH, and I can connect 
 to it without problems from my shell, but Julia fails to connect and I get 
 timed out after 60 secs.

 I tried putting the host in a machinefile, using it through addprocs 
 (all combinations of specifying an explicit username and/or IP instead of 
 the hostname).

 The julia executable is in the same place on all machines, I can connect 
 to two other machines on the LAN, and they work.

 What could be the problem?




[julia-users] Re: Help to eliminate Calendar.jl dependence

2015-07-08 Thread Avik Sengupta
Maybe you want https://github.com/quinnj/TimeZones.jl ?

On Wednesday, 8 July 2015 15:59:33 UTC+1, Tom Breloff wrote:

 I have some code which requires figuring out the number of seconds from 
 the Epoch until midnight (local time) in order to quickly compute the local 
 TimeOfDay.  The reason is that I get passed a field which is seconds since 
 Epoch, and I'd like to just subtract off the (cached) # seconds from 
 Epoch--Midnight.

 Since I'm using a cached number, I don't care so much how long it takes to 
 calculate.  Right now I use both Dates and Calendar.jl, but I'm wondering 
 if I can accomplish this without the dependency on Calendar.jl (which I 
 currently use ONLY to get the hours offset between Eastern US and UTC).  Is 
 there a better way to write this function?


 function getHoursAdjustmentFromUTC(year::Integer, month::Integer, 
 day::Integer)
   millisEST = *Calendar.ymd*(year, month, day, EST5EDT).millis
   millisUTC = *Calendar.ymd*(year, month, day, UTC).millis
   UInt64(round((millisEST - millisUTC) / (secondsInOneHour * 
 millisInOneSecond)))
 end

 getEpochMillis() = UInt64(DateTime(1970,1,1).instant.periods.value)
 createUTCDateTimeFromSecondsSinceEpoch(secondsSinceEpoch::Integer) = 
 DateTime(Dates.UTM(secondsSinceEpoch * millisInOneSecond + 
 getEpochMillis()))


 # this is the function I care about... note that midnight refers to 
 midnight local to Eastern US
 function calcSecondsEpochToMidnight(secondsSinceEpoch::Integer)

   dt = createUTCDateTimeFromSecondsSinceEpoch(secondsSinceEpoch)

   # get the hour adjustment using the Calendar module
   y = Dates.year(dt)
   m = Dates.month(dt)
   d = Dates.day(dt)
   hourAdjustment = getHoursAdjustmentFromUTC(y, m, d)

   millisMidnightUTC::UInt64 = DateTime(y, m, d).instant.periods.value
   millisMidnightEST::UInt64 = millisMidnightUTC + hourAdjustment * 
 secondsInOneHour * millisInOneSecond

   return UInt64((millisMidnightEST - getEpochMillis()) / millisInOneSecond)
 end




[julia-users] Re: New package BusinessDays.jl

2015-07-06 Thread Avik Sengupta
Good to see this. 

I should probably point out that Ito.jl also has various various day count 
and business calendar functionality. See here: 
http://aviks.github.io/Ito.jl/time.html

On Monday, 6 July 2015 04:55:07 UTC+1, felip...@gmail.com wrote:

 Hello,

 you might want to check out this new package I'm working on.

 *Installation*
 julia Pkg.update()
 julia Pkg.add(BusinessDays)

 Package documentation is currently on the Readme file, or at 
 https://github.com/felipenoris/BusinessDays.jl .

 Cheers.



[julia-users] Re: Nan is readed as NaN but is the name of cat. How to read this data ?

2015-06-24 Thread Avik Sengupta
Interesting problem! :)

Try:
readlm(data.txt, '\t', ASCIIString)

On Wednesday, 24 June 2015 03:24:58 UTC-4, paul analyst wrote:

 Nan is readed as NaN but Nan is the name of cat. How to read this data ? 
 How to find the cat ?
 I have data.txt file , UTF8

 Lucycat
 Fliperdog
 Miadog
 Nancat
 Snupydog

 julia data=readd
 readdir readdlm
 julia data=readdlm(data.txt,'\t')
 5x2 Array{Any,2}:
 Lucycat
 Fliper  dog
 Mia dog
  NaN  cat
 Snupy   dog

 julia unique(data[:,1])
 5-element Array{Any,1}:
 Lucy
 Fliper
 Mia
  NaN
 Snupy

 julia findin(data[:,1],[Fliper])

 1-element Array{Int32,1}:
  2

 julia findin(data[:,1],[Nan])
 0-element Array{Int32,1}

 Paul



[julia-users] Re: Redirecting output julia (log to file)

2015-06-23 Thread Avik Sengupta
From a batch file, you can redirect the output using  . 
See 
http://blog.crankybit.com/redirecting-output-to-a-file-in-windows-batch-scripts/
 
for some details. 

Alternatively, if you control how the output is generated, you can use the 
Logging.jl package to write them to file in reasonably flexible way. 

Regards
-
Avik

On Tuesday, 23 June 2015 07:55:54 UTC+1, bernhard wrote:

 Hi all

 I am invoking a Julia process from an external program (say a Java script, 
 Windows or any program). 
 Julia starts, does some calculations and closes again. While Julia runs I 
 can of course see the REPL which shows me some logging and evaluations.

 I now want to set up a web service (REST or similar) where people can 
 upload data, start of a model, and download results. For this I want to 
 have a log file which shows the same or similar output which the REPL 
 (=Julia session) displays. I understand that the REPL is does much more 
 than just displaying stdout and stderr (this is why is said similar before).

 Leah Hanson is describing 
 http://blog.leahhanson.us/running-shell-commands-from-julia.html  (Base.| 
 ) which works perfectly for me. But this only works if I use Julia to 
 start another Julia session. In my case I want to start Julia from windows 
 (a *.bat file) or any other software. How can I achieve the same result?

 I am aware of redirect_stdout and redirect_stderr. This does not work 
 properly for me, as the program might run for several minutes, and it seems 
 to me that output is only written after I flush or close the stream. But I 
 want to see the progress in the log file (just as the REPL does) while my 
 code runs. It would be tedious to add flush  everywhere in my code where 
 I have a print command.

 Is there a way to achieve this? 

 As mentioned above I can invoke a julia session which starts another julia 
 session with the actual code:
 (st,pr) = open(`$(juliaExecutable) $(juliaProgram) $(arguments)` | 
 logFilename)
 Is there a way to achieve the same result without the intermediate julia 
 session?

 Thanks
 Bernhard



Re: [julia-users] Re: What's [] called? ie How do I refer to the array construction function?

2015-06-17 Thread Avik Sengupta
Indeed

*julia **getindex(Any, (1,2,3))*

*1-element Array{Any,1}:*

* (1,2,3)*


Basically, any code with X[y...] gets lowered to getindex, and then the 
corresponding method takes over to do the right thing. Makes the lowering 
relatively simple, i imagine. 



On Wednesday, 17 June 2015 13:54:11 UTC+1, Mauro wrote:

 I think it just uses getindex (a bit of a hack...): 

 julia @which Int[3] 
 getindex(T::Union(DataType,UnionType,TypeConstructor),vals...) at 
 array.jl:119 


 On Wed, 2015-06-17 at 14:50, andrew cooke and...@acooke.org javascript: 
 wrote: 
  Oh, I think the call() thing is just me being confused.  That's *only* a 
  mechanism to allow non-functions to look like functions?  I guess my 
  misunderstanding is more about how apply is defined (it mentions call), 
  which really isn't important to me right now, so feel free to ignore 
 that 
  part of my question.  Sorry. 
  
  
  On Wednesday, 17 June 2015 09:45:46 UTC-3, andrew cooke wrote: 
  
  
  If I want to pass the function that constructs an array of Any, given 
 some 
  values, to another function, what do I use? 
  
  Here's an example that might make things clearer: 
  
  julia f(x...) = Any[x...] 
  f (generic function with 1 method) 
  
  julia apply(f, 1,2,3) 
  3-element Array{Any,1}: 
   1 
   2 
   3 
  
  julia apply(Any[], 1,2,3) 
  ERROR: MethodError: `call` has no method matching call(::Array{Any,1}, 
 :: 
  Int64, ::Int64, ::Int64) 
  Closest candidates are: 
BoundsError(::Any...) 
TypeVar(::Any...) 
TypeConstructor(::Any...) 
... 
   in apply at deprecated.jl:116 
  
  where I am looking for what the built-in equivalent of f() is. 
  
  I may be even more confused, because I also don't understand why this 
  fails: 
  
  julia call(f, 1, 2) 
  ERROR: MethodError: `call` has no method matching call(::Function, 
 ::Int64 
  , ::Int64) 
  Closest candidates are: 
BoundsError(::Any...) 
TypeVar(::Any...) 
TypeConstructor(::Any...) 
... 
  
  So any guidance appreciated. 
  
  Thanks, 
  Andrew 
  



[julia-users] Re: Need help writing parallel code with @sync and @everywhere

2015-06-17 Thread Avik Sengupta

So again, this is an informal description... In particular, my nomenclature 
is not precise... 

So basically, an @parallel is a construct which will take the work to be 
done in each iteration of a for loop, and will farm them out to available 
remote processors, all at once. This will happen asynchronously, which 
means that all these jobs will be started without waiting for any of them 
to finish. You then want to wait for all the jobs to complete before going 
on the the Consume tmp stage. Hence you put an @async around this, to 
wait for all the parallel tasks to complete. 

Hope this makes it a little more understandable. I realise this does not 
help in designing a parallel system from scratch, but that is a much longer 
story. 

Note that with tmp being a shared array, this code will work only when 
all julia processes are in a single physical machine. 

Also, the @parallel construct is most useful when you combine a reduction 
operator with the for loop. 

Hope this helps
-
Avik

On Wednesday, 17 June 2015 10:49:58 UTC+1, Daniel Carrera wrote:


 On Wednesday, 17 June 2015 10:28:37 UTC+2, Nils Gudat wrote:

 I haven't used @everywhere in combination with begin..end blocks, I 
 usually pair @sync with @parallel - see an example here 
 https://github.com/nilshg/LearningModels/blob/master/NHL/NHL_6_Bellman.jl, 
 where I've parallelized the entire nested loop ranging from lines 25 to 47. 



 Aha! Thanks. Copying your example I was able to produce this:

 N = 5
 tmp = SharedArray(Int, (N))
 
 for i = 1:N
 # Compute tmp in parallel #
 @sync @parallel for j = (i + 1):N
 tmp[j] = i * j
 end
 
 # Consume tmp in serial #
 for j = (i + 1):N
 println(tmp[j])
 end
 end


 This seems to work correctly and gives the same answer as the serial code. 
 Can you help me understand how it works? What does @sync @parallel do? I 
 feel like I half-understand it, but the concept is not clear in my head.

 Thanks.

 Daniel.



[julia-users] Re: Backend deployment for website

2015-06-16 Thread Avik Sengupta
There are, indeed, various ways of doing so. So I suppose the choice 
depends a lot on your personal preferences. 

I don't have much experience with the node eco-system, but node-julia may 
be a good option for you. 

The way I have settled on doing this is using 
using https://github.com/tanmaykm/JuliaWebAPI.jl . This allows you to very 
easily provide a remote callable API to any Julia function using ZMQ. I use 
this from Java, using a standard Java ZMQ client. Alternatively, that 
package also wraps the ZMQ API with a HTTP/JSON api, which you can use with 
any http client. Presumably, the latter might be easier to do from nodejs. 

Regards
-
Avik

On Tuesday, 16 June 2015 16:35:40 UTC+1, Matthew Krick wrote:

 I've read everything I could on deployment options, but my head is still a 
 mess when it comes to all the choices, especially with how fast julia is 
 moving! I have a website on a node.js server  when the user inputs a list 
 of points, I want to solve a traveling salesman problem (running time 
 between 2 and 10 minutes, multiple users). Can someone offer some advice on 
 what's worked for them or any pros/cons to each option? Least cost is 
 preferable to performance.


1. Spawn a new node.js instance  solve using node-julia (
https://www.npmjs.com/package/node-julia)
2. Use Forio's epicenter to host the code (
http://forio.com/products/epicenter/)
3. Create a julia HTTP server  make a REST API (
https://github.com/JuliaWeb/HttpServer.jl)
4. Host on Google Compute Engine (https://cloud.google.com/compute/)
5. Host on Amazon's Simple Queue (http://aws.amazon.com/sqs/)
6. Use Julia-box, if it can somehow accept inputs via an http call (
https://www.juliabox.org/)
7. ???




[julia-users] Re: Announcement: Escher.jl - a toolkit for beautiful Web UIs in pure Julia

2015-06-09 Thread Avik Sengupta
There is no compilation of Julia code into JavaScript. At the cost of 
simplifying, you essentially manipulate a shadow DOM in Julia, that 
generates the corresponding  HTML. And browser events are delivered to 
Julia using reactive signals. 

So yes,  I suppose you could say that it is all driven from the server. 

On Tuesday, 9 June 2015 14:01:43 UTC+1, Sebastian Good wrote:

 Looks pretty interesting and in line with a lot of current web framework 
 thinking. Are there any pieces inside Escher which help with compiling 
 Julia code to JavaScript? Or is it all driven from the server?

 On Monday, June 8, 2015 at 12:23:21 PM UTC-4, Shashi Gowda wrote:

 Hello all!

 I have been working on a package called *Escher* over the past several 
 months.

 It is now quite feature-rich and ready to use in some sense. I put 
 together an overview here:

https://shashi.github.io/Escher.jl/*

 My aim is to converge at a UI toolkit that any Julia programmer can use 
 to create rich interactive GUIs and deploy them over the web, *within 
 minutes*.

 Escher simplifies the web platform into a simple and pleasant pure-Julia 
 library. You don't need to learn or write HTML or CSS or JavaScript. Many 
 problems associated with traditional web development basically disappear. 
 There is no need to write separate front-end and back-end code, layouts are 
 tractable and similar to layouts in the original TeX. Communication is done 
 under-the-hood as and when required. No boiler plate code. Things just look 
 great by default.

 Briefly, here is how Escher works under the hood:

 - A UI is an immutable Julia value that is converted to a Virtual DOM 
 http://en.wikipedia.org/wiki/React_%28JavaScript_library%29#Virtual_DOM 
 using the Patchwork https://github.com/shashi/Patchwork.jl library.
   Compose graphics and Gadfly plots also get rendered to Virtual DOM as 
 well.
 - Subsequent updates to a UI are sent as patches to the current UI over a 
 websocket connection
 - Input widgets send messages to the server over the same websocket 
 connection
 - Complex things like tabs, slideshows, code editor, TeX and dropdown 
 menus are set up as custom HTML elements using the Web Component 
 http://webcomponents.org/ specification, mainly using the Polymer 
 library http://polymer-project.org/. These things are just Virtual DOM 
 nodes in the end.


 This is still a work in progress, I am very happy to receive any critique 
 on this thread, and bug reports on Github 
 https://github.com/shashi/Escher.jl. I am very excited to see what you 
 will create with Escher.

 Thanks! :)
 Shashi

 * - Escher uses some bleeding-edge Web features, this page might not work 
 so well on Safari, should work well on a decently new Chrome, and on 
 Firefox if you wait for long enough for all the assets to load. I will be 
 fixing this in due time, and also working on a cross-browser testing 
 framework.

 PS: I have been dealing with RSI issues of late and my hands will 
 appreciate any help with expanding the documentation! See 
 https://github.com/shashi/Escher.jl/issues/26 if you wish to help.



[julia-users] Re: form -X:X where X is Uint64

2015-06-03 Thread Avik Sengupta
Negating an unsigned effectively causes it to overflow.. it flips all bits 
(rather than the sign bit... which doesnt exist)

*julia **bits(x)*

*0100*

*julia **bits(-x)*

*1100*


So the start of the range you create is greater than typemax(Int64). 

*julia **-x:x*

*0xfffc:0xfffb*

If you need negation, you need a signed integer, I think. 


Regards

-

Avik


On Wednesday, 3 June 2015 06:12:19 UTC+1, Pete Williams wrote:

 Hi, I'm not sure what the right way to form the range -X:X is when X is 
 Uint64.  It works as expected for smaller Uints

 *julia **Q = uint(4)*

 *0x0004*


 *julia **M = 0x4*

 *0x04*


 *julia **typeof(Q)*

 *Uint64*


 *julia **typeof(M)*

 *Uint8*


 *julia **[-1*M:M]*

 *9-element Array{Int64,1}:*

 * -4*

 * -3*

 * -2*

 * -1*

 *  0*

 *  1*

 *  2*

 *  3*

 *  4*


 *julia **[-1*Q:Q]*

 *ERROR: OverflowError()*

 * in vcat at range.jl:500*

 obviously I can make an Int64 copy of the Uint64 to fix this, but I'd like 
 to know if there is a more graceful way to do this.  Thanks.



[julia-users] Re: High-performance metric collector in Julia

2015-05-19 Thread Avik Sengupta
I'm not sure a debate about the relative merits of RDBMS vs other kinds of 
stores is going to be productive in this list.. Its a question that hasn't 
been settled in the lifetime of computers. 

Andrei  building a fast persistent queue using ZMQ is something that I've 
been interested in, but there are only so many hours a day. You mention the 
number of lines of code in your current trial.. but you are building a 
concurrent store, so not sure it can get much simpler than that. ZMQ will 
give you quite a bit of leverage in the networking layer, but you'll still 
need to build a user level api over it, and handle storage. 

One option, if you care to go down that route, is to use Redis as a store. 
There are a couple of julia Redis drivers around. 

Regards
-
Avik

On Tuesday, 19 May 2015 17:23:23 UTC+1, Scott Jones wrote:



 On Tuesday, May 19, 2015 at 11:39:24 AM UTC-4, Andrei Zh wrote:

 Not quite, I'm more interested in systems for collecting metrics (think 
 of reporting server or application health, for example) rather than storage 
 with random reads and writes. It is possible to use databases for this, but 
 it will be pretty inefficient. For example: 

 1. If we tale traditional RDBMS like MySQL or PostgreSQL, each insert 
 into DB will result in writing to disk (slow!), triggering indexes and 
 other maintenance activities. So these systems simply cannot handle the 
 load and will shortly become a bottleneck. 


 ???  Not on any real RDBMS like MySQL, PostgreSQL...
 You can also look at systems like InterSystem's Caché, which can be used 
 as a fast key-value store, but also has SQL and object capabilities...
 It is fast enough to be used to store huge amounts of data from the 
 European Space Agency...
 It has been used for storing metrics...

 2. Some NoSQL databases like Couchbase or Aerospike may give pretty good 
 performance, but since they are key-value stores, scanning them for results 
 may be terribly slow. 

  
 Why would being a key-value store make getting results slow?
 I think really all depends on the indices that you build...
  

 3. Persistent queues like Apache Kafka provide very fast sequential 
 writes and high-performance reads. But given their terrible API and 
 permanent breaking changes even in minor versions I don't even want to try 
 to connect to it from Julia. Well, not for the purpose of this little 
 project, at least. 
 4. In-memory queues with many producers and single consumer / collector 
 are pretty much close. So here we come to fast RabbitMQ and even faster 
 ZMQ. Still, they require some effort to build metric collection on top of 
 them. 
 5. There is also StatsD which is close in spirit, but hard to integrate 
 with Julia. It also requires too many unrelated dependencies (e.g. 
 node.js), especially compared to integrated ZMQ. 


 I don't expect ready-to-use library or even well defined approach, but 
 maybe someone in Julia community has already encountered problem of metric 
 collection? 



Re: [julia-users] Julia will always be open source

2015-05-19 Thread Avik Sengupta
To quickly follow up on the training materials comment, 

David Sander's tutorial that he delivered at SciPi is available 
here: https://github.com/dpsanders/scipy_2014_julia . David is also doing a 
tutorial at JuliaCon I believe. 

I have used something similar for a couple of sessions, the material is 
available here: https://github.com/aviks/learn-julia . Feel free to reuse. 

Regards
-
Avik


On Monday, 11 May 2015 11:48:52 UTC+1, Viral Shah wrote:

 That’s fantastic to hear, and thanks for the good wishes. We are using 
 much of the already public training material for the most part right now, 
 but we expect to refine it with every engagement, and put out something new 
 as soon as we have something substantially better. 

 -viral 



  On 10-May-2015, at 4:42 pm, Ken B ken.bas...@gmail.com javascript: 
 wrote: 
  
  I was able to sell Julia recently for a small 2,5 month consultancy 
 project at a research institute. The main difficulty in convincing the 
 client was the uncertain long term support for the language, so I'm very 
 happy to see this Julia Computing LLC up and running. 
  
  I agree with Scott that a list of organisations using Julia would be 
 very valuable for further promotion. Viral, would that be possible? 
  
  Eric, I put the project online under an MIT license. The idea was that 
 the more people use it, the more valuable it would become as it might 
 receive issues and fixes for free. This is of course very much project 
 dependent. 
  
  Also, I've just started at a University where I plan to promote Julia, 
 so I hope that Julia Computing LLC will share their training material. 
  
  And finally, best of luck with the new company! 
  
  Best regards, Ken 
  
  On Sunday, 10 May 2015 02:33:58 UTC+2, Eric Forgy wrote: 
  I think this is great. Our startup has similar issues. We want to do 
 innovative work, but that work needs funding, so we also do some 
 consulting/training to pay the RD bills. It can be a challenge to find the 
 right balance though, so beware :) 
  
  Given the position of Julia Computing, another potential source of 
 revenue for you is helping companies (like mine) with recruiting. If you 
 kept a database of Julia developers looking for employment opportunities, 
 firms (like mine) would be willing to pay up to 3 months salary for 
 finding fees. Speaking of which, do you know anyone in Hong Kong? :) 
  
  One question I have though is about how to balance open source versus 
 proprietary development. There are currently Julia packages we're using 
 that could use some professional development to clean up and make 
 production worthy. If we pay developers to clean up an existing package, it 
 feels weird to just give the work we paid for away. Any thoughts on how I 
 should think about this? I probably just need some education and am open to 
 suggestions. It would be interesting if Github issues could be given a $ 
 value, i.e. resolve this issue and receive $x in fees. This could be an 
 effective way to prioritize :) 
  
  On Sunday, May 10, 2015 at 4:20:15 AM UTC+8, Viral Shah wrote: 
  Hello all, 
  
  You may have seen today’s Hacker News story about Julia Computing: 
 https://news.ycombinator.com/item?id=9516298 
  
  As you all know, we are committed to Julia being high quality and open 
 source. 
  
  The existence of Julia Computing was discussed a year ago at JuliaCon 
 2014, though we recognize that not everyone is aware. We set up Julia 
 Computing to assist those who asked for help building Julia applications 
 and deploying Julia in production.  We want Julia to be widely adopted by 
 the open source community, for research in academia, and for production 
 software in companies.  Julia Computing provides support, consulting, and 
 training for customers, in order to help them build and deploy Julia 
 applications. 
  
  We are committed to all the three organizations that focus on different 
 users and use cases of Julia: 
  
  1. The open source Julia project is housed at the NumFocus Foundation. 
 http://numfocus.org/projects/ 
  2. Research on various aspects of Julia is anchored in Alan’s group at 
 MIT. http://www-math.mit.edu/~edelman/research.php 
  3. Julia Computing works with customers who are building Julia 
 applications. http://www.juliacomputing.com/ 
  
  Our customers make Julia Computing self-funded. We are grateful that 
 they have created full time opportunities for us to follow our passions. 
 Open source development will never cease. 
  
  You may have questions. Please shoot them here. We will respond back 
 with a detailed blog post. 
  
  -viral 
  



[julia-users] Re: Confused by method ambiguity warning

2015-05-05 Thread Avik Sengupta
Thanks Tovio

 unless JString : String (but I guess it isn't?). 

No, indeed, JString is not a subtype of a Julia string. It is simply a 
wrapper around a pointer. It has no string-like behaviour in Julia, other 
than being able to be converted back and forth from a Julia string. 

 it seems to me that your method can never be an identity conversion

 I could write a method definition such as 

convert(::Type{JString}, str::JString) = str

I suppose that should be safe, but I don't understand why that should be 
necessary, or what benefit it will have. 

On Tuesday, 5 May 2015 11:38:38 UTC+1, Toivo Henningsson wrote:

 This looks like a julia bug, unless JString : String (but I guess it 
 isn't?). 

 The method from Base is the generic identity conversion, but it seems to 
 me that your method can never be an identity conversion? 



[julia-users] Confused by method ambiguity warning

2015-05-04 Thread Avik Sengupta
I've been trying to get JavaCall to work with the latest Julia master, 
after the Tuplecalypse. I am getting a method ambiguity warning, and am a 
bit confused by the suggested fix. Any help appreciated. 

so the warning message says: 

Warning: New definition 

convertTuple{Type{JavaCall.JavaObject{symbol(java.lang.String)}},T:AbstractString}
 
at /home/vagrant/.julia/v0.4/JavaCall/src/JavaCall.jl:150
is ambiguous with: 
convertTuple{Type{T},T} at base.jl:38.
To fix, define 

convertTuple{Type{JavaCall.JavaObject{symbol(java.lang.String)}},JavaCall.JavaObject{symbol(java.lang.String)}}
before the new definition.

The method definition at line 150 of JavaCall.jl is :

convert{T:String}(::Type{JString}, str::T) = JString(str)

where JString is a type alias:

typealias JString JavaObject{symbol(java.lang.String)}

My primary point of confusion is that the suggested fix seems to ask me to 
define an identity method. Is that really what I need to do? I suppose I 
haven't really understood why this method definition should be ambigous. 
Especially since this was OK in 0.3, and older versions of 0.4.

Regards
-
Avik


[julia-users] Space sensitive macro parsing in v0.4

2015-05-03 Thread Avik Sengupta
So in julia v0.3:

julia @osx?print(A):print(B)
A

But in julia 0.4:

julia @osx?print(A):print(B)
ERROR: wrong number of arguments

A space is now required after the ?

julia @osx? print(A):print(B)
A

Is this intentional, or should I file a bug? 

Regards
-
Avik



[julia-users] Re: Something wrong with Optim?

2015-04-29 Thread Avik Sengupta
So I am not terribly sure why creating a closure should should mess with 
the scoping of the variables. I'm not sure this is the desired behaviour. 
Maybe there is a good reason. Clearly in this scenario, the compiler is 
confused by what z is.

Its just that printing a variable without implicitly or explicitly 
declaring it first in a lexical scope seemed like a code smell to me. That 
was the first thought on debugging this. 

Regards
-
Avik

On Wednesday, 29 April 2015 05:57:09 UTC+1, Pooya wrote:

 Ah! Thank you. I had not heard of closure before. Now, I have heard of it, 
 but am not sure if I can completely understand it! I guess this might be 
 worth being explained in the manual. One thing that is still kind of 
 confusing is that in your example, z is defined after the closure is 
 created until the end of that iteration. So, z is printed once below, but 
 not the second time in the beginning of the second iteration! 

 julia for i=1:10
if i=2; println(z); end 
z=2 
g()=2z 
println(z) 
end 
 2 
 ERROR: z not defined 
  in anonymous at no file:2


 On Tuesday, April 28, 2015 at 10:17:17 PM UTC-4, Avik Sengupta wrote:

 Yes, sorry I jumped the gun. Thanks for clarifying. 

 But it still does not have anything to do with Optim :)

 The problem is due to defining an inline function (line 43) that creates 
 closure over the x_previous variable.  To test this, just comment that 
 line (and adjust the Optim.optimize call), the problem goes away. 

 A simpler version of the code that fails is as follows: 

 julia function f() 
  for i=1:10
if i2; println(z); end
z=2
g() = 2z
  end
end
 f (generic function with 1 method)

 julia f()
 ERROR: z not defined
  in f at none:3

 A fix to get it to work is to declare the variable at the start of your 
 function. Similarly, adding a local x_previous at the top of your 
 function makes it work correctly. Remember, variables in Julia are lexical 
 in scope. 

 julia function f()
  local z
  for i=1:10
if i2; println(z); end
z=2
g()=2z
  end
end
 f (generic function with 1 method)

 julia f()
 2
 2
 2
 2
 2
 2
 2
 2


 On Wednesday, 29 April 2015 02:23:28 UTC+1, Pooya wrote:

 If you comment out lines 42-49, you will see that it works fine!

 On Tuesday, April 28, 2015 at 9:20:49 PM UTC-4, Pooya wrote:

 Thanks, but I think if iter  2 (line 21) makes sure that x_previous 
 is defined in the previous iteration. Just to be clear, the condition to 
 check here was g_norm  g_norm_old, but I changed it to get there as 
 early as the second iteration.  

 On Tuesday, April 28, 2015 at 9:13:49 PM UTC-4, Avik Sengupta wrote:

 I'm seeing the error in line 22 of your gist where you are trying to 
 print the current value of x_previous. However, x_previous is first 
 defined in line 38 of your gist, and so the error is correct and doesnt 
 have anything to do with Optim, as far as I can see. 

 On Wednesday, 29 April 2015 01:39:02 UTC+1, Pooya wrote:

 Hi all,

 I have a problem that has made me scratch my head for many hours now! 
 It might be something obvious that I am missing. I have a Newton-Raphson 
 code to solve a system of nonlinear equations. The error that I get here 
 does not have anything to do with the algorithm, but just to be clear, I 
 need to find the best possible solution if the equations are not 
 solvable, 
 so I am trying to stop simulation when the direction found by 
 Newton-Raphson is not correct! In order to do that I put an if-loop in 
 the 
 beginning of the main loop to take x from the previous iteration 
 (x_previous), but I get x_previous not defined! I am using the Optim 
 package to do a line search after the direction has been found by 
 Newton-Raphson. If Optim is not used, things work perfectly (I tried by 
 commenting out those lines of code). Otherwise I get the error I 
 mentioned. 
 My code is here: 
 https://gist.github.com/prezaei85/372bde76012472865a94, which solves 
 a simple one-variable quadratic equation. Any thoughts are very much 
 appreciated.

 Thanks,
 Pooya



[julia-users] Re: Something wrong with Optim?

2015-04-28 Thread Avik Sengupta
Yes, sorry I jumped the gun. Thanks for clarifying. 

But it still does not have anything to do with Optim :)

The problem is due to defining an inline function (line 43) that creates 
closure over the x_previous variable.  To test this, just comment that 
line (and adjust the Optim.optimize call), the problem goes away. 

A simpler version of the code that fails is as follows: 

julia function f() 
 for i=1:10
   if i2; println(z); end
   z=2
   g() = 2z
 end
   end
f (generic function with 1 method)

julia f()
ERROR: z not defined
 in f at none:3

A fix to get it to work is to declare the variable at the start of your 
function. Similarly, adding a local x_previous at the top of your 
function makes it work correctly. Remember, variables in Julia are lexical 
in scope. 

julia function f()
 local z
 for i=1:10
   if i2; println(z); end
   z=2
   g()=2z
 end
   end
f (generic function with 1 method)

julia f()
2
2
2
2
2
2
2
2


On Wednesday, 29 April 2015 02:23:28 UTC+1, Pooya wrote:

 If you comment out lines 42-49, you will see that it works fine!

 On Tuesday, April 28, 2015 at 9:20:49 PM UTC-4, Pooya wrote:

 Thanks, but I think if iter  2 (line 21) makes sure that x_previous 
 is defined in the previous iteration. Just to be clear, the condition to 
 check here was g_norm  g_norm_old, but I changed it to get there as 
 early as the second iteration.  

 On Tuesday, April 28, 2015 at 9:13:49 PM UTC-4, Avik Sengupta wrote:

 I'm seeing the error in line 22 of your gist where you are trying to 
 print the current value of x_previous. However, x_previous is first 
 defined in line 38 of your gist, and so the error is correct and doesnt 
 have anything to do with Optim, as far as I can see. 

 On Wednesday, 29 April 2015 01:39:02 UTC+1, Pooya wrote:

 Hi all,

 I have a problem that has made me scratch my head for many hours now! 
 It might be something obvious that I am missing. I have a Newton-Raphson 
 code to solve a system of nonlinear equations. The error that I get here 
 does not have anything to do with the algorithm, but just to be clear, I 
 need to find the best possible solution if the equations are not solvable, 
 so I am trying to stop simulation when the direction found by 
 Newton-Raphson is not correct! In order to do that I put an if-loop in the 
 beginning of the main loop to take x from the previous iteration 
 (x_previous), but I get x_previous not defined! I am using the Optim 
 package to do a line search after the direction has been found by 
 Newton-Raphson. If Optim is not used, things work perfectly (I tried by 
 commenting out those lines of code). Otherwise I get the error I 
 mentioned. 
 My code is here: https://gist.github.com/prezaei85/372bde76012472865a94, 
 which solves a simple one-variable quadratic equation. Any thoughts are 
 very much appreciated.

 Thanks,
 Pooya



[julia-users] Re: Something wrong with Optim?

2015-04-28 Thread Avik Sengupta
I'm seeing the error in line 22 of your gist where you are trying to print 
the current value of x_previous. However, x_previous is first defined in 
line 38 of your gist, and so the error is correct and doesnt have anything 
to do with Optim, as far as I can see. 

On Wednesday, 29 April 2015 01:39:02 UTC+1, Pooya wrote:

 Hi all,

 I have a problem that has made me scratch my head for many hours now! It 
 might be something obvious that I am missing. I have a Newton-Raphson code 
 to solve a system of nonlinear equations. The error that I get here does 
 not have anything to do with the algorithm, but just to be clear, I need to 
 find the best possible solution if the equations are not solvable, so I am 
 trying to stop simulation when the direction found by Newton-Raphson is not 
 correct! In order to do that I put an if-loop in the beginning of the main 
 loop to take x from the previous iteration (x_previous), but I get 
 x_previous not defined! I am using the Optim package to do a line search 
 after the direction has been found by Newton-Raphson. If Optim is not used, 
 things work perfectly (I tried by commenting out those lines of code). 
 Otherwise I get the error I mentioned. My code is here: 
 https://gist.github.com/prezaei85/372bde76012472865a94, which solves a 
 simple one-variable quadratic equation. Any thoughts are very much 
 appreciated.

 Thanks,
 Pooya



[julia-users] Re: code to study

2015-04-22 Thread Avik Sengupta
This is a good question, though the answers are going to be quite 
opinionated. My personal view is that the standard library is probably the 
best in this regard. I usually suggest rational.jl as the best beginners 
introduction to the language. BigInts and BitFloats for more advanced 
stuff, including C interop. DateTime is a larger, but self contained, piece 
of functionality. 

On Wednesday, 22 April 2015 14:25:04 UTC+1, Tamas Papp wrote:

 Hi, 

 Looking at code snippets from others I sometimes realize that my usage 
 of Julia is not idiomatic. I learn a lot from code by others, and I am 
 wondering if there is a way to approach this more systematically. 

 In particular, it would be great to get recommendations on which 
 libraries one should could to learn good, idiomatic coding style in 
 Julia. Ideally, the library 

 1. should be a native julia implementation, not an interface to a 
 C/... library, 

 2. written for Julia explicitly, not a translation from Matlab etc, 

 3. should not be a lot of LOC, so that one can understand its details in 
 reasonable time. 

 Documentation and interesting macro examples are extras. 

 Best, 

 Tamas 



[julia-users] Re: How to fix package after breaking change in 0.4?

2015-04-19 Thread Avik Sengupta

Try this: 

 function _make_simple_undirected_graph{T:Integer}(n::T, 
edgelist::Vector{Tuple{T,T}}) 

On Monday, 20 April 2015 00:18:33 UTC+5:30, Seth wrote:

 Could someone please explain what's going on here and what I need to do to 
 fix my package with the latest 0.4 tuple changes?

 Here's the error (from pkg.julialang.org):

 ERROR: LoadError: LoadError: LoadError: TypeError: apply_type: in alias, 
 expected Type{T}, got Tuple{TypeVar,TypeVar}
  in include at ./boot.jl:250
  in include_from_node1 at ./loading.jl:129
  in include at ./boot.jl:250
  in include_from_node1 at ./loading.jl:129
  in reload_path at ./loading.jl:153
  in _require at ./loading.jl:68
  in require at ./loading.jl:51
  in include at ./boot.jl:250
  in include_from_node1 at loading.jl:129
  in process_options at ./client.jl:299
  in _start at ./client.jl:398
 while loading /home/vagrant/testpkg/v0.4/LightGraphs/src/smallgraphs.jl, in 
 expression starting on line 120
 while loading /home/vagrant/testpkg/v0.4/LightGraphs/src/LightGraphs.jl, in 
 expression starting on line 93
 while loading /vagrant/nightlyAL/PKGEVAL_LightGraphs_using.jl, in expression 
 starting on line 4


 Here's the line in question:

 function _make_simple_undirected_graph{T:Integer}(n::T, edgelist::Vector
 {(T,T)})

 I confess to not yet fully understanding the new change to tuples, and I'm 
 lost as to how to fix my code to comply with the new rules.

 Thanks.



[julia-users] Re: Unable to show `Interact` widget in IJulia.

2015-03-26 Thread Avik Sengupta
I think you need to run Pkg.checkout(Interact) at the Julia prompt to get 
this working with ipython 3.0. 

See https://github.com/JuliaLang/Interact.jl/issues/55 for details. 

Regards
-
Avik

On Thursday, 26 March 2015 20:36:21 UTC, Big Stone wrote:

 Same here on windows ipython3.0 / julia0.3.5,

 Maybe interact.jl is not in synch with recent breaking changes from 
 Ipython.



[julia-users] Re: NLopt: define objective function with other inputs

2015-03-24 Thread Avik Sengupta
If I understand your question correctly, the simplest way to do this is to 
create a closure via an anonymous function. 

function myRealFunc(x::Vector, grad::Vector, param1, param2) 
   #do something with x, param1 and param2
end

function optimise(param1, param2)
   opt = Opt(:LD_MMA, 2)
   min_objective!(opt, (x,y)-myRealFunc(x, y, param1, param2)
end



On Tuesday, 24 March 2015 06:34:43 UTC+1, Pooya wrote:

 Hi there. In NLopt the method for defining the objective function is 
 function 
 myfunc(x::Vector, grad::Vector), where grad is the gradient. Is there a 
 way to pass other inputs to this function so as to use them to evaluate the 
 objective function or the gradient? If not, what is the work around 
 solution? Thanks.



[julia-users] Re: isnull woes

2015-03-15 Thread Avik Sengupta

I think while a Java Null and Nullable Null are different, asking the 
question isnull is  a similar enough concept to deserve the same 
function. The Base/Nullable method is isnull(::Nullable), while the 
JavaCall method is isnull(::JavaObject{T}) .. which is the way it should 
be, afaics. It's only my wish to write a package that works accross 0.3 and 
0.4 that introduces the problem. 


On Saturday, 14 March 2015 11:14:58 UTC, Toivo Henningsson wrote:

 Do we consider nullness of java objects and nullables to be similar enough 
 that they should actually be checked with the same predicate? I guess the 
 two concepts do have a lot of things in common, though methods written to 
 work with nullables might not be prepared to accept java objects.



[julia-users] isnull woes

2015-03-13 Thread Avik Sengupta

So JavaCall has always had an isnull(::JavaObject) method, which is 
exported. 

Now that Base has Nullable in v0.4, it also has an isnull(::Nullable) 
method exported. 

So far so good. But I want to use Compat for JavaCall, primarily for the 
Int/int change. Now, Compat also has an isnull(::Nullable) method exported, 
but that is in the module Compat!

So I cant figure out how to write the definition of isnull in JavaCall, 
that'll work in all versions of Julia. 

Any help appreciated. 

Regards
-
Avik

PS Maybe this is another reason why new functionality should NOT be 
backported, even in compat?


[julia-users] Re: RFC: JuliaWeb Roadmap + Call for Contributors

2015-03-12 Thread Avik Sengupta
I think this is very useful. The web stack is a bit lacking in 
documentation, so this is great. Maybe flesh out the doucumentation a bit, 
explaining the usage of the morsel/meddle/mustache API's in this code. And 
possibly host the documentation separately on bitbucket-pages. 

I think it would be good to link to this from the JuliaWebStack docs. 

On Thursday, 12 March 2015 01:05:33 UTC, jock@gmail.com wrote:

 Hi all,

 Here https://bitbucket.org/jocklawrie/skeleton-webapp.jl is a bare 
 bones application that fetches some data, runs a model and produces some 
 pretty charts.
 I'll flesh this out over the next few months, including documentation 
 aimed at data scientists (I'm a statistician not a web programmer).
 Would this help with your request for docs and examples?
 Happy to discuss.

 Cheers,
 Jock


 On Friday, February 13, 2015 at 9:57:56 AM UTC+11, Iain Dunning wrote:

 Hi all,

 TL;DR: 
 - New JuliaWeb roadmap: https://github.com/JuliaWeb/Roadmap/issues
 - Please consider volunteering on core JuliaWeb infrastructure (e.g. 
 Requests, GnuTLS), esp. by adding tests/docs/examples.

 ---

 *JuliaWeb* (https://github.com/JuliaWeb) is a collection of 
 internet-related packages, including HTTP servers/parsers/utilities, IP 
 address tools, and more.

 Many of these packages were either created by rockstar ninja guru 
 developer Keno, or by students at Hacker School. Some of these packages, 
 like Requests.jl/HttpParser.jl/GnuTLS.jl/... are almost surely installed on 
 your system, but some (e.g. GnuTLS.jl) haven't really been touched much 
 since they were created and aren't actively maintained. For such core 
 packages, it isn't fair to put all the burden on one developer.

 On a personal level, I've been trying to help out where I can by merging 
 PRs, but this web stuff isn't really my strength, and I'm not really able 
 to effectively triage the issues that have built up on some of these 
 packages. So heres what we're (Seth Bromberger has been part of this 
 too) doing:

 - We've made a *roadmap repo for JuliaWeb* to discuss some of these 
 issues and co-ordinate limited resources: 
 https://github.com/JuliaWeb/Roadmap/issues . We'd like to hear your 
 perspectives!

 - *We want you!* You don't have to be a Julia master - you can even 
 start just by reading the code of one of these packages, and then adding 
 some tests or documentation. Maybe you'll even get comfortable to add 
 features! Right now, the focus is definitely on maintainence and making 
 sure whats there works (on Julia 0.3 and 0.4!). Your Pull Requests are very 
 welcome!



[julia-users] Re: Best practices for migrating 0.3 code to 0.4? (specifically constructors)

2015-03-12 Thread Avik Sengupta
I think this is simply due to your passing a UTF8String, while your 
function defined only for ASCIIString. Since there is no function defined 
for UTF8String, julia falls back to the default constructor that calls 
convert. 

julia type A
 a::ASCIIString
 b::Int
   end

julia function A(fn::ASCIIString)
   A(fn, length(fn)
   end
ERROR: syntax: missing comma or ) in argument list

julia function A(fn::ASCIIString)
   A(fn, length(fn))
   end
A

julia A(X)
A(X,1)

julia A(∞)
ERROR: MethodError: `convert` has no method matching convert(::Type{A}, 
::UTF8String)
This may have arisen from a call to the constructor A(...),
since type constructors fall back to convert methods.
Closest candidates are:
  convert{T}(::Type{T}, ::T)

 in call at no file


#Now try this: 

julia type A
 a::AbstractString
 b::Int
   end

julia function A(fn::AbstractString)
   A(fn, length(fn))
   end
A

julia A(X)
A(X,1)

julia A(∞)
A(∞,1)

Not that using AbstractString is only one way to solve this, which may or 
may not be appropriate for your use case. The code above is simply to 
demonstrate the issue at hand. 



On Thursday, 12 March 2015 23:43:58 UTC, Phil Tomson wrote:

 I thought I'd give 0.4 a spin to try out the new garbage collector.

 On my current codebase developed with 0.3 I ran into several warnings 
 (*float32() 
 should now be Float32()* - that sort of thing)

 And then this error:






 *ERROR: LoadError: LoadError: LoadError: LoadError: LoadError: 
 MethodError: `convert` has no method matching convert(::Type{Img.ImgHSV}, 
 ::UTF8String)This may have arisen from a call to the constructor 
 Img.ImgHSV(...),since type constructors fall back to convert 
 methods.Closest candidates are:  convert{T}(::Type{T}, ::T)*
 After poking around New Language Features and the list here a bit it seems 
 that there are changes to how overloaded constructors work.

 In my case I've got:

 type ImgHSV
   name::ASCIIString
   data::Array{HSV{Float32},2}  
   #data::Array{IntHSV,2}  
   height::Int64
   wid::Int64
   h_mean::Float32
   s_mean::Float32
   v_mean::Float32
   h_std::Float32
   s_std::Float32
   v_std::Float32
 end

 # Given a filename of an image file, construct an ImgHSV
 function ImgHSV(fn::ASCIIString)
   name,ext = splitext(basename(fn))
   source_img_hsv = Images.data(convert(Image{HSV{Float64}},imread(fn)))
   #scale all the values up from (0-1) to (0-255)
   source_img_scaled = map(x- HSV( ((x.h/360)*255),(x.s*255),(x.v*255)),
   source_img_hsv)
   img_ht  = size(source_img_hsv,2)
   img_wid = size(source_img_hsv,1)
   h_mean = (mean(map(x- x.h,source_img_hsv)/360)*255)
   s_mean = (mean(map(x- x.s,source_img_hsv))*255)
   v_mean = (mean(map(x- x.v,source_img_hsv))*255)
   h_std  = (std(map(x- x.h,source_img_hsv)/360)*255)
   s_std  = (std(map(x- x.s,source_img_hsv))*255)
   v_std  = (std(map(x- x.v,source_img_hsv))*255)
   ImgHSV(
 name,
 float32(source_img_scaled),
 img_ht,
 img_wid,
 h_mean,
 s_mean,
 v_mean,
 h_std,
 s_std,
 v_std
   )
 end

 Should I rename this function to something like buildImgHSV so it's not 
 actually a constructor and *convert* doesn't enter the picture?

 Phil



[julia-users] Re: Project organization

2015-03-05 Thread Avik Sengupta
Sorry , I missed this reponse... 

  $ julia MajorCalculations.jl configuration.txt data.txt

Well, you can certainly run it like that, even if this is a package.  You 
would write code to handle the parsing of the command line arguments 
(potentially using ArgParse.jl) .. As I said, a package is primarily a unit 
of code that can be shared and installed easily. The module load part is 
useful, but not necessary. 

But if you want to run it from within other julia code, and thus want to 
import this functionality with using MajorCalculations then there are a 
couple of options. There is an `__init` funcition that you can define, that 
runs every time the module is loaded. You could use that, but you cant pass 
parameters to it. In that case, you could write an external `init` 
function. So this would be something like 

using MajorCalculations
init(config.txt)
run(data.txt)

.. or something like that

On Monday, 23 February 2015 15:30:26 UTC, Marc Gallant wrote:

 Thanks for your input. I have some questions about your reply:

 4.  Yes, putting constants in global scope is fine. I believe there will 
 not be a performance issue is you mark the variables as const


 How do I load the configuration file if Major Calculations is a package? 
 using MajorCalculations won't work because MajorCalculations.jl requires 
 a configuration file to define constants. And how to I pass the data to 
 MajorCalculations.jl?

 For example, if MajorCalculations is my main file, I would like to write

 $ julia MajorCalculations.jl configuration.txt data.txt

 But how does this work in conjunction with using or import 
 MajorCalculations?

 Thanks.



[julia-users] Re: Equivalent of MATLAB's nargout in Julia

2015-03-04 Thread Avik Sengupta
Yes, Julia doesnt have nargout. The idiomatic way to do this would be to 
use optional arguments:

http://julia.readthedocs.org/en/latest/manual/functions/#optional-arguments

So:

function f(a, b=0)
  if b  0
 #do the computations for second argument
   end
   #rest of computation
end

Use a default value that makes sense in your domain. 

On Wednesday, 4 March 2015 16:48:28 UTC, Pooya wrote:

 I have a function with two outputs. The second one is computationally 
 expensive, so I want to avoid the computation unless the user needs it. I 
 read on another post in the group that the solution in this case is usually 
 to define two functions, but in this case I basically need to do all the 
 computations for the first output to compute the second. Is there any nicer 
 way to do this in julia? In MATLAB, I would just say:

 If nargout  1
 # do all the computations for second output
 end



[julia-users] Re: Project organization

2015-02-23 Thread Avik Sengupta
So I am not sure there are cannonical answers to some of these questions, 
but I'll try to address some of them based of my current opininions. So 
imho, and fwiw etc... 

1. Major Calculations should mostly be a package. A package is not 
necessarily a library, it is a self contained unit of code sharing. So if 
you want to share your code publicly, it should most certainly be a 
package. If its only a private piece of code, private to you or your 
organisation, then you can get away with not making it a package. However, 
I think you would benefit from making it one, if only for the reason that 
the src/ directory of all packages are automatically in the load path. 

2. I think this is a personal choice based on your domain and design. 
Creating separate modules will create clear boundaries between parts of 
your code. Only you can decide if that is valuable to you. 

3. If you make this  a package, then your main file should be 
MajorCalculations.jl . This file will be loaded when calling using 
MajorCalculations . Beyond that, your are free to layout your code as you 
wish. The majority of Julia packages these days I think have functionality 
in separate files (and optionally separate modules) that are included in 
the main file for the package

In terms of steps, I believe you should model your steps as function calls. 
So one way would be 

#file: MajorCalculations.jl

module MajorCalculations

include(first.jl)  #define function first()
include(second.jl) #define function second()

function process()
   first()
   second()
end #function

end #process

4.  Yes, putting constants in global scope is fine. I believe there will 
not be a performance issue is you mark the variables as const

5. If the functions have different number of types of parameters, they will 
not clash, they will be multiple methods of a single function (so long as 
correcly imported). If they really clash, then don't export them from the 
module, call them with a fully qualified name Module.func()


On Monday, 23 February 2015 14:39:49 UTC, Marc Gallant wrote:

 I'm having some trouble figuring out the proper way to organize a project 
 in Julia. I understand how a *package* is organized (from the many 
 available examples), but now I am writing code that uses various packages 
 (my own and others) and I don't feel like I have a good idea on how a 
 *project* should be organized.

 Let's say I have a project called Major Calculations that uses the 
 packages Foo.jl, Bar.jl, and Important.jl.

 1. Should I use Pkg.generate() to create Major Calculations? In other 
 words, should it be a package (in the julia sense)? It isn't going to be a 
 library of types and methods, but rather a project where I give it large 
 amounts of data and it outputs modified data and plots.

 2. Should I break down Major Calculations into separate modules? For 
 example, there are groups of functions that are related. Should each of 
 these get their own module?

 3. What should the directory layout of Major Calculations be? Should I 
 have a main.jl? What if I want to process the data in steps (e.g., 
 first.jl, second.jl, ...).

 4. When I use the project, I want to pass it two files: a configuration 
 file, and the data file. The configuration file will define a bunch of 
 constants that are used throughout Major Calculations (i.e., it is 
 required). Should these be declared as global consts? If that's the case, 
 should I have a file (e.g., constants.jl) that I include at the start of 
 main.jl that reads the file and just sets all constants? And should this be 
 completely in the global scope?

 5. If the two modules Foo and Bar both export functions with the same name 
 (but different parameters), how do I avoid conflicts? Should the project 
 use import instead of using?

 In essence, I am just having a hard time differentiating how code is 
 organized when it is a package for general usage, compared to how it 
 organized when it is a project used to process data. 

 Thanks for your time. 



[julia-users] Re: building GUI on top of julia code

2015-02-06 Thread Avik Sengupta
I would have said IJulia with Interact.jl is your best bet to get this gone 
quickly. But I see that doesn't work for you. That is unfortunate, because 
doing it that way is going to be the easiest by far. If you can replicate 
the issues, an IJulia bug report would be appreciated, I imagine. 

Julia does have bindings to GTK and TK. Depending on your familiarity with 
these frameworks, they may work for you. 

Regards
-
Avik

On Friday, 6 February 2015 18:40:46 UTC, Andrei Berceanu wrote:

 So I have wrote the code for a numerical simulation in Julia, and I have a 
 few free parameters that I can play with (5-6) which will change the 
 resulting plots. The plots are done using Matplotlib via PyPlot.

 I would like to build a simple GUI with a few sliders for my parameters 
 and an array of plots that will change interactively as I change the 
 sliders.
 What are my options for quickly building such a thing? I prefer avoiding 
 the IJulia notebook because the kernel crashes quite often for some reason 
 when plotting stuff (this doesnt happen in the REPL).

 Thanks,
 A



[julia-users] Re: What Julia package would you use for animations?

2015-02-06 Thread Avik Sengupta
Well, there is https://github.com/shashi/Reel.jl which might help. 

On Friday, 6 February 2015 17:47:41 UTC, Phil Tomson wrote:

 Say I want to do something like Boids simulation in Julia (
 http://en.wikipedia.org/wiki/Boids), what packages are available to show 
 the animations? These are easy(ish) things to do in Processing, but Julia 
 is more capable mathematically and performance should be better. 

 I know there's the Images library, but is it amenable to doing animations?




[julia-users] Re: Help with include()/module workflow in JuliaStudio0.4.4

2015-02-06 Thread Avik Sengupta
after re-running include I got a 'Warning Replacing module 

Yes, that is expected when you reload a module, and is mostly harmless in 
this workflow. 

On Friday, 6 February 2015 17:29:58 UTC, Michael Bullman wrote:

 After I posted this I looked at the modules section of the julia lang 
 doc, I added the module  end syntax. after re-running include I got a 
 'Warning Replacing module , is this the normal response in this work 
 flow? 

 On Friday, February 6, 2015 at 12:22:39 PM UTC-5, Michael Bullman wrote:



 Hi All, 

 I'm trying to follow the workflow described here: 
 http://julia.readthedocs.org/en/latest/manual/faq/ under the How can I 
 modify the declaration of a type/immutable in my session?

 section. 

 I'm very very new to julia, this is one of the first programs I'm 
 actually trying to write in julia. So I understand that I could be missing 
 some very basic understanding here. 

 So I have my program file in Julia Studio load_balancer_sim.jl It 
 currently defines a type Fyle with some fields. When I restart the julia 
 session and load the file I don't get errors. So I started a new session 
 and defined a string with the file path in it so I could use 
 include(path_name) instead of a long messy path. 

 However, I made some minor change, and tried to use include(path_name) 
 but it is giving me the Invalid redefinition of constant Fyle error. 

 I thought the work-around described in the FAQ was supposed to solve this?

 When I run whos(), I do see Fyle there as a DataType. Am I supposed to 
 see this in whos()? Or is this supposed to be happening behind a module 
 import? Am I supposed to add syntax to load_balancer_sim.jl to imply it 
 is a module?

 Hopefully some of this makes sense, thank you. 



[julia-users] Re: Type Annotations and Overloading Question

2015-02-04 Thread Avik Sengupta
I don't understand your domain of course, but the way I'd do this would be 
a slight variant of OPTION 1

get_forces(a::AbstractAtom) = error(All AbstractAtom subtypes should 
implement get_forces)
get_forces(a::Atom) = get_forces(a.calc)

I think the point to ponder is, what amount of commonality does all 
possible Atoms contain? 

Regards
-
Avik

On Wednesday, 4 February 2015 15:16:02 UTC, Christoph Ortner wrote:


 I am trying to re-structure a molecular simulation code I've been working 
 on, to make it more readily extendable. I am puzzling over how to do this 
 most effectively in Julia, and would appreciate any thoughts from more 
 experienced Julia programmers. I am roughly trying to mimic the structure 
 of CAMPOS ASE ( a Python package ).

 The main type that contains the simulation state is 

abstract AbstractAtoms

 The simplest sub-type is (here a simplified version)

 type Atoms
 X::Array{Float64, 2}#  positions of atoms
 calc #  calculator for computing 
 energies, forces, etc
 neigs   # neighbourlist
 precon # preconditioner
 end

 but there could be many other sub-types that store atom positions 
 differently, or live on manifolds, or contain information for continuum 
 mechanics boundary conditions, etc.

 I now need functions that depends on the type of the atoms object and on 
 the type of calculator object.  (for example). 

 OPTION 1:At the moment, my thinking is that I can do

function get_forces(atoms::AbstractAtoms)
return get_forces(atoms, atoms.calc)
end

 and the type of `atoms` and of `atoms.calc` will then determine which 
 function is called. This feels a bit clunky to be honest, but looks like 
 the best way to go?


 OPTION 2:  Another thought that I had, was to define

type Atoms{CT, NT, PT}
 X::Array{Float64, 2}#  positions of atoms
 calc::CT #  calculator for computing 
 energies, forces, etc
 neigs::NT   # neighbourlist
 precon::PT # preconditioner
 end

function get_forces(atoms::Atoms{MyCalculator,NT,PT})
# . . .
end

 and to determine the type of the calculator this way. The problem there is 
 that I cannot give AbstractAtoms the parameters {CT, NT, PT} because other 
 sub-types might use a different, possibly longer, possibly shorter list of 
 parameters.


 I'd be very grateful for any advise what sort of constructions would be 
 the most convenient / useful to try out here.

 Many thanks,
 Christoph







[julia-users] Re: Type Annotations and Overloading Question

2015-02-04 Thread Avik Sengupta


On Wednesday, 4 February 2015 17:46:58 UTC, Christoph Ortner wrote:

 On Wednesday, 4 February 2015 16:59:14 UTC, Avik Sengupta wrote:

 I don't understand your domain of course, but the way I'd do this would 
 be a slight variant of OPTION 1

 get_forces(a::AbstractAtom) = error(All AbstractAtom subtypes should 
 implement get_forces)
 get_forces(a::Atom) = get_forces(a.calc)


 this is indeed what I've done at the moment. Good to hear that this is 
 not completely idiotic. 

  
 Ok, actually this is slightly different - so I don't understand why this 
 would help? Is it just the fact that not all implementations of 
 AbstractAtoms need to have a field `calc`?


Well, yes, that is one reason, but that may or may not be true in your 
case.  Mainly, the idea is to ensure that if some subtype fails to 
implement its get_forces method, then the error message will be explicit 
about what should be fixed. 

 thought one problem with not having proper inheritance is that this 
doesn't really help?

I meant more about commonality of behaviour. 
 


[julia-users] Re: set DPI of output figure

2015-01-28 Thread Avik Sengupta
I believe you can do it this way: 

draw(PNG(hi_res.png, 1inch, 1inch, dpi=300), p)

See here for more:  https://github.com/dcjones/Compose.jl/pull/94

You might have to run the latest master of Gadfly.. not sure this is in a 
released version of Gadfly yet. 
Run Pkg.checkout(Gadfly) to get the latest master. Pkg.free(Gadfly) to set 
it back to the released version. 



On Wednesday, 28 January 2015 23:35:01 UTC, Li Zhang wrote:

 Hi fellows,

 I just encounter a scenario that i want to set the DPI of PNG output of 
 gadfly plot.

 There seems no direct way to control what i want

 ```
 draw(PNG(path, width, height))
 ```

 Any one have experience or way to do this?



[julia-users] Re: pkg.julialang.org test

2015-01-22 Thread Avik Sengupta
The pkg.julialang.org checks slightly different things from the travis 
tests. In particular, while the travis tests run only when there is a 
change to the package code, these tests run nightly, and catch any package 
breakage due to changes to Julia, or any of your package dependencies. 

If your dependencies are easy to install on linux, then I'm sure Ian will 
be happy to discuss installing them on the server. Alternatively, some 
packages can be marked Untestable rather than broken, if their 
dependencies are difficult to acquire. Packages with proprietary commercial 
dependencies are marked this way, for example.  Either way, you can raise 
an issue at https://github.com/IainNZ/PackageEvaluator.jl/issues to discuss 
the specifics for your package. 

Regards
-
Avik

On Thursday, 22 January 2015 14:51:16 UTC, Josh Langsfeld wrote:

 This is a fairly minor topic, but thought I'd bring it up anyway. I 
 noticed the pkg.julialang.org listings generate pass/fail info for the 
 package tests by running the tests locally rather than hooking into Travis. 
 This is a problem for me as my Travis script involves installing 
 dependencies, and so it will always list as Tests fail as things 
 currently are.

 Is there a way to have it display the travis build status instead?

 Thanks,
 Josh



[julia-users] Re: Considering posting SDE solver package

2015-01-18 Thread Avik Sengupta
Hi Micah, 

I intend Ito to only contain specific financial products/algos. My thinking 
has been that all core math should be in external packages. Having said 
that, I'd be happy for any feedback on Ito itself. Please feel free to open 
issues with any comments on taste or correctness. 

Regards
-
Avik

On Sunday, 18 January 2015 06:21:41 UTC, Micah Corah wrote:

 I have been working on a project involving large systems of stochastic 
 differential equations. I considered using Ito.jl (to my knowledge the only 
 package with features for SDEs), but it was not quite to my tastes and did 
 not seem to offer much. In response, I wrote my own solver based on the 
 tutorial An Algorithmic Introduction to Numerical Simulation of Equations 
 by Desmond Higham (Euler-Maruyama) and have spent some time optimizing it. 
 Would this be something that people would be interested in using?


 There are some small changes that I would have to make for theoretical 
 correctness, but otherwise it looks fairly nice to me. If I do turn this 
 into its own package I will fix any of these latent issues and also work on 
 adding support for features such as different algorithms and distributions. 
 Then we would have Ito.jl for quantitative finance and SDE.jl (or whatever 
 I call it) for controls, dynamical systems, etc.


 Currently this code is on github with the code for a personal project I am 
 working on at https://github.com/mcorah/MultiQuadLift



[julia-users] Re: How to change the accuracy of Big numbers?

2015-01-11 Thread Avik Sengupta
Does this help? 

 jwith_bigfloat_precision(512) do
  exp(BigFloat(1)) 
  end
2.71828182845904523536028747135266249775724709369995957496696762772407663035354759457138217852516642742746639193200305992181741359662904357290033429526059559e+00
 
with 512 bits of precision


On Sunday, 11 January 2015 14:16:53 UTC, Hans W Borchers wrote:

 The following function computes Euler's constant  e = exp(1.0)  to n 
 digits *exactly* (returning it as string):

 function dropletE(n::Int)
   a = fill(1, n+2)
   E = 2.
   for i in 1:n
 a = 10 * a
 for j in (n+2):-1:2
   a[j-1] = a[j-1] + div(a[j], j+1)
   a[j]   = mod(a[j], j+1)
 end
 E = E * string(div(a[1], 2))
 a[1] = mod(a[1], 2)
   end
   return E
 end

 Comparing it with e calculated in Julia with the Big number class shows 
 that the computation in Julia is only correct up to the 76th digit (of 78 
 digits shown).

 julia dropletE(100)
 2.71828182845904523536028747135266249775724709369995
95749669676277240766303535475945713821785251664274

 julia exp(big(1.0))  # or simply: 
 big(e)
  2.71828182845904523536028747135266249775724709369995
9574966967627724076630353555e+00 with 256 bits of precision

 This corresponds well to the fact that Julia is utilizing the MPFR library 
 (?) with 256 bits of precision only.

 Question: How can I change this behavior and force Julia to apply more 
 digits, e.g. 4096 bits, to get about 1200 correct decimal digits. Is there 
 a parameter one can set, or do I need to recompile Julia with a certain 
 option?

 [In R, with the MPFR package, one can set the number of digits with every 
 single number defined as 'big', i.e. as MPFR number.]



Re: [julia-users] Dan Luu's critique of Julia: needs commented code, better testing, error handling, and bugs fixed.

2014-12-31 Thread Avik Sengupta
This has actually been a particularly nasty bug, it broke many packages on 
0.3.x, from Gadfly to GLM to HDF5, starting sometime in mid October. Tim 
had a workaround in Color.jl that solved some of the issues, but there are 
still reports of more failures. 

Thanks to Tim and Jameson for tracking this ... 

Regards
-
Avik

On Wednesday, 31 December 2014 02:29:58 UTC, Stefan Karpinski wrote:

 Ah, that's good to know. Even better that Jameson may have fixed it! 


  On Dec 30, 2014, at 8:10 PM, Tim Holy tim@gmail.com javascript: 
 wrote: 
  
  On Tuesday, December 30, 2014 06:40:30 PM Stefan Karpinski wrote: 
  That change only exists on master, not in the 0.3.x stable releases. So 
 it 
  seems likely that you were actually using the unstable development 
 version 
  of Julia when you encountered all of these problems. Otherwise you 
 could 
  not have encountered that bug. 
  
  Actually, while that particular construction is only available in julia 
 0.4, 
  it turned out upon deeper investigation that you can trigger the same 
 bug on 
  0.3: see, for example, 
  https://github.com/JuliaLang/Color.jl/issues/68 
  
  This is the issue (one of two, actually), that I branded 
 convertalypse, and 
  in my view it's one of the nastier bugs that has ever lurked this long 
 in 
  julia base: this definitely qualifies as a wart to be embarrassed about. 
 It 
  wasn't discovered until long after julia 0.3's release, unfortunately, 
 and it 
  has been extremely hard to track down. I tried 3 times myself (devoting 
 big 
  chunks of a day to it), and failed to make any real progress. 
  
  Fortunately, within the last 24 hours, our superhero Jameson Nash seems 
 to 
  have just diagnosed the problem and proposed a fix. 
  https://github.com/JuliaLang/julia/issues/8631#issuecomment-68336062. 
  Hopefully the same fix will apply on julia 0.3, too. 
  
  Best, 
  --Tim 
  



Re: [julia-users] warnings including module multiple times

2014-12-29 Thread Avik Sengupta
  – but, Julia largely obviates the name clash problem via multiple 
dispatch, meaning you can have large namespaces very safely

 Yes, absolutely, this  is a very important point when comparing 
namespacing strategies with other languages. I would go further and claim 
that with multiple disptach, you WANT to have large namespaces. The power 
of multiple dispatch comes about when you have many functions with the same 
name. The fact that (+) has 117 methods is a feature, not a problem. 

Modules and multiple dispatch have some tension here. This is the reason we 
have the slight complications of import/using etc. So when comparing module 
systems with single dispatch languages, we need to consider the special 
needs of multiple dispatch in this area. 

Slightly more generally, I think we are all figuring out how to architect 
large systems using multiple dispatch. The definitive book on that subject 
has not been written yet. It certainly will not look like a Java 
application. 

Regards
-
Avik


On Monday, 29 December 2014 02:24:38 UTC, Mike Innes wrote:

 I can only speculate about the reason that people still use include, even 
 though Julia has nice modules.


 Well, I for one think that

 1) Modules containing a large number of functions are OK (and this is very 
 common in more functional languages)
 2) If you're going to have (1), you want to split that module across 
 multiple files.

 Languages which embrace (1) but conflate modules and files tend to end up 
 looking like this 
 https://github.com/clojure/clojure/blob/master/src/clj/clojure/core.clj. 
 Personally, I prefer the Base's organisation, and would be happy to never 
 see a 7,000 line Julia file.

 Now, arguably Clojure could benefit from going with (1) a little less than 
 it does, because of the potential for name clashes – but, Julia largely 
 obviates the name clash problem via multiple dispatch, meaning you can have 
 large namespaces very safely. On top of that, having lots of small 
 submodules destroys a huge convenience factor, since you suddenly have to 
 think about lots of internal sub-APIs. But maybe there's a compelling 
 argument for small modules that I've missed.

 Another key point here is interactivity. If I reload a file in Julia, I 
 *actually 
 want* and fully expect that include statements and the relevant files 
 will be reloaded, whereas I don't want to reload every package dependency. 
 It's great that you can make that distinction, and a replacement that 
 doesn't involve that is a deal breaker for me.

 On 28 December 2014 at 19:46, Jason Merrill jwme...@gmail.com 
 javascript: wrote:

 On Sunday, December 28, 2014 1:34:50 PM UTC-5, Mauro wrote:

  Now the popular packages tend use include in a way that's fairly 
  harmless--i.e. to allow a lot of different symbols and functions to be 
  exported from a single module, without writing all the code in a 
 single 
  giant file. But given that the good uses of include are pretty 
 restricted, 
  I think we'd be better off if the default tool for doing this kind of 
 thing 
  was more restrictive. 

 Any thoughts on how a restricted include should work? 


 Sure: we already have modules. The good thing about them is that top 
 level code only runs once, and it executes in a separate scope from the 
 code where the module is imported.

 Modules are great, and you should use one any time you want to run code 
 that is in one file from another file.

 I can only speculate about the reason that people still use include, even 
 though Julia has nice modules. There's a bit about mixins in the manual (
 http://julia.readthedocs.org/en/latest/manual/modules/#modules-and-files), 
 but I haven't ever seen include used that way in the wild. The common case 
 appears to be that people sometimes want symbols in a child file to show 
 up in a parent module. If you make the child file into a module, export 
 some of its symbols, and then say importall Child in the parent module, 
 you get the exported symbols of the child as non-exported symbols of the 
 parent. But so far there isn't an easy way to

 1) make all of the non-exported symbols of a child module into 
 non-exported symbols of a parent module, nor
 2) reexport all of the exported symbols of a child module from a parent 
 module.

 1) feels kind of suspect to me because I think it's better to be explicit 
 about these things. But I'd rather see this behavior enabled if it would 
 convince people to stop using include, which is much worse.

 I'm not sure about names, but 1) could be something like

 importunexported Child

 which would be like using except that it would load all the symbols in 
 Child, not just the ones that were explicitly exported. Even though this is 
 not perfectly explicit, it maintains the advantages that the top level code 
 in Child is known to run only once, and that it runs in a separate scope 
 from Parent so that symbols already in Parent can't affect the behavior of 
 top level code in 

Re: [julia-users] Get exception message in catch block

2014-12-29 Thread Avik Sengupta
Thanks Tim and Ishmael. With your help, I got it to do what I needed. 

https://github.com/kmsquire/Logging.jl/pull/13

Regards
-
Avik


On Monday, 29 December 2014 01:52:39 UTC, Tim Holy wrote:

 But your understanding of the subtleties is very good! 

 --Tim 

 On Sunday, December 28, 2014 05:35:47 PM Ismael VC wrote: 
  Use `rethrow(e)` rather than `showerror`. 
  
  
  This is indeed the way to do it, thanks Tim! 



Re: [julia-users] Example of a Package Install Breaking

2014-12-28 Thread Avik Sengupta


On Sunday, 28 December 2014 05:01:22 UTC, Stefan Karpinski wrote:

 I'm somewhat thrilled that the problem here is the inability to conjure a 
 failing case :) 


I'm not sure. I've had the feeling that OSX has had the worst experience in 
installing binary dependencies. 

One example I had is last week: 
https://github.com/JuliaWeb/GnuTLS.jl/issues/25 . The issue is still open. 
It may or may not have been fixed with a new Bindeps release. 

Current status on my OSX Mavericks, Julia 0.3.4 on Pkg.build(Cairo) 

== Summary
  /Users/aviks/.julia/v0.3/Homebrew/deps/usr/Cellar/icu4c/52.1: 239 
files, 60M
== Installing pango dependency: staticfloat/juliadeps/harfbuzz
== Downloading 
https://juliabottles.s3.amazonaws.com/harfbuzz-0.9.33.mavericks.bottle.tar.gz
Already downloaded: 
/Users/aviks/Library/Caches/Homebrew.jl/harfbuzz-0.9.33.mavericks.bottle.tar.gz
Error: SHA1 mismatch
Expected: 3d136380b810141a5d35fda62bdd35b8771f9314
Actual: a97e9fdfaa2dd88f567f82933f9b27384d822f47
Archive: 
/Users/aviks/Library/Caches/Homebrew.jl/harfbuzz-0.9.33.mavericks.bottle.tar.gz
To retry an incomplete download, remove the file above.
Warning: Bottle installation failed: building from source.
Error: /Users/aviks/.julia/v0.3/Homebrew/deps/usr/opt/pkg-config not 
present or broken
Please reinstall pkg-config. Sorry :(
==[ 
ERROR: Cairo 
]==

failed process: 
Process(`/Users/aviks/.julia/v0.3/Homebrew/deps/usr/bin/brew install 
--force-bottle staticfloat/juliadeps/pango`, ProcessExited(1)) [1]
while loading /Users/aviks/.julia/v0.3/Cairo/deps/build.jl, in expression 
starting on line 144



==[ 
BUILD ERRORS 
]==

WARNING: Cairo had build errors.

 - packages with build errors remain installed in /Users/aviks/.julia/v0.3
 - build the package(s) and all dependencies with `Pkg.build(Cairo)`
 - build a single package by running its `deps/build.jl` script




Note that a couple of weeks ago I was getting a different error in 
installing Cairo. 

I must admit that I have NEVER been able to install TK  or Cairo packages 
in Julia without manual intervention. Typically one tends to find a manual 
workaround, which lasts till the next OS or machine upgrade. 

Regards
-
Avik

 



  On Dec 27, 2014, at 11:42 PM, Tim Holy tim@gmail.com javascript: 
 wrote: 
  
  Images has a somewhat overwhelming number of closed issues (and likely, 
 a few 
  still open) regarding problems with ImageMagick. Take your pick :-). 
  
  --Tim 
  
  On Sunday, December 28, 2014 03:32:45 AM Leah Hanson wrote: 
  I'm working on a book chapter about using the Julia package manager. 
 One 
  example I want to include is debugging a broken package install. I'm 
  currently expecting to focus on a problem caused by binary installs, 
 since 
  that seems to be the mostly likely cause of a Pkg.add failing. 
  
  However, it's hard for me to conjure one at will. Does anyone here have 
 any 
  suggestions? 
  
  It would be helpful if you either (A) have a story about a package 
 install 
  that broke at first and that you then got working (please say what 
 happened 
  and how you fixed it) or (B) an idea for how to reliably create a 
 problem 
  for Pkg.add (which would make it easier for me to get the example 
 output 
  for the book). 
  
  Thanks! 
  Leah 
  



[julia-users] Get exception message in catch block

2014-12-28 Thread Avik Sengupta

So if I do sqrt(-1), it throws a DomainError, but I get a fairly long 
message explaining what is wrong. 

julia sqrt(-1)
ERROR: DomainError
sqrt will only return a complex result if called with a complex argument.
try sqrt(complex(x))
 in sqrt at math.jl:131

If I put the call to sqrt in a try block, how can I access the detailed 
error message in the catch block? One thing I tried is sprint(showerror, 
e), but that only returns DomainError(), without any additional details. 
. 

julia try 
 sqrt(-1)
   catch e
  return sprint(showerror, e)
   end
DomainError()

I'm probably missing something obvious...


Re: [julia-users] Optional functionality in submodule

2014-12-23 Thread Avik Sengupta
Thanks, so the code is only executed when the module was previously loaded 
right?

No, I believe that if the module is loaded in the future, the code is 
executed then. The code is executed immediately if the module has been 
previously loaded. See Mike's comments at that issue: 
https://github.com/JuliaLang/julia/issues/2025#issuecomment-67733391

Regards
-
Avik

On Tuesday, 23 December 2014 18:57:37 UTC, Tobias Knopp wrote:

 Thanks, so the code is only executed when the module was previously loaded 
 right?

 Am Dienstag, 23. Dezember 2014 16:10:55 UTC+1 schrieb tshort:

 Not quite what you're asking, but see some discussions in this issue:

 https://github.com/JuliaLang/julia/issues/2025

 Particularly, see the note on Mike Innes's require macro. Here is an 
 example in action for supporting multiple plotting mechanisms:


 https://github.com/one-more-minute/Jewel.jl/blob/b0e8c184f57e8e60c83e1b9ef49511b08c88f16f/src/LightTable/display/objects.jl#L168-L170



 On Tue, Dec 23, 2014 at 9:42 AM, Tobias Knopp tobias...@googlemail.com 
 wrote:

 Sorry if this has already been answered. Its about optional plotting 
 functionality in a package. More precisely I want to have some Winston / 
 Gtk based plotting things and some PyPlot plotting routines.

 Is there a possibility to have submodules in a package so that the main 
 module can be used without the subfunctionality?

 e.g.

 using Foo 

 works does not require Winston/Gtk/PyPlot

 using Foo, FooGUI

 does require Winston and Gtk and

 using Foo, FooMyBeautifulPlots

 requires PyPlot?

 Thanks

 Tobi




Re: [julia-users] Re: Integer to Julia Date Value

2014-12-21 Thread Avik Sengupta
I'm not sure if I like the idea of privileging a Date constructor for the 
Rata integer, even if that is the internal representation. I'd rather have 
consistent conversion functions for different representations, since I can 
think of many other ways to convert an integer or a float to a Date. For 
example,  I often need to convert an Excel date (days from 1900 or 1904, in 
fractions). Or unix epochs. Or Julian day numbers. 

Regards
-
Avik

On Sunday, 21 December 2014 04:57:23 UTC, Jacob Quinn wrote:

 Yeah, I'd be open to changing the behavior of one-arg `Date()` if there 
 was enough support. The reason for the current behavior is to provide 
 consistency, i.e.:

 Date(y) - Date(y,1,1)
 Date(y,m) - Date(y,m,1)

 Similarly with DateTime:

 DateTime(y,m,d) - DateTime(y,m,d,0,0,0,0)
 etc.

 I guess we should at least have a better API for creating a Date/DateTime 
 from the `Dates.value(dt::Date)` integer value. 

 -Jacob

 On Sat, Dec 20, 2014 at 2:24 PM, Min-Woong Sohn mws...@gmail.com 
 javascript: wrote:

 Thank you so much!


 On Saturday, December 20, 2014 11:05:26 AM UTC-5, Avik Sengupta wrote:


 julia d2=Date(Dates.UTD(715510))
 1960-01-01

 On Saturday, 20 December 2014 03:09:42 UTC, Min-Woong Sohn wrote:



 Date(1960/1/1,/m/d) returns 1960-01-01, whose integer value is 
 715510. I want to convert this integer back to Date type. How do I do 
 that? 

 Also I noticed that Date(1) returns 0001-01-01 and Date(2) returns 
 0002-01-01 and Date(715510) returns 715510-01-01. Isn't this more natural 
 that Date(2) returns 0001-01-02 and Date(715510) returns 1960-01-01? Just 
 my opinion.




[julia-users] Re: strptime confusion

2014-12-21 Thread Avik Sengupta
Yes, that should work, but i cannot replicate your issue in julia version 
0.3.4-pre... the strptime methods  seem to be defined on the abstract type 
String, which should accept a SubString. What version of Julia are you 
using? Can you see the result of methods(strptime) ? That is in general a 
good way to solve issues such as this. 

julia a=SubString(utf8(2014-06-20), 1,10)
2014-06-20

julia typeof(a)
SubString{UTF8String} (constructor with 1 method)

julia b=2014-06-20
2014-06-20

julia typeof(b)
ASCIIString (constructor with 2 methods)

julia a==b
true

julia strptime(%Y-%m-%d, a)
TmStruct(0,0,1,20,5,114,5,170,1,0,3600,0,-1765316840,32751)

julia methods(strptime)
# 2 methods for generic function strptime:
strptime(timestr::String) at libc.jl:48
strptime(fmt::String,timestr::String) at libc.jl:50


 
On Sunday, 21 December 2014 14:28:50 UTC, tobiasjone wrote:

 Hello,  

 I solved by encoding a to utf8,  and the TmStruct was returned as 
 expected.

 *julia* strptime(%Y-%m-%d, utf8(a))
 TmStruct(0,0,0,20,5,114,5,170,0,0,0,0,0,0

 Many Thanks,
 Tobias



[julia-users] Re: Integer to Julia Date Value

2014-12-20 Thread Avik Sengupta

julia d2=Date(Dates.UTD(715510))
1960-01-01

On Saturday, 20 December 2014 03:09:42 UTC, Min-Woong Sohn wrote:



 Date(1960/1/1,/m/d) returns 1960-01-01, whose integer value is 
 715510. I want to convert this integer back to Date type. How do I do that? 

 Also I noticed that Date(1) returns 0001-01-01 and Date(2) returns 
 0002-01-01 and Date(715510) returns 715510-01-01. Isn't this more natural 
 that Date(2) returns 0001-01-02 and Date(715510) returns 1960-01-01? Just 
 my opinion.



[julia-users] Too many warnings

2014-12-09 Thread Avik Sengupta
On running the Gadfly tests on 0.4, there are too many warnings generated 
on STDOUT. As a result, Travis terminates the build, complaining that the 
build output has crossed 4 MB. 

Warnings of the following nature are generated, over and over again. More 
here: https://travis-ci.org/dcjones/Gadfly.jl/jobs/43356151 

Is there a flag suppress these kinds of warnings? 

WARNING: (iround{T})(::Type{T},x) is deprecated, use round(T,x) instead.
 in svg_print_float at /home/travis/.julia/v0.4/Compose/src/svg.jl:45
 in print_svg_path at /home/travis/.julia/v0.4/Compose/src/svg.jl:536
 in finish at /home/travis/.julia/v0.4/Compose/src/svg.jl:368
 in draw at /home/travis/.julia/v0.4/Compose/src/container.jl:395
 in draw at /home/travis/.julia/v0.4/Gadfly/src/Gadfly.jl:774
 in run_tests at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:116
 in include at ./boot.jl:242
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:300
 in _start at ./client.jl:382
 in _start_3B_4080 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so
Rendering points on png backend.
WARNING: iround(x) is deprecated, use round(Integer,x) instead.
 in newsurface at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:253
 in call at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:127
 in call at /home/travis/.julia/v0.4/Compose/src/cairo_backends.jl:139
 in anonymous at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:91
 in run_tests at /home/travis/.julia/v0.4/Gadfly/test/runtests.jl:116
 in include at ./boot.jl:242
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:300
 in _start at ./client.jl:382
 in _start_3B_4080 at /usr/bin/../lib/x86_64-linux-gnu/julia/sys.so




Re: [julia-users] Reviewing a Julia programming book for Packt

2014-12-08 Thread Avik Sengupta
Yes, Malcom runs the London Julia user group. 

On Monday, 8 December 2014 23:25:43 UTC, cdm wrote:


 see also:


 http://datasciencelondon.org/julia-language-shooting-star-or-a-flash-in-the-pan-by-malcolm-sherrington/

 https://skillsmatter.com/legacy_profile/malcolm-sherrington#overview


 ... and the meetup group:

 http://www.meetup.com/London-Julia-User-Group

 which seems to get good reviews.

 cdm



 On Monday, December 8, 2014 2:32:36 PM UTC-8, Ivar Nesje wrote:

 By the way, I think his github presence is at https://github.com/sherrinm 
 (not much to see).



[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



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.




[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



[julia-users] Re: BinDeps: How to access include path?

2014-11-16 Thread Avik Sengupta

If you redefine the struct as a julia immutable, you can unsafe_load() a 
pointer to that struct to read off the values in Julia.  You can also use 
it to pass a pointer to the struct into C. This trick can take you quite a 
way without resorting to a C wrapper. 

For one example, see: 

https://github.com/staticfloat/Nettle.jl/blob/master/src/hash.jl#L20-L28
https://github.com/staticfloat/Nettle.jl/blob/master/src/hash.jl#L41



On Sunday, 16 November 2014 15:10:07 UTC, Erik Schnetter wrote:

 I want to wrap a library (hwloc) for Julia. This is working fine. 

 The library defines some C structs that are part of the API. My 
 current approach uses wrapper C functions to access struct elements. 
 Is there a better way? 

 I thus I need to build this wrapper file as well. I created a 
 SimpleBuild rule for this. However, I need to know the path where 
 BinDeps installed (or found) the header files so that I can compile 
 this file. How do I access this information? 

 -erik 

 -- 
 Erik Schnetter schn...@gmail.com javascript: 
 http://www.perimeterinstitute.ca/personal/eschnetter/ 



  1   2   >